The function simulates data from the following dedicated factor
model, for \(i = 1, ..., N\):
$$Y_i = \alpha \theta_i + \epsilon_i$$
$$\theta_i \sim \mathcal{N}(0, R)$$
$$\epsilon_i \sim \mathcal{N}(0, \Sigma)$$
where the \(K\)-vector \(\theta_i\) contains the latent factors, and
\(\alpha\) is the \((M \times K)\)-matrix of factor loadings. Each
row \(m\) of \(\alpha\) contains only zeros, besides its element
indicated by the \(m\)th element of dedic that is equal to the
\(m\)th element of alpha (denoted \(\alpha_m^\Delta\) below).
The \(M\)-vector \(\epsilon_i\) is the vector of error terms, with
\(\Sigma = diag(\)sigma\()\). \(M\) is equal to the length of
the vector dedic, and \(K\) is equal to the maximum value of this
vector.
Only N and dedic are required, all the other parameters can be
missing, completely or partially. Missing values (NA) are
independently sampled from the following distributions, for each manifest
variable \(m = 1, ..., M\):
Factor loadings:
$$\alpha_m^\Delta = (-1)^{\phi_m}\sqrt{a_m}$$
$$\phi_m \sim \mathcal{B}er(0.5)$$
$$a_m \sim \mathcal{U}nif (0.04, 0.64)$$
Idiosyncratic variances:
$$\sigma^2_m \sim \mathcal{U}nif (0.2, 0.8)$$
For the variables that do not load on any factors (i.e., for which the
corresponding elements of dedic are equal to 0), it is specified that
\(\alpha_m^\Delta = 0\) and \(\sigma^2_m = 1\).
Covariance matrix of the latent factors:
$$\Omega \sim \mathcal{I}nv-\mathcal{W}ishart(K+5, I_K)$$
which is rescaled to be a correlation matrix if R.corr = TRUE:
$$R = \Lambda^{-1/2} \Omega \Lambda^{-1/2}$$
$$\Lambda = diag(\Omega)$$
Note that the distribution of the covariance matrix is truncated such that
all the off-diagonal elements of the implied correlation matrix \(R\) are
below max.corr in absolute value. The truncation is also applied if
the covariance matrix is used instead of the correlation matrix (i.e., if
R.corr = FALSE).
The distributions and the corresponding default values used to simulate the
model parameters are specified as in the Monte Carlo study of CFSHP, see
section 4.1 (p.43).