Giter Club home page Giter Club logo

tcomp-r-package's Introduction

Tcomp R package

Data from the 2010 Tourism Forecasting competition

Travis-CI Build Status CRAN version CRAN RStudio mirror downloads

This project provides an R package of convenient access to the data from the tourism forecasting competition described in Athanasopoulos, Hyndman, Song and Wu (2011). Athanasopoulos et al was originally published in International Journal of Forecastsing (2011) 27(3), 822-84.

Currently this package is only available on GitHub:

devtools::install_github("ellisp/Tcomp-r-package/pkg")

The original data are from various tourism organisations and academics around the world and are no identifiable to their original metadata. The copies used for this package came from Professor Hyndman's webpage. Transformation into the format used in this package is done in the /prep/ folder of this GitHub project; but there's no need for most users to look into that

Usage is straight-forward. All 1,311 series are elements in a single list called tourism. tourism is an object of class Mcomp, and each individual series is an element of class Mdata (these classes are borrowed from Hyndman's Mcomp R package and come with convenient print, plot, subset, etc methods).

library(Tcomp)
plot(tourism$M4)

plot of chunk unnamed-chunk-3

plot(forecast::forecast(tourism$Q12$x))

plot of chunk unnamed-chunk-3

A wrapper function forecast_comp is provided that fits four models from the forecast package and returns the mean absolute scaled error for user-provided testing periods.

round(forecast_comp(tourism$M4, tests = list(1, 6, 12, 24, 1:12, 1:24), plot = TRUE), 2)

plot of chunk unnamed-chunk-4

          1     6    12    24  1-12  1-24
ARIMA  0.12 11.43 17.33 21.86 13.34 15.87
ETS    5.62 15.79  7.47 15.45  8.38  8.84
Theta  1.39  1.39  6.38 13.50  5.41  7.36
Naive 27.86  1.72  7.31 15.31 11.24 14.64
ARIMA  0.01  1.04  2.47  3.40  1.58  2.00
ETS    0.65  1.44  1.06  2.41  0.89  1.06
Theta  0.16  0.13  0.91  2.10  0.61  0.92
Naive  3.23  0.16  1.04  2.38  1.34  1.84

This method will also work with the data from the Mcomp package:

library(Mcomp)
round(forecast_comp(M3[[2000]], tests = list(1, 3, 6, 1:6), plot = FALSE), 2)
          1     3    6   1-6
ARIMA  5.59 18.60 2.09  9.01
ETS    5.09 31.47 7.32 15.36
Theta  5.12 31.58 7.50 15.47
Naive 24.53 25.88 6.69 19.81
ARIMA  0.21  0.56 0.08  0.30
ETS    0.19  0.95 0.27  0.51
Theta  0.19  0.95 0.28  0.51
Naive  0.93  0.78 0.25  0.68

An extended example in /r/extended-example/reproduce.R aims to show how this can be used efficiently to reproduce some of the results in Athanasopoulos but currently fails to come up with the same results.

tcomp-r-package's People

Contributors

ellisp avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

hendrikklopries

tcomp-r-package's Issues

data error in number of observations

Hi, I found the package has some data errors in the number of observations.
I thought the n is suppose to be the number of observation in the time series. However it seems it is different from the length of time series in the training data in many cases.

To give an example, tourism[[2]]$n = 1979, however length(tourism[[2]]$x) = 163.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.