Fixing the parameter estimates at the starting values
Posted on

Attachment | Size |
---|---|
test1.pdf | 27.3 KB |
Hi,
I want to fit a model by using the starting values as the parameter estimates. This can quickly be done by treating them as fixed parameters. However, I also want to get some standard errors on these estimates though the starting values may not be the optimal solution.
I can fix the starting values as the estimates with `mxRun(my.model, useOptimizer = FALSE)`. But it does not provide any standard errors. Attached is an example. Any suggestions? Thanks in advance.
Mike
Try this
## Use custom compute plan:
plan <- omxDefaultComputePlan()
plan$steps <- list(plan$steps$ND, plan$steps$SE, plan$steps$RD, plan$steps$RE)
uniModel3 <- mxModel(uniModel, plan)
fit3 <- mxRun(uniModel3) #<--Status RED is expected, since OpenMx has not optimized the free parameters.
summary(fit3)
This block of code creates a custom compute plan, which happens to be the default compute plan, except without the gradient-based optimization step (because we want the free parameters to stay at their start values) and the Hessian-quality step (because we don't expect the Hessian to "look good" when the free parameters are not at their MLEs).
If for some reason you want to run `uniModel3` or `fit3` with the default compute plan, you need to do, e.g.,
fit3$compute$.persist <- FALSE
first.
Log in or register to post comments
Thanks, it is very helpful.
Log in or register to post comments
In reply to Thanks, it is very helpful. by Mike Cheung
Glad I could help!
Log in or register to post comments