Skip to contents

Temporal Gaussian probabilistic reconciliation

Usage

tegauss(
  base,
  agg_order,
  comb = "ols",
  comb_base = comb,
  res = NULL,
  tew = "sum",
  approach = "proj",
  reduce_form = FALSE,
  ...
)

Arguments

base

A (\(N(k^\ast + m) \times 1\)) numeric vector containing the base forecasts to be reconciled, ordered from lowest to highest frequency; \(m\) is the maximum aggregation order, \(k^\ast\) is the sum of a chosen subset of the \(p - 1\) factors of \(m\) (excluding \(m\) itself) and \(h\) is the forecast horizon for the lowest frequency time series.

agg_order

Highest available sampling frequency per seasonal cycle (max. order of temporal aggregation, \(m\)), or a vector representing a subset of \(p\) factors of \(m\).

comb

A string specifying the reconciliation method. For a complete list, see tecov.

comb_base

A string specifying the reconciliation method. For a complete list, see tecov.

res

A (\(N(k^\ast+m) \times 1\)) optional numeric vector containing the residuals ordered from the lowest frequency to the highest frequency. This vector is used to compute come covariance matrices.

tew

A string specifying the type of temporal aggregation. Options include: "sum" (simple summation, default), "avg" (average), "first" (first value of the period), and "last" (last value of the period).

approach

A string specifying the approach used to compute the reconciled forecasts. Options include:

  • "proj" (default): Projection approach according to Byron (1978, 1979).

  • "strc": Structural approach as proposed by Hyndman et al. (2011).

  • "proj_osqp": Numerical solution using osqp for projection approach.

  • "strc_osqp": Numerical solution using osqp for structural approach.

reduce_form

A logical parameter indicating whether the function should return the full distribution (FALSE, default) or only the distribution corresponding to the high-frequency time series (TRUE).

...

Arguments passed on to tecov

mse

If TRUE (default) the residuals used to compute the covariance matrix are not mean-corrected.

shrink_fun

Shrinkage function of the covariance matrix, shrink_estim (default)

References

Byron, R.P. (1978), The estimation of large social account matrices, Journal of the Royal Statistical Society, Series A, 141, 3, 359-367. doi:10.2307/2344807

Byron, R.P. (1979), Corrigenda: The estimation of large social account matrices, Journal of the Royal Statistical Society, Series A, 142(3), 405. doi:10.2307/2982515

Girolimetto, D., Athanasopoulos, G., Di Fonzo, T. and Hyndman, R.J. (2024), Cross-temporal probabilistic forecast reconciliation: Methodological and practical issues. International Journal of Forecasting, 40, 3, 1134-1151. doi:10.1016/j.ijforecast.2023.10.003

Hyndman, R.J., Ahmed, R.A., Athanasopoulos, G. and Shang, H.L. (2011), Optimal combination forecasts for hierarchical time series, Computational Statistics & Data Analysis, 55, 9, 2579-2589. doi:10.1016/j.csda.2011.03.006

Panagiotelis, A., Gamakumara, P., Athanasopoulos, G. and Hyndman, R.J. (2023), Probabilistic forecast reconciliation: Properties, evaluation and score optimisation, European Journal of Operational Research 306(2), 693–706. doi:10.1016/j.ejor.2022.07.040

See also

Probabilistic reconciliation: csgauss(), cssample(), ctgauss(), ctsample(), tesample()

Temporal framework: teboot(), tebu(), tecov(), telcc(), temo(), terec(), tesample(), tetd(), tetools()

Examples

set.seed(123)
# (7 x 1) base forecasts vector (simulated), m = 4
base <- rnorm(7*2, rep(c(20, 10, 5), 2*c(1, 2, 4)))
# (70 x 1) in-sample residuals vector (simulated)
res <- rnorm(70)

m <- 4 # from quarterly to annual temporal aggregation
reco_dist <- terec(base = base, agg_order = m, comb = "wlsv", res = res)