Skip to contents

For each horizon h the series is aggregated into non-overlapping h-period sums and a Kolmogorov-type sup distance compares their empirical distribution with the model's distribution at that horizon – the \(V_{1T}\)-type comparison of Corradi & Swanson (2006). A model can fit the one-period distribution and still fail at 20 periods; checking several horizons is what detects that.

Usage

morie_multi_horizon_ks(
  r,
  horizons = c(1L, 5L, 20L),
  cdf = NULL,
  n_mc = 500L,
  seed = 0L
)

Arguments

r

Numeric return series.

horizons

Positive integer aggregation horizons.

cdf

Optional function cdf(x, h) giving the model CDF of an h-period aggregate.

n_mc

Monte Carlo replicates for the fitted-parameter null.

seed

Seed for the Monte Carlo.

Value

Named list with statistic, p_value, per_horizon (data.frame: h, n_h, statistic, p_value), n, method.

Details

With cdf supplied the null is fully specified and classical Kolmogorov p-values apply per horizon; with cdf = NULL a Gaussian is fitted per horizon and the null is simulated (the Lilliefors construction). The joint p-value is Bonferroni.

Mirrors morie.fn.volcorpst.

References

Corradi, V. & Swanson, N. R. (2006). Predictive density and conditional confidence interval accuracy tests. Journal of Econometrics, 135(1-2), 187-228. Lilliefors, H. W. (1967). On the Kolmogorov-Smirnov test for normality with mean and variance unknown. JASA, 62(318), 399-402.

Examples

set.seed(1)
morie_multi_horizon_ks(rnorm(400), horizons = c(1, 5), n_mc = 100)$p_value
#> [1] 0.5742574