draw_lm_basic: Draw samples from the basic LM model

Description Usage Arguments Value Author(s) Examples

Description

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

Usage

1
draw_lm_basic(piv, Pi, Psi, n)

Arguments

piv

vector of initial probabilities of the latent Markov chain

Pi

set of transition matrices

Psi

matrix of conditional response probabitlies

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
# draw a sample for 1000 units and only one response variable
piv = c(0.7,0.3)
Pi = matrix(c(0.9,0.1,0.1,0.9),2,2)
Pi = array(Pi,c(2,2,6))
Pi[,,1] = 0
Psi = matrix(c(0.7,0.2,0.1,0.5,0.4,0.1),3,2)
Psi = array(Psi,c(3,2,1))
out = draw_lm_basic(piv, Pi, Psi, n=1000)


Search within the LMest package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.