knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.align = "center",
  fig.width = 5,
  fig.height = 3,
  echo = TRUE
)
library(knitr)

The R package Mcomp contains the 1001 time series from the M-competition (Makridakis et al. 1982), the 3003 time series from the IJF-M3 competition (Makridakis and Hibon, 2000), and the forecasts contributed to the IJF-M3 competition. See also the tscompdata package for data from other forecasting competitions.

M1 competition

The M1 forecasting competition was organized by Spyros Makridakis and Michèle Hibon, involving 1001 series. In this competition, anyone could submit forecasts, making this the first true forecasting competition as far as I am aware. They also used multiple forecast measures to determine the most accurate method.

The 1001 time series were taken from demography, industry and economics, and ranged in length between 9 and 132 observations. All the data were either non-seasonal (e.g., annual), quarterly or monthly. Curiously, all the data were positive, which made it possibly to compute mean absolute percentage errors, but was not really reflective of the population of real data.

The M1 competition data are stored as M1.

library(Mcomp)
M1

Functions are provided to plot and manage the date. The plot.Mdata() and autoplot.Mdata() functions plot a time series, showing both the training and test sections of the series.

plot(M1[[1]])
autoplot(M1[[1]])

subset.Mcomp() returns a subset of the time series data; subsets can be for specific periods, or specific types of data or both.

subset(M1, "monthly")
subset(M1, "macro1")
subset(M1, "macro1", "monthly")

The 111 series used in the extended comparisons in the 1982 M-competition can also be selected.

subset(M1, 111)

M1 is of class Mcomp which is a list, where each element is also a list containing information about one time series. For example, the first element contains the following information.

str(M1[[1]])

The various items are as follows:

M3 competition

In 1998, Makridakis & Hibon ran their M3 competition. Entrants had to forecast 3003 time series and the results were compared to a test set that was withheld from participants. The time series were all taken from business, demography, finance and economics, and ranging in length between 14 and 126 observations. Again, the data were all either non-seasonal (e.g., annual), quarterly or monthly, and all were positive.

The time series from the M3 forecasting competition and the forecasts from all the original participating methods are stored in M3 and M3Forecast respectively. plot.Mdata(), autoplot.Mdata() and subset.Mcomp() work on M3 as well. The structure of M3 is the same as for M1.

M3Forecast is a list of data.frames. Each list element is the result of one forecasting method. The data.frame then has the following structure. Each row is the forecast of one series; rows are named accordingly. Each column corresponds to a forecast horizon. There are 18 columns, as the maximum number of forecasts for any series is 18. If fewer forecasts than 18 exist, the row is padded with NA values.

M3
autoplot(M3[[1]])
subset(M3, "macro")

Sources

Makridakis, S., A. Andersen, R. Carbone, R. Fildes, M. Hibon, R. Lewandowski, J. Newton, E. Parzen, and R. Winkler (1982) The accuracy of extrapolation (time series) methods: results of a forecasting competition. Journal of Forecasting, 1, 111--153.

Makridakis and Hibon (2000) The M3-competition: results, conclusions and implications. International Journal of Forecasting, 16, 451-476.



robjhyndman/Mcomp documentation built on July 5, 2024, 9:40 p.m.