Learn R Programming

MSGARCH (version 0.17.7)

Pstate: Filtered state probabilities.

Description

Method returning the filtered probabilities of the states.

Usage

Pstate(object, theta, y)

Arguments

object
Model specification of class MSGARCH_SPEC created with create.spec or fit object of type MSGARCH_MLE_FIT created with fit.mle or MSGARCH_BAY_FIT created with fit.bayes.
theta
Vector (of size d) or matrix (of size M x d) of parameter estimates (not require when using a fit object).
y
Vector (of size T) of observations (not require when using a fit object).

Value

Filtered state probabilities of class MSGARCH_PSTATE (array of size (T + 1) x M x K). The class MSGARCH_PSTATE contains the plot method.

Details

If a matrix of parameter estimates is given, each parameter estimates is evaluated individually.

Examples

Run this code
# load data
data("sp500")
sp500 = sp500[1:1000]

# create model specification
spec = MSGARCH::create.spec() 

# fit the model on the data with ML estimation using DEoptim intialization
set.seed(123)
fit = MSGARCH::fit.mle(spec = spec, y = sp500, ctr = list(do.init = FALSE))
 
# compute the filtered state probabilities
Pstate  = MSGARCH::Pstate(object = fit)

plot(Pstate)

Run the code above in your browser using DataLab