Learn R Programming

⚠️There's a newer version (6.0.3) of this package.Take me there.

hts

The R package hts presents functions to create, plot and forecast hierarchical and grouped time series. In forecasting hierarchical and grouped time series, the base methods implemented include ETS, ARIMA and the naive (random walk) models. Forecasts for grouped time series are calibrated using bottom-up and optimal combination methods. Forecasts for hierarchical time series are distributed in the hierarchy using bottom-up, top-down, middle-out and optimal combination methods. Three top-down methods are available: the two Gross-Sohl methods and the forecast-proportion approach of Hyndman, Ahmed, and Athanasopoulos (2011).

Installation

You can install the stable version on R CRAN.

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

You can also install the development version from Github

# install.packages("devtools")
devtools::install_github("robjhyndman/hts")

Usage

# library(hts)
demo(htseg1)  # hts example 1
demo(htseg2)  # hts example 2
demo(infantgts)  # gts

License

This package is free and open source software, licensed under GPL (>= 2).

Copy Link

Version

Install

install.packages('hts')

Monthly Downloads

3,569

Version

5.0

License

GPL (>= 2)

Maintainer

Rob Hyndman

Last Published

April 6th, 2016

Functions in hts (5.0)

combinef

Optimally combine forecasts from a hierarchical or grouped time series
MinT

Trace minimization for hierarchical or grouped time series
allts

Extract all time series from a gts object
accuracy.gts

In-sample or out-of-sample accuracy measures for forecast grouped and hierarchical model
htseg1

Simple examples of hierarchical time series.
hts-package

Hierarchical and grouped time series
forecast.gts

Forecast a hierarchical or grouped time series
aggts

Extract selected time series from a gts object
window.gts

Time window of a gts object
hts

Create a hierarchical time series
plot.gts

Plot grouped or hierarchical time series
infantgts

Regional infant mortality counts across Australia from 1933 to 2003.
gts

Create a grouped time series
smatrix

Summing matrix for hierarchical or grouped time series