forecast v8.13
Monthly downloads
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 
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
- Get started in forecasting with the online textbook at http://OTexts.org/fpp2/
- Read the Hyndsight blog at https://robjhyndman.com/hyndsight/
- Ask forecasting questions on http://stats.stackexchange.com/tags/forecasting
- Ask R questions on http://stackoverflow.com/tags/forecasting+r
- Join the International Institute of Forecasters: http://forecasters.org/
License
This package is free and open source software, licensed under GPL-3.
Functions in forecast
Name | Description | |
Arima | Fit ARIMA model to univariate time series | |
Acf | (Partial) Autocorrelation and Cross-Correlation Function Estimation | |
arimaorder | Return the order of an ARIMA or ARFIMA model | |
auto.arima | Fit best ARIMA model to univariate time series | |
arima.errors | Errors from a regression model with ARIMA errors | |
autolayer | Create a ggplot layer appropriate to a particular data type | |
autoplot.acf | ggplot (Partial) Autocorrelation and Cross-Correlation Function Estimation and Plotting | |
autoplot.decomposed.ts | Plot time series decomposition components using ggplot | |
croston | Forecasts for intermittent demand using Croston's method | |
BoxCox | Box Cox Transformation | |
BoxCox.lambda | Automatic selection of Box Cox transformation parameter | |
forecast.fracdiff | Forecasting using ARIMA or ARFIMA models | |
bats | BATS model (Exponential smoothing state space model with Box-Cox transformation, ARMA errors, Trend and Seasonal components) | |
accuracy | Accuracy measures for a forecast model | |
checkresiduals | Check that residuals from a time series model look like white noise | |
easter | Easter holidays in each season | |
bizdays | Number of trading days in each season | |
arfima | Fit a fractionally differenced ARFIMA model | |
bld.mbb.bootstrap | Box-Cox and Loess-based decomposition bootstrap. | |
fitted.ARFIMA | h-step in-sample forecasts for time series models. | |
autolayer.mts | Automatically create a ggplot for time series objects | |
dshw | Double-Seasonal Holt-Winters Forecasting | |
forecast-package | Forecasting Functions for Time Series and Linear Models | |
forecast.mts | Forecasting time series | |
forecast.HoltWinters | Forecasting using Holt-Winters objects | |
forecast.mlm | Forecast a multiple linear model with possible time series components | |
forecast.modelAR | Forecasting using user-defined model | |
forecast.nnetar | Forecasting using neural network models | |
gas | Australian monthly gas production | |
dm.test | Diebold-Mariano test for predictive accuracy | |
StatForecast | Forecast plot | |
forecast.baggedModel | Forecasting using a bagged model | |
forecast.bats | Forecasting using BATS and TBATS models | |
gglagplot | Time series lag ggplots | |
ggtsdisplay | Time series display | |
meanf | Mean Forecast | |
ma | Moving-average smoothing | |
getResponse | Get response variable from time series model. | |
fourier | Fourier terms for modelling seasonality | |
forecast.stl | Forecasting using stl objects | |
gghistogram | Histogram with optional normal and kernel density functions | |
tslm | Fit a linear model with time series components | |
mstl | Multiple seasonal decomposition | |
baggedModel | Forecasting using a bagged model | |
forecast.ets | Forecasting using ETS models | |
na.interp | Interpolate missing values in a time series | |
plot.Arima | Plot characteristic roots from ARIMA model | |
forecast.lm | Forecast a linear model with possible time series components | |
plot.bats | Plot components from BATS model | |
rwf | Naive and Random Walk Forecasts | |
ggmonthplot | Create a seasonal subseries ggplot | |
msts | Multi-Seasonal Time Series | |
findfrequency | Find dominant frequency of a time series | |
monthdays | Number of days in each season | |
modelAR | Time Series Forecasts with a user-defined model | |
ets | Exponential smoothing state space model | |
is.acf | Is an object a particular model type? | |
nnetar | Neural Network Time Series Forecasts | |
residuals.forecast | Residuals for various time series models | |
ndiffs | Number of differences required for a stationary series | |
autoplot.mforecast | Multivariate forecast plot | |
splinef | Cubic Spline Forecast | |
is.constant | Is an object constant? | |
forecast.StructTS | Forecasting using Structural Time Series models | |
forecast | Forecasting time series | |
gold | Daily morning gold prices | |
is.forecast | Is an object a particular forecast type? | |
plot.forecast | Forecast plot | |
plot.ets | Plot components from ETS model | |
seasadj | Seasonal adjustment | |
ses | Exponential smoothing forecasts | |
ggseasonplot | Seasonal plot | |
reexports | Objects exported from other packages | |
nsdiffs | Number of differences required for a seasonally stationary series | |
ocsb.test | Osborn, Chui, Smith, and Birchenhall Test for Seasonal Unit Roots | |
simulate.ets | Simulation from a time series model | |
taylor | Half-hourly electricity demand | |
sindexf | Forecast seasonal index | |
subset.ts | Subsetting a time series | |
thetaf | Theta method forecast | |
tbats.components | Extract components of a TBATS model | |
seasonal | Extract components from a time series decomposition | |
seasonaldummy | Seasonal dummy variables | |
tsoutliers | Identify and replace outliers in a time series | |
wineind | Australian total wine sales | |
tbats | TBATS model (Exponential smoothing state space model with Box-Cox transformation, ARMA errors, Trend and Seasonal components) | |
woolyrnq | Quarterly production of woollen yarn in Australia | |
tsclean | Identify and replace outliers and missing values in a time series | |
tsCV | Time series cross-validation | |
CV | Cross-validation statistic | |
CVar | k-fold Cross-Validation applied to an autoregressive 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 | https://pkg.robjhyndman.com/forecast/, https://github.com/robjhyndman/forecast |
VignetteBuilder | knitr |
Encoding | UTF-8 |
RoxygenNote | 7.1.1 |
NeedsCompilation | yes |
Packaged | 2020-09-11 07:27:05 UTC; robjhyndman |
Repository | CRAN |
Date/Publication | 2020-09-12 06:00:08 UTC |
depends | , R (>= 3.0.2) |
imports | colorspace , fracdiff , ggplot2 (>= 2.2.1) , graphics , lmtest , magrittr , nnet , parallel , Rcpp (>= 0.11.0) , stats , timeDate , tseries , urca , zoo |
suggests | forecTheta , knitr , methods , rmarkdown , rticles , seasonal , testthat , uroot |
linkingto | RcppArmadillo (>= 0.2.35) |
Contributors | Earo Wang, Leanne Chhay, Fotios Petropoulos, R Core team, Yuan Tang, Christoph Bergmeir, Slava Razbash, David Shaub, Zhenyu Zhou, Ross Ihaka, Mitchell O'Hara-Wild, George Athanasopoulos, Gabriel Caceres, Farah Yasmeen, Daniel Reid |
Include our badge in your README
[](http://www.rdocumentation.org/packages/forecast)