erhmm: ER-HMM (HMM with Erlang outputs)

Description Usage Arguments Details Value Note See Also Examples

View source: R/model_erhmm.R

Description

A function to generate an object of erhmm.

Usage

1
erhmm(shape, alpha, rate, P, class = "CsparseMatrix")

Arguments

shape

an integer vector of shape parameters of Erlang outputs.

alpha

a vector for initial probabilities of HMM states.

rate

a vector of rate parameters of Erlang outputs.

P

an object of Matrix class for a transition probability matrix of HMM.

class

name of Matrix class for P.

Details

ER-HMM has parameters α, shape, rate and P. HMM state chages according to a discrete-time Markov chain with transition matrix P. At each HMM state, there is an inherent Erlang distriution as an output. This model can be converted to a MAP.

Value

erhmm gives an object of ER-HMM.

Note

erhmm requires shape parameters. Other parameters have default values.

See Also

map, gmmpp, map.mmoment, map.jmoment, map.acf

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
## create an ER-HMM consisting of two Erlang components with
## shape parameters 2 and 3.
erhmm(c(2,3))

## create an ER-HMM consisting of two Erlang components with
## shape parameters 2 and 3.
erhmm(shape=c(2,3))

## create an ER-HMM with specific parameters
(param <- erhmm(shape=c(2,3), alpha=c(0.3,0.7),
                rate=c(1.0,10.0),
                P=rbind(c(0.3, 0.7), c(0.1, 0.9))))

## convert to a general MAP
as(param, "map")

## marginal moments of MAP
map.mmoment(k=3, map=as(param, "map"))

## joint moments of MAP
map.jmoment(lag=1, map=as(param, "map"))

## k-lag correlation
map.acf(map=as(param, "map"))

mapfit documentation built on May 29, 2017, 3:44 p.m.