generate {depmix} R Documentation

## Generate data from a dependent mixture model

### Description

generate generates a dataset according to a given dmm.

### Usage


generate(ntimes,dmm,nreal=1)



### Arguments

 ntimes The number of repeated measurements, ie the length of the time series (this may be a vector containing the lengths of independent realiazations). dmm Object of class dmm or mixdmm. nreal The number of independent realizations that is to generated. Each of them will have the dimension of ntimes; all this does is replace ntimes by rep(ntimes,nreal).

### Details

generate generates a date set of the specified dimensions ntimes and nreal using the parameter values in dmm, which should be an object of class dmm or mixdmm. generate does not handle multi group models, which can be run separately.

This function is used in the bootstrap'ping routine to compute standard errors based on parametric bootstraps.

### Value

Generate returns an object of class markovdata. The return object has an attribute called instates, a vector with the starting states of each realization. When the model is a mixture the return has another attribute incomp containing the components of each realization.

### Author(s)

Ingmar Visser i.visser@uva.nl

dmm, markovdata

### Examples


# create a 2 state model with one continuous and one binary response
# with start values provided in st
st <- c(1,0.9,0.1,0.2,0.8,2,1,0.7,0.3,5,2,0.2,0.8,0.5,0.5)
mod <- dmm(nsta=2,itemt=c(1,2), stval=st)

# generate two series of lengths 100 and 50 respectively using above model
gen<-generate(c(100,50),mod)

summary(gen)
plot(gen)



[Package depmix version 0.9.16 Index]