Type: Package
Title: Model Confidence Set Procedure
Version: 0.2.0
Date: 2026-03-19
Maintainer: Leopoldo Catania <leopoldo.catania@econ.au.dk>
Depends: R(≥ 3.0.1)
Description: Perform the Model Confidence Set procedure of Hansen et.al (2011).
License: GPL-2
Encoding: UTF-8
Imports: methods
RoxygenNote: 7.3.3
NeedsCompilation: no
Packaged: 2026-03-19 13:54:04 UTC; au588008
Author: Leopoldo Catania [aut, cre] (ORCID: <https://orcid.org/0000-0002-0981-1921>)
Repository: CRAN
Date/Publication: 2026-03-19 15:40:12 UTC

Loss Function for level forecasts

Description

Calculate the losses associated with level forecasts

Usage

LossLevel(realized, evaluated, which = "SE")

Arguments

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: 'SE' that coincides with Square Error and AE that coincides with Absolute Error

Value

A matrix with the forecast losses

Author(s)

Leopoldo Catania


Loss Function for VaR forecasts

Description

Calculate the losses associated with VaR forecasts.

Usage

LossVaR(
  realized,
  evaluated,
  which = "asymmetricLoss",
  type = "normal",
  delta = 25,
  tau
)

Arguments

realized

a vector of returns realization

evaluated

a vector or a matrix of VaR forecasts

which

The chosen VaR loss function. Only which = "asymmetricLoss" is available.

type

if which = "asymmetricLoss" the type of the asymmetric loss function of Gonzalez-Riviera et.al. (2004). Possible choices are type = 'normal' which reports the quantile loss function used for example in Koenker and Bassett (1978) and type = "differentiable" for the differentiable version of Gonzalez-Riviera et.al. (2004).

delta

if type = 'differentiable' the delta parameter controls the smoothness of the function.

tau

the VaR confidence level

Value

A matrix with the VaR losses

Author(s)

Leopoldo Catania

References

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.


Loss Function for volatility forecasts

Description

Calculate the losses associated with volatility (standard deviation) forecasts

Usage

LossVol(realized, evaluated, which = "SE1")

Arguments

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: 'SE1','SE2','QLIKE','R2LOG','AE1','AE2', for further information see Bernardi and Catania (2014) or Hansen and Lunde (2005).

Value

A matrix with the forecast losses

Author(s)

Leopoldo Catania

References

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.


MCSprocedure

Description

Perform the Model Confidence Set procedure of Hansen et.al. (2011)

Usage

MCSprocedure(
  Loss,
  alpha = 0.15,
  B = 1000,
  statistic = "Tmax",
  k = NULL,
  min.k = 3,
  verbose = TRUE,
  seed = NULL
)

Arguments

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.

Value

A SSM object

Author(s)

Leopoldo Catania

References

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.

Examples

#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-class

Description

Class for SSM object


SSM-methods

Description

SSM-methods

Usage

## S4 method for signature 'SSM'
show(object)

Arguments

object

An object of the class SSM