gfa: Gibbs sampling for group factor analysis

Description Usage Arguments Details Value


gfa returns posterior samples of group factor analysis model.


gfa(Y, opts, K = NULL, projection = NULL, filename = "")




  1. Data sources with co-occuring samples: a list of data matrices, where Y[[m]] is a numeric N \times D_m matrix, or

  2. Data sources paired in two modes (some data sources share the samples of the first data source, and some share its features): A list with two elements structured as 1. The data collections Y[[1]] and Y[[2]] should be connected by sharing their first data source, i.e. Y[[1]][[1]] should equal the transpose of Y[[2]][[1]].

NOTE: The data features should have roughly zero mean and unit variance. If this is not the case, preprocessing with function normalizeData is recommended.


List of model options; see function getDefaultOpts.


The number of components (i.e. latent variables). Recommended to be set somewhat higher than the expected component number, so that the sampler can determine the model complexity by shutting down excessive components. High values result in high CPU time. Default: half of the minimum of the sample size and total data dimensionality.


Fixed projections. Only intended for sequential prediction use via function sequentialGfaPrediction. Default: NULL.


A string. If provided, will save the sampling chain to this file every 100 iterations. Default "", inducing no saving.


GFA allows factor analysis of multiple data sources (i.e. data sets). The priors of the model can be set to infer bicluster structure from the data sources; see getDefaultOpts. Missing values (NAs) are inherently supported. They will not affect the model parameters, but can be predicted with function reconstruction, based on the observed values of the corresponding sample and feature. The association of a data source to each component is inferred based on the data. Letting only a subset of the components to explain a data source results in the posterior identifying relationships between any subset of the data sources. In the extreme cases, a component can explain relationships within a single data source only ("structured noise"), or across all the data sources.


A list containing the model parameters - in case of pairing in two modes, each element is a list of length 2; one element for each mode. For most parameters, the final posterior sample is provided to aid in initial checks; all the posterior samples should be used for model analysis. The list elements are:


The loading matrix (final posterior sample); D \times K matrix.


The latent variables (final sample); N \times K matrix.


The spike-and-slab parameters (final sample); D \times K matrix.


The probability of slab in Z (final sample).


The probability of slab in the spike-and-slab prior of X (final sample).


The noise precisions (final sample); D-element vector.


The precisions of the projection weights W (final sample); D \times K matrix.


The precisions of the latent variables X (final sample); N \times K matrix.


A list denoting which features belong to each data source.


Data dimensionalities; M-element vector.


The number of components inferred. May be less than the initial K.

and the following elements:


the posterior samples of, by default, X, W and tau.


The likelihood of all the posterior samples.


The Akaike information criterion of all the posterior samples.


The options used for the GFA model.


An estimate of the convergence of the model's reconstruction based on Geweke diagnostic. Values significantly above 0.05 imply a non-converged model, and hence the need for a longer sampling chain.


The CPU time (in seconds) used to sample the model.

GFA documentation built on May 1, 2019, 8:49 p.m.