Learn R Programming

MSGARCH (version 0.17.7)

crps: CRPS (continuous ranked probability score) measure.

Description

Method returning the CRPS at t = T + 1.

Usage

crps(object, yn, ctr = list(lower = -20, upper = 20, n.mesh = 500, a = 0, b = 1))

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.
yn
scalar value at t = T + 1 to be evaluated.
ctr
control list parameters.

Value

a vector with five crps measures

Details

If a matrix of MCMC posterior draws estimates is given, the Bayesian CRPS is calculated.

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))

# run at T + 1 from model       
crps = MSGARCH::crps(object = fit, yn = 0.6)

Run the code above in your browser using DataLab