R

forecast

Forecasting Functions for Time Series and Linear Models

R

robjhyndman

Dernière activité 27 sept. 2026
robjhyndman/forecast

1,2 k

étoiles

337

forks

7

issues ouvertes

cranforecastforecastingr

Ce README est souvent en anglais.

forecast

R-CMD-check CRAN_Status_Badge 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.

A complementary forecasting package is the fable package, which implements many of the same models but in a tidyverse framework.

Installation

You can install the stable version from CRAN.

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

You can install the development version from Github

# install.packages("pak")
pak::pak("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 = -0.4, d = 0.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.

Projets similaires

Tool for producing high quality forecasts for time series data that has multiple seasonality with linear or non-linear growth.

Pythonforecastingpythonr
Ffacebook
20,4 k étoiles4,6 k

Modeltime unlocks time series forecast models and machine learning in one framework

Rarimadata-sciencedeep-learning
Bbusiness-science
584 étoiles85

Chronos: Pretrained Models for Time Series Forecasting

Pythonartificial-intelligenceforecastingfoundation-models
Aamazon-science
5,9 k étoiles720