Fast_Test_aSPA: Fast Test average Superior Predictive Ability

Description Usage Arguments Value Author(s) References See Also Examples

View source: R/Fast_Test_aSPA.R

Description

Implements the test for average Superior Predictive Ability (aSPA) of Quaedvlieg (2021)

Usage

1
2
3
4
5
6
7
8
Fast_Test_aSPA(
  LossDiff,
  weights = NULL,
  L,
  B = 999,
  num_cores = 1,
  seed = stats::runif(1, 0, .Machine$integer.max)
)

Arguments

LossDiff

the T x H matrix forecast path loss differential

weights

the 1 x H vector of weights for the losses at different horizons. For instance weights <- matlab::ones(1,20)/20

L

integer, the parameter for the moving block bootstrap

B

integer, the number of bootstrap iterations. Default 999

num_cores

integer, the number of cores to be used. Default 1

seed

integer, random seed for replication

Value

A list containing two objects:

"p_value"

the p-value for aSPA

"t_aSPA"

the statistics for aSPA

Author(s)

Luca Barbaglia https://lucabarbaglia.github.io/

References

Quaedvlieg, Rogier. "Multi-horizon forecast comparison." Journal of Business & Economic Statistics 39.1 (2021): 40-53.

See Also

Test_uSPA

Examples

1
2
3
4
5
6
7
8
## Test for aSPA and uSPA
Trow <- 200 
H <- 12
Mmethods <- 5
weights <- rep(1/H,H)
Losses <- matrix(rnorm(Trow*H, mean = 0), nrow = Trow, ncol = H)

Fast_Test_aSPA(LossDiff=Losses, weights=weights, L=3, B=10)

lucabarbaglia/MultiHorizonSPA documentation built on Dec. 12, 2021, 5:43 a.m.