Learn R Programming

GenHMM1d (version 0.2.1)

EstHMMGen: Estimation of univariate hidden Markov model

Description

This function estimates the parameters from a univariate hidden Markov model

Usage

EstHMMGen(
  y,
  ZI = 0,
  reg,
  family,
  start = 0,
  max_iter = 10000,
  eps = 1e-04,
  size = 0,
  theta0 = NULL,
  graph = FALSE
)

Value

theta

estimated parameters; (r x p)

Q

estimated transition matrix for the regimes; (r x r)

eta

conditional probabilities of being in regime k at time t given observations up to time t; (n x r)

lambda

conditional probabilities of being in regime k at time t given all observations; (n x r)

U

matrix of Rosenblatt transforms; (n x r)

cvm

cramer-von-Mises statistic for goodness-of-fit

W

pseudo-observations that should be uniformly distributed under the null hypothesis

LL

log-likelihood

nu

stationary distribution

AIC

Akaike information criterion

BIC

Bayesian information criterion

CAIC

consistent Akaike information criterion

AICcorrected

Akaike information criterion corrected

HQC

Hannan-Quinn information criterion

stats

empirical means and standard deviation of each regimes using lambda

pred_l

estimated regime using lambda

pred_e

estimated regime using eta

runs_l

estimated number of runs using lambda

runs_e

estimated number of runs using eta

Arguments

y

observations; (n x 1)

ZI

1 if zero-inflated, 0 otherwise (default)

reg

number of regimes (including zero-inflated; must be > ZI)

family

distribution name; run the function distributions() for help

start

starting parameters for the estimation; (1 x p)

max_iter

maximum number of iterations of the EM algorithm; suggestion 10000

eps

precision (stopping criteria); suggestion 0.001.

size

additional parameter for some discrete distributions; run the command distributions() for help

theta0

initial parameters for each regimes; (r x p), default is NULL

graph

TRUE a graph, FALSE otherwise (default); only for continuous distributions

Details

#############################################################################

Examples

Run this code
family = "gaussian"
Q = matrix(c(0.8, 0.3, 0.2, 0.7), 2, 2) ;
theta = matrix(c(-1.5, 1.7, 1, 1),2,2) ;
y = SimHMMGen(theta, Q=Q, family=family,  n=100)$SimData
est = EstHMMGen(y, reg=2, family=family)






Run the code above in your browser using DataLab