├── .Rbuildignore ├── .github ├── .gitignore └── workflows │ ├── R-CMD-check.yaml │ └── pkgdown.yaml ├── .gitignore ├── DESCRIPTION ├── NAMESPACE ├── R ├── combine_training_test.R ├── data.R └── tscompdata.R ├── README.Rmd ├── README.md ├── _pkgdown.yml ├── data ├── gefcom2012_load.rda ├── gefcom2012_temp.rda ├── gefcom2012_wp.rda ├── nn3.rda ├── nn5.rda └── nngc1.rda ├── man ├── combine_training_test.Rd ├── figures │ └── README-nn5-1.png ├── gefcom2012_load.Rd ├── gefcom2012_temp.Rd ├── gefcom2012_wp.Rd ├── nn3.Rd ├── nn5.Rd ├── nngc1.Rd └── tscompdata.Rd ├── pkgdown └── extra.css ├── tscompdata.Rproj └── vignettes └── tscompdata.Rmd /.Rbuildignore: -------------------------------------------------------------------------------- 1 | ^docs$ 2 | ^_pkgdown\.yml$ 3 | ^.*\.Rproj$ 4 | ^\.Rproj\.user$ 5 | ^README\.Rmd$ 6 | ^README-.*\.png$ 7 | ^README\_.*$ 8 | ^READMEfigs 9 | ^pkgdown$ 10 | ^\.github$ 11 | -------------------------------------------------------------------------------- /.github/.gitignore: -------------------------------------------------------------------------------- 1 | *.html 2 | -------------------------------------------------------------------------------- /.github/workflows/R-CMD-check.yaml: -------------------------------------------------------------------------------- 1 | # Workflow derived from https://github.com/r-lib/actions/tree/v2/examples 2 | # Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help 3 | on: 4 | push: 5 | branches: [main, master] 6 | pull_request: 7 | branches: [main, master] 8 | 9 | name: R-CMD-check 10 | 11 | jobs: 12 | R-CMD-check: 13 | runs-on: ${{ matrix.config.os }} 14 | 15 | name: ${{ matrix.config.os }} (${{ matrix.config.r }}) 16 | 17 | strategy: 18 | fail-fast: false 19 | matrix: 20 | config: 21 | - {os: macos-latest, r: 'release'} 22 | - {os: windows-latest, r: 'release'} 23 | - {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'} 24 | - {os: ubuntu-latest, r: 'release'} 25 | - {os: ubuntu-latest, r: 'oldrel-1'} 26 | 27 | env: 28 | GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} 29 | R_KEEP_PKG_SOURCE: yes 30 | 31 | steps: 32 | - uses: actions/checkout@v3 33 | 34 | - uses: r-lib/actions/setup-pandoc@v2 35 | 36 | - uses: r-lib/actions/setup-r@v2 37 | with: 38 | r-version: ${{ matrix.config.r }} 39 | http-user-agent: ${{ matrix.config.http-user-agent }} 40 | use-public-rspm: true 41 | 42 | - uses: r-lib/actions/setup-r-dependencies@v2 43 | with: 44 | extra-packages: any::rcmdcheck 45 | needs: check 46 | 47 | - uses: r-lib/actions/check-r-package@v2 48 | with: 49 | upload-snapshots: true 50 | -------------------------------------------------------------------------------- /.github/workflows/pkgdown.yaml: -------------------------------------------------------------------------------- 1 | # Workflow derived from https://github.com/r-lib/actions/tree/v2/examples 2 | # Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help 3 | on: 4 | push: 5 | branches: [main, master] 6 | pull_request: 7 | branches: [main, master] 8 | release: 9 | types: [published] 10 | workflow_dispatch: 11 | 12 | name: pkgdown 13 | 14 | jobs: 15 | pkgdown: 16 | runs-on: ubuntu-latest 17 | # Only restrict concurrency for non-PR jobs 18 | concurrency: 19 | group: pkgdown-${{ github.event_name != 'pull_request' || github.run_id }} 20 | env: 21 | GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} 22 | permissions: 23 | contents: write 24 | steps: 25 | - uses: actions/checkout@v3 26 | 27 | - uses: r-lib/actions/setup-pandoc@v2 28 | 29 | - uses: r-lib/actions/setup-r@v2 30 | with: 31 | use-public-rspm: true 32 | 33 | - uses: r-lib/actions/setup-r-dependencies@v2 34 | with: 35 | extra-packages: any::pkgdown, local::. 36 | needs: website 37 | 38 | - name: Build site 39 | run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE) 40 | shell: Rscript {0} 41 | 42 | - name: Deploy to GitHub pages 🚀 43 | if: github.event_name != 'pull_request' 44 | uses: JamesIves/github-pages-deploy-action@v4.4.1 45 | with: 46 | clean: false 47 | branch: gh-pages 48 | folder: docs 49 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .Rproj.user 2 | .Rhistory 3 | .RData 4 | 5 | # History files 6 | .Rapp.history 7 | # Example code in package build process 8 | *-Ex.R 9 | # RStudio files 10 | .Rproj.user/ 11 | # produced vignettes 12 | vignettes/*.html 13 | vignettes/*.pdf 14 | .Rbuildignore 15 | *.Rproj 16 | README_cache 17 | inst/doc 18 | docs 19 | -------------------------------------------------------------------------------- /DESCRIPTION: -------------------------------------------------------------------------------- 1 | Package: tscompdata 2 | Title: Time series data from various forecasting competitions 3 | Version: 0.0.1 4 | Authors@R: person("Rob", "Hyndman", email="Rob.Hyndman@monash.edu", role=c("aut", "cre", "cph"), comment = c(ORCID = "0000-0002-2140-5352")) 5 | Description: 6 | Time series data from the following forecasting competitions are provided: M, M3, NN3, NN5, NNGC1, Tourism, and GEFCom2012. 7 | Depends: R (>= 3.4.2), Mcomp, Tcomp 8 | Imports: 9 | stats, 10 | purrr, 11 | forecast (>= 8.3) 12 | License: GPL-3 13 | URL: https://pkg.robjhyndman.com/tscompdata/, https://github.com/robjhyndman/tscompdata, 14 | BugReports: https://github.com/robjhyndman/tscompdata/issues 15 | Encoding: UTF-8 16 | LazyData: true 17 | ByteCompile: true 18 | RoxygenNote: 6.1.0 19 | Suggests: knitr, 20 | rmarkdown 21 | VignetteBuilder: knitr 22 | -------------------------------------------------------------------------------- /NAMESPACE: -------------------------------------------------------------------------------- 1 | # Generated by roxygen2: do not edit by hand 2 | 3 | export(combine_training_test) 4 | import(Mcomp) 5 | import(Tcomp) 6 | importFrom(forecast,mstl) 7 | importFrom(purrr,map) 8 | importFrom(stats,ts) 9 | importFrom(stats,tsp) 10 | -------------------------------------------------------------------------------- /R/combine_training_test.R: -------------------------------------------------------------------------------- 1 | #' Combining training and test data 2 | #' 3 | #' The data in the Mcomp and Tcomp packages are in the \code{Mcomp} class which 4 | #' contains various information used in the competitions including the training 5 | #' and test portions of the time series. This function combines 6 | #' the training data and test data into a single \code{ts} object. 7 | #' 8 | #' @param object An object of class \code{Mcomp} from either the Mcomp or Tcomp 9 | #' packages. 10 | #' @return A list of time series 11 | #' @examples 12 | #' m3ts <- combine_training_test(M3) 13 | #' @export 14 | 15 | combine_training_test <- function(object) 16 | { 17 | if("Mcomp" %in% class(object)) 18 | { 19 | new <- purrr::map(object, 20 | function(x){ 21 | tspx <- tsp(x$x) 22 | ts(c(x$x,x$xx), start=tspx[1], frequency=tspx[3]) 23 | }) 24 | } 25 | else 26 | stop("Unknown object class") 27 | 28 | return(new) 29 | } 30 | -------------------------------------------------------------------------------- /R/data.R: -------------------------------------------------------------------------------- 1 | #' NN3 data 2 | #' 3 | #' Data from the NN3 forecasting competition, comprising 111 monthly time series. 4 | #' Training and test data are combined. In the competition, the last 18 months 5 | #' were used as test data. Time series NN3-101 to NN3-111 made up the reduced data 6 | #' set from the competition. 7 | #' 8 | #' @format A list of time series data, each of class \code{ts}. 9 | #' @source \url{http://www.neural-forecasting-competition.com/NN3}. 10 | #' @keywords datasets 11 | #' @examples 12 | #' plot(nn3[[1]]) 13 | #' 14 | "nn3" 15 | 16 | #' NN5 data 17 | #' 18 | #' Data from the NN5 forecasting competition, comprising 111 daily time series. 19 | #' Training and test data are combined. In the competition, the last 56 days 20 | #' were used as test data. Time series NN5-101 to NN5-111 made up the reduced data 21 | #' set from the competition. 22 | #' 23 | #' @format A list of time series data, each of class \code{msts}. 24 | #' @source \url{http://www.neural-forecasting-competition.com/NN5}. 25 | #' @keywords datasets 26 | #' @examples 27 | #' plot(nn5[[1]]) 28 | #' 29 | "nn5" 30 | 31 | #' NNGC1 data 32 | #' 33 | #' Data from the NNGC1 forecasting competition, comprising 11 annual time series, 11 34 | #' quarterly time series, 11 monthly time series, 11 weekly time series, 11 daily 35 | #' time series and 11 hourly time series. Only training data are provided. 36 | #' 37 | #' @format A list of time series data, each of class \code{ts} or \code{msts}. 38 | #' @source \url{http://www.neural-forecasting-competition.com/}. 39 | #' @keywords datasets 40 | #' @examples 41 | #' plot(nngc1[[1]]) 42 | #' 43 | "nngc1" 44 | 45 | #' GEFCOM2012 load data 46 | #' 47 | #' Data from the GEFCOM2012 forecasting competition, comprising 20 time series containing 48 | #' hourly load data from 20 zones in the United States. Only training data are provided. 49 | #' The missing data in each series formed the test sets. 50 | #' 51 | #' @format A list of time series data, each of class \code{msts}. 52 | #' @source \url{https://www.kaggle.com/c/global-energy-forecasting-competition-2012-load-forecasting}, 53 | #' \url{http://www.drhongtao.com/gefcom/2012}. 54 | #' @references Hong, T., Pinson, P., & Fan, S. (2014). Global energy forecasting competition 2012. 55 | #' \emph{International Journal of Forecasting}, 30(2), 357-363. 56 | #' \url{https://doi.org/10.1016/j.ijforecast.2013.07.001}. 57 | #' @keywords datasets 58 | #' @examples 59 | #' plot(gefcom2012_load[[1]]) 60 | "gefcom2012_load" 61 | 62 | #' GEFCOM2012 temperature data 63 | #' 64 | #' Data from the GEFCOM2012 forecasting competition, comprising 11 time series containing 65 | #' hourly temperature data from 11 weather stations in the United States. 66 | #' 67 | #' @format A list of time series data, each of class \code{msts}. 68 | #' @source \url{https://www.kaggle.com/c/global-energy-forecasting-competition-2012-load-forecasting}, 69 | #' \url{http://www.drhongtao.com/gefcom/2012}. 70 | #' @references Hong, T., Pinson, P., & Fan, S. (2014). Global energy forecasting competition 2012. 71 | #' \emph{International Journal of Forecasting}, 30(2), 357-363. 72 | #' \url{https://doi.org/10.1016/j.ijforecast.2013.07.001}. 73 | #' @keywords datasets 74 | #' @examples 75 | #' plot(gefcom2012_temp[[1]]) 76 | "gefcom2012_temp" 77 | 78 | #' GEFCOM2012 wind power data 79 | #' 80 | #' Data from the GEFCOM2012 forecasting competition, comprising 7 hourly time series containing 81 | #' wind power data from 7 wind farms. Only training data are provided. 82 | #' The missing data in each series formed the test sets. 83 | #' 84 | #' @format A list of time series data, each of class \code{msts}. 85 | #' @source \url{https://www.kaggle.com/c/GEF2012-wind-forecasting/data}, 86 | #' \url{http://www.drhongtao.com/gefcom/2012}. 87 | #' @references Hong, T., Pinson, P., & Fan, S. (2014). Global energy forecasting competition 2012. 88 | #' \emph{International Journal of Forecasting}, 30(2), 357-363. 89 | #' \url{https://doi.org/10.1016/j.ijforecast.2013.07.001}. 90 | #' @keywords datasets 91 | #' @keywords datasets 92 | #' @examples 93 | #' plot(gefcom2012_wp[[1]]) 94 | "gefcom2012_wp" 95 | -------------------------------------------------------------------------------- /R/tscompdata.R: -------------------------------------------------------------------------------- 1 | #' Time Series Competition Data 2 | #' 3 | #' The tscompdata package provides time series data from several forecasting competitions. 4 | #' 5 | #' @docType package 6 | #' @name tscompdata 7 | #' @importFrom stats tsp ts 8 | #' @importFrom purrr map 9 | #' @importFrom forecast mstl 10 | #' @import Mcomp 11 | #' @import Tcomp 12 | NULL 13 | #> NULL 14 | -------------------------------------------------------------------------------- /README.Rmd: -------------------------------------------------------------------------------- 1 | --- 2 | output: github_document 3 | editor_options: 4 | chunk_output_type: console 5 | --- 6 | 7 | 8 | 9 | ```{r, echo = FALSE} 10 | knitr::opts_chunk$set( 11 | collapse = TRUE, 12 | comment = "#>", 13 | fig.path = "man/figures/README-" 14 | ) 15 | ``` 16 | 17 | # tscompdata 18 | 19 | The R package *tscompdata* provides time series data from the following forecasting competitions: M, M3, NN3, NN5, NNGC1, Tourism and GEFCom2012. 20 | 21 | The M, M3 and Tourism data are loaded from the [Mcomp](http://pkg.robjhyndman.com/Mcomp/) and [Tcomp](https://github.com/ellisp/Tcomp-r-package) packages. The remaining data are contained within the tscompdata package. 22 | 23 | ## Installation 24 | 25 | You can install the **development** version from [Github](https://github.com/robjhyndman/tscompdata) with: 26 | 27 | ```{r gh-installation, eval = FALSE} 28 | # install.packages("devtools") 29 | devtools::install_github("robjhyndman/tscompdata") 30 | ``` 31 | 32 | ## Usage 33 | 34 | ```{r nn5} 35 | library(tscompdata) 36 | library(ggplot2) 37 | autoplot(nn5[[23]]) 38 | ``` 39 | 40 | ## License 41 | 42 | This package is free and open source software, licensed under GPL-3. 43 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | # tscompdata 5 | 6 | The R package *tscompdata* provides time series data from the following 7 | forecasting competitions: M, M3, NN3, NN5, NNGC1, Tourism and 8 | GEFCom2012. 9 | 10 | The M, M3 and Tourism data are loaded from the 11 | [Mcomp](http://pkg.robjhyndman.com/Mcomp/) and 12 | [Tcomp](https://github.com/ellisp/Tcomp-r-package) packages. The 13 | remaining data are contained within the tscompdata package. 14 | 15 | ## Installation 16 | 17 | You can install the **development** version from 18 | [Github](https://github.com/robjhyndman/tscompdata) with: 19 | 20 | ``` r 21 | # install.packages("devtools") 22 | devtools::install_github("robjhyndman/tscompdata") 23 | ``` 24 | 25 | ## Usage 26 | 27 | ``` r 28 | library(tscompdata) 29 | #> Loading required package: Mcomp 30 | #> Loading required package: forecast 31 | #> Registered S3 method overwritten by 'quantmod': 32 | #> method from 33 | #> as.zoo.data.frame zoo 34 | #> Loading required package: Tcomp 35 | library(ggplot2) 36 | autoplot(nn5[[23]]) 37 | ``` 38 | 39 | ![](man/figures/README-nn5-1.png) 40 | 41 | ## License 42 | 43 | This package is free and open source software, licensed under GPL-3. 44 | -------------------------------------------------------------------------------- /_pkgdown.yml: -------------------------------------------------------------------------------- 1 | url: http://pkg.robjhyndman.com/tscompdata/ 2 | template: 3 | bootstrap: 5 4 | theme: tango 5 | bootswatch: flatly 6 | bslib: 7 | base_font: 8 | google: Fira Sans 9 | heading_font: 10 | google: Fira Sans 11 | code_font: Hack, mono 12 | primary: '#234460' 13 | link-color: '#234460' 14 | includes: 15 | in_header: 16 | authors: 17 | Rob Hyndman: 18 | href: http://robjhyndman.com 19 | navbar: 20 | type: light 21 | structure: 22 | left: 23 | - home 24 | - intro 25 | - reference 26 | - articles 27 | - tutorials 28 | - news 29 | right: github 30 | components: 31 | home: 32 | icon: fa-home fa-lg 33 | href: index.html 34 | reference: 35 | text: Reference 36 | href: reference/index.html 37 | intro: 38 | text: Get started 39 | href: articles/tscompdata.html 40 | github: 41 | icon: fa-github fa-lg 42 | href: https://github.com/robjhyndman/tscompdata 43 | reference: 44 | - title: Package 45 | contents: 46 | - tscompdata 47 | - title: Data 48 | desc: Data sets in the tscompdata package 49 | contents: 50 | - gefcom2012_load 51 | - gefcom2012_temp 52 | - gefcom2012_wp 53 | - nn3 54 | - nn5 55 | - nngc1 56 | - title: Functions 57 | desc: Functions for combining data 58 | contents: combine_training_test 59 | -------------------------------------------------------------------------------- /data/gefcom2012_load.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robjhyndman/tscompdata/668b3451c17de3fbae399c9c77362932b5f4637a/data/gefcom2012_load.rda -------------------------------------------------------------------------------- /data/gefcom2012_temp.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robjhyndman/tscompdata/668b3451c17de3fbae399c9c77362932b5f4637a/data/gefcom2012_temp.rda -------------------------------------------------------------------------------- /data/gefcom2012_wp.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robjhyndman/tscompdata/668b3451c17de3fbae399c9c77362932b5f4637a/data/gefcom2012_wp.rda -------------------------------------------------------------------------------- /data/nn3.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robjhyndman/tscompdata/668b3451c17de3fbae399c9c77362932b5f4637a/data/nn3.rda -------------------------------------------------------------------------------- /data/nn5.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robjhyndman/tscompdata/668b3451c17de3fbae399c9c77362932b5f4637a/data/nn5.rda -------------------------------------------------------------------------------- /data/nngc1.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robjhyndman/tscompdata/668b3451c17de3fbae399c9c77362932b5f4637a/data/nngc1.rda -------------------------------------------------------------------------------- /man/combine_training_test.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/combine_training_test.R 3 | \name{combine_training_test} 4 | \alias{combine_training_test} 5 | \title{Combining training and test data} 6 | \usage{ 7 | combine_training_test(object) 8 | } 9 | \arguments{ 10 | \item{object}{An object of class \code{Mcomp} from either the Mcomp or Tcomp 11 | packages.} 12 | } 13 | \value{ 14 | A list of time series 15 | } 16 | \description{ 17 | The data in the Mcomp and Tcomp packages are in the \code{Mcomp} class which 18 | contains various information used in the competitions including the training 19 | and test portions of the time series. This function combines 20 | the training data and test data into a single \code{ts} object. 21 | } 22 | \examples{ 23 | m3ts <- combine_training_test(M3) 24 | } 25 | -------------------------------------------------------------------------------- /man/figures/README-nn5-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robjhyndman/tscompdata/668b3451c17de3fbae399c9c77362932b5f4637a/man/figures/README-nn5-1.png -------------------------------------------------------------------------------- /man/gefcom2012_load.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/data.R 3 | \docType{data} 4 | \name{gefcom2012_load} 5 | \alias{gefcom2012_load} 6 | \title{GEFCOM2012 load data} 7 | \format{A list of time series data, each of class \code{msts}.} 8 | \source{ 9 | \url{https://www.kaggle.com/c/global-energy-forecasting-competition-2012-load-forecasting}, 10 | \url{http://www.drhongtao.com/gefcom/2012}. 11 | } 12 | \usage{ 13 | gefcom2012_load 14 | } 15 | \description{ 16 | Data from the GEFCOM2012 forecasting competition, comprising 20 time series containing 17 | hourly load data from 20 zones in the United States. Only training data are provided. 18 | The missing data in each series formed the test sets. 19 | } 20 | \examples{ 21 | plot(gefcom2012_load[[1]]) 22 | } 23 | \references{ 24 | Hong, T., Pinson, P., & Fan, S. (2014). Global energy forecasting competition 2012. 25 | \emph{International Journal of Forecasting}, 30(2), 357-363. 26 | \url{https://doi.org/10.1016/j.ijforecast.2013.07.001}. 27 | } 28 | \keyword{datasets} 29 | -------------------------------------------------------------------------------- /man/gefcom2012_temp.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/data.R 3 | \docType{data} 4 | \name{gefcom2012_temp} 5 | \alias{gefcom2012_temp} 6 | \title{GEFCOM2012 temperature data} 7 | \format{A list of time series data, each of class \code{msts}.} 8 | \source{ 9 | \url{https://www.kaggle.com/c/global-energy-forecasting-competition-2012-load-forecasting}, 10 | \url{http://www.drhongtao.com/gefcom/2012}. 11 | } 12 | \usage{ 13 | gefcom2012_temp 14 | } 15 | \description{ 16 | Data from the GEFCOM2012 forecasting competition, comprising 11 time series containing 17 | hourly temperature data from 11 weather stations in the United States. 18 | } 19 | \examples{ 20 | plot(gefcom2012_temp[[1]]) 21 | } 22 | \references{ 23 | Hong, T., Pinson, P., & Fan, S. (2014). Global energy forecasting competition 2012. 24 | \emph{International Journal of Forecasting}, 30(2), 357-363. 25 | \url{https://doi.org/10.1016/j.ijforecast.2013.07.001}. 26 | } 27 | \keyword{datasets} 28 | -------------------------------------------------------------------------------- /man/gefcom2012_wp.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/data.R 3 | \docType{data} 4 | \name{gefcom2012_wp} 5 | \alias{gefcom2012_wp} 6 | \title{GEFCOM2012 wind power data} 7 | \format{A list of time series data, each of class \code{msts}.} 8 | \source{ 9 | \url{https://www.kaggle.com/c/GEF2012-wind-forecasting/data}, 10 | \url{http://www.drhongtao.com/gefcom/2012}. 11 | } 12 | \usage{ 13 | gefcom2012_wp 14 | } 15 | \description{ 16 | Data from the GEFCOM2012 forecasting competition, comprising 7 hourly time series containing 17 | wind power data from 7 wind farms. Only training data are provided. 18 | The missing data in each series formed the test sets. 19 | } 20 | \examples{ 21 | plot(gefcom2012_wp[[1]]) 22 | } 23 | \references{ 24 | Hong, T., Pinson, P., & Fan, S. (2014). Global energy forecasting competition 2012. 25 | \emph{International Journal of Forecasting}, 30(2), 357-363. 26 | \url{https://doi.org/10.1016/j.ijforecast.2013.07.001}. 27 | } 28 | \keyword{datasets} 29 | -------------------------------------------------------------------------------- /man/nn3.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/data.R 3 | \docType{data} 4 | \name{nn3} 5 | \alias{nn3} 6 | \title{NN3 data} 7 | \format{A list of time series data, each of class \code{ts}.} 8 | \source{ 9 | \url{http://www.neural-forecasting-competition.com/NN3}. 10 | } 11 | \usage{ 12 | nn3 13 | } 14 | \description{ 15 | Data from the NN3 forecasting competition, comprising 111 monthly time series. 16 | Training and test data are combined. In the competition, the last 18 months 17 | were used as test data. Time series NN3-101 to NN3-111 made up the reduced data 18 | set from the competition. 19 | } 20 | \examples{ 21 | plot(nn3[[1]]) 22 | 23 | } 24 | \keyword{datasets} 25 | -------------------------------------------------------------------------------- /man/nn5.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/data.R 3 | \docType{data} 4 | \name{nn5} 5 | \alias{nn5} 6 | \title{NN5 data} 7 | \format{A list of time series data, each of class \code{msts}.} 8 | \source{ 9 | \url{http://www.neural-forecasting-competition.com/NN5}. 10 | } 11 | \usage{ 12 | nn5 13 | } 14 | \description{ 15 | Data from the NN5 forecasting competition, comprising 111 daily time series. 16 | Training and test data are combined. In the competition, the last 56 days 17 | were used as test data. Time series NN5-101 to NN5-111 made up the reduced data 18 | set from the competition. 19 | } 20 | \examples{ 21 | plot(nn5[[1]]) 22 | 23 | } 24 | \keyword{datasets} 25 | -------------------------------------------------------------------------------- /man/nngc1.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/data.R 3 | \docType{data} 4 | \name{nngc1} 5 | \alias{nngc1} 6 | \title{NNGC1 data} 7 | \format{A list of time series data, each of class \code{ts} or \code{msts}.} 8 | \source{ 9 | \url{http://www.neural-forecasting-competition.com/}. 10 | } 11 | \usage{ 12 | nngc1 13 | } 14 | \description{ 15 | Data from the NNGC1 forecasting competition, comprising 11 annual time series, 11 16 | quarterly time series, 11 monthly time series, 11 weekly time series, 11 daily 17 | time series and 11 hourly time series. Only training data are provided. 18 | } 19 | \examples{ 20 | plot(nngc1[[1]]) 21 | 22 | } 23 | \keyword{datasets} 24 | -------------------------------------------------------------------------------- /man/tscompdata.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/tscompdata.R 3 | \docType{package} 4 | \name{tscompdata} 5 | \alias{tscompdata} 6 | \alias{tscompdata-package} 7 | \title{Time Series Competition Data 8 | 9 | The tscompdata package provides time series data from several forecasting competitions.} 10 | \description{ 11 | Time Series Competition Data 12 | 13 | The tscompdata package provides time series data from several forecasting competitions. 14 | } 15 | -------------------------------------------------------------------------------- /pkgdown/extra.css: -------------------------------------------------------------------------------- 1 | h1, .h1 { 2 | font-size: 2rem; 3 | font-weight: 700; 4 | } 5 | 6 | h2, .h2 { 7 | font-size: 1.5rem; 8 | font-weight: 700; 9 | } 10 | 11 | .bg-primary .navbar-nav .show>.nav-link, .bg-primary .navbar-nav .nav-link.active, .bg-primary .navbar-nav .nav-link:hover, .bg-primary .navbar-nav .nav-link:focus { 12 | color: #ffb81c !important; 13 | } 14 | -------------------------------------------------------------------------------- /tscompdata.Rproj: -------------------------------------------------------------------------------- 1 | Version: 1.0 2 | 3 | RestoreWorkspace: No 4 | SaveWorkspace: No 5 | AlwaysSaveHistory: Default 6 | 7 | EnableCodeIndexing: Yes 8 | UseSpacesForTab: Yes 9 | NumSpacesForTab: 2 10 | Encoding: UTF-8 11 | 12 | RnwWeave: Sweave 13 | LaTeX: pdfLaTeX 14 | 15 | AutoAppendNewline: Yes 16 | StripTrailingWhitespace: Yes 17 | 18 | BuildType: Package 19 | PackageUseDevtools: Yes 20 | PackageInstallArgs: --no-multiarch --with-keep.source 21 | PackageRoxygenize: rd,collate,namespace 22 | -------------------------------------------------------------------------------- /vignettes/tscompdata.Rmd: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Introduction to the tscompdata package" 3 | author: "Yangzhuoran Yang" 4 | date: "`r Sys.Date()`" 5 | output: rmarkdown::html_vignette 6 | vignette: > 7 | %\VignetteIndexEntry{Introduction to the tscompdata package} 8 | %\VignetteEngine{knitr::rmarkdown} 9 | %\VignetteEncoding{UTF-8} 10 | --- 11 | 12 | ```{r setup, include = FALSE} 13 | knitr::opts_chunk$set( 14 | collapse = TRUE, 15 | comment = "#>", 16 | fig.align = "center" 17 | ) 18 | ``` 19 | 20 | # tscompdata 21 | 22 | The R package *tscompdata* provides time series data from the following forecasting competitions: M, M3, NN3, NN5, NNGC1, Tourism and GEFCom2012. 23 | 24 | The M, M3 and Tourism data are loaded from the [Mcomp](http://pkg.robjhyndman.com/Mcomp/) and [Tcomp](https://github.com/ellisp/Tcomp-r-package) packages. The remaining data are contained within the tscompdata package. 25 | 26 | ## Installation 27 | 28 | You can install the **development** version from [Github](https://github.com/robjhyndman/tscompdata) with: 29 | 30 | ```{r gh-installation, eval = FALSE} 31 | # install.packages("devtools") 32 | devtools::install_github("robjhyndman/tscompdata") 33 | ``` 34 | 35 | ## Usage 36 | 37 | ```{r} 38 | library(tscompdata) 39 | library(ggplot2) 40 | ``` 41 | 42 | ### NN3 data 43 | 44 | Data from the [NN3 forecasting competition](http://www.neural-forecasting-competition.com/NN3), comprising 111 monthly time series each of class `ts`. 45 | 46 | Training and test data are combined. In the competition, the last 18 months 47 | were used as test data. Time series NN3-101 to NN3-111 made up the reduced data 48 | set from the competition. 49 | 50 | ```{r nn3} 51 | head(nn3[[1]]) 52 | autoplot(nn3[[1]]) 53 | ``` 54 | 55 | ### NN5 data 56 | 57 | Data from the [NN5 forecasting competition](http://www.neural-forecasting-competition.com/NN5), comprising 111 daily time series each of lass `msts`. 58 | 59 | Training and test data are combined. In the competition, the last 56 days 60 | were used as test data. Time series NN5-101 to NN5-111 made up the reduced data 61 | set from the competition. 62 | 63 | ```{r nn5} 64 | head(nn3[[2]]) 65 | autoplot(nn5[[2]]) 66 | ``` 67 | 68 | ### NNGC1 data 69 | 70 | Data from the [NNGC1 forecasting competition](http://www.neural-forecasting-competition.com/), comprising 11 annual time series, 11 quarterly time series, 11 monthly time series, 11 weekly time series, 11 daily time series and 11 hourly time series each of class `ts` or `msts`. Only training data are provided. 71 | 72 | ```{r} 73 | head(nngc1[[3]]) 74 | autoplot(nngc1[[3]]) 75 | ``` 76 | 77 | ### GEFCOM2012 load data 78 | 79 | Data from the [GEFCOM2012 forecasting competition](http://www.drhongtao.com/gefcom/2012) which was hosted on the [kaggle platform](https://www.kaggle.com/c/global-energy-forecasting-competition-2012-load-forecasting). The data comprise 20 time series containing hourly load data from 20 zones in the United States, each of class `msts`. Only training data are provided. 80 | The missing data in each series formed the test sets. 81 | 82 | ```{r} 83 | head(gefcom2012_load[[4]]) 84 | autoplot(gefcom2012_load[[4]]) 85 | ``` 86 | 87 | ### GEFCOM2012 temperature data 88 | 89 | Data from the [GEFCOM2012 forecasting competition](http://www.drhongtao.com/gefcom/2012) which held on the [kaggle platform](https://www.kaggle.com/c/global-energy-forecasting-competition-2012-load-forecasting). The data comprise 11 time series containing hourly temperature data from 11 weather stations in the United States, each of class `msts`. 90 | 91 | ```{r} 92 | head(gefcom2012_temp[[5]]) 93 | autoplot(gefcom2012_temp[[5]]) 94 | ``` 95 | 96 | ### GEFCOM2012 wind power data 97 | 98 | Data from the [GEFCOM2012 forecasting competition](http://www.drhongtao.com/gefcom/2012) which held on the [kaggle platform](https://www.kaggle.com/c/GEF2012-wind-forecasting/data). The data comprise 7 hourly time series containing wind power data from 7 wind farms, each of class `msts`. Only training data are provided. 99 | The missing data in each series formed the test sets. 100 | 101 | ```{r} 102 | head(gefcom2012_wp[[6]]) 103 | autoplot(gefcom2012_wp[[6]]) 104 | ``` 105 | 106 | ### Mcomp: M1 data 107 | 108 | The 1001 time series from the M competition, taken from demography, industry and economics, and ranging in length between 9 and 132 observations. All the data were either non-seasonal (e.g., annual), quarterly or monthly. All the data were positive, which made it possibly to compute mean absolute percentage errors, but is not really reflective of the population of real data. 109 | 110 | `M1` is of class `Mcomp` with each time series of class `Mdata`. The function `subset` inherited from the [Mcomp](http://pkg.robjhyndman.com/Mcomp/) package can return a subset specified by periods, or types of data or both. See the [Mcomp](http://pkg.robjhyndman.com/Mcomp/) package for more details. 111 | 112 | ```{r fig.width = 5, fig.height = 3} 113 | M1 114 | autoplot(M1[[7]]) 115 | subset(M1,"monthly") 116 | ``` 117 | 118 | The 111 series used in the extended comparisons in the 1982 M-competition can be selected as follows. 119 | 120 | ```{r} 121 | subset(M1,111) 122 | ``` 123 | 124 | The data in the [Mcomp](http://pkg.robjhyndman.com/Mcomp/) and [Tcomp](https://github.com/ellisp/Tcomp-r-package) packages are in the `Mcomp` class which contains various information used in the competitions including the training and test portions of the time series. The function `combine_training_test` combines the training data and test data into a single `ts` object. 125 | 126 | ```{r} 127 | m1ts <- combine_training_test(M1) 128 | ``` 129 | 130 | ### Mcomp: M3 data 131 | 132 | The time series from the M3 forecasting competition and the forecasts from all the original participating methods are stored in `M3` and `M3Forecast`. `M3` is a list of 3003 series of class `Mcomp`. Each series within M3 is of class `Mdata`. `M3Forecast` is a list of data.frames. See the [Mcomp](http://pkg.robjhyndman.com/Mcomp/) package for more details. 133 | 134 | ```{r fig.width = 5, fig.height = 3} 135 | M3 136 | autoplot(M3[[8]]) 137 | subset(M3, "macro") 138 | ``` 139 | 140 | ### Tcomp: tourism forecasting competition data 141 | 142 | Data from the [tourism forecasting competition](https://robjhyndman.com/publications/the-tourism-forecasting-competition/) described in Athanasopoulos, Hyndman, Song and Wu (2011). 143 | 144 | `tourism` is a list of 1,311 series of class `Mcomp`, and each individual series is an element of class `Mdata`. See the [Tcomp](https://github.com/ellisp/Tcomp-r-package) package for more details. 145 | 146 | ```{r fig.width = 5, fig.height = 3} 147 | tourism 148 | autoplot(tourism[[9]]) 149 | ``` 150 | 151 | ## Sources 152 | 153 | [Hong, T., Pinson, P., & Fan, S. (2014). Global energy forecasting competition 2012. **International Journal of Forecasting**, 30(2), 357-363.](https://doi.org/10.1016/j.ijforecast.2013.07.001) 154 | 155 | [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.](http://doi.org/10.1002/for.3980010202) 156 | 157 | [Makridakis and Hibon (2000) The M3-competition: results, conclusions and implications. *International Journal of Forecasting*, **16**, 451-476.](https://doi.org/10.1016/S0169-2070(00)00057-1) 158 | 159 | [George Athanasopoulos, Rob J. Hyndman, Haiyan Song, Doris C. Wu, The tourism forecasting competition, *International Journal of Forecasting*, Volume **27**, Issue 3, 2011, Pages 822-844, ISSN 0169-2070.](https://doi.org/10.1016/j.ijforecast.2010.04.009) 160 | 161 | ## License 162 | 163 | This package is free and open source software, licensed under GPL-3. 164 | --------------------------------------------------------------------------------