| Title: | Computation of Adaptive Forecast |
| Version: | 0.1.0 |
| Description: | The function forAD() implements the adaptive forecasting procedure of Giraitis, Kapetanios and Price (2013) <doi:10.1016/j.jeconom.2013.04.003>. The method can be iterated (e.g., adapt²) and combined with autoregressive (AR) forecasting. These approaches are computationally simple and adapt automatically to structural changes without requiring prior specification of the underlying data-generating process. They are applicable to both stationary and non-stationary time series. The numerical and graphical outputs assist in selecting an appropriate forecasting method, particularly one that minimises mean squared forecast error (MSFE) and yields uncorrelated forecast errors. |
| License: | GPL-3 |
| Encoding: | UTF-8 |
| Imports: | stats, graphics, lubridate, grDevices, knitr, testcorr, xts, zoo |
| RoxygenNote: | 7.3.3 |
| Suggests: | testthat |
| NeedsCompilation: | no |
| Packaged: | 2026-05-05 10:34:53 UTC; drvio |
| Author: | Violetta Dalla [aut, cre], Liudas Giraitis [aut], George Kapetanios [aut] |
| Maintainer: | Violetta Dalla <vidalla@econ.uoa.gr> |
| Repository: | CRAN |
| Date/Publication: | 2026-05-08 14:40:08 UTC |
Computing adaptive forecast
Description
The functions forAD computes the adaptive one-step ahead forecast of Giraitis, Kapetanios and Price (2013).
Usage
forAD(x, p_max = 3, T0 = 50, n_v = 100, n_AR = 400,
plots = TRUE, P = 50, PL = 500, p = 1, date_1 = NULL)
Arguments
x |
A univariate numeric time series ( |
p_max |
Maximum order of the AR model. Default is |
T0 |
Length of the training period used to select tuning parameter |
n_v |
Length of the period of forecast errors used in calculation of MSFE. Default is |
n_AR |
Length of the period of forecast errors used for estimation of AR and for computing correlograms. Default is |
plots |
Logical. If |
P |
Length of the period used in plots. Default is |
PL |
Length of the longer period used in plots. Default is |
p |
Selected AR order used in plots. Default is |
date_1 |
The date for the one-step ahead forecast when |
Details
The method implements the adaptive (one-stage adapt or two-stage adapt^2) one-step ahead forecasting with weights w_{j,\rho}\propto\rho^j for 0<\rho\leq 1 (normalized to sum up to 1) in the 1st step, combined with AR forecasting in 2nd step.
Value
An object of class 'forAD', which is a list with the following components:
for_1 |
The one-step ahead forecast for all methods (adapt, adapt+AR( |
rho |
The tuning parameter for adaptive methods (adapt, adapt |
ar_coef_se |
The estimated coefficients and their standard errors for the adapt+AR( |
ar_coef_se_sq |
The estimated coefficients and their standard errors for the adapt |
MSFE |
The MSFE for all methods. |
for_in |
The rolling one-step ahead forecasts for all methods. |
rho_in |
The rolling tuning parameters for adaptive methods. |
MSFE_in |
The rolling MSFE for all methods. |
err_in |
The rolling one-step ahead forecast errors for all methods. |
data |
The original data. |
Note
Missing values are not allowed.
Permitted sample size: N\geq25+2p_{max} when p_max > 0 and N\geq21 when p_max = 0.
Author(s)
Violetta Dalla, Liudas Giraitis and George Kapetanios
References
Giraitis L, Kapetanios G, Price S (2013). "Adaptive Forecasting in the Presence of Recent and Ongoing Structural Change." Journal of Econometrics, 177(2), 153-170. doi:10.1016/j.jeconom.2013.04.003.
Giraitis L, Kapetanios G, Mansur M, Price S (2015). "Forecasting Under Structural Change." In J Beran, Y Feng, H Hebbel (eds.), Empirical Economic and Financial Research: Theory, Methods and Practice, pp. 401–419. Springer International Publishing, Cham. doi:10.1007/978-3-319-03122-4_25.
Examples
# Sample x contains 200 independent standard normal data.
x <- rnorm(200)
print(forAD(x, plots = FALSE))
# Set plots to TRUE to see the plots.
print(forAD(x))