Learn R Programming

LMest (version 3.1.2)

est_mc_basic: Estimate basic Markov chain (MC) model

Description

Main function for estimating the basic MC model.

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

Usage

est_mc_basic(S, yv, mod = 0, tol = 10^-8, maxit = 1000, out_se = FALSE)

Value

lk

maximum log-likelihood

piv

estimate of initial probability vector

Pi

estimate of transition probability matrices

np

number of free parameters

aic

value of AIC for model selection

bic

value of BIC for model selection

Fy

estimated marginal distribution of the response variable for each time occasion

sepiv

standard errors for the initial probabilities

sePi

standard errors for the transition probabilities

call

command used to call the function

Arguments

S

matrix (n x TT) of available configurations of the response variable with categories starting from 0

yv

vector of frequencies of the available configurations

mod

model on the transition probabilities (0 for time-heter., 1 for time-homog., from 2 to (TT-1) partial homog. of that order)

tol

tolerance level for convergence

maxit

maximum number of iterations of the algorithm

out_se

to compute the information matrix and standard errors

Author

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

References

Bartolucci, F., Farcomeni, A. and Pennoni, F. (2013) Latent Markov Models for Longitudinal Data, Chapman and Hall/CRC press.

Examples

Run this code
# Example of drug consumption data

# load data
data(data_drug)
data_drug <- as.matrix(data_drug)
S <- data_drug[,1:5]-1
yv <- data_drug[,6]

# fit of the Basic MC model
out <- est_mc_basic(S, yv, mod = 1, out_se = TRUE)
summary(out)

Run the code above in your browser using DataLab