{"id":13474459,"url":"https://github.com/xqnwang/darima","last_synced_at":"2026-01-06T10:13:39.692Z","repository":{"id":45835907,"uuid":"276029954","full_name":"xqnwang/darima","owner":"xqnwang","description":"Distributed ARIMA Models","archived":false,"fork":false,"pushed_at":"2022-10-17T01:09:21.000Z","size":6083,"stargazers_count":26,"open_issues_count":0,"forks_count":24,"subscribers_count":7,"default_branch":"master","last_synced_at":"2024-10-30T07:47:55.101Z","etag":null,"topics":["arima","distributed-computing","spark","time-series-forecasting"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/xqnwang.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-06-30T07:33:48.000Z","updated_at":"2024-10-20T04:19:32.000Z","dependencies_parsed_at":"2023-01-20T06:02:56.011Z","dependency_job_id":null,"html_url":"https://github.com/xqnwang/darima","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xqnwang%2Fdarima","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xqnwang%2Fdarima/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xqnwang%2Fdarima/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xqnwang%2Fdarima/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xqnwang","download_url":"https://codeload.github.com/xqnwang/darima/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245738674,"owners_count":20664326,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["arima","distributed-computing","spark","time-series-forecasting"],"created_at":"2024-07-31T16:01:12.511Z","updated_at":"2026-01-06T10:13:39.653Z","avatar_url":"https://github.com/xqnwang.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"# `darima`\n\nDistributed ARIMA Models implemented with Apache Spark\n\n# Introduction\n\nDARIMA is designed to facilitate forecasting ultra-long time series by utilizing the industry-standard MapReduce framework. The algorithm is developed on Spark platform and both Python as well as R interfaces.\n\nSee [`darima`](darima) for developed functions used for implementing DARIMA models.\n- [`model.py`](darima/model.py) : Train ARIMA models for each subseries and convert the trained models into AR representations (Mapper).\n- [`dlsa.py`](darima/dlsa.py) : Combine the local estimators obtained in Mapper by minimizing the global loss function (Reducer).\n- [`forecast.py`](darima/forecast.py) : Forecast the next H observations by utilizing the combined estimators.\n- [`evaluation.py`](darima/evaluation.py) : Calculate the forecasting accuracy in terms as MASE, sMAPE and MSIS.\n- [`R`](darima/R) : R functions designed for modeling, combining and forecasting. [rpy2](https://pypi.org/project/rpy2/) is needed as an interface to use R from Python.\n\n# System requirements\n\n- `Spark \u003e= 2.3.1`\n- `Python \u003e= 3.7.0`\n    - `pyspark \u003e= 2.3.1`\n    - `rpy2 \u003e= 3.0.4`\n    - `scikit-learn \u003e= 0.21.2`\n    - `numpy \u003e= 1.16.3`\n    - `pandas \u003e= 0.23.4`\n- `R \u003e= 3.5.2`\n    - `forecast \u003e= 8.5`\n    - `polynom = 1.3.9`\n    - `dplyr \u003e= 0.8.4`\n    - `quantmod \u003e= 0.4.13`\n    - `magrittr \u003e= 1.5`\n\n# Usage\n\n## DARIMA\nRun the [PySpark](https://spark.apache.org/docs/latest/api/python/index.html) code to forecast the time series of the GEFCom2017 by utilizing DARIMA.\n\n```sh\n  ./bash/run_darima.sh\n```\nor simply run\n```py\n  PYSPARK_PYTHON=/usr/local/bin/python3.7 ARROW_PRE_0_15_IPC_FORMAT=1 spark-submit ./run_darima.py\n```\n**Note**: `ARROW_PRE_0_15_IPC_FORMAT=1` is added to instruct `PyArrow \u003e= 0.15.0` to use the legacy IPC format with the older Arrow Java that is in Spark 2.3.x and 2.4.x.\n\n## ARIMA\nRun the R code to forecast the time series of the GEFCom2017 by utilizing the `auto.arima()` function (used for comparison).\n```sh\n  ./bash/auto_arima.sh\n```\nor simply run\n```r\n  Rscript auto_arima.R\n```\n\n# References\n\n- [Xiaoqian Wang](https://xqnwang.rbind.io), [Yanfei Kang](https://yanfei.site), [Rob J Hyndman](https://robjhyndman.com), \u0026 [Feng Li](https://feng.li/) (2022) Distributed ARIMA models for ultra-long time series. International Journal of Forecasting [DOI: 10.1016/j.ijforecast.2022.05.001](https://doi.org/10.1016/j.ijforecast.2022.05.001).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxqnwang%2Fdarima","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxqnwang%2Fdarima","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxqnwang%2Fdarima/lists"}