Skip to main content

pymgarch

CI/CD PyPI Python Downloads codecov Docs License: MIT

Multivariate GARCH for Python: DCC, ADCC, and CCC correlation dynamics built on top of arch univariate marginals, validated against R's rmgarch/tsmarch.

Why

Python has no maintained general-purpose multivariate GARCH framework. The existing packages cover Gaussian DCC(1,1) at most, while R users have had DCC, ADCC, GO-GARCH and copula-GARCH in rmgarch (now tsmarch) for a decade. pymgarch closes that gap incrementally, starting with the correlation layer:

  • stage 1 (univariate volatility) is delegated to arch, the ecosystem's dominant, battle-tested GARCH package;
  • stage 2 (correlation dynamics) is what this library implements, with correct two-stage Engle-Sheppard standard errors and replication tests against rmgarch's fitted parameters and likelihoods.

Install

pip install pymgarch          # or: pip install pymgarch[numba]

The optional numba extra JIT-compiles the correlation recursions; without it everything runs in pure NumPy.

Quickstart

import pymgarch as mg

# returns: (T, N) DataFrame, percent scale recommended
res = mg.DCC(dist="t").fit(returns)
print(res.summary())

res.conditional_correlations   # (T, N, N)
res.conditional_covariances    # (T, N, N)

fc = res.forecast(horizon=10)                    # analytic
fc = res.forecast(horizon=10, method="simulation", n_paths=2000)
flt = res.filter(new_returns)                    # fixed params, new data

Marginals default to constant-mean GARCH(1,1). Customize per-column via a spec, or bring your own fitted arch results:

spec = mg.UnivariateSpec(vol="GARCH", p=1, o=1, q=1, dist="t")  # GJR-t
res = mg.ADCC().fit(returns, marginals=spec)

from arch import arch_model
fitted = [arch_model(returns[c], rescale=False).fit(disp="off") for c in returns]
res = mg.DCC().fit(returns, marginals=fitted)

Models (v0.1)

Model Distribution Estimation
CCC (Bollerslev 1990) Gaussian closed form given marginals
DCC(1,1) (Engle 2002) Gaussian, Student-t two-stage QML, correlation targeting
ADCC (Cappiello-Engle-Sheppard 2006) Gaussian, Student-t two-stage QML, PSD-constrained targeting
GO-GARCH (van der Weide 2002) Gaussian or t factors fastICA rotation + univariate factor fits
Copula-GARCH (Patton 2006) Gaussian or t copula, static or DCC two-stage QML, parametric or empirical margins

Standard errors are Engle-Sheppard (2001) two-stage sandwich estimates: the marginal and correlation scores are stacked so stage-2 uncertainty reflects stage-1 estimation error. Correlation targets are held fixed (same approximation rmgarch makes). If the stacked system is singular the library falls back to a stage-2-only sandwich and says so in summary().

Roadmap

  • v0.4: composite likelihood for large cross-sections, scalar/diagonal BEKK

License

MIT

Release files for pymgarch 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pymgarch 0.3.0
File Size Uploaded
pymgarch-0.3.0.tar.gz 717.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pymgarch 0.3.0
File Interpreter ABI Platform
pymgarch-0.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 754.1 kB

Release files / pymgarch-0.3.0.tar.gz

Download URL pymgarch-0.3.0.tar.gz
Size 717.5 kB
Tags Source
SHA-256 checksum
How to use checksums
1e209d19fa0a7362c0b0d637d0622db03ea970929fdf143e0c2167db7c2bd77f
BLAKE2b-256 checksum
How to use checksums
594165453709199913d58995a85d44358a22b1ed1f05339dcd75559704883360
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 20, 2026.

Transparency log

Release files / pymgarch-0.3.0-py3-none-any.whl

Download URL pymgarch-0.3.0-py3-none-any.whl
Size 36.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c8876794c3fb3df54278611526a91ba1b0f1ba6e6493340a0839cd3f6956434b
BLAKE2b-256 checksum
How to use checksums
a977f327cbb7c2033ac8da390eb75e190ed23311d61a427c50abbf3ab5b57df3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 20, 2026.

Transparency log

Release history Release notifications | RSS feed

0.4.0

2 release files

This release

0.3.0 This release

2 release files

0.2.0

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release 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