fitforecast: Fit and forecast for benchmarking purposes

View source: R/fitforecast.R

fitforecastR Documentation

Fit and forecast for benchmarking purposes

Description

Fit and forecast for benchmarking purposes

Usage

fitforecast(
  y,
  h = NULL,
  pct_train = 0.9,
  pct_calibration = 0.5,
  method = c("thetaf", "arima", "ets", "te", "tbats", "tslm", "dynrmf", "ridge2f",
    "naive", "snaive"),
  level = 95,
  B = 1000L,
  seed = 17223L,
  graph = TRUE,
  conformalize = FALSE,
  type_calibration = c("splitconformal", "cv1", "loocv"),
  gap = 3L,
  agg = c("mean", "median"),
  vol = c("constant", "garch"),
  type_sim = c("kde", "surrogate", "bootstrap"),
  ...
)

Arguments

y

A univariate time series of class ts

h

Forecasting horizon (default is NULL, in that case, pct_train and pct_calibration are used)

pct_train

Percentage of data in the training set, when h is NULL

pct_calibration

Percentage of data in the calibration set for conformal prediction

method

For now "thetaf" (default), "arima", "ets", "tbats", "tslm", "dynrmf" (from ahead), "ridge2f" (from ahead), "naive", "snaive"

level

Confidence level for prediction intervals in %, default is 95

B

Number of bootstrap replications or number of simulations (yes, 'B' is unfortunate)

seed

Reproducibility seed

graph

Plot or not?

conformalize

Calibrate or not?

type_calibration

"splitconformal" (default conformal method), "cv1" (do not use), "loocv" (do not use)

gap

length of training set for loocv conformal (do not use)

agg

"mean" or "median" (aggregation method) for

vol

"constant" or "garch" (type of volatility modeling for calibrated residuals)

type_sim

"kde", "surrogate", "bootstrap" (type of simulation for calibrated residuals)

...

additional parameters

Value

an object of class 'forecast' with additional information

Examples


par(mfrow=c(2, 2))
obj1 <- ahead::fitforecast(AirPassengers)
obj2 <- ahead::fitforecast(AirPassengers, conformalize = TRUE)
plot(AirPassengers)
plot(obj1)
obj2$plot()
obj2$plot("simulations")


Techtonique/ahead documentation built on Nov. 24, 2024, 10:33 a.m.