Skip to main content

tsecon

High-performance time series econometrics: a Rust core with a Python-first API.

Pre-1.0 software under active development. The name is settled — tsecon is what you install and import — but the API may still change before 1.0.

tsecon brings the scattered toolkit of modern time series econometrics — diagnostics and specification tests, ARIMA, GARCH, VARs and structural identification, local projections, Bayesian VARs, nowcasting, predictive regressions, panels, the term structure — into one fast, validated, Python-first library. The compute core is written from scratch in Rust (no BLAS, no heavy dependencies) so bootstrap inference and Monte Carlo work that is painfully slow elsewhere runs in seconds, with results bit-reproducible at any thread count.

Every estimator is validation-gated: its numbers are checked against a reference implementation (statsmodels, SciPy, NumPy, arch, linearmodels, scikit-learn, ArviZ) or a documented closed form before it ships, and a cross-library parity gate re-verifies the agreement in CI on every push. The library ships no data loaders and makes no network calls — the only runtime dependency is NumPy.

Install

pip install tsecon

A single self-contained wheel whose only runtime dependency is NumPy — no Rust toolchain, no system BLAS. Prebuilt wheels cover Linux (x86_64, aarch64), macOS on Apple Silicon (arm64), and Windows (x64), for every Python >= 3.9. Plotting is an optional extra:

pip install 'tsecon[plots]'    # adds matplotlib for the .plot_*() methods

Then check what you got:

import tsecon
print(tsecon.__version__)   # 0.2.0

There is no prebuilt wheel for Intel macOS (x86_64); on that platform, and for building from a checkout, pip compiles from the source distribution, which needs a Rust toolchain and Python >= 3.9. Contributors build with maturin:

pip install maturin
maturin develop --release -m bindings/python/Cargo.toml   # builds + installs into the active venv

A taste

import numpy as np
import tsecon

rng = np.random.default_rng(0)
y = np.cumsum(rng.standard_normal(300))          # a random walk

tsecon.check_stationarity(y)["recommendation"]   # -> "Difference"

# Fit a VAR, read off impulse responses, decompose the variance
data = rng.standard_normal((200, 3))
irf  = tsecon.var_irf(data, lags=2, horizon=16)          # [h][response][shock]
fevd = tsecon.var_fevd(data, lags=2, horizon=16)   # [h][variable][shock]

# Robust SEs, exact-MLE ARIMA with a forecast fan, GARCH with robust SEs,
# instrumented local projections, a fiscal multiplier, a Bayesian VAR...
tsecon.ols(y, X, se_type="hac")
tsecon.arima_fit(y, p=1, d=1, q=1, forecast_steps=12, conf_alpha=0.1)
tsecon.garch_fit(returns, vol="gjr", dist="t")
tsecon.lp_multiplier(y_out, spending, instrument, horizons=20)
tsecon.bvar_irf_draws(data, lags=2, horizon=12, n_draws=800)

Every function takes plain NumPy arrays and returns arrays or dicts of documented keys. An opt-in tsecon.results layer wraps the same calls in objects that render themselves (.summary(), .plot_irf()) without changing the dict contract.

What's here today

126 functions across the full applied workflow: the diagnostic battery and unit-root workflow (ADF, KPSS, check_stationarity, and the one-call check_series battery with model recommendations); specification and stability tests (White, Breusch-Pagan, RESET, Chow, CUSUM); robust and HAC standard errors; the bootstrap family; an exact-diffuse Kalman filter; ARIMA, GARCH/GJR/EGARCH, and GAS score-driven volatility; VAR/SVAR with sign-restricted identification, FAVAR, and Diebold-Yilmaz connectedness; local projections (lag-augmented, LP-IV, state-dependent, and the Ramey-Zubairy integral multiplier); a Minnesota-NIW Bayesian VAR; GMM and IV-GMM; predictive regressions with IVX inference; heterogeneous panels (mean group, CCE-MG, PMG); cointegration and Markov switching; MIDAS and DFM nowcasting with a news decomposition; multivariate GARCH; realized volatility; spectral analysis; long memory; recession-probability models; survey-expectations tools; the Nelson-Siegel/Svensson term structure with the arbitrage-free (AFNS) adjustment; and a linear rational-expectations (DSGE-lite) solver.

The library ships with complete type stubs (py.typed), so autocomplete and type checking work out of the box.

Learn more

The full documentation — a 15-chapter guide to time series econometrics, model cards for every estimator family, a worked figure gallery, two replications of published results, a Monte Carlo validation suite, and an honest benchmark harness — lives in the project repository.

License

MIT OR Apache-2.0.

Download files

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

Source Distribution

tsecon-0.6.0.tar.gz (2.0 MB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

tsecon-0.6.0-cp39-abi3-win_amd64.whl (4.8 MB view details)

Uploaded CPython 3.9+Windows x86-64

tsecon-0.6.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (5.4 MB view details)

Uploaded CPython 3.9+manylinux: glibc 2.17+ x86-64

tsecon-0.6.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (4.5 MB view details)

Uploaded CPython 3.9+manylinux: glibc 2.17+ ARM64

tsecon-0.6.0-cp39-abi3-macosx_11_0_arm64.whl (4.1 MB view details)

Uploaded CPython 3.9+macOS 11.0+ ARM64

File details

Details for the file tsecon-0.6.0.tar.gz.

File metadata

  • Download URL: tsecon-0.6.0.tar.gz
  • Upload date:
  • Size: 2.0 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for tsecon-0.6.0.tar.gz
Algorithm Hash digest
SHA256 e64bb3c5ed8335014f2188b2fad5e191544d8aaf524851aaaa4c95396e3fef57
MD5 d3a600419bb66b993d071686ec868797
BLAKE2b-256 0684ee8d54a103d376f6cee9cb10b655cdf8c02df37559eeeafa67b216b576be

See more details on using hashes here.

Provenance

The following attestation bundles were made for tsecon-0.6.0.tar.gz:

Publisher: release.yml on cacoleman16/tsecon

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file tsecon-0.6.0-cp39-abi3-win_amd64.whl.

File metadata

  • Download URL: tsecon-0.6.0-cp39-abi3-win_amd64.whl
  • Upload date:
  • Size: 4.8 MB
  • Tags: CPython 3.9+, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for tsecon-0.6.0-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 f9e0cd4be9f3edbdb820ece65e8391406b123eb07173aec4d2fcbdf6a1f97de3
MD5 95f2b7dc5a7fd7acb70d9b4ba20a4161
BLAKE2b-256 f3c75c66533348709c49a9be481e4613a3c8f5675502a970f170e73a51b459d8

See more details on using hashes here.

Provenance

The following attestation bundles were made for tsecon-0.6.0-cp39-abi3-win_amd64.whl:

Publisher: release.yml on cacoleman16/tsecon

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file tsecon-0.6.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for tsecon-0.6.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 4fcc3c95a0709b9460182e55cdf1abbdf6c148386a20025bb16806e6ae0d843e
MD5 cb7d3a6d994af1a34d5348a9bc190c83
BLAKE2b-256 198d8ee89b110f3c9b1e8beb16c88bda1268fc7b8868d0d456c9a953b04c0342

See more details on using hashes here.

Provenance

The following attestation bundles were made for tsecon-0.6.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: release.yml on cacoleman16/tsecon

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file tsecon-0.6.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for tsecon-0.6.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 90d38315d0a9d790d311d4fc634093c1ca290bd6eb065f1feb74ba3d7d517760
MD5 a4785a5371835d8bbe461fbc174b6b85
BLAKE2b-256 a7d8cb75d237bc4bbb7a8c1c85a6fa00ea04afcffa4c2c56eef9c928da100ed7

See more details on using hashes here.

Provenance

The following attestation bundles were made for tsecon-0.6.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: release.yml on cacoleman16/tsecon

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file tsecon-0.6.0-cp39-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for tsecon-0.6.0-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 b6f53a79cea923f2268d8dd2f72e4a2f1c1d946f345b7f22a29b15c1919f7a50
MD5 d0ffd8aff18f3f4089974c6eba7a59ac
BLAKE2b-256 64422abb5964d04f97188e6a64c2a1d8764d042bf5a09640033128c1aa284236

See more details on using hashes here.

Provenance

The following attestation bundles were made for tsecon-0.6.0-cp39-abi3-macosx_11_0_arm64.whl:

Publisher: release.yml on cacoleman16/tsecon

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.6.0 This release

5 files

0.5.0

5 files

0.4.0

5 files

0.3.0

5 files

0.2.0

5 files

0.1.0

5 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page