estimateHMM: estimateHMM

Description Usage Arguments Details Value Examples

View source: R/estimateHMM.R

Description

estimateHMM performs EM Algorithm on multiple trajectures of observed chain X

Usage

1
estimateHMM(X, M, constr = matrix(1, M, M), tol = 0.001)

Arguments

X

a vector of observed states

M

the number of states of Markov chain

constr

a constrain matrix for transition probability:

  • constr[i,j]=0 indicates p(i->j)=0.

  • constr[i,j]=1 indicates p(i->j)>0

tol=0.001

error tolerance.

Details

Assumes hidden Markov model, the emmision probability follows normal distribution. Detail model parameters are given by the function generateHMM. Estimation would terminate in a given error tolerance.

Value

A list containing:

Print the class: EstConverge

Examples

1
2
3
4
5
6
set.seed(1221)
df <- generateHMM(num=6,n=100)
estimateHMM(df$X, M=3, constr=matrix(1,3,3), tol=0.001)
constr2 <- matrix(1,3,3)
constr2[1,1] <- 0; constr2[3,3] <- 0;
estimateHMM(df$X, M=3, constr=constr2, tol=0.001)

jiangrongo/HMM documentation built on May 19, 2019, 9:38 p.m.