This repository is associated with the article Bayesian cumulative shrinkage for infinite factorizations (Biometrika, 107(3), 745-752; also on arXiv) and provides detailed materials and codes for posterior inference under the Cumulative Shrinkage Process (CUSP) proposed in the article.
The repository contains:
-
cusp.R
: the source code to perform posterior computation for Gaussian factor models endowed with the CUSP prior via the adaptive Gibbs sampler provided in the paper (Algorithm 2). Gaussian factor models are used here as a notable illustrative example, but the CUSP can be employed in a variety of models (e.g. Poisson factorization). Hence, the parts ofcusp.R
which are not specific to Gaussian factor models can be repurposed for other models. Note that this is a basicR
implementation meant to provide a clear understanding of the computational routines associated with the proposed model; fasterC++
implementations can be derived. -
tutorial.md
: a comprehensive tutorial to perform posterior inference for Gaussian factor models endowed with the CUSP prior, leveraging the source codecusp.R
. As an illustrative example, we reproduce step by step the analysis of thebfi
dataset from theR
packagepsych
described in Section 5 of the article. The analyses are performed with a laptop equipped with Ubuntu 18.04.5 OS, Intel Core i7-3632QM CPU and 7.7 GB of RAM, usingR
version 3.4.2.