Specifying Unique mxFitFunction
Posted on
jacobucc
Joined: 05/27/2014
Attachment | Size |
---|---|
openmx_q.R | 1.04 KB |
Forums
Hi,
I am new to 2.0 and am playing around with specifying a non-standard fit function, and have hit some road bumps in trying to start with specifying the ML fit through mxFitFunctionAlgebra. Attached is the reproducible script. Error message is:
I am new to 2.0 and am playing around with specifying a non-standard fit function, and have hit some road bumps in trying to start with specifying the ML fit through mxFitFunctionAlgebra. Attached is the reproducible script. Error message is:
Error: The job for model 'One Factor' exited abnormally with the error message: MxComputeGradientDescent: fitfunction One Factor.fitfunction is not finite ()
If mxFitFunctionAlgebra() is used, does it have to include a gradient specification?
Thanks for your help.
Ross
mx version 4157,R 3.1.2, Mac OSX.
Bound the variances
To solve your issue, add a lower bound on the residual variances.
mxResVariances <- mxMatrix(type="Diag", nrow=5, ncol=5,
free=TRUE, values=1, name="resVariances", lbound=1e-6)
The variances are becoming negative in the course of optimization, likely because the starting values are not great. With just adding the lower bound, I get a complete optimization but it does give a warning (MxStatus RED). Changing the starting values or re-running the model from the solution solved that.
mxFacLoadings <- mxMatrix(type="Full", nrow=5, ncol=1,
free=TRUE, values=0.8, name="facLoadings") #was.2
mxFacVariances <- mxMatrix(type="Symm", nrow=1, ncol=1,
free=FALSE, values=1, name="facVariances")
mxResVariances <- mxMatrix(type="Diag", nrow=5, ncol=5,
free=TRUE, values=.2, name="resVariances", lbound=1e-6) # was 1
Log in or register to post comments