forecast v8.12

0

Monthly downloads

0th

Percentile

Forecasting Functions for Time Series and Linear Models

Methods and tools for displaying and analysing univariate time series forecasts including exponential smoothing via state space models and automatic ARIMA modelling.

Readme

forecast

R build status CRAN_Status_Badge cran checks Lifecycle: retired Downloads Licence

The R package forecast provides methods and tools for displaying and analysing univariate time series forecasts including exponential smoothing via state space models and automatic ARIMA modelling.

This package is now retired in favour of the fable package. The forecast package will remain in its current state, and maintained with bug fixes only. For the latest features and development, we recommend forecasting with the fable package.

Installation

You can install the stable version from CRAN.

install.packages('forecast', dependencies = TRUE)

You can install the development version from Github

# install.packages("remotes")
remotes::install_github("robjhyndman/forecast")

Usage

library(forecast)
library(ggplot2)

# ETS forecasts
USAccDeaths %>%
  ets() %>%
  forecast() %>%
  autoplot()

# Automatic ARIMA forecasts
WWWusage %>%
  auto.arima() %>%
  forecast(h=20) %>%
  autoplot()

# ARFIMA forecasts
library(fracdiff)
x <- fracdiff.sim( 100, ma=-.4, d=.3)$series
arfima(x) %>%
  forecast(h=30) %>%
  autoplot()

# Forecasting with STL
USAccDeaths %>%
  stlm(modelfunction=ar) %>%
  forecast(h=36) %>%
  autoplot()

AirPassengers %>%
  stlf(lambda=0) %>%
  autoplot()

USAccDeaths %>%
  stl(s.window='periodic') %>%
  forecast() %>%
  autoplot()

# TBATS forecasts
USAccDeaths %>%
  tbats() %>%
  forecast() %>%
  autoplot()

taylor %>%
  tbats() %>%
  forecast() %>%
  autoplot()

For more information

License

This package is free and open source software, licensed under GPL-3.

Functions in forecast

Name Description
autoplot.decomposed.ts Plot time series decomposition components using ggplot
arimaorder Return the order of an ARIMA or ARFIMA model
checkresiduals Check that residuals from a time series model look like white noise
dshw Double-Seasonal Holt-Winters Forecasting
arima.errors Errors from a regression model with ARIMA errors
forecast.mts Forecasting time series
CV Cross-validation statistic
forecast.HoltWinters Forecasting using Holt-Winters objects
easter Easter holidays in each season
forecast.nnetar Forecasting using neural network models
fourier Fourier terms for modelling seasonality
CVar k-fold Cross-Validation applied to an autoregressive model
forecast.StructTS Forecasting using Structural Time Series models
bld.mbb.bootstrap Box-Cox and Loess-based decomposition bootstrap.
autolayer Create a ggplot layer appropriate to a particular data type
mstl Multiple seasonal decomposition
forecast.fracdiff Forecasting using ARIMA or ARFIMA models
msts Multi-Seasonal Time Series
is.constant Is an object constant?
auto.arima Fit best ARIMA model to univariate time series
fitted.ARFIMA h-step in-sample forecasts for time series models.
forecast.stl Forecasting using stl objects
meanf Mean Forecast
forecast Forecasting time series
BoxCox.lambda Automatic selection of Box Cox transformation parameter
gold Daily morning gold prices
autolayer.mts Automatically create a ggplot for time series objects
ma Moving-average smoothing
BoxCox Box Cox Transformation
ndiffs Number of differences required for a stationary series
baggedModel Forecasting using a bagged model
dm.test Diebold-Mariano test for predictive accuracy
autoplot.mforecast Multivariate forecast plot
sindexf Forecast seasonal index
Arima Fit ARIMA model to univariate time series
nnetar Neural Network Time Series Forecasts
forecast-package Forecasting Functions for Time Series and Linear Models
reexports Objects exported from other packages
forecast.lm Forecast a linear model with possible time series components
simulate.ets Simulation from a time series model
forecast.ets Forecasting using ETS models
Acf (Partial) Autocorrelation and Cross-Correlation Function Estimation
croston Forecasts for intermittent demand using Croston's method
seasonal Extract components from a time series decomposition
getResponse Get response variable from time series model.
bats BATS model (Exponential smoothing state space model with Box-Cox transformation, ARMA errors, Trend and Seasonal components)
gghistogram Histogram with optional normal and kernel density functions
forecast.mlm Forecast a multiple linear model with possible time series components
seasonaldummy Seasonal dummy variables
rwf Naive and Random Walk Forecasts
plot.ets Plot components from ETS model
plot.forecast Forecast plot
ggtsdisplay Time series display
tslm Fit a linear model with time series components
na.interp Interpolate missing values in a time series
gglagplot Time series lag ggplots
tsoutliers Identify and replace outliers in a time series
taylor Half-hourly electricity demand
ggmonthplot Create a seasonal subseries ggplot
is.acf Is an object a particular model type?
bizdays Number of trading days in each season
wineind Australian total wine sales
is.forecast Is an object a particular forecast type?
subset.ts Subsetting a time series
ets Exponential smoothing state space model
nsdiffs Number of differences required for a seasonally stationary series
findfrequency Find dominant frequency of a time series
forecast.baggedModel Forecasting using a bagged model
ocsb.test Osborn, Chui, Smith, and Birchenhall Test for Seasonal Unit Roots
residuals.forecast Residuals for various time series models
seasadj Seasonal adjustment
forecast.bats Forecasting using BATS and TBATS models
modelAR Time Series Forecasts with a user-defined model
plot.Arima Plot characteristic roots from ARIMA model
plot.bats Plot components from BATS model
forecast.modelAR Forecasting using user-defined model
gas Australian monthly gas production
tsCV Time series cross-validation
tbats TBATS model (Exponential smoothing state space model with Box-Cox transformation, ARMA errors, Trend and Seasonal components)
splinef Cubic Spline Forecast
monthdays Number of days in each season
StatForecast Forecast plot
ggseasonplot Seasonal plot
ses Exponential smoothing forecasts
tbats.components Extract components of a TBATS model
tsclean Identify and replace outliers and missing values in a time series
woolyrnq Quarterly production of woollen yarn in Australia
thetaf Theta method forecast
autoplot.acf ggplot (Partial) Autocorrelation and Cross-Correlation Function Estimation and Plotting
arfima Fit a fractionally differenced ARFIMA model
accuracy Accuracy measures for a forecast model
No Results!

Vignettes of forecast

Name
JSS-paper.bib
JSS2008.Rmd
jsslogo.jpg
No Results!

Last month downloads

Details

LinkingTo Rcpp (>= 0.11.0), RcppArmadillo (>= 0.2.35)
LazyData yes
ByteCompile TRUE
BugReports https://github.com/robjhyndman/forecast/issues
License GPL-3
URL http://pkg.robjhyndman.com/forecast, https://github.com/robjhyndman/forecast
VignetteBuilder knitr
Encoding UTF-8
RoxygenNote 7.1.0
NeedsCompilation yes
Packaged 2020-03-31 08:18:48 UTC; robjhyndman
Repository CRAN
Date/Publication 2020-03-31 14:10:07 UTC

Include our badge in your README

[![Rdoc](http://www.rdocumentation.org/badges/version/forecast)](http://www.rdocumentation.org/packages/forecast)