Learn R Programming

slfm (version 0.2.1)

slfm: Sparse Latent Factor Model

Description

This function is used to fit a Bayesian sparse latent factor model.

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
prior shape parameter for Gamma distribution
b
prior scale parameter for Gamma distribution
gamma_a
prior parameter for Beta distribution
gamma_b
prior parameter for Beta distribution
omega_0
prior variance of the spike component
omega_1
prior variance of the slab component
sample
sample size after burn-in
burnin
burn-in size
lag
lag for MCMC
degenerate
use the degenerate version of mixture

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

1. Duarte, J. D. N. and Mayrink, V. D. (2015). Factor analysis with mixture modeling to evaluate coherent patterns in microarray data. In Interdisciplinary Bayesian Statistics, volume 118 of Springer Proceedings in Mathematics & Statistics, pages 185-195. Springer International Publishing.

Examples

Run this code
mat <- matrix(rnorm(2000), nrow = 20)
slfm(mat, sample = 1000)

Run the code above in your browser using DataLab