Donate Your Models
- Read more about Donate Your Models
- 1 comment
- Log in or register to post comments
Better error reporting on algebra extents not matching matrix extent?
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
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
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
> mxCompare(twinSatSub1Fit,c(twinSatSub2Fit)) base comparison ep minus2LL df AIC diffLL diffdf p 1 twinSat4 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
- Read more about mxCompare() take just a base model
- 8 comments
- Log in or register to post comments
summary() needs ability to provide the df of the saturated model, as well as the saturated fit?
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
> 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
nonlinear definition test,
- Read more about nonlinear definition test,
- 1 comment
- Log in or register to post comments
mxData error details
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
MZ.data contains 2 variables as follows:
twin1: type logical
twin2: type integer
- Read more about mxData error details
- 1 comment
- Log in or register to post comments
jitter starts if optimization can't get started
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.
- Read more about jitter starts if optimization can't get started
- 1 comment
- Log in or register to post comments