Hi,

I am running Hermine's Cholesky script (Boulder "cdrom" 2016) only change I make is that I Use mxDataWLS to precompute the polychoric correlations and WLS weights:

DZdata <- mxDataWLS(DZ)

This runs without errors.

I then proceed to adjust the mxExpectation to reflect the nature of the data:

expMZ <- mxExpectationNormal( covariance="expCovMZ", means="meanG",thresholds="Tr", dimnames=selVars )

expDZ <- mxExpectationNormal( covariance="expCovDZ", means="meanG",thresholds="Tr", dimnames=selVars )

(Threshodls fixed at 0 and 1, so covariance and means can be freely estimated)

I proceed to specify the correct fit function:

funWLS <- mxFitFunctionWLS()

When I run the model I get the following error:

Running mulACEc with 185 parameters

Error in svd(X) : infinite or missing values in 'x'

Any suggestions?

I found the issue, the Weights matrix in the WLS data object contained NaN and Inf values.

Any sugestion on how to proceed? Does the fact that the fullWeights matrix is illbehaved detrimental to my analysis? Or are their ways to proceed? Open

So you'r using this script as a basis, and you're getting NaN and Inf in the "Weights" matrix when you create a WLS data object?

A reproducible code chunk always helps:

This object doesn't have a Weights slot, but the acov/fullWeights matrix looks OK?

Tim,

Your obviously right it would be great to reproduce the error. However it seems to be dependent on the data, and I am not allowed upload my data.

Ill work on simulating data which reproduces the error.

Michel

Hi Michel,

I'm not sure what the problem is with this just yet. WLS is generally safe to use and I'm very glad someone outside the dev team is trying it!

I'll be checking into this over the next few days to see what the problem is and hopefully solve it swiftly. My current guess is there's a small bug in WLS. For arguments sake, is there anything strange about the data? Tons of missingness? 400 variables?

Hi,

78 variables, I can reproduce the error with as little as 10 variables in the model. Missingness is << 10% for any given variable.

If there is a bug it must be local to MxDataWLS() because clearly the NaN's in the Weights matrix are the error.

summary(as.vector(MZdata$fullWeight))

Min. 1st Qu. Median Mean 3rd Qu. Max. NA's

-Inf -72 0 NaN 73 Inf 310

The summary of the data:

q1m7t1 q3m7t1 q8m7t1 q10m7t1 q13m7t1 q16m7t1 q17m7t1 q20m7t1 q21m7t1 q22m7t1 q1m7t2

0 :3535 0 :1554 0 :2566 0 :2601 0 :4263 0 :3872 0 :3049 0 :3915 0 :3954 0 :2047 0 :3460

1 : 750 1 :2423 1 :1473 1 :1451 1 : 161 1 : 548 1 :1225 1 : 480 1 : 459 1 :2208 1 : 798

2 : 159 2 : 468 2 : 360 2 : 394 2 : 19 2 : 37 2 : 170 2 : 49 2 : 26 2 : 181 2 : 160

NA's: 92 NA's: 91 NA's: 137 NA's: 90 NA's: 93 NA's: 79 NA's: 92 NA's: 92 NA's: 97 NA's: 100 NA's: 118

q3m7t2 q8m7t2 q10m7t2 q13m7t2 q16m7t2 q17m7t2 q20m7t2 q21m7t2 q22m7t2

0 :1723 0 :2633 0 :2570 0 :4258 0 :3898 0 :3165 0 :3940 0 :3971 0 :2170

1 :2288 1 :1423 1 :1484 1 : 148 1 : 515 1 :1111 1 : 441 1 : 423 1 :2086

2 : 411 2 : 297 2 : 378 2 : 14 2 : 21 2 : 156 2 : 46 2 : 30 2 : 168

NA's: 114 NA's: 183 NA's: 104 NA's: 116 NA's: 102 NA's: 104 NA's: 109 NA's: 112 NA's: 112

Best,

Michel

Hi Michel

What is the sample size here? Weight matrices can get non-positive definite if the sample size is small. Even with 10 variables we are looking at 10*11/2 = 55 statistics if there is only one threshold per trait. With 78 variables we are talking over 3,000 statistics.

Another possible source of the issue occurs to me - if the data are ordinal and whole rows or columns are empty, then I suspect the threshold estimates could get messy, as one would want to be exactly on top of the next one, and underidentification could occur.

Cheers

Mike

N MZ -= 4.4k n DZ = 8.5k

Should be sufficinent for the 20 item subset in which the issue now occurs right?

As to your comment about empty rows or columns, rows or columns of what matrix exactly? The data?

This is perhaps a silly question, but are you using the latest version of OpenMx? Between 2.6.9 and 2.7.11 there were quite a few improvements to WLS, particularly with regard to missing data.

2.7.11