This release is a pre-release and may not be stable for production use.
connectedness
Diebold-Yilmaz connectedness and volatility spillover indices in Python.
connectedness turns a panel of asset prices into a fully reproducible spillover
analysis: realized covariance and semicovariance matrices, optional PIT
normality transform, MHAR-LASSO dynamics, generalized FEVD (Koop-Pesaran-Shin),
and the static and rolling-window spillover indices of Diebold and Yilmaz.
Status
Alpha. The API may change before 1.0.0.
Installation
pip install connectedness # core
pip install connectedness[plots] # + matplotlib helpers
pip install connectedness[parallel] # + joblib/tqdm for rolling windows
pip install connectedness[io] # + pyarrow for parquet I/O
Quickstart
import pandas as pd
from connectedness import SpilloverPipeline
# wide DataFrame: DatetimeIndex (intraday) × markets
prices = pd.read_parquet("prices.parquet")
result = (
SpilloverPipeline(prices)
.compute_returns()
.compute_realized_measures()
.auto_pit()
.fit_static()
.fit_rolling(window=365)
.run()
)
print(result.tsi) # total spillover index (%)
print(result.directional_to) # contributions TO others
print(result.directional_from) # contributions FROM others
print(result.rolling_tsi) # rolling TSI time series
For the underlying primitives:
from connectedness import (
simple_returns,
realized_covariance,
realized_semicov,
pit_transform,
static_spillover,
rolling_spillover,
)
Methodology
See docs/methodology.md for the formal definitions
of realized (semi)covariance, the MHAR-LASSO specification, the generalized
variance decomposition, and the Diebold-Yilmaz total / directional /
net spillover indices.
Related Packages and References
connectedness focuses on an end-to-end realized-measure pipeline: intraday
returns to realized covariance and semicovariance, optional PIT normalization,
MHAR-LASSO dynamics, generalized FEVD, and static or rolling Diebold-Yilmaz
indices. For a lighter-weight package focused on generalized FEVD and
connectedness tables from supplied VAR inputs, see
diebold-yilmaz.
Selected references:
- Diebold, F. X. and Yilmaz, K. (2012). Better to give than to receive: Predictive directional measurement of volatility spillovers. International Journal of Forecasting 28(1), 57-66.
- Diebold, F. X. and Yilmaz, K. (2014). On the network topology of variance decompositions: Measuring the connectedness of financial firms. Journal of Econometrics 182(1), 119-134.
- Diebold, F. X. and Yilmaz, K. (2023). On the past, present, and future of the Diebold-Yilmaz approach to dynamic network connectedness. Journal of Econometrics 234(S), 115-120.
- Koop, G., Pesaran, M. H. and Potter, S. M. (1996). Impulse response analysis in nonlinear multivariate models. Journal of Econometrics 74(1), 119-147.
- Pesaran, M. H. and Shin, Y. (1998). Generalized impulse response analysis in linear multivariate models. Economics Letters 58, 17-29.
- Corsi, F. (2009). A simple approximate long-memory model of realized volatility. Journal of Financial Econometrics 7(2), 174-196.
- Audrino, F. and Knaus, S. D. (2016). Lassoing the HAR model: A model selection perspective on realized volatility dynamics. Econometric Reviews 35(8-10), 1485-1521.
- Bollerslev, T., Li, J., Patton, A. J. and Quaedvlieg, R. (2020). Realized semicovariances. Econometrica 88(4), 1515-1551.
- Chanatasig-Niza, E., Ciarreta, A. and Zarraga, A. (2022). A volatility spillover analysis with realized semi(co)variances in Australian electricity markets. Energy Economics 111, 106076.
- Apergis, N., Barunik, J. and Lau, M. C. K. (2017). Good volatility, bad volatility: What drives the asymmetric connectedness of Australian electricity markets? Energy Economics 66, 108-115.
- Lyu, C., Do, H. X., Nepal, R. and Jamasb, T. (2024). Volatility spillovers and carbon price in the Nordic wholesale electricity markets. Energy Economics 134, 107559.
Citation
@software{connectedness,
author = {Rolotti, Francisco},
title = {connectedness: Diebold-Yilmaz spillover indices in Python},
year = {2026},
url = {https://github.com/franrolotti/connectedness}
}
See also CITATION.cff.
License
MIT. See LICENSE.
Metadata
Release files for connectedness 0.1.0a2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| connectedness-0.1.0a2.tar.gz | 19.2 kB | With provenance | Details for connectedness-0.1.0a2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| connectedness-0.1.0a2-py3-none-any.whl | Python 3 | none | any | Details for connectedness-0.1.0a2-py3-none-any.whl |
Total release size: 38.9 kB
Release files / connectedness-0.1.0a2.tar.gz
| Download URL | connectedness-0.1.0a2.tar.gz |
|---|---|
| Size | 19.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7568675a3aba70213b52492e9631694df17f802321c18b37378e708e9ffe6d97
|
|
BLAKE2b-256 checksum How to use checksums |
3a9cd730ded5712feef57c24e85d914c0ad26eba97bb7cdbe842e11cb2bdea2f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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 May 31, 2026.
Transparency logRelease files / connectedness-0.1.0a2-py3-none-any.whl
| Download URL | connectedness-0.1.0a2-py3-none-any.whl |
|---|---|
| Size | 19.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
75dbd036b683c6cf7ba521401555721e837e38be3cdad92f5f8ed1838289d69d
|
|
BLAKE2b-256 checksum How to use checksums |
70040836d8b9c4f047588bdc863136710c37397f4e797b45856fb1108b3d75f4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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 May 31, 2026.
Transparency logSecurity for connectedness 0.1.0a2
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.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for connectedness-0.1.0a2.tar.gz
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 May 31, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.