Hi blavaan team--
I've run into a problem when trying to specify beta priors for the correlations among more than 2 latent variables. This can be illustrated in the Holzinger & Swineford example used here:
The example there is
HS.model <- ' visual =~ x1 + x2 + x3
textual =~ x4 + x5 + x6
speed =~ x7 + x8 + x9
visual ~~ prior("beta(1,1)")*textual '
When I run that model, and look at the summary, it reports the prior for each of the three latent variable correlations as "lkj(1)". This is the case when specifying the model as above, or several variations (e.g., each of the pairings of latent variables explicitly having a beta prior, or the use of dpriors(). For completeness, running the code:
############################################
library(blavaan)
library(lavaan)
HS.model <- ' visual =~ x1 + x2 + x3
textual =~ x4 + x5 + x6
speed =~ x7 + x8 + x9
visual ~~ prior("beta(1,1)")*textual
'
bfit1 <- bcfa(
HS.model,
n.chains = 2,
data = HolzingerSwineford1939
)
summary(bfit1)
############################################
gives a summary reporting that the lkj(1) prior was used for all latent variable correlations. This issue does not occur when only using 2 latent variables. For example the code:
############################################
HS.model.2 <- ' visual =~ x1 + x2 + x3
textual =~ x4 + x5 + x6
#speed =~ x7 + x8 + x9
visual ~~ prior("beta(4,1)")*textual
'
bfit2 <- bcfa(
HS.model.2,
n.chains = 2,
data = HolzingerSwineford1939
)
summary(bfit2)
############################################
gives a summary reporting that the beta(1,1) prior was used.
I'm confused by this. Ultimately I would like to specify beta priors for the latent variable correlations when there are more than 2 latent variables, and am unsure why that's not enacted here, or how to enact it. Can you clarify?
My apologies if this has been addressed elsewhere and I have missed it.
Thanks,
Roy