estimated parameters: 0

Posted on
No user picture. karobro Joined: 01/16/2013

Hi,
I am trying the Beta version to run a multivariate saturated model with ordinal data. However, I am getting no estimated parameters. Could I be missing something in the script (attached)? Any help is greatly appreciated.

Here is the output message:

> SatFit<- mxRun(SatModel, intervals=F)
Running Sat
> summary(SatFit)
Summary of Sat

observed statistics: 7099
estimated parameters: 0
degrees of freedom: 7099
-2 log likelihood: NA
number of observations: 1394
Information Criteria:
| df Penalty | Parameters Penalty | Sample-Size Adjusted
AIC: NA NA NA
BIC: NA NA NA
Some of your fit indices are missing.
To get them, fit saturated and independence models, and include them with
summary(yourModel, SaturatedLikelihood=..., IndependenceLikelihood=...).
timestamp: 2014-08-22 13:59:41
wall clock time: 0.390008 secs
OpenMx version number: 2.0.0.3751

Replied on Fri, 08/22/2014 - 09:15
Picture of user. mhunter Joined: 07/31/2009

I think the top level model does not have a fit function, and that's what's causing the estimated parameters to be zero.

Replace

SatModel <- mxModel( "Sat", modelMZM, modelMZF, modelDZM, modelDZF, modelDZO)

with

mgfitfunction <- mxFitFunctionMultigroup(c("MZM", "MZF", "DZM", "DZF", "DZO"))
SatModel <- mxModel( "Sat", modelMZM, modelMZF, modelDZM, modelDZF, modelDZO, mgfitfunction)

Hopefully that makes it work!

Replied on Mon, 08/25/2014 - 05:38
No user picture. karobro Joined: 01/16/2013

In reply to by mhunter

Thank you very much! I tried this and now get an error message that I don't know what means:

> SatFit<- mxRun(SatModel, intervals=F)
Running Sat
Error: The job for model 'Sat' exited abnormally with the error message: MxComputeGradientDescent: fitfunction Sat.fitfunction evaluated to 1.#QNAN0 ()

In addition: Warning message:
In model 'Sat' Optimizer returned a non-zero status code 6. The model does not satisfy the first-order optimality conditions to the required accuracy, and no improved point for the merit function could be found during the final linesearch (Mx status RED)

> summary(SatFit)
Error in summary(SatFit) :
error in evaluating the argument 'object' in selecting a method for function 'summary': Error: object 'SatFit' not found

Replied on Mon, 08/25/2014 - 11:24
Picture of user. RobK Joined: 04/19/2011

In reply to by karobro

The first error you're seeing is saying that the fit function for the top-level model returned a value of NaN (Not a Number). This probably happened on its first evaluation, at the start values, since CSOLNP and NPSOL can both deal with NaN once optimization has gotten underway. But, if it happens at the very start, they don't know what to do next, and terminate prematurely.

It's a bit peculiar that you got the warning about "Mx status RED," but you can ignore it for now, since the real problem is that your model won't run.

The last error you got is just R saying it cannot find an object called SatFit. This is because SatFit was never created; the line that would have created it, SatFit<- mxRun(SatModel, intervals=F), led to an error.

You should change the start values for your CorMZM and CorMZF, because those matrices are not positive definite at the values you're currently using. You can see this with, for example, eigen(CorMZM$values)$values, which should all be positive, but that's not the case. You could try lowering the biggest off-diagonal values. Also, it looks like you're starting all of your thresholds at positive numbers. That might be suitable for your data, but it might also be something you'd want to adjust.

BTW, are you running this on a Windows machine?

Replied on Mon, 08/25/2014 - 13:37
No user picture. karobro Joined: 01/16/2013

In reply to by RobK

Excellent...Thanks so much guys! Changing the starting values for the covariance matrices of the MZ groups did the trick.

Yes, I'm running this on a Windows machine.

Replied on Mon, 08/25/2014 - 14:05
Picture of user. RobK Joined: 04/19/2011

In reply to by karobro

I thought so. For some reason, under Windows, the end of that error message gets garbled to 1.#QNAN0 ().

Replied on Mon, 08/25/2014 - 12:12
Picture of user. tbates Joined: 07/31/2009

In reply to by karobro

DeJa Vu, we discussed this this morning :-) This might be a good place to collect that knowledge.

From Mike "the matrix" Neale: "This message is usually caused by parameter values that lead to a likelihood of zero. A non-positive definite covariance matrix (check eigenvalues of the expected covariance matrix) or data vectors that are far from the mean, in standardized units. It may help to bound parameters, or to improve the starting values."

You can sometimes get a model to mxRun with unsafe = TRUE, that can either let it find a good solution - perhaps after another couple of runs - or at least give you something more to work with.


# Explore values of the matrices and algebras driving the expectation
m1 = mxRun(m1 unsafe = T) # unsafe on to get you going
m1 = mxRun(m1) # second run, unsafe off
summary(m1)

omxSetParameters is useful for moving start values, and free/fixing parameters. For instance


m1 = omxSetParameters(m1, "a_r2c1", free=T, values = 0); # drop this parameter to zero
m1 = omxSetParameters(m1, "a[2,1]", free=T, values = .3); # bracket notation if cells are not labeled
m1 = mxRun(m1, unsafe=T)

Setting checkpointing can generate a file of free-parameter estimates that might be useful if you want to see what happened before the condition arose.


mxOption(factorModel, "Checkpoint Directory", getwd())
mxOption(model, "Always Checkpoint", "Yes")
mxOption(model, "Checkpoint Count" , 1)
mxOption(model, "Checkpoint Units" , "evaluations")

For the future, having OpenMx should give a message at least this helpful, hopefully taking into account whether this problem happened on the first iteration to help shape this error message.