FcSeasonalArima: Forecasting with Seasonal Arima

View source: R/FcSeasonalArima.R

FcSeasonalArimaR Documentation

Forecasting with Seasonal Arima

Description

Automatic Forecasting using the seasonal arima method based on the X-13-ARIMA-SEATS standard.

Usage

FcSeasonalArima(DataVec, SplitAt, ForecastHorizon, Frequency, Time, PlotIt = TRUE, ...)

Arguments

DataVec

[1:n] [1:n] numerical vector or a time series object. If a time series object is given, the argument "Frequency" does not need to be given.

SplitAt

Index of row where the DataVec is divided into test and train data. If not given n is used

ForecastHorizon

Scalar defining the timesteps to forecast ahead. Beware, it is NOT the internal forecast horizont.

Frequency

Either days, weeks, months or quarters or years, see ConvertNumerical2TSobject. Can be ignored if DataVec is a time series object.

Time

[1:n] character vector of Time in the length of data. Can be ignored if DataVec is a time series object.

PlotIt

FALSE (default), do nothing. TRUE: plots the forecast versus test data of time series data.

...

Further specification using the seas interface of the X-13-ARIMA-SEATS standard. Please see also references for further details

Details

X-13-ARIMA-SEATS is the standard of the seasonal adjustment software by the US Census Bureau. This function is an easy-to-use wrapper of the function seas calling the interface.

If n-SplitAt=ForecastHorizon then forecast is completely on test data.

If ForecastHorizon>n-SplitAt then a real forecast is made of ForecastHorizon-(n-SplitAt) steps.

If SplitAt=n then the complete data set is used in estimating the forecast.

Value

List with

Forecast

[1:Horizont] object of ts

Accuracy

Accuracy of TestSet against Forecast, if TestandTrain==TRUE

TaT

TrainingSet and TestSet, if TestandTrain==TRUE

Model

Output of seas

ForecastMaxlead

Output of series, which is an extended forecast if upper and lower boundary.

Note

The default internal forecast horizont is one year (unless a SEATS seasonal adjustment is requested - then the default is three years of forecasts) and 120 is the maximum. Setting Horizont lower results in 3 year forecast saved in ForecastMaxlead.

Author(s)

Michael Thrun

References

https://www.census.gov/ts/x13as/docX13AS.pdf

https://github.com/christophsax/seasonal/wiki/Examples-of-X-13ARIMA-SEATS-in-R#77-forecast

See Also

seas, series

Examples

# Example using a time series object for DataVec
data("AirPassengers")
ForecastHorizon=12
FcSeasonalArima(AirPassengers,SplitAt=length(AirPassengers)-ForecastHorizon,
                ForecastHorizon=ForecastHorizon)

# Example using a numerical vector for DataVec
data("ElectricityBRD$Mrd_KWh")
ForecastHorizon=12
FcSeasonalArima(ElectricityBRD$Mrd_KWh,SplitAt = length(ElectricityBRD$Mrd_KWh) - ForecastHorizon, 
                Frequency='months', ForecastHorizon = ForecastHorizon, 
                Time=ElectricityBRD$Time)


Mthrun/TSAT documentation built on Feb. 5, 2024, 11:15 p.m.