Bayesian Clustering Factor Models
BCFM: Bayesian Clustering Factor Models
Fit BCFM Model
BCFM Model Selection Over Multiple Groups and Factors
Gibbs sampler of BCFM
Get the mode of a vector
Build factor loadings plot
Trace plot for posterior of factor loadings
Plot IC Matrix from Model Selection
Plot Latent Factor Profiles by Cluster
Density of group means mu using ggplot2
The density plot of the diagonal of group covariance, Omega, with ggpl...
Density plot for posterior of probabilities
Trace plot of probabilities parameter
A credible interval plot of posterior of sigma squared
A credible interval plot of posterior of factor loadings covariance, t...
Variability explained by factors
A heatmap of group assignments, Z using ggplot2
Information Criterion. Very close to the original BIC method, but this...
Initialize Data Array for BCFM Model
Initialize cluster hyperparameters
Initialize hyperparmeters for BCFM model
Build model attributes from the dataset
Order of permutation by the largest absolute value in each eigenvector
Permute the dataset by the largest absolute value in each eigenvector,...
Implements the Bayesian Clustering Factor Models (BCFM) for simultaneous clustering and latent factor analysis of multivariate longitudinal data. The model accounts for within-cluster dependence through shared latent factors while allowing heterogeneity across clusters, enabling flexible covariance modeling in high-dimensional settings. Inference is performed using Markov chain Monte Carlo (MCMC) methods with computationally intensive steps implemented via 'Rcpp'. Model selection and visualization tools are provided. The methodology is described in Shin, Ferreira, and Tegge (2018) <doi:10.1002/sim.70350>.