State {MSGARCH}R Documentation

State probabilities.

Description

Method returning the filtered, predictive, and smoothed probabilities of the states, and the most probable path computed with the Viterbi algorithm.

Usage

State(object, ...)

## S3 method for class 'MSGARCH_SPEC'
State(object, par, data, ...)

## S3 method for class 'MSGARCH_ML_FIT'
State(object, newdata = NULL, ...)

## S3 method for class 'MSGARCH_MCMC_FIT'
State(object, newdata = NULL, ...)

Arguments

object

Model specification of class MSGARCH_SPEC created with CreateSpec or fit object of type MSGARCH_ML_FIT created with FitML or MSGARCH_MCMC_FIT created with FitMCMC.

...

Not used. Other arguments to State.

par

Vector (of size d) or matrix (of size nmcmc x d) of parameter estimates where d must have the same length as the default parameters of the specification.

data

Vector (of size T) of observations.

newdata

Vector (of size T*) of new observations. (Default newdata = NULL)

Details

If a matrix of parameter estimates is given, each parameter estimate (each row) is evaluated individually.

Value

A list of class MSGARCH_PSTATE with the following elements:

The class MSGARCH_PSTATE contains the plot method. The plot method contains as input type.prob which is one of "filtered", "predictive", "smoothed", "viterbi". (Default: type.prob = "smoothed")

Examples

# create specification
spec <- CreateSpec()

# load data
data("SMI", package = "MSGARCH")

# state from specification
par <- c(0.1, 0.1, 0.8, 0.2, 0.1, 0.8, 0.99, 0.01)
state <- State(object = spec, par = par, data = SMI)
plot(state, type.prob = "filtered")

# state from ML fit
fit <- FitML(spec = spec, data = SMI)
state <- State(object = fit)
plot(state, type.prob = "smoothed")

## Not run: 
# state from MCMC fit
set.seed(1234)
fit <- FitMCMC(spec = spec, data = SMI)
state <- State(object = fit)
plot(state, type.prob = "smoothed")

## End(Not run)

[Package MSGARCH version 2.51 Index]