slfm {slfm} | R Documentation |
slfm
Description
Bayesian Sparse Latent Factor Model (SLFM) designed for the analysis of coherent patterns in gene expression data matrices. Details about the methodology being applied here can be found in Duarte and Mayrink (2015) and Duarte and Mayrink (2019).
Usage
slfm(
x,
a = 2.1,
b = 1.1,
gamma_a = 1,
gamma_b = 1,
omega_0 = 0.01,
omega_1 = 10,
sample = 1000,
burnin = round(0.25 * sample),
lag = 1,
degenerate = FALSE
)
Arguments
x |
matrix with the pre-processed data. |
a |
positive shape parameter of the Inverse Gamma prior distribution (default = 2.1). |
b |
positive scale parameter of the Inverse Gamma prior distribution (default = 1.1). |
gamma_a |
positive 1st shape parameter of the Beta prior distribution (default = 1). |
gamma_b |
positive 2nd shape parameter of the Beta prior distribution (default = 1). |
omega_0 |
prior variance of the spike mixture component (default = 0.01). |
omega_1 |
prior variance of the slab mixture component (default = 10). |
sample |
sample size to be considered for inference after the burn in period (default = 1000). |
burnin |
size of the burn in period in the MCMC algorithm (default = sample/4). |
lag |
lag to build the chains based on spaced draws from the Gibbs sampler (defaul = 1). |
degenerate |
logical argument (default = FALSE) indicating whether to use the degenerate version of the mixture prior for the factor loadings. |
Value
x: data matrix.
q_star: matrix of MCMC chains for q_star parameter.
alpha: summary table of MCMC chains for alpha parameter.
lambda: summary table of MCMC chains for lambda parameter.
sigma: summary table of MCMC chains for sigma parameter.
classification: classification of each alpha ('present', 'marginal', 'absent')
References
DOI:10.18637/jss.v090.i09 (Duarte and Mayrink; 2019)
DOI:10.1007/978-3-319-12454-4_15 (Duarte and Mayrink; 2015)
See Also
Examples
mat <- matrix(rnorm(2000), nrow = 20)
slfm(mat, sample = 1000)