| Title: | Model Confidence Set Procedure |
|---|---|
| Description: | Perform the Model Confidence Set procedure of Hansen et.al (2011). |
| Authors: | Leopoldo Catania [aut, cre] (ORCID: <https://orcid.org/0000-0002-0981-1921>) |
| Maintainer: | Leopoldo Catania <[email protected]> |
| License: | GPL-2 |
| Version: | 0.2.0 |
| Built: | 2026-05-19 07:35:12 UTC |
| Source: | https://github.com/cran/MCS |
Calculate the losses associated with level forecasts
LossLevel(realized, evaluated, which = "SE")LossLevel(realized, evaluated, which = "SE")
realized |
a vector with the realizations of the interest object. |
evaluated |
a vector or a matrix of forecasts |
which |
The loss function to use. possible choices are: |
A matrix with the forecast losses
Leopoldo Catania
Calculate the losses associated with VaR forecasts.
LossVaR( realized, evaluated, which = "asymmetricLoss", type = "normal", delta = 25, tau )LossVaR( realized, evaluated, which = "asymmetricLoss", type = "normal", delta = 25, tau )
realized |
a vector of returns realization |
evaluated |
a vector or a matrix of VaR forecasts |
which |
The chosen VaR loss function. Only |
type |
if |
delta |
if |
tau |
the VaR confidence level |
A matrix with the VaR losses
Leopoldo Catania
Koenker, R., & Bassett, G. (1978). Regression quantiles. Econometrica, 46(1), 33–50.
Gonzalez-Rivera G, Lee TH, Mishra S (2004). Forecasting volatility: A reality check based on option pricing, utility function, value-at-risk, and predictive likelihood. International Journal of Forecasting, 20(4), 629-645. ISSN 0169-2070. doi:http://dx.doi.org/10.1016/j.ijforecast.2003.10.003. URL http://www.sciencedirect.com/science/article/pii/S0169207003001420.
Calculate the losses associated with volatility (standard deviation) forecasts
LossVol(realized, evaluated, which = "SE1")LossVol(realized, evaluated, which = "SE1")
realized |
a vector with some realized volatility measure |
evaluated |
a vector or a matrix of volatility forecasts |
which |
The loss function to use. possible choices are: |
A matrix with the forecast losses
Leopoldo Catania
Koenker, R., & Bassett, G. (1978). Regression quantiles. Econometrica, 46(1), 33-50.
Gonzalez-Rivera G, Lee TH, Mishra S (2004). Forecasting volatility: A reality check based on option pricing, utility function, value-at-risk, and predictive likelihood." International Journal of Forecasting, 20(4), 629-645. ISSN 0169-2070. doi:http://dx.doi.org/10.1016/j.ijforecast.2003.10.003. URL http://www.sciencedirect.com/science/article/pii/S0169207003001420.
Hansen PR, Lunde A (2005). A forecast comparison of volatility models: does anything beat a GARCH(1,1)?" Journal of Applied Econometrics, 20(7), 873-889. ISSN 1099-1255. doi:10.1002/jae.800. URL http://dx.doi.org/10.1002/jae.800.
Bernardi M. and Catania L. (2014) The Model Confidence Set package for R.
Perform the Model Confidence Set procedure of Hansen et.al. (2011)
MCSprocedure( Loss, alpha = 0.15, B = 1000, statistic = "Tmax", k = NULL, min.k = 3, verbose = TRUE, seed = NULL )MCSprocedure( Loss, alpha = 0.15, B = 1000, statistic = "Tmax", k = NULL, min.k = 3, verbose = TRUE, seed = NULL )
Loss |
A matrix or something coercible to that (as.matrix) which contains the loss series per each competing model |
alpha |
a scalar in (0,1) indicating the confidence level of the tests |
B |
an integer indicating the number of bootstrapped samples used to construct the statistic test |
statistic |
Possible choice are : Tmax and TR. See Hansen et.al. (2011) [pag. 465] and Bernardi M. and Catania L. (2014) for more information. |
k |
The number of block bootstrap length. If NULL (default) the block length is determined by the max number of significants parameters resulted after fitting an AR(p) process on all the Loss differences as suggested by Hansen et.al. (2011) |
min.k |
If k=NULL the minimum length of the the blocks, by default equal to 3 |
verbose |
Information abount the MCS procedure should be printed ? |
seed |
Fixed by set.seed(seed). If NULL, one random seed will be selected. |
A SSM object
Leopoldo Catania
Hansen PR, Lunde A, Nason JM (2011). The model confidence set. Econometrica, 79(2), 453-497.
Bernardi M. and Catania L. (2014) The Model Confidence Set package for R.
#set the seed set.seed(123) # DGP is iid standard normal draws iT = 500 vY = rnorm(iT) # Point predicitions from 11 competing modeld # The best model is model6 mM = matrix(rep(seq(-0.5, 0.5, length.out = 11), iT), nrow = iT, byrow = TRUE) # compute squared error loss Loss = apply(mM, 2, LossLevel, realized = vY, which = "SE") # compute the SSM MCS = MCSprocedure(Loss, verbose = TRUE) #print the results MCS#set the seed set.seed(123) # DGP is iid standard normal draws iT = 500 vY = rnorm(iT) # Point predicitions from 11 competing modeld # The best model is model6 mM = matrix(rep(seq(-0.5, 0.5, length.out = 11), iT), nrow = iT, byrow = TRUE) # compute squared error loss Loss = apply(mM, 2, LossLevel, realized = vY, which = "SE") # compute the SSM MCS = MCSprocedure(Loss, verbose = TRUE) #print the results MCS
SSM-methods
## S4 method for signature 'SSM' show(object)## S4 method for signature 'SSM' show(object)
object |
An object of the class SSM |