Greetings,
I'm working on a general confirmatory factor analysis model with Stan, inspired by the lavaan and blavaan packages (
https://arxiv.org/pdf/1511.05604.pdf). My idea is to build a pre-compiled model, similar to the strategy used in rstanarm, to quickly fit CFA models with Stan (and general SEM models later on), using lavaan's simple syntax to define the model and generate the parameter matrices.
I have some questions about my implementation:
(1) Especially with standardized latent variables, there are at least two modes for some sets of parameters (loadings lambda and latent covariance matrix Phi) due to sign switching. I have visited many threads about this issue here, but some proposed solutions, like manual initialization and positivity constraints, are not working as expected. For example, when I constrain the loadings to be positive, some chains find the right mode, but other chains keep bouncing at zero. I suspect I should constrain more parameters, but I don't know exactly which. Could someone suggest how to deal with this multimodality issue without post-processing?
(2) I read in another thread that leaving free parameters (parameters not really constrained by any data or prior) can be harmful to HMC. Currently, I'm defining unconstrained parameters in the 'parameters' block (with cholesky correlation matrix and vector of standard deviations for the CFA model matrices), and constraining them in the 'transformed parameters' block -- e.g., fixing some elements of a matrix to zero or one. The likelihood is defined with the constrained parameters, of course, but that leaves some parameters without any true connection to the model. All unconstrained parameters are given somewhat weakly informative priors (like normal(0,1) for loadings, cauchy(0,1) for residual standard deviations, etc. etc.), so they are not completely unconstrained. When estimating the parameter of a CFA with one indicator loading fixed to one for each latent factor, HMC samples very quickly and with very good mixing. Should I be worried about the unconstrained parameters?
Thanks!
Erikson