mixture: Estimate mixture latent variable model.

Description Usage Arguments Details Author(s) See Also Examples

Description

Estimate mixture latent variable model

Usage

1
2
mixture(x, data, k = length(x), control = list(), type = c("standard",
  "CEM", "SEM"), vcov = "observed", ...)

Arguments

x

List of lvm objects. If only a single lvm object is given, then a k-mixture of this model is fitted (free parameters varying between mixture components).

data

data.frame

k

Number of mixture components

control

Optimization parameters (see details)

type

Type of EM algorithm (standard, classification, stochastic)

vcov

of asymptotic covariance matrix (NULL to omit)

...

Additional arguments parsed to lower-level functions

Details

Estimate parameters in a mixture of latent variable models via the EM algorithm.

The performance of the EM algorithm can be tuned via the control argument, a list where a subset of the following members can be altered:

start

Optional starting values

nstart

Evaluate nstart different starting values and run the EM-algorithm on the parameters with largest likelihood

tol

Convergence tolerance of the EM-algorithm. The algorithm is stopped when the absolute change in likelihood and parameter (2-norm) between successive iterations is less than tol

iter.max

Maximum number of iterations of the EM-algorithm

gamma

Scale-down (i.e. number between 0 and 1) of the step-size of the Newton-Raphson algorithm in the M-step

trace

Trace information on the EM-algorithm is printed on every traceth iteration

Note that the algorithm can be aborted any time (C-c) and still be saved (via on.exit call).

Author(s)

Klaus K. Holst

See Also

mvnmix

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
set.seed(1)
m0 <- lvm(list(y~x+z,x~z))
distribution(m0,~z) <- binomial.lvm()
d <- sim(m0,500,p=c("y<-z"=2,"y<-x"=1))

## unmeasured confounder example
m <- baptize(lvm(y~x));
covariance(m,~x) <- "v"
intercept(m,~x+y) <- NA

M <- mixture(m,k=2,data=d,control=list(trace=1,tol=1e-6))
summary(M)
lm(y~x,d)
## True slope := 1

kkholst/lava.mixture documentation built on May 20, 2019, 10:46 a.m.