You are here

Fixing the parameter estimates at the starting values

4 posts / 0 new
Last post
Mike Cheung's picture
Offline
Joined: 10/08/2009 - 22:37
Fixing the parameter estimates at the starting values
AttachmentSize
PDF icon test1.pdf27.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

AdminRobK's picture
Offline
Joined: 01/24/2014 - 12:15
Try this

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.

Mike Cheung's picture
Offline
Joined: 10/08/2009 - 22:37
Thanks, it is very helpful.

Thanks, it is very helpful.

AdminRobK's picture
Offline
Joined: 01/24/2014 - 12:15
Glad I could help!

Glad I could help!