add_var: Add variables to a Gaussian mixture model
Description
This function adds variables to a Gaussian mixture model.
Usage
add_var(gmm, var)
Value
The gmm object after adding the variables.
Arguments
gmm
An object of class gmm. If NULL, a gmm object
is created with the added variables and one mixture component.
var
A character vector containing the added variables, or a data frame
or numeric matrix whose columns are named after the added variables. In the
first case, for each mixture component, the marginal mean vector of the added
variables is 0 and the marginal covariance matrix the identity matrix. In the
second case, these mean vector and covariance matrix are computed from the
data (after removing the rows that contain missing values).