Learn R Programming

mapfit (version 0.9.9)

erhmm: ER-HMM (HMM with Erlang outputs)

Description

A function to generate an object of '>erhmm.

Usage

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.

Value

erhmm gives an object of ER-HMM.

Details

ER-HMM has parameters \(\alpha\), \(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.

See Also

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

Examples

Run this code
# NOT RUN {
## 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"))

# }

Run the code above in your browser using DataLab