View source: R/FullConditionals.R
psi_hyper | R Documentation |
Takes an inverse-Gamma shape hyperparameter, and an inverse covariance matrix (or estimate thereof), and finds data-driven scale hyperparameters in such a way that Heywood problems are avoided for factor analysis or probabilistic principal components analysis (and mixtures thereof).
psi_hyper(shape,
dat,
type = c("unconstrained", "isotropic"),
beta0 = 3,
...)
shape |
A positive shape hyperparameter. |
dat |
The data matrix for which the inverse covariance matrix is to be estimated. If data are to be centered &/or scaled within |
type |
A switch indicating whether a single scale ( |
beta0 |
See Note below. Must be a strictly positive numeric scalar. Defaults to |
... |
Catches unused arguments. Advanced users can also supply the sample covariance matrix of |
Constraining uniquenesses to be isotropic provides the link between factor analysis and the probabilistic PCA model. When used in conjunction with mcmc_IMIFA
with "isotropic" or "single" uniquenesses, type
must be isotropic
, but for "unconstrained" or "constrained" uniquenesses, it's possible to specify either a single scale (type="isotropic"
) or variable-specific scales (type="unconstrained"
).
Used internally by mcmc_IMIFA
when its argument psi_beta
is not supplied.
Either a single scale hyperparameter or ncol(dat)
variable-specific scale hyperparameters.
When N > P
, where N
is the number of observations and P
is the number of variables, the inverse of the sample covariance matrix is used by default.
When N <= P
, the inverse either does not exist or the estimate thereof is highly unstable. Thus, an estimate of the form \left(\beta_0 + \frac{N}{2}\right)\left(\beta_0\mathcal{I}_p + 0.5\sum_{i=1}^N x_i x_i^\top\right)^{-1}
is used instead.
For unstandardised data, the estimate is instead constructed using a standardised version of the data, and the resulting inverse correlation matrix estimate is scaled appropriately by the diagonal entries of the sample covariance matrix of the original data.
This estimate can also be used in N > P
cases by explicitly supplying beta0
. It will also be used if inverting the sample covariance matrix fails in N > P
cases.
The optional argument beta0
can be supplied to mcmc_IMIFA
via the control function mixfaControl
.
Keefe Murphy - <keefe.murphy@mu.ie>
Murphy, K., Viroli, C., and Gormley, I. C. (2020) Infinite mixtures of infinite factor analysers, Bayesian Analysis, 15(3): 937-963. <\Sexpr[results=rd]{tools:::Rd_expr_doi("10.1214/19-BA1179")}>.
Fruwirth-Schnatter, S. and Lopes, H. F. (2010). Parsimonious Bayesian factor analysis when the number of factors is unknown, Technical Report. The University of Chicago Booth School of Business.
Fruwirth-Schnatter, S. and Lopes, H. F. (2018). Sparse Bayesian factor analysis when the number of factors is unknown, to appear. <arXiv:1804.04231>.
Tipping, M. E. and Bishop, C. M. (1999). Probabilistic principal component analysis, Journal of the Royal Statistical Society: Series B (Statistical Methodology), 61(3): 611-622.
mcmc_IMIFA
, mixfaControl
data(olive)
olive2 <- olive[,-(1:2)]
shape <- 2.5
(scale1 <- psi_hyper(shape=shape, dat=olive2))
# Try again with scaled data
olive_S <- scale(olive2, center=TRUE, scale=TRUE)
# Use the inverse of the sample covariance matrix
(scale2 <- psi_hyper(shape=shape, dat=olive_S))
# Use the estimated inverse covariance matrix
(scale3 <- psi_hyper(shape=shape, dat=olive_S, beta0=3))
# In the normalised example, the mean uniquenesses (given by scale/(shape - 1)),
# can be interpreted as the prior proportion of the variance that is idiosyncratic
(prop1 <- scale1/(shape - 1))
(prop2 <- scale2/(shape - 1))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.