# forecast v8.9

0

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.

## Installation

You can install the **stable** version from
CRAN.

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

You can install the **development** version from
Github

```
# install.packages("devtools")
devtools::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 | |

auto.arima | Fit best ARIMA model to univariate time series | |

dshw | Double-Seasonal Holt-Winters Forecasting | |

Acf | (Partial) Autocorrelation and Cross-Correlation Function Estimation | |

bats | BATS model (Exponential smoothing state space model with Box-Cox transformation, ARMA errors, Trend and Seasonal components) | |

bizdays | Number of trading days in each season | |

autolayer.mts | Automatically create a ggplot for time series objects | |

baggedModel | Forecasting using a bagged model | |

fitted.fracdiff | h-step in-sample forecasts for time series models. | |

forecast-package | Forecasting Functions for Time Series and Linear Models | |

Arima | Fit ARIMA model to univariate time series | |

dm.test | Diebold-Mariano test for predictive accuracy | |

gglagplot | Time series lag ggplots | |

ggmonthplot | Create a seasonal subseries ggplot | |

croston | Forecasts for intermittent demand using Croston's method | |

forecast.stl | Forecasting using stl objects | |

forecast.bats | Forecasting using BATS and TBATS models | |

forecast.baggedModel | Forecasting using a bagged model | |

fourier | Fourier terms for modelling seasonality | |

mstl | Multiple seasonal decomposition | |

rwf | Naive and Random Walk Forecasts | |

na.interp | Interpolate missing values in a time series | |

plot.Arima | Plot characteristic roots from ARIMA model | |

easter | Easter holidays in each season | |

ndiffs | Number of differences required for a stationary series | |

nnetar | Neural Network Time Series Forecasts | |

msts | Multi-Seasonal Time Series | |

tbats.components | Extract components of a TBATS model | |

residuals.forecast | Residuals for various time series models | |

seasadj | Seasonal adjustment | |

forecast.mts | Forecasting time series | |

plot.bats | Plot components from BATS model | |

forecast.nnetar | Forecasting using neural network models | |

thetaf | Theta method forecast | |

CVar | k-fold Cross-Validation applied to an autoregressive model | |

bld.mbb.bootstrap | Box-Cox and Loess-based decomposition bootstrap. | |

CV | Cross-validation statistic | |

checkresiduals | Check that residuals from a time series model look like white noise | |

sindexf | Forecast seasonal index | |

tsclean | Identify and replace outliers and missing values in a time series | |

tsCV | Time series cross-validation | |

simulate.ets | Simulation from a time series model | |

forecast | Forecasting time series | |

forecast.fracdiff | Forecasting using ARIMA or ARFIMA models | |

forecast.StructTS | Forecasting using Structural Time Series models | |

forecast.HoltWinters | Forecasting using Holt-Winters objects | |

plot.ets | Plot components from ETS model | |

woolyrnq | Quarterly production of woollen yarn in Australia | |

getResponse | Get response variable from time series model. | |

plot.forecast | Forecast plot | |

subset.ts | Subsetting a time series | |

splinef | Cubic Spline Forecast | |

gghistogram | Histogram with optional normal and kernel density functions | |

modelAR | Time Series Forecasts with a user-defined model | |

monthdays | Number of days in each season | |

autoplot.mforecast | Multivariate forecast plot | |

seasonaldummy | Seasonal dummy variables | |

reexports | Objects exported from other packages | |

taylor | Half-hourly electricity demand | |

seasonal | Extract components from a time series decomposition | |

BoxCox | Box Cox Transformation | |

BoxCox.lambda | Automatic selection of Box Cox transformation parameter | |

accuracy | Accuracy measures for a forecast model | |

tbats | TBATS model (Exponential smoothing state space model with Box-Cox transformation, ARMA errors, Trend and Seasonal components) | |

arfima | Fit a fractionally differenced ARFIMA model | |

findfrequency | Find dominant frequency of a time series | |

ets | Exponential smoothing state space model | |

forecast.mlm | Forecast a multiple linear model with possible time series components | |

gas | Australian monthly gas production | |

is.acf | Is an object a particular model type? | |

nsdiffs | Number of differences required for a seasonally stationary series | |

ggseasonplot | Seasonal plot | |

is.forecast | Is an object a particular forecast type? | |

ocsb.test | Osborn, Chui, Smith, and Birchenhall Test for Seasonal Unit Roots | |

StatForecast | Forecast plot | |

forecast.modelAR | Forecasting using user-defined model | |

autoplot.acf | ggplot (Partial) Autocorrelation and Cross-Correlation Function Estimation and Plotting | |

ses | Exponential smoothing forecasts | |

autoplot.decomposed.ts | Plot time series decomposition components using ggplot | |

ggtsdisplay | Time series display | |

tslm | Fit a linear model with time series components | |

forecast.lm | Forecast a linear model with possible time series components | |

forecast.ets | Forecasting using ETS models | |

is.constant | Is an object constant? | |

gold | Daily morning gold prices | |

ma | Moving-average smoothing | |

tsoutliers | Identify and replace outliers in a time series | |

meanf | Mean Forecast | |

wineind | Australian total wine sales | |

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 | 6.1.1 |

NeedsCompilation | yes |

Packaged | 2019-08-22 03:02:51 UTC; hyndman |

Repository | CRAN |

Date/Publication | 2019-08-22 11:50:02 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 | knitr , methods , rmarkdown , rticles , 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

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