Donate Your Models

As we get closer to the OpenMx 1.0 release, we would like to increase the number of scripts in our test system. We are currently at 115 scripts in the test suite, which is not too shabby. We would like you to donate your working scripts to our test system. Here are the motivating factors for donating your scripts - (1) the altruistic motivation, your work helps to make the project better for all OpenMx users; or (2) the selfish motivation, donating your script virtually guarantees that the script will continue to work in future versions of the OpenMx project.

Better error reporting on algebra extents not matching matrix extent?

Hi,
currently a model can be built with a run time error like this
> ACEOrdFit = mxRun(ACEOrdModel, intervals=F)
Error: The algebra 'thresholdsMatrix' in model 'ACE' generated the error message: length of 'dimnames' [1] not equal to array extent

It would be very helpful if the error reported the size of matrix that was being dimensioned, and the dimnames provided.

e.g. Error: The algebra 'thresholdsMatrix' in model 'ACE' generated the error message: length of 'dimnames' [1] not equal to array extent: You are giving dimnames to a 3:4 matrix, but provided 2:4 dimnames:
c("X","X")

Error: Cannot add the following item(s) into the model

Hi,
Not sure if this is by deisgn/necessity or something we can alter.

It is illegal to create variables other than mxModel components inside an mxModel. Therefore things like this fail (with errors that will be cryptic to users):
lboundList = c(rep(-3,times=nVar), rep(.0001,times=nVar*(maxThresholds-1))),
mxMatrix("Full", maxThresholds, nVar, free=T, lbound = lboundList, values=.5, name="baseAndIncrements"),

Because OpenMx tries to add the items of lboundList to the model:

mxCompare() compare each model to base AND to the model above it

currently mxCompare compares each listed submodel to the base

e.g.

> tableFitStatistics(twinSatFit, c(twinSatSub1Fit, twinSatSub2Fit))
          Name    ep -2LL    df   AIC      diffLL diffdf p   
Model 1 : twinSat 6  1599.78 2282 -2964.22 -      -      -   
Model 2 : twinSat 4  1602.96 2284 -2965.04 3.18   2      0.2 
Model 3 : twinSat 3  1605.63 2285 -2964.37 5.85   3      0.12

mxCompare() take just a base model

Here's the output of comparing two nested models (just setting var = across twin and zygosity...)

> mxCompare(twinSatSub1Fit,c(twinSatSub2Fit))
     base comparison ep minus2LL   df   AIC diffLL diffdf     p
1 twinSat         4     1600 2284 -2970     NA     NA    NA
2 twinSat    twinSat  3     1610 2285 -2960   2.67      1 0.102

*NOTE*: minus2LL is 1600 and 1610

But in the actual models (accessed via summary) the values are 1602.957 and 1605.626

> summary(twinSatSub1Fit)
# observed statistics:  2288 
# estimated parameters:  4 

summary() needs ability to provide the df of the saturated model, as well as the saturated fit?

Hi,
was just using this to compare a model to the saturated model:

> summary(twinSatSub1Fit, SaturatedLikelihood=1599.781)

It gets the χ² but not the df between the sub-model and the saturated model.

Do we need a parameter for summary to specifiy "sat model estimated parameters"?

ideally, one could simply do

> summary(subFit, satFit)

And summary would summarise the second model recursively then grab $Minus2LogLikelihood and $estimatedParameters

Cheers,
t

matrix not populated as expected in R, based on nrow & ncol

> nv <- 1
> ntv <- nv*2
> nth <-3
> thLBound <- matrix(rep(c(-3,(rep(0.001,nth-1))),nv),nrow=nth,ncol=nv)

Given these defined variables, I expected that the values and lbounds for the matrix to be created below would be populated repeatedly until the desired number of rows/columns based on nrow and ncol was obtained, but it appears that the dimensions of the matrix are determined by the values and lbound arguments.

> mxMatrix( type="Full", nrow=nth, ncol=ntv, free=TRUE, values=c(-1,.5,.5), lbound=thLBound, name="Thre")
FullMatrix 'Thre'

@labels: No labels assigned.

@values

mxData error details

regarding this query...
http://openmx.psyc.virginia.edu/thread/589
and this error
Error: The data object 'MZ.data' contains an observed matrix that is not of type 'double'

it would be very helpful to add a call to summary Names and say something like

Error: The data object 'MZ.data' contains an observed matrix that is not of type 'double'
details:
type(MZ.data) is that is fine|I am expecting a matrix or dataframe
MZ.data contains 2 variables as follows:
twin1: type logical
twin2: type integer

jitter starts if optimization can't get started

I see CIs now jitter if they can't get started. That's nice.

Often multivariate scripts won't get started when start values are specified with one value (because matrix is not invertable). I wrote a helper that jiggles starts to avoid this, but it would be nice if mx did this itself, if it can't get started.

This would also take away a lot of frustration from users whose scripts won't run, when the only problem is that the start values are identical across one or more matrices.