get_latents: Simulation of latent variables Z in the _mixdpclust_ model

Description Usage Arguments Details

View source: R/get_latents.R

Description

Simulates values for latent variables Z=(Z_1,...,Z_q) according to the specification in the mixdpclust model.

Usage

1
2
3
4
5
6
7
8
get_latents(
  Y,
  var_type,
  mu_Z = NULL,
  sigma_Z = NULL,
  Z_old = NULL,
  USING_CPP = TRUE
)

Arguments

Y

Matrix or data frame containing the observed data.

var_type

Character vector that indicates the type of variable in each column of Y. Three possible types:

  • "c" for continuous variables.

  • "o" for ordinal variables (ordered categorical).

  • "m" for nominal variables (non-ordered categorical).

mu_Z

an optional vector with the expected values μ_Z of the latent variables.

sigma_Z

an optional matrix with the covariance matrix Σ_Z of the latent variables.

Z_old

an optional matrix with initial values for the latent variables that will be simulated.

USING_CPP

indicates usage of C++ in some modules.

Details

For each variable in the Y data frame, an associated continuous latent variable is generated. if Y_j is continuous, the corresponding Z_j will keep the original values of Y_j. If Y_j is categorical, the function will scan the unique values of Y_j and generate continuous latent variables accordingly.


BNPMIXcluster documentation built on Nov. 30, 2020, 5:07 p.m.