Sampling statement for cfa on correlation matrix

Hi guys,

i am trying to model a confirmatory factor analysis on a correlation matrix. Therefore, i set up matrices and priors for loadings, factor correlations and variances and use those to calculate a model-implied correlation matrix, much like in ML estimation:

correlations_{implied} = loadings * correlations_{factor} * loadings' + variances

I struggle then to correctly set up a sampling statement. I do something like this:

model {
  observed_correlations ~ normal(implied_correlations, 0.1);

This sampling statement seems to work, but i am concerned about the 0.1, which is just an arbitrary value i chose. Is there a more reasonable way to do this?

best, Felix

Factor analysis models get pretty involved. There was a thread a few days ago with someone setting one up: Help with factor analysis (latent variable model) . It sounds like everything got worked out, and the code is pretty clean and well commented, so I’d recommend you have a look there and see if it gives you some clues on how to goo about building your model.

1 Like

Thanks, that helped!

I don’t know about this model in particular, but in cases like the IRT model you just need to establish a fixed scale—it doesn’t matter what it is. Here, the loadings are probably providing the scaling.