SEM-model with lavaan ERROR: initial model-implied matrix (Sigma) is not positive definite

787 views
Skip to first unread message

Antti Simola

unread,
Sep 14, 2013, 9:52:48 AM9/14/13
to lav...@googlegroups.com

Hello!

I have the following model:

sem.model.1 <- 'y.1.1 ~ b1*x.1.1 + trend
              y.2.1 ~ b21*x.21.1 + b22*x.22.1 + trend
              y.3.1 ~ b31*x.31.1 + b32*x.32.1 + trend
              b21 == b31
              b21 == -b22/(1-b1)
              b22 == b32'

CES.1 <- sem(sem.model.1, data=data.1, group = "ts2", start = "Mplus")

I have two alternatives for this, CES.2 and CES.3. The data for each comes essentially from same source and the variables are calculated from same initial data, but organized somewhat differently. Datasets 1 and 3 do not cause any trouble but the second won't solve and produces following error message:

Error in estimateModel(lavaanModel, samplestats = lavaanSampleStats, X = lavaanData@X,  :
  lavaan ERROR: initial model-implied matrix (Sigma) is not positive definite;
  check your model and/or starting parameters in group 3.
In addition: Warning messages:
1: In lavSampleStatsFromData(Data = lavaanData, missing = lavaanOptions$missing,  :
  lavaan WARNING sample covariance can not be inverted in group: 1
2: In lavSampleStatsFromData(Data = lavaanData, missing = lavaanOptions$missing,  :
  lavaan WARNING sample covariance can not be inverted in group: 2
3: In lavSampleStatsFromData(Data = lavaanData, missing = lavaanOptions$missing,  :
  lavaan WARNING sample covariance can not be inverted in group: 4
4: In lavSampleStatsFromData(Data = lavaanData, missing = lavaanOptions$missing,  :
  lavaan WARNING sample covariance can not be inverted in group: 5
5: In lavSampleStatsFromData(Data = lavaanData, missing = lavaanOptions$missing,  :
  lavaan WARNING sample covariance can not be inverted in group: 6

I reckon that something in dataset 2, group 3 data isn't correct, but checking the data shows me nothing unusual. I've already tried with default start option and Mplus. What should I try next? And how severe are those warning messages?

Cheers,

Antti

yrosseel

unread,
Sep 16, 2013, 2:34:43 AM9/16/13
to lav...@googlegroups.com
On 09/14/2013 03:52 PM, Antti Simola wrote:

> Error in estimateModel(lavaanModel, samplestats = lavaanSampleStats, X =
> lavaanData@X, :
> lavaan ERROR: initial model-implied matrix (Sigma) is not positive
> definite;
> check your model and/or starting parameters in group 3.
> In addition: Warning messages:
> 1: In lavSampleStatsFromData(Data = lavaanData, missing =
> lavaanOptions$missing, :
> lavaan WARNING sample covariance can not be inverted in group: 1
> 2: In lavSampleStatsFromData(Data = lavaanData, missing =
> lavaanOptions$missing, :
> lavaan WARNING sample covariance can not be inverted in group: 2
> 3: In lavSampleStatsFromData(Data = lavaanData, missing =
> lavaanOptions$missing, :
> lavaan WARNING sample covariance can not be inverted in group: 4
> 4: In lavSampleStatsFromData(Data = lavaanData, missing =
> lavaanOptions$missing, :
> lavaan WARNING sample covariance can not be inverted in group: 5
> 5: In lavSampleStatsFromData(Data = lavaanData, missing =
> lavaanOptions$missing, :
> lavaan WARNING sample covariance can not be inverted in group: 6

Try fitting your model (first without any constraints) to each group
separately.

It looks like for many groups, the sample-based covariance matrix is not
positive-definite. This is weird. But you calculate this yourself and
see what is going on. Perhaps you have many missing values?

If everything fails, you may send your data+script to me and I will
investigate.

Yves.



Reply all
Reply to author
Forward
0 new messages