train_CPFA: Train a copula PFA model

Description Usage Arguments Details Value

Description

This function trains a copula factor analysis model with Poisson marginals in Stan.

Usage

1
train_CPFA(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.

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.


bstatcomp/copulafa documentation built on May 30, 2019, 4:02 a.m.