ecmerkle/blavaan

Priors applied to the wrong parameters (in certain conditions) using the rstan interface

EnricoToffalini opened this issue · 3 comments

Hi Ed,

I noticed that, when setting informed priors for specific parameters, "bsem" applies those priors to the wrong parameters.

Specifically, this happens under certain conditions when you run a path model with multiple dependent variables.

For example, you set a prior for the path
Predictor1 -> DepVar1
but it ends up being applied to the path
Predictor 1 -> DepVar2.

The issue is described in the attached documents which include:

  • PNG screenshot that depicts the issue
  • R code for example and a simulated dataset (zipped)

This happens when using the rstan interface.
Note: I use blavaan version 0.3-7, and R version 3.6.1

Thanks,
Enrico

PS. I wrote to Y Rosseel who encouraged me to report the issue here. He also noted that this happens when using the rstan interface but not the rjags interface.

example blavaan output

[example_code_and_dataset.zip](https://github.com/ecmerkle/blavaan/files/3840546/example_code_and_dataset.zip)

Enrico,

Thanks for the careful work and the example here, this is obviously a problem. I am testing a fix and, assuming it works as expected, I will get a new version out soon.

Ed

I believe this is now fixed, and blavaan 0.3-8 is now making its way to CRAN. Please let me know if you encounter further problem.