EstHMM1d: Estimation of a univariate Gaussian Hidden Markov Model (HMM)
Description
This function estimates parameters (mu, sigma, Q) of a univariate Hidden Markov Model.
It computes also the probability of being in each regime, given the past observations (eta)
and the whole series (lambda). The conditional distribution given past observations is applied to
obtains pseudo-observations W that should be uniformly distributed under the null hypothesis.
A Cramér-von Mises test statistic is then computed.
Usage
EstHMM1d(y, reg, max_iter = 10000, eps = 1e-04)
Value
mu
estimated mean for each regime
sigma
stimated standard deviation for each regime
Q
(reg x reg) estimated transition matrix
eta
(n x reg) probabilities of being in regime k at time t given observations up to time t
lambda
(n x reg) probabilities of being in regime k at time t given all observations
cvm
Cramér-von Mises statistic for the goodness-of-fit test
U
Pseudo-observations that should be uniformly distributed under the null hypothesis of a Gaussian HMM
LL
Log-likelihood
Arguments
y
(nx1) vector of data
reg
number of regimes
max_iter
maximum number of iterations of the EM algorithm; suggestion 10 000
eps
precision (stopping criteria); suggestion 0.0001.
Author
Bouchra R Nasri and Bruno N Rémillard, January 31, 2019
References
Chapter 10.2 of B. Rémillard (2013). Statistical Methods for Financial Engineering,
Chapman and Hall/CRC Financial Mathematics Series, Taylor & Francis.