train_CFA: Train a copula FA model

Description Usage Arguments Details Value

Description

This function trains a copula factor analysis model in Stan.

Usage

1
train_CFA(train, gp_train, nfac = 2, ...)

Arguments

train

data frame. The training data set, consisting of counts. Columns represent variables, rows represent observations.

gp_train

vector. Groups for each observation.

nfac

numeric. The number of factors.

...

Arguments passed to rstan::sampling (e.g. iter, chains).

Details

The transformations are made separately, between the modeling of marginals and the correlation.

Value

A list.

train

Training data set.

gp_train

A vector of groups for each observation.

loadings

Aggregated loadings.

scores

Aggregated factor scores.

noise

Aggregated residual covariance matrix.

noise_org

Aggregated residual covariance matrix, scaled by the variance of the original data.

Sigma

Aggregated correlation matrix.

stan_mod

A list with two elements. Both are objects of S4 class stanfit. First is the marginal distribution estimation, second is the copula.


gregorp90/RStan-package-test documentation built on May 26, 2019, 1:32 a.m.