genericforecast: Generic Forecasting Function (Unified interface)

View source: R/genforecast.R

genericforecastR Documentation

Generic Forecasting Function (Unified interface)

Description

This function allows to call any function "of class forecast" in a unified way.

Usage

genericforecast(FUN, y, h, level = 95, ...)

Arguments

FUN

A forecasting function.

y

A time series (ts object or vector).

h

Forecasting horizon.

level

The confidence level.

...

Additional arguments to be passed to the forecasting function.

Value

An object of class forecast.

Examples


y <- fdeaths 
h <- 25L
plot(genericforecast(FUN=forecast::thetaf, y, h))
plot(genericforecast(FUN=ahead::dynrmf, y, h))
plot(genericforecast(FUN=forecast::tbats, y=y, h=h, use.box.cox = TRUE, use.trend=FALSE))


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