cs_dispersion {GeomComb} | R Documentation |
Compute Cross-Sectional Dispersion
Description
Computes (time-varying) dispersion measures for the cross section of individual model forecasts that are the input of forecast combination.
Usage
cs_dispersion(x, measure = "SD", plot = FALSE)
Arguments
x |
An object of class |
measure |
Cross-sectional dispersion measure, one of: |
plot |
logical. If |
Details
The available measures of scale are defined as in Davison (2003). Let y_{(i)}
denote the i-th order statistic of the sample, then:
Range_t = y_{(n), t} - y_{(1), t}
IQR_t = y_{(3n/4),t} - y_{(n/4),t}
SD_t = \sqrt{\frac{1}{n-1} \Sigma_{i=1}^n \left(y_{i,t} - \bar{y}_t \right)}
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.
Value
Returns a vector of the evolution of cross-sectional dispersion over the sample period (using the selected dispersion measure)
References
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.
See Also
Examples
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")