Hello,
I am working on a Masters thesis with a comparison of frequentist and Bayesean SEM and estimating with simulations the “same” model in lavaan (SEM) and blavaan (BSEM). I have used the estimation code as a function and then use replicate to get 500 replications. I have checked that the initial covariance matrix to be tested is not NPD and everything works fine with the lavaan analyses.
From the 2021 article it seems that when using blavaan with Stan NPD problems “should” be handled by Stan, but maybe this is a more general statement with exceptions. In some simulation replications with blavaan I get the message that
“Chain 3: Exception: multi_normal_rng: Matrix covariance matrix argument is not positive definite (in 'model_stanmarg' at line 1017)”
I assume this happens because when a new sample is drawn it has become a NPD matrix. I would like to (a) see if these matrices could be transformed to nonNPD or (b) skip this case and continue with the next simulation, noting the number of cases with NPD problems.
Any suggestions how to pursue on this would be much appreciated
Gunnar Gelin, Statistics Dept, Stockholm university
--
You received this message because you are subscribed to the Google Groups "blavaan" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blavaan+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/blavaan/00e72455-6af5-48a0-82eb-65b51beb1b1fn%40googlegroups.com.
--
To Ed Merkle:
At first it seemed ok to use your suggestion test=”none” since the error messages disappeared, but now I see that the run “hangs” without giving messages. This occurs at various stages of the replication, so it is most presumably a NPD problem due to that the sampling gives a problematic matrix. I have gone through the Stan User Manual and some additional sources but not found out how to deal with this. My intention is to simply skip a replication case that gives this problem, increase a counter variable indicating that his problem occurred, and go in with the next replication case. But how to code this and also keep the replicability goals with seed etc? This is not transparent to me, but I suppose this is not the first time such problems occur, so could you please suggest other studies and/or code to handle this? Thanks in advance!
You received this message because you are subscribed to a topic in the Google Groups "blavaan" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/blavaan/feKgiTvqxio/unsubscribe.
To unsubscribe from this group and all its topics, send an email to blavaan+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/blavaan/51f6ecf5-238b-4ea4-8e47-00ec8f6adeb7n%40googlegroups.com.
“Chain 3: Exception: multi_normal_rng: Matrix covariance matrix argument is not positive definite (in 'model_stanmarg' at line 1017)”
I am running a simulation and only very few of the conditions are giving me this hanging/error message issue. I'd like to be able to tell blavaan to conditionally stop/skip analyses with this error code, and move on to the next datafile.
Hello,I am working on a Masters thesis with a comparison of frequentist and Bayesean SEM and estimating with simulations the “same” model in lavaan (SEM) and blavaan (BSEM). I have used the estimation code as a function and then use replicate to get 500 replications.I have checked that the initial covariance matrix to be tested is not NPD and everything works fine with the lavaan analyses.
--
You received this message because you are subscribed to a topic in the Google Groups "blavaan" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/blavaan/feKgiTvqxio/unsubscribe.
To unsubscribe from this group and all its topics, send an email to blavaan+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/blavaan/063d28bdbb5f301655fbdbd0bc2b471bd80e8341.camel%40gmail.com.