NSFA_gibbs: Gibbs Sampler for the Non-parametric Sparse Factor Analysis...

Description Usage Arguments Details Value References

View source: R/NSFA_gibbs_run_chain.R

Description

This function runs a Gibbs sampler to obtain posterior samples from the NSFA model by Knowles & Ghahramani (2011). This is my personal implementation, which contains some corrections with respect to the model presented in the original article.

Usage

1
NSFA_gibbs(S, Y, hp = NULL, Y_test = NULL, R = 1L, verbose = 0L)

Arguments

S

number of iterations for the chain.

Y

matrix with the observed data, of size D x N.

hp

list of hyperparameters. See Details for a description and default values used.

Y_test

matrix with test set for assessing out-of-sample performance. Number of columns must be same as Y (N).

R

function returns last R values in the chain. Default is 1.

verbose

integer. Function prints every verbose iterations. The default value of 0 prints no output.

Details

The model was originally proposed in Knowles & Ghahramani (2011). However, you can read my own report evaluating this model here.

The following hyperparameters can be supplied by the user through hp. Default values are in parenthesis and tend to work well.

If chain keeps restarting, try increasing lambda_MH and/or pi_MH to get more aggressive proposals for growing Z.

Value

List with two lists:

chain

list with last R samples of the chain.

stats

list of traces of train set log-likelihood (ll), test set ll, and K.

References

Knowles, D., & Ghahramani, Z. (2011). Nonparametric Bayesian sparse factor models with application to gene expression modeling. The Annals of Applied Statistics, 1534-1552.


miguelbiron/SBGLM documentation built on May 29, 2019, 8:23 p.m.