View source: R/simul.R.prior.R
simul.R.prior | R Documentation |
This function produces a sample of correlation matrices drawn from their prior distribution induced in the identified version of the factor model, given the prior distribution specified on the corresponding covariance matrices of the factors in the expanded model.
simul.R.prior(Kmax, nu0 = Kmax + 1, S0 = 1, HW.prior = TRUE,
nrep = 10^5, verbose = TRUE)
Kmax |
Maximum number of latent factors. |
nu0 |
Degrees of freedom of the Inverse-Wishart prior on the covariance matrix of the latent factors in the expanded model. |
S0 |
Scale parameters of the Inverse-Wishart prior on the covariance matrix of latent factors in the expanded model:
Either a scalar or a numeric vector of length equal to |
HW.prior |
If |
nrep |
Number of Monte Carlo replications. |
verbose |
If |
Covariance matrices are sampled from the prior distribution in the
expanded model, and transformed to produce the corresponding correlation
matrices. See section 2.3.5 of CFSHP (p.36-37), as well as the details of
the function befa
.
To compare several prior specifications, different values of the parameters
nu0
and S0
can be specified. The function then simulates for
each pair of these parameters. nu0
and S0
should therefore be
scalars or vectors of same length.
A list of length equal to the number of pairs of parameters
nu0
and S0
, where each element of the list is an array of
dimension (Kmax
, Kmax
, nrep
) that contains the
correlation matrices of the latent factors drawn from the prior.
Rémi Piatek remi.piatek@gmail.com
G. Conti, S. Frühwirth-Schnatter, J.J. Heckman, R. Piatek (2014): “Bayesian Exploratory Factor Analysis”, Journal of Econometrics, 183(1), pages 31-57, \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1016/j.jeconom.2014.06.008")}.
# partial reproduction of figure 1 in CFSHP (p.38)
# note: use larger number of replications nrep to increase smoothness
Kmax <- 10
Rsim <- simul.R.prior(Kmax, nu0 = Kmax + c(1, 2, 5), S0 = .5, nrep = 1000)
summary(Rsim)
plot(Rsim)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.