optim.equal.norm: performs the M step for measurement density parameters in...

Description Usage Arguments Details Value Examples

View source: R/optim.equal.norm.R

Description

Estimates the mean mu and parameters of the variance-covariance matrix sigma of a multinormal distribution for the measurements with equal variance for all measurements and equal covariance between all pairs of measurements within each class. The variance and covariance parameters are however distinct for each class.

Usage

1
optim.equal.norm(y, status, weight, param, x = NULL, var.list = NULL)

Arguments

y

a matrix of continuous measurements (only for symptomatic subjects),

status

symptom status of all individuals,

weight

a matrix of n times K of individual weights, where n is the number of individuals and K is the total number of latent classes in the model,

param

a list of measurement density parameters, here is a list of mu and sigma,

x

a matrix of covariates (optional). Default id NULL,

var.list

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

Details

The values of explicit estimators are computed for both mu and sigma. The variance-covariance matrices sigma are distinct for each class. Treatment of covariates is not yet implemented, and any provided covariate value will be ignored.

Value

The function returns a list of estimated parameters param.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
#data
data(ped.cont)
status <- ped.cont[,6]
y <- ped.cont[,7:ncol(ped.cont)]
data(peel)
#probs and param
data(probs)
data(param.cont)
#e step
weight <- e.step(ped.cont,probs,param.cont,dens.norm,peel,x=NULL,
                 var.list=NULL,famdep=TRUE)$w
weight <- matrix(weight[,1,1:length(probs$p)],nrow=nrow(ped.cont),
                 ncol=length(probs$p))
#the function
optim.equal.norm(y[status==2,],status,weight,param.cont,x=NULL,
                 var.list=NULL)

abureau/LCAextend documentation built on May 3, 2019, 9:41 p.m.