tc.test {pEPA}R Documentation

Computes Test for Time Clusters.

Description

This function computes test of the equal predictive accuracy for time clusters. The null hypothesis of this test is that the equal predictive accuracy for the two methods holds within each of the time clusters. The test is suitable if either: K \ge 2 and significance level \le 0.08326, or 2 \le K \leq 14 and significance level \le 0.1, or K = \{ 2,3 \} and significance level \le 0.2, where K denotes the number of time clusters.

Usage

tc.test(evaluated1,evaluated2,realized,loss.type="SE",cl)

Arguments

evaluated1

same as in pool_av.test

evaluated2

same as in pool_av.test

realized

same as in pool_av.test

loss.type

same as in pool_av.test

cl

vector of the beginning indices of each pre-defined blocks of time – as a result always cl[1]=1

Value

class htest object, list of

statistic

test statistic

parameter

K, number of time clusters

alternative

alternative hypothesis of the test

p.value

p-value

method

name of the test

data.name

names of the tested data

References

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

See Also

pool_av.test

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]
  }
# 3 time clusters: Jun 1996 -- Nov 2007, Dec 2007 -- Jun 2009, Jul 2009 - Aug 2021
# rownames(observed)[1] 
# rownames(observed)[139] 
# rownames(observed)[158] 
t.cl <- c(1,139,158)
t <- tc.test(evaluated1=f.bsr,evaluated2=f.dma,realized=y,loss.type="SE",cl=t.cl)

[Package pEPA version 1.0 Index]