Directional Accuracy Test

Share:

Description

Implements the Directional Accuracy Test of Pesaran and Timmerman and Excess Profitability Test of Anatolyev and Gerko.

Usage

1
DACTest(forecast, actual, test = c("PT", "AG"), conf.level = 0.95)

Arguments

forecast

A numeric vector of the forecasted values.

actual

A numeric vector of the actual (realized) values.

test

Choice of Pesaran and Timmermann (‘PT’) or Anatolyev and Gerko (‘AG’) tests.

conf.level

The confidence level at which the Null Hypothesis is evaluated.

Details

See the references for details on the tests. The Null is effectively that of independence, and distributed as N(0,1).

Value

A list with the following items:

Test

The type of test performed.

Stat

The test statistic.

p-value

The p-value of the test statistic.

H0

The Null Hypothesis.

Decision

Whether to reject or not the Null given the conf.level.

DirAcc

The directional accuracy of the forecast.

Author(s)

Alexios Ghalanos

References

Anatolyev, S. and Gerko, A. 2005, A trading approach to testing for predictability, Journal of Business and Economic Statistics, 23(4), 455–461.
Pesaran, M.H. and Timmermann, A. 1992, A simple nonparametric test of predictive performance, Journal of Business and Economic Statistics, 10(4), 461–465.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
## Not run: 
data(dji30ret)
spec = ugarchspec(mean.model = list(armaOrder = c(6,1), include.mean = TRUE),
variance.model = list(model = "gjrGARCH"), distribution.model = "nig")
fit = ugarchfit(spec, data = dji30ret[, 1, drop = FALSE], out.sample = 1000)
pred = ugarchforecast(fit, n.ahead = 1, n.roll = 999)
# Get Realized (Oberved) Data
obsx = tail(dji30ret[,1], 1000)
forc = as.numeric(as.data.frame(pred,rollframe="all",align=FALSE,which="series"))
print(DACTest(forc, obsx, test = "PT", conf.level = 0.95))
print(DACTest(forc, obsx, test = "AG", conf.level = 0.95))

## End(Not run)

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.