forecast.ftsm.RdProduces forecasts from a functional time series model using various univariate time series forecasting methods applied to the coefficients.
Forecasts a functional time series model using various univariate time series methods.
# S3 method for class 'ftsm'
forecast(
object,
h = 10,
method = c("ets", "arima", "ar", "ets.na", "rwdrift", "rw", "struct", "arfima",
"ridge2f"),
level = 95,
jumpchoice = c("fit", "actual"),
pimethod = c("parametric", "nonparametric"),
B = 100,
usedata = nrow(object$coeff),
adjust = TRUE,
model = NULL,
damped = NULL,
stationary = FALSE,
FUN = NULL,
FUN_method = c("block-bootstrap", "surrogate", "kde", "bootstrap", "fitdistr"),
FUN_nsim = B,
FUN_block_size = 5,
FUN_seed = 123L,
...
)
# S3 method for class 'ftsm'
forecast(
object,
h = 10,
method = c("ets", "arima", "ar", "ets.na", "rwdrift", "rw", "struct", "arfima",
"ridge2f"),
level = 95,
jumpchoice = c("fit", "actual"),
pimethod = c("parametric", "nonparametric"),
B = 100,
usedata = nrow(object$coeff),
adjust = TRUE,
model = NULL,
damped = NULL,
stationary = FALSE,
FUN = NULL,
FUN_method = c("block-bootstrap", "surrogate", "kde", "bootstrap", "fitdistr"),
FUN_nsim = B,
FUN_block_size = 5,
FUN_seed = 123L,
...
)An object of class ftsm returned by ftsm().
Forecast horizon (number of periods to forecast).
Forecasting method: "ets" (default), "arima", "ar", "ets.na", "rwdrift", "rw", "struct", or "arfima".
Confidence level for prediction intervals (default: 80).
Method for handling the jump-off point: "fit" (default) or "actual".
Method for prediction intervals: "parametric" (default) or "nonparametric".
Number of bootstrap replications for nonparametric prediction intervals (default: 100).
Number of observations to use for fitting (default: all available).
Logical. If TRUE, adjust forecasts for bias (default: TRUE).
ETS model specification (optional).
Logical. If TRUE, use damped trend (optional).
Logical. If TRUE, force stationarity (default: FALSE).
forecasting function (if provided, method is ignored)
Method to be used for conformalization (simulation of calibrated residuals)
when FUN is not NULL.
Number of simulations when FUN is not NULL.
Block size for block-bootstrap when FUN is not NULL.
Seed for reproducibility when FUN is not NULL.
Additional arguments passed to the forecasting method.
An object of class ftsf containing:
Point forecasts as a functional time series object
Lower prediction bounds (parametric method)
Upper prediction bounds (parametric method)
One-step fitted values
One-step forecast errors
Forecasts and prediction intervals for each coefficient
Errors in coefficient estimation
Variance components
The original ftsm object
Bootstrap samples (nonparametric method)
An object of class ftsf containing:
Forecasting method used
Time points
Original functional time series
Fitted values
Residuals
Point forecasts
Lower prediction intervals
Upper prediction intervals
Confidence level
Name of x variable
Name of y variable
This function forecasts a functional time series by applying univariate time series forecasting methods to the coefficients obtained from a functional principal component analysis. The forecasts are then transformed back to functional space.
For the method = "ets" option, the model parameter can be specified as:
A single character string: Applied to all coefficients except the first
A vector of length nb-1: Applied to coefficients 2 through nb
A vector of length nb: Applied to all coefficients
The first coefficient (mean function) always uses "ANN" model unless specified otherwise.
Hyndman, R.J., & Shang, H.L. (2009). Forecasting functional time series. Journal of the Korean Statistical Society, 38(3), 199-221.
if (FALSE) { # \dontrun{
# Fit functional time series model
fmodel <- ftsm(y = fts(data))
# Forecast using ETS method
forecast_ets <- forecast(fmodel, h = 10, method = "ets")
# Forecast using ARIMA method
forecast_arima <- forecast(fmodel, h = 10, method = "arima")
# Forecast with custom function
custom_forecast <- forecast(fmodel, h = 10, FUN = forecast::thetaf)
# Plot forecasts
plot(forecast_ets)
} # }
if (FALSE) { # \dontrun{
# Fit functional time series model
fit <- ftsm(pm_10_GR, order = 3)
# Forecast 12 periods ahead
fc <- forecast(fit, h = 12, method = "ets")
# Plot forecasts
plot(fc)
fit <- ftsm(pm_10_GR, order = 3, mean=FALSE); fc <- forecast(fit, h = 12, method = "ridge2f")
# Forecast 12 periods ahead
# Plot forecasts
plot(fc)
} # }