summary() of fitted mxModel object returns error

neale's picture
Project:OpenMx
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed
Description

running the attached file & data, the model fits satisfactorily, but summary says:

> ACENonScSLCoraSumm <- summary(ACENonScSLCoraFit)
Error in observedStatisticsHelper(model, expectations[[i]], datalist,  : 
  trying to get slot "type" from an object of a basic class ("NULL") with no slots

AttachmentSize
sexlimSummaryBug.R10.14 KB
DASS_Data_Dummy_1.csv55.53 KB

Comments

AdminHunter's picture

#1

I can't reproduce this error. My summary works fine and is attached. Does it still occur for you or is it fixed?

AttachmentSize
SummaryOfSexlimSummaryBug.R 10.46 KB
neale's picture

#2

I still get the error with fresh build of 3426:

> ACENonScSLCoraFit
MxModel 'ACENonScSLCora'
type : default
$matrices :
$algebras : 'modelfit'
$constraints :
$intervals :
$latentVars : none
$manifestVars : none
$data : NULL
$submodels : 'ACE'
$expectation : NULL
$fitfunction : MxFitFunctionAlgebra
$compute : NULL
$independent : FALSE
$options :
$output : TRUE
> summary(ACENonScSLCoraFit)
Error in observedStatisticsHelper(model, expectations[[i]], datalist, :
trying to get slot "type" from an object of a basic class ("NULL") with no slots

AdminHunter's picture

#3

I was able to reproduce the error with the Beta and R 3.0. I failed to reproduce it with the Beta or trunk on R 2.14. From the error message, I think I have a fix but can't currently test it on R 3.0 where I actually get the error.

The potential fix is checked in. Try r3428. Let me know if it works!

neale's picture

#4

Yay it works! Well done Mike (AdminHunter). I note also we get a report on the compute plan now:

compute plan:
   MxComputeSequence 'compute' 
   $freeSet : '.' 
   steps[[ 1 ]] : 
     MxComputeGradientDescent 'compute' 
     $freeSet : '.' 
     $engine : 'CSOLNP' 
     $fitfunction : '21' 
     $verbose : 0 
   steps[[ 2 ]] : 
     MxComputeNumericDeriv 'compute' 
     $freeSet : '.' 
     $fitfunction : 21 
     $parallel : TRUE 
     $stepSize : 1e-04 
     $iterations : 4 
     $verbose : 0 
   steps[[ 3 ]] : 
     MxComputeStandardError 'compute' 
     $freeSet : '.' 
   steps[[ 4 ]] : 
     MxComputeReportDeriv 'compute' 
     $freeSet : '.' 

If we are going to be as verbose as this, perhaps the $fitfunction should be in terms of the actual function, not the code for it? Also, the number of function evaluations in each step would, IMO, be more useful to return than the number of iterations.

AdminHunter's picture

#5

Status:active» closed

I'm glad this worked!

The compute plan is a separate issue, but it's printing definitely needs to be prettied up and tweaked.