
Extract parameters from fitted model for use as initial values
Source:R/extract_optim_parameters.R
extract_optim_parameters.galamm.RdThis 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.
Arguments
- object
Object of class
galammreturned fromgalamm.
Value
A list object containing the following elements:
thetaNumerical vector of variance components, i.e., entries of the lower Cholesky form of the covariance matrix of random effects.betaFixed regression coefficients.lambdaFactor loadings.weightsWeights for heteroscedastic residuals.
See also
Other optimization functions:
galamm_control()
Examples
# Fit linear mixed model with heteroscedastic residuals
mod <- galamm(
formula = y ~ x + (1 | id),
dispformula = ~ (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),
dispformula = ~ (1 | item),
data = hsced,
start = start,
control = galamm_control(method = "Nelder-Mead")
)