Fixing the parameter estimates at the starting values

Posted on
Picture of user. Mike Cheung Joined: 10/08/2009
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

Replied on Fri, 07/09/2021 - 15:59
Picture of user. AdminRobK Joined: 01/24/2014

Append this to your script:

## 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.