BacktestDensity {GAS} | R Documentation |
Backtest a series of one-step ahead density predictions.
Description
The BacktestDensity()
function accepts an object of the class uGASRoll, and returns a list
with
two elements: (i) the averages Negative Log Score (NLS) and weighted Continuous Ranked Probability Score (wCRPS)
introduced by Gneiting and Ranjan (2012), and (ii) their values at each point in time. The wCRPS is
evaluated using 5 weight functions, see Details.
Usage
BacktestDensity(Roll, lower, upper, K = 1000, a = NULL, b = NULL)
Arguments
Roll |
an object of the class uGASRoll. |
lower |
|
upper |
|
K |
|
a |
|
b |
|
Details
The average Negative Log Score (NLS) is computed as the negative of the average of the log scores evaluated
during the out-of-sample period. The average weighted Continuous Ranked Probability Score (wCRPS) is computed as
the average of the wCRPS evaluated during the out-of-sample period, see Gneiting and Ranjan (2012).
The wCRPS is evaluated using Equation 16 of Gneiting and Ranjan (2012). The weights functions implemented are:
-
: Uniform,
-
: Center,
-
: Tails,
-
: Right tail,
-
: Left tail,
where and
are the pdf and cdf of a Gaussian distribution with mean
and standard deviation
, respectively. The label "Uniform" represents the case where equal
emphasis is given to all the parts of the distribution.
Value
A list
with elements: average
, series
. The element "average
" is a named vector
with the averages NLS and wCRSP. The element "series
" is a list
: the fist element, LS
, contains
the out-of-sample Log Score (not with the negative sign), the second element, WCRPS
, contains a matrix
with the wCRPS series. The columns of this matrix are named: "uniform
", "center
", "tails
",
"tail_r
", "tail_l
", which are associated with the wCRSP with emphasis on: Uniform, Center, Tails,
Right tail and Left tail, respectively.
Author(s)
Leopoldo Catania
References
Gneiting T, Ranjan R (2011). "Comparing Density Forecasts using Threshold -and Quantile-Weighted Scoring Rules." Journal of Business & Economic Statistics, 29(3), 411-422. doi: 10.1198/jbes.2010.08110.
Examples
## Not run:
data("cpichg")
GASSpec = UniGASSpec(Dist = "std", ScalingType = "Identity",
GASPar = list(location = TRUE, scale = TRUE,
shape = FALSE))
Roll = UniGASRoll(cpichg, GASSpec, ForecastLength = 50,
RefitEvery = 10, RefitWindow = c("moving"))
BackTest = BacktestDensity(Roll, lower = -100, upper = 100)
BackTest$average
## End(Not run)