Compute Cross-Sectional Dispersion
Computes (time-varying) dispersion measures for the cross section of individual model forecasts that are the input of forecast combination.
cs_dispersion(x, measure = "SD", plot = FALSE)
x
: An object of class foreccomb
. Contains training set (actual values + matrix of model forecasts) and optionally a test set.measure
: Cross-sectional dispersion measure, one of: "SD"
= standard deviation (default); "IQR"
= interquartile range; or "Range"
= range.plot
: logical. If TRUE
, evolution of cross-sectional forecast dispersion is plotted as ggplot
.Returns a vector of the evolution of cross-sectional dispersion over the sample period (using the selected dispersion measure)
The available measures of scale are defined as in Davison (2003). Let denote the i-th order statistic of the sample, then:
Previous research in the forecast combination literature has documented that regression-based combination methods tend to have relative advantage when one or more individual model forecasts are better than the rest, while eigenvector-based methods tend to have relative advantage when individual model forecasts are in the same ball park.
obs <- rnorm(100) preds <- matrix(rnorm(1000, 1), 100, 10) train_o<-obs[1:80] train_p<-preds[1:80,] test_o<-obs[81:100] test_p<-preds[81:100,] data<-foreccomb(train_o, train_p, test_o, test_p) cs_dispersion(data, measure = "IQR")
Davison, A. C. (2003). Statistical Models. Cambridge University Press.
Hsiao, C., and Wan, S. K. (2014). Is There An Optimal Forecast Combination? Journal of Econometrics, 178(2) , 294--309.
foreccomb
, sd
, IQR
, range