mixdmm: Mixture of dmm's specification

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/mixdmm.R

Description

mixdmm creates an object of class mixdmm, ie a mixture of dmm's, given a list of component models of class dmm.

Usage

1
2
3
4
	
	mixdmm(dmm, modname=NULL, mixprop=NULL, conrows=NULL)
	## S3 method for class 'mixdmm'
summary(object, specs=FALSE, precision=3, se=NULL, ...)

Arguments

dmm

A list of dmm objects to form the mixture.

modname

A character string with the name of the model, good when fitting many models. Components of mixture models keep their own names. Names are printed in the summary. Boring default names are provided.

conrows

Argument conrows can be used to specify general constraints between parameters.

mixprop

Arugement mixprop can be used to set the initial values of the mixing proportions of a mixture of dmm's.

precision

Precision sets the number of digits to be printed in the summary functions.

object

An object of class mixdmm.

specs,...

Internal use. Not functioning currently.

se

Vector with standard errors, these are passed on from the summary.fit function if and when ses are available.

Details

The function mixdmm can be used to define a mixture of dmm's by providing a list of such objects as argument to this function. See the dmm helpfile on how to use the conrows argument. Note that it has to be of length npars, ie including all parameters of the model and not just the mixing proportions.

Value

mixdmm returns an object of class mixdmm which has the same fields as a dmm object. In addition it has the following fields:

nrcomp

The number of components of the mixture model.

mod

A list of the component models, that is a list of objects of class dmm.

Author(s)

Ingmar Visser [email protected]

See Also

dmm on defining single component models, and mgdmm on defining multi group models. See generate for generating data.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# define component 1
# all or none model with error prob in the learned state
fixed = c(0,0,0,1,1,1,1,0,0,0,0)
stv = c(1,1,0,0.07,0.93,0.9,0.1,0.5,0.5,0,1)
allor <- dmm(nstates=2,itemtypes=2,fixed=fixed,stval=stv,modname="All-or-none")

# define component 2
# Concept identification model: learning only after an error
st=c(1,1,0,0,0,0.5,0.5,0.5,0.25,0.25,0.8,0.2,1,0,0,1,0.25,0.375,0.375)
# fix some parameters
fx=rep(0,19)
fx[8:12]=1
fx[17:19]=1
# add a couple of constraints
conr1 <- rep(0,19)
conr1[9]=1
conr1[10]=-1
conr2 <- rep(0,19)
conr2[18]=1
conr2[19]=-1
conr3 <- rep(0,19)
conr3[8]=1
conr3[17]=-2
conr=c(conr1,conr2,conr3)
cim <- dmm(nstates=3,itemtypes=2,fixed=fx,conrows=conr,stval=st,modname="CIM")

# define a mixture of the above component models
mix <- mixdmm(dmm=list(allor,cim),modname="MixAllCim")
summary(mix)

depmix documentation built on Dec. 9, 2018, 1:04 a.m.