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)

Arguments

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.

Value

Returns a vector of the evolution of cross-sectional dispersion over the sample period (using the selected dispersion measure)

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.

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")
#> $Dispersion_Measure
#> [1] "IQR"
#> 
#> $CS_Dispersion
#>   [1] 1.3343597 1.0754691 1.6637157 1.0823478 1.0531970 1.2647708 0.7183218
#>   [8] 1.8745487 1.0019946 1.6879826 0.7348044 1.4993914 1.0462952 2.3244630
#>  [15] 0.7188059 0.6942161 1.0750376 1.1122865 1.7438334 1.5508781 1.1754916
#>  [22] 0.5846702 0.4025949 0.7333911 1.3155745 0.9693909 1.1132609 0.9364909
#>  [29] 1.4213014 1.0874781 0.9801703 0.8429715 1.1009143 1.4249893 0.9039189
#>  [36] 0.9986553 1.4828157 1.8514895 1.0533189 1.1164494 0.7372126 1.5766089
#>  [43] 1.1861353 1.2904017 1.6915409 0.8450235 0.8690732 1.1572492 0.8288789
#>  [50] 0.7494116 0.6254915 1.1352976 0.5364267 1.2011038 1.3698492 1.0508518
#>  [57] 0.5514935 1.4804572 1.0872862 1.1737736 1.3705590 1.5875791 1.5773565
#>  [64] 1.3526212 0.4877584 0.6645017 1.2238244 1.4517505 1.1984695 1.3467099
#>  [71] 1.1262991 1.0334017 1.3372927 0.7148267 1.4654625 0.5757317 0.9676559
#>  [78] 1.1931056 1.3430763 0.6661047 1.7108211 0.6128552 0.4012661 1.3734927
#>  [85] 1.7379329 0.9580122 1.1565937 1.2883275 1.2607283 0.9838529 1.2188554
#>  [92] 1.0890757 1.2988961 1.4762676 1.8382442 1.0138241 0.8848985 0.8783593
#>  [99] 0.8220779 0.8626036
#>