Learn R Programming

BNPMIXcluster (version 1.1.0)

get_latents: Simulation of latent variables \(Z\) in the mixdpclust model

Description

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

Usage

get_latents(Y, var_type, mu_Z.ini = NULL, sigma_Z.ini = NULL,
  Z.ini = NULL)

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.ini

an optional vector with the expected values \(\mu_Z\) of the latent variables.

sigma_Z.ini

an optional matrix with the covariance matrix \(\Sigma_Z\) of the latent variables.

Z.ini

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

Details

For each variable in the Y data frame, an associated continuos latent variable is generated. if \(Y_j\) is continuos, 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.