# likelihood statistic returned from npsol

10 posts / 0 new
Offline
Joined: 07/31/2009 - 15:29
likelihood statistic returned from npsol

i am following up here on the discussion previously started on the email list. i'm still unsure, after perusing the code and the npsol manual as to weather the raw likelihood or the -2 log likelihood is being returned from the optimizer. i'm wondering if anyone might know where i could find this info? or how i might reasonably search for it in the code (?)

Offline
Joined: 07/31/2009 - 15:10
NPSOL doesn't care about the

NPSOL doesn't care about the fit function used.

The computation of the likelihood function is performed by each objective function individually, usually as the function to be minimized. Often, this will mean that the  modelFit@output$minimum  element will contain -2 Log Likelihood, and for the first beta release, that is, in general, the case. Because the objective functions are not guaranteed to be minimizing the likelihood directly (often there are computationally simpler forms that are minimized), you will not be able to count on this in the general case. Instead, you will want to use the summary() function, and pull out the -2 Log Likelihood from there. I think the syntax would be  summary(modelFit)$Minus2LogLikelihood. Alternately, it should also be in  modelFit@output$Minus2LogLikelihood, but the recommended access is through summary(). These changes should be available in the most recent developer build (r715). Offline Joined: 01/06/2010 - 06:17 Independence likelihood Is the$IndependenceLikelihood also the -2 * likelihood from the independence model?

In my case it is very different from the $minus2Likelihood of fitting the independence model itself. -2loglik of independence model : 3096.288 IndependenceLik of target model: 126040060 For the independence model I used a diagonal model. Thanks in advance! Suzanne Offline Joined: 07/31/2009 - 15:12 The$IndependenceLikelihood

The \$IndependenceLikelihood value from @output should be the -2 log likelihood of a diagonal model with freely estimated variances and means. I understand that the name could be a little confusing, as it lacks both -2 and log. Can you post code/data so we can find the discrepancy? In your initial post, was the first value (3096.00) the Minus2LogLikelihood from your manual fitting of the diagonal model, or is that the second value?

Offline
Joined: 01/06/2010 - 06:17

Thank you for your reply. Indeed the 3096.288 is the -2 loglikelihood of manually fitting the diagonal model. I attached my script where I fit a target model (savamodel) and ask for the independencelikelihood and then fit the independence model (savaindep) and ask for the likelihood.
Hope you can figure it out, many thanks in advance,
Suzanne

Offline
Joined: 07/31/2009 - 15:12
No news yet, but I wanted to

No news yet, but I wanted to let you know that we're working on it. Thanks for the code! This really helps us figure out what the problem is.

Offline
Joined: 01/06/2010 - 06:17
Ok good to know, thank you!

Ok good to know, thank you!

Offline
Joined: 07/31/2009 - 15:12
Ok, we figured it out. This

Ok, we figured it out. This will be fixed in the next release. If you like, you can compile OpenMx from source and use the updated (fixed) version now.

Offline
Joined: 07/31/2009 - 15:24
This should be fixed in

This should be fixed in OpenMx 1.1.2: http://openmx.psyc.virginia.edu/2011/10/openmx-112-released

Offline
Joined: 07/31/2009 - 15:24
I opened a ticket for this

I opened a ticket for this issue http://openmx.psyc.virginia.edu/issue/2011/10/likelihood-statistic-independence-model