draw_lm_mixed: Draws samples from the mixed LM model

Description Usage Arguments Value Author(s) Examples

View source: R/draw_lm_mixed.R

Description

Function that draws samples from the mixed LM model with specific parameters.

The function is no longer maintained. Please look at drawLMmixed function.

Usage

1
draw_lm_mixed(la, Piv, Pi, Psi, n, TT)

Arguments

la

vector of mass probabilities for the first latent variable

Piv

matrix of initial probabilities of the latent Markov chain (k2 x k1)

Pi

set of transition matrices (k2 x k2 x k1)

Psi

array of conditional response probabitlies (mb x k2 x r)

n

sample size

TT

number of time occasions

Value

Y

matrix of response configurations unit by unit

S

matrix of distinct response configurations

yv

corresponding vector of frequencies

Author(s)

Francesco Bartolucci, Silvia Pandolfi, University of Perugia (IT), http://www.stat.unipg.it/bartolucci

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
## Not run: 
# draw a sample for 1000 units and only one response variable and 5 time occasions
k1 <- 2
k2 <- 3
la <- rep(1/k1,k1)
Piv <- matrix(1/k2,k2,k1)
Pi <- array(0,c(k2,k2,k1))
Pi[,,1] <- diag(k2)
Pi[,,2] <- 1/k2
Psi <- cbind(c(0.6,0.3,0.1),c(0.1,0.3,0.6),c(0.3,0.6,0.1))
out <- draw_lm_mixed(la,Piv,Pi,Psi,n=1000,TT=5)

## End(Not run)

LMest documentation built on Oct. 10, 2021, 1:09 a.m.