Skip to main content

Statistical tools for converting low frequency time series data to higher frequencies

Project description

tsdisagg

Tools for converting low time series data to high frequency, based on the R package tempdisagg, and espeically the accompanying paper by Sax and Steiner 2013.

tsdisagg allows the user to convert low frequency time series data (e.g., yearly or quarterly) to a higher frequency (e.g., quarterly or monthly) in a way that preserves desired aggregate statistics in the high frequency data. It should, for example, sum back to the original low-frequency data.

In addition, regression-based methods are also implemented that allow the user to supply "indicator series", allowing variation from correlated high-frequency time series to be imputed into the low frequency data.

If you have any questions or issues, please open a thread. Pull requests to add features or fix bugs are welcome. Please clone the repository locally to have access to the testing suite.

Installation

To install, use pip install tsdisagg

Current Features

Currently, only conversion between yearly, quarterly, and monthly data is supported. Conversion to lower frequencies is non-trivial due to the calendar math that needs to be added, but this is on my to-do list.

The following interpolation methods have been implemented:

Single series, non-parametric methods:

  • Denton
  • Denton-Cholette

Multiseries, regression-based methods:

  • Chow-Lin
  • Litterman

Examples

For example usage, please see the examples.ipynb notebook. tsdisagg depends heavily on pandas to handle time reindexing, so the user is advised to read the associated Pandas documentation, especially as it relates to setting frequencies.

To-do:

  1. Refactor codebase to use statsmodels model and results objects, as well as .fit() api
  2. Add missing interpolation methods relative to timedisagg (Fernandez, min RSS objective functions)
  3. Add support for finer time frequencies (weekly, daily, hourly)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tsdisagg-1.3.tar.gz (13.6 kB view details)

Uploaded Source

Built Distribution

tsdisagg-1.3-py3-none-any.whl (12.4 kB view details)

Uploaded Python 3

File details

Details for the file tsdisagg-1.3.tar.gz.

File metadata

  • Download URL: tsdisagg-1.3.tar.gz
  • Upload date:
  • Size: 13.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.9

File hashes

Hashes for tsdisagg-1.3.tar.gz
Algorithm Hash digest
SHA256 4223b7f1a488a806d9ddf9dfbc2e6eec5aa69d6bd868da83d3ff671c846965c9
MD5 b1ec96f957c298fcda8341066dad9fdb
BLAKE2b-256 af3cc96fcf5a369b776f18e4d5269ab5f0c0b45272810c957bfd5fd57f845f2d

See more details on using hashes here.

File details

Details for the file tsdisagg-1.3-py3-none-any.whl.

File metadata

  • Download URL: tsdisagg-1.3-py3-none-any.whl
  • Upload date:
  • Size: 12.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.9

File hashes

Hashes for tsdisagg-1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 dcb88b6aba5a49b1046ee286007646c95654873101cf3ae23a0bb40da781a638
MD5 1ec2080d5e150e09051dbd0bae809af7
BLAKE2b-256 53dc604ac58f48340bb77df8c066844e99e7b1cb6898efcb01b26bb317b1e2d5

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page