fp.forecast | R Documentation |
This function merely wraps some excellent functions from the forecast package up and returns the forecast values and their lower and upper prediction intervals.
fp.forecast(x, h = 1, conf.level = 95)
x |
The time series you wish to forecast. |
h |
The number of steps ahead (forecast horizon) |
conf.level |
The confidence level for the forecast prediction interval expressed as a value between 0 and 100. |
This function entirely relies on existing functions from
the forecast package. It applies auto.arima
to x
to fit an ARIMA model to the series with an automatic choice
of parameters. Then the forecast
function is applied
to the ARIMA object to obtain forecasts and prediction intervals.
A matrix with h
rows and three columns. The first column
contains the forecasted values. The second and third columns
contrain the lower and upper prediction intervals.
G.P. Nason
Killick, R., Knight, M.I., Nason, G.P., Nunes M.A., Eckley I.A. (2023) Automatic Locally Stationary Time Series Forecasting with application to predicting U.K. Gross Value Added Time Series under sudden shocks caused by the COVID pandemic arXiv:2303.07772
Hyndman, R.J. and Khandakar, Y. (2008) Automatic Time Series Forecasting: The forecast package for R. Journal of Statistical Software, 27, Issue 3.
#
# Generate random test series
#
x.test <- tvar2sim()
#
# Produce stationary Box-Jenkins forecasts and prediction intervals for
# two-steps ahead
#
fp.forecast(x.test, h=2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.