extract_optim_parameters.galamm {galamm} | R Documentation |
Extract parameters from fitted model for use as initial values
Description
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.
Usage
## S3 method for class 'galamm'
extract_optim_parameters(object)
Arguments
object |
Object of class |
Value
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.
See Also
Other optimization functions:
galamm_control()
Examples
# 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")
)
[Package galamm version 0.2.0 Index]