draw_lm_basic: Draw samples from the basic LM model

Description Usage Arguments Value Author(s) Examples

View source: R/draw_lm_basic.R

Description

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

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

Usage

1
draw_lm_basic(piv, Pi, Psi, n)

Arguments

piv

vector of initial probabilities of the latent Markov chain

Pi

set of transition probabilities matrices (k x k x TT)

Psi

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

n

sample size

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
14
15
16
17
## Not run: 
# draw a sample for 1000 units and only one response variable
n <- 1000
TT <- 6
k <- 2
r <- 1 #number of response variables
mb <- 3 #maximum number of response categories

piv <- c(0.7, 0.3)
Pi <- matrix(c(0.9,0.1,0.1,0.9), k, k)
Pi <- array(Pi, c(k, k, TT))
Pi[,,1] <- 0
Psi <- matrix(c(0.7,0.2,0.1,0.5,0.4,0.1), mb, k)
Psi <- array(Psi, c(mb, k, r))
out <- draw_lm_basic(piv, Pi, Psi, n = 1000)

## End(Not run)

Example output

Loading required package: MASS
Loading required package: MultiLCIRT
Loading required package: limSolve
Loading required package: mvtnorm
Loading required package: mmm
Loading required package: gee
Loading required package: mix
------------|
 sample unit|
------------|
       1000 | 
------------|

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