dens.norm {LCAextend}R Documentation

computes the multinormal density of a given continuous measurement vector for all classes

Description

computes the density of an individual's continuous measurement vector for all latent classes, eventually taking covariates into account. This is an internal function not meant to be called by the user.

Usage

dens.norm(y.x, param, var.list = NULL)

Arguments

y.x

a vector y of values of the measurement followed by the values x of covariates, if any,

param

a list of the multinormal density parameters: means mu and variances-covariances sigma,

var.list

a list of integers indicating which covariates (taken from x) are used for a given type of measurement.

Details

For each class k, the function computes the multinormal density with means param$mu[[k]] and variances-covariances matrix param$sigma[[k]] for the individual's measurement vector. Treatment of covariates is not yet implemented, and any provided covariate value will be ignored.

Value

The function returns a vector dens of length K, where dens[k] is the density of the measurements if the individual belongs to class k.

Examples

#data
data(ped.cont)
status <- ped.cont[,6]
y <- ped.cont[status==2,7:ncol(ped.cont)]
#param
data(param.cont)
#the function applied for measurement of the first individual in the ped.ordi
dens.norm(y.x=y[1,],param.cont)

[Package LCAextend version 1.3 Index]