Estep {HiddenMarkov}R Documentation

E-Step of EM Algorithm for DTHMM

Description

Performs the expectation step of the EM algorithm for a dthmm process. This function is called by the BaumWelch function. The Baum-Welch algorithm referred to in the HMM literature is a version of the EM algorithm.

Usage

Estep(x, Pi, delta, distn, pm, pn = NULL)

Arguments

x

is a vector of length nn containing the observed process.

Pi

is the current estimate of the m×mm \times m transition probability matrix of the hidden Markov chain.

distn

is a character string with the distribution name, e.g. "norm" or "pois". If the distribution is specified as "wxyz" then a probability (or density) function called "dwxyz" should be available, in the standard R format (e.g. dnorm or dpois).

pm

is a list object containing the current (Markov dependent) parameter estimates associated with the distribution of the observed process (see dthmm).

pn

is a list object containing the observation dependent parameter values associated with the distribution of the observed process (see dthmm).

delta

is the current estimate of the marginal probability distribution of the mm hidden states.

Details

Let uiju_{ij} be one if Ci=jC_i=j and zero otherwise. Further, let vijkv_{ijk} be one if Ci1=jC_{i-1}=j and Ci=kC_i=k, and zero otherwise. Let X(n)X^{(n)} contain the complete observed process. Then, given the current model parameter estimates, the returned value u[i,j] is

u^ij=\mboxE[uijX(n)]=Pr{Ci=jX(n)=x(n)}, \widehat{u}_{ij} = \mbox{E}[u_{ij} \, | \, X^{(n)}] = \Pr\{C_i=j \, | \, X^{(n)} = x^{(n)} \} \,,

and v[i,j,k] is

v^ijk=\mboxE[vijkX(n)]=Pr{Ci1=j,Ci=kX(n)=x(n)}, \widehat{v}_{ijk} = \mbox{E}[v_{ijk} \, | \, X^{(n)}] = \Pr\{C_{i-1}=j, C_i=k \, | \, X^{(n)} = x^{(n)} \}\,,

where j,k=1,,mj,k = 1, \cdots, m and i=1,,ni = 1, \cdots, n.

Value

A list object is returned with the following components.

u

an n×mn \times m matrix containing estimates of the conditional expectations. See “Details”.

v

an n×m×mn \times m \times m array containing estimates of the conditional expectations. See “Details”.

LL

the current value of the log-likelihood.

Author(s)

The algorithm has been taken from Zucchini (2005).

References

Cited references are listed on the HiddenMarkov manual page.

See Also

BaumWelch, Mstep


[Package HiddenMarkov version 1.8-13 Index]