EstRegime | R Documentation |
This function computes and plots the most likely regime for univariate Gaussian HMM using probabilities of being in regime k at time t given all observations (lambda) and probabilities of being in regime k at time t given observations up to time t (eta).
EstRegime(t, y, lambda, eta)
t |
(nx1) vector of dates (years, ...); if no dates then t=[1:length(y)] |
y |
(nx1) vector of data; |
lambda |
(nxreg) probabilities of being in regime k at time t given all observations; |
eta |
(nxreg) probabilities of being in regime k at time t given observations up to time t; |
A |
Estimated Regime using lambda |
B |
Estimated Regime using eta |
runsA |
Estimated number of runs using lambda |
runsB |
Estimated number of runs using eta |
pA |
Graph for the estimated regime for each observation using lambda |
pB |
Graph for the estimated regime for each observation using eta |
Bouchra R Nasri and Bruno N RĂ©millard, January 31, 2019
Chapter 10.2 of B. RĂ©millard (2013). Statistical Methods for Financial Engineering, Chapman and Hall/CRC Financial Mathematics Series, Taylor & Francis.
Q <- matrix(c(0.8, 0.3, 0.2, 0.7),2,2); mu <- c(-0.3 ,0.7) ; sigma <- c(0.15,0.05);
data <- Sim.HMM.Gaussian.1d(mu,sigma,Q,eta0=1,100)$x
t=c(1:100);
est <- EstHMM1d(data, 2)
EstRegime(t,data,est$lambda, est$eta)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.