pool_av.test {pEPA}R Documentation

Computes Test for the Pooled Average.

Description

This function computes test of the equal predictive accuracy for the pooled average. The null hypothesis of this test is that the pooled average loss is equal in expectation for a pair of forecasts from both considered methods. The alternative hypothesis can be formulated as the differences do not average out across the cross-sectional and time-series dimensions.

Usage

pool_av.test(evaluated1,evaluated2,realized,loss.type="SE",J=NULL)

Arguments

evaluated1

matrix of forecasts from the first method, cross-sections are ordered by rows, and time by columns

evaluated2

matrix of forecasts from the second method, cross-sections are ordered by rows, and time by columns

realized

matrix of the observed values, cross-sections are ordered by rows, and time by columns

loss.type

a method to compute the loss function, loss.type="SE" applies squared errors, loss.type="AE" – absolute errors, loss.type="SPE" – squared proportional error (useful if errors are heteroskedastic), loss.type="ASE" – absolute scaled error, if loss.type is specified as some numeric, then the function of type exp(loss.type*errors)-1-loss.type*errors is applied (useful when it is more costly to underpredict realized than to overpredict), if not specified loss.type="SE" is used

J

numeric maximum lag length, if not specified J=round(T^(1/3)) is used, where T=ncol(realized)

Value

class htest object, list of

statistic

test statistic

parameter

J, maximum lag length

alternative

alternative hypothesis of the test

p.value

p-value

method

name of the test

data.name

names of the tested data

References

Hyndman, R.J., Koehler, A.B. 2006. Another look at measures of forecast accuracy. International Journal of Forecasting 22, 679–688.

Qu, R., Timmermann, A., Zhu, Y. 2024. Comparing forecasting performance with panel data. International Journal of Forecasting 40, 918–941.

Taylor, S. J., 2005. Asset Price Dynamics, Volatility, and Prediction, Princeton University Press.

Triacca, U., 2024. Comparing Predictive Accuracy of Two Forecasts, https://www.lem.sssup.it/phd/documents/Lesson19.pdf.

Examples

data(forecasts)
y <- t(observed)
f.bsr <- matrix(NA,ncol=ncol(y),nrow=56)
f.dma <- f.bsr
# extract prices predicted by BSR rec and DMA methods
for (i in 1:56)
  {
    f.bsr[i,] <- predicted[[i]][,1]
    f.dma[i,] <- predicted[[i]][,9]
  }
t <- pool_av.test(evaluated1=f.bsr,evaluated2=f.dma,realized=y,loss.type="SE")

[Package pEPA version 1.0 Index]