View source: R/inherit-param-estimates.R
inherit_param_estimates | R Documentation |
Set the initial parameter estimates of a model using the estimates of a
previously executed model. Often this is used to carry forward the final
estimates of a "parent" model to be used as the initial estimates of the
"child" model, for example a model created with copy_model_from()
.
inherit_param_estimates(
.mod,
.parent_mod = get_based_on(.mod)[1],
inherit = c("theta", "sigma", "omega"),
bounds = c("keep", "discard"),
digits = 3,
.bbi_args = list(no_grd_file = TRUE, no_shk_file = TRUE)
)
.mod |
model object to update. |
.parent_mod |
Either a model object, or path to a model to inherit
properties from. Defaults to the "parent" model of |
inherit |
type of estimates to inherit from parent model. Defaults to replacing all of THETA, SIGMA, and OMEGA |
bounds |
Whether to keep or discard the existing bounds when setting the initial estimates in THETA records. |
digits |
Number of significant digits to round estimates to. |
.bbi_args |
Named list passed to |
These functions update initial estimates only if they are explicitly defined in the control stream.
For example, consider the update of $THETA (1)x4
. That defines four
initial estimates, but only the first explicitly appears. Calling
inherit_param_estimates()
with theta estimates c(5, 6, 7, 8)
would
return a result of (5)x4
.
Using additional parameter records for priors is not supported and will
lead to a size mismatch between the parameter and its records. Instead use
informative prior record names (such as THETAP
and THETAPV
).
tweak_initial_estimates()
## Not run:
base_mod <- read_model(file.path(MODEL_DIR, "1"))
mod2 <- copy_model_from(base_mod, "mod2") %>%
inherit_param_estimates()
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.