Learn R Programming

GenHMM1d (version 0.2.1)

ForecastHMMCdf: Forecasted cumulative distribution function of a univariate HMM at times n+k1, n+k2,....

Description

This function computes the forecasted cumulative distribution function of a univariate HMM for multiple horizons, given observations up to time n

Usage

ForecastHMMCdf(
  x,
  ZI = 0,
  family,
  theta,
  Q,
  eta,
  size = 0,
  k = 1,
  graph = FALSE
)

Value

cdf

values of the cdf function

Arguments

x

points at which the cdf function is computed

ZI

1 if zero-inflated, 0 otherwise (default)

family

distribution name; run the function distributions() for help

theta

parameters; (r x p)

Q

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

eta

vector of the estimated probability of each regime at time n; (1 x r)

size

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

k

prediction times

graph

TRUE to produce plots (FALSE by default).

Examples

Run this code
family = "gaussian"
theta = matrix(c(-1.5, 1.7, 1, 1),2,2)
Q = matrix(c(0.8, 0.3, 0.2, 0.7), 2, 2)
eta = c(0.96, 0.04)
x=seq(from=-6, to=6, by=0.1)
k=c(1,5,10,20)
cdf = ForecastHMMCdf(x, 0, family, theta, Q, eta, size=0, k, graph=TRUE)


Run the code above in your browser using DataLab