Reports the candidate set as requested, the candidate set attempted, the equations excluded and why, and any substitution made in the response.

bnec_record(x)

Arguments

x

An object of class bayesnecfit or bayesmanecfit returned by bnec.

Value

A list with elements requested and attempted, both character vectors of equation names; excluded, a data.frame of the equations bnec declined to attempt with the reason for each; and substitutions, a data.frame of the changes made to the response, or NULL where none were made. requested is partitioned exactly by attempted and excluded$model, with one exception. Where the response does not vary, bnec fits the constant equation "ecxflat" alone whatever was requested: attempted is then "ecxflat", which need not have been requested, and every other requested equation is in excluded with that reason. See the section of ?bnec on a response that does not vary.

attempted is the set bnec tried to fit, not the set that sampled: an equation that was attempted and failed appears here, and for bnec and amend also in failed_models. update does not record failures, so an equation whose refit failed stays in attempted and is not reported by failed_models.

The record is kept through update, amend, pull_out, c and +. pull_out lists each equation it does not keep in excluded, with the reason "not kept by pull_out()", as amend does with the reason "dropped by amend()" for an equation it drops. An equation whose failure failed_models still reports stays in attempted. c and + join the records of the objects they combine. requested and attempted are the unions of theirs, and an equation attempted in any of them is not in excluded. An equation excluded by more than one of them keeps the reason the first gives, as c keeps the first of two fits of one equation. substitutions holds the distinct rows of theirs. Where any of the objects combined has no record, the result has none, because what was done to its part of the request is not known.

NULL for an object fitted by a version that did not record it.

Details

bnec can decline to attempt some of the requested equations, and can substitute values that a family cannot represent — a zero under Gamma or Beta, a one under Beta. Both are recorded on the returned object, so they can be recovered where the console output was not kept, as in a knitted document or a call wrapped in suppressMessages. The set as requested, the set attempted, the reason for the difference, and what was altered in the data are what a methods section has to state.

See also

Examples

# \donttest{
library(bayesnec)
data(manec_example)
bnec_record(manec_example)
#> $requested
#> [1] "nec4param" "ecx4param"
#> 
#> $attempted
#> [1] "nec4param" "ecx4param"
#> 
#> $excluded
#> [1] model  reason
#> <0 rows> (or 0-length row.names)
#> 
#> $substitutions
#> NULL
#> 
# }