Closed mattansb closed 4 months ago
Thanks for following up, I think this is a different issue than the one described in #68.
I think the issue now is related to the fourth warning message about the theta covariance matrix. The y1 ~~ y5
residual covariance leads to a covariance matrix with one free off-diagonal element and others fixed to 0. In such a case, the prior for the covariance matrix can be influenced by the positive definite constraint, and blavaan cannot necessarily evaluate the correct prior (which throws off the BF calculation) so an NA is reported. For more detail, see the "positive definite constraints" section here.
In your specific case, I think it is a false alarm because there can be one free covariance without worrying about positive definiteness. I can improve the check here. And if you remove the residual covariance, you should get the BF with the current version of blavaan.
You should now be able to obtain the Bayes factor for your model. If you were to add a second residual covariance to your model involving either y1
or y5
, then the Bayes factor would again become NA due to the positive definite issue from my first reply. And the Bayes factor is also currently turned off for models that have ordinal observed variables. In general, I am trying to be careful about only returning the Bayes factor when it is clear that we can reliably evaluate the priors in the model.
Revisiting https://github.com/ecmerkle/blavaan/issues/68 & https://github.com/easystats/bayestestR/issues/627, we're still not getting BFs.
(I'm comparing the same model to itself, so log(BF) should be 0, but getting
NA
):