View source: R/extract_optim_parameters.R
extract_optim_parameters.galamm | R Documentation |
This function extracts parameter values from a fitted model object in a form that can be directly provided as initial values for a new model fit.
## S3 method for class 'galamm'
extract_optim_parameters(object)
object |
Object of class |
A list
object containing the following elements:
theta
Numerical vector of variance components, i.e., entries of
the lower Cholesky form of the covariance matrix of random effects.
beta
Fixed regression coefficients.
lambda
Factor loadings.
weights
Weights for heteroscedastic residuals.
Other optimization functions:
galamm_control()
# Fit linear mixed model with heteroscedastic residuals
mod <- galamm(
formula = y ~ x + (1 | id),
weights = ~ (1 | item),
data = hsced
)
# Extract parameters
start <- extract_optim_parameters(mod)
# Fit again using the Nelder-Mead algorithm, using start as initial values:
mod_nm <- galamm(
formula = y ~ x + (1 | id),
weights = ~ (1 | item),
data = hsced,
start = start,
control = galamm_control(method = "Nelder-Mead")
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.