LogPSplinePSD
LogPSplinePSD estimates power spectral densities (PSDs) with Bayesian log-P-splines. It supports univariate and multivariate time series, fits smooth spectral matrices with NumPyro/JAX, and returns PSDResult outputs with ArviZ-compatible xarray.DataTree posteriors.
Highlights
Log-domain P-spline models for positive PSDs.
Multivariate Wishart likelihoods for spectral matrices.
VI warm starts and factorised multivariate NUTS.
Optional frequency-domain coarse graining.
Scalar time-varying fits from WDM and moving-periodogram powers.
Posterior PSD quantiles, coherence summaries, and diagnostic plots.
Install
For development, use the repository virtual environment:
source .venv/bin/activate
python -m pip install -e '.[dev]'
For package use:
python -m pip install LogPSplinePSD
Five-Minute Example
from log_psplines import StationaryConfig, fit
from log_psplines.example_datasets import VARMAData
data = VARMAData.ar(order=4, n_samples=8192, fs=64.0, seed=7)
result = fit(
data.ts,
StationaryConfig(
n_knots=16,
knot_kwargs={"method": "density"},
vi_steps=200,
n_warmup=100,
n_samples=200,
rng_key=7,
true_psd=data.get_true_psd(),
),
)
frequency = result.frequency
psd_draws = result.psd
Next Steps
Follow the univariate example.
Explore the multivariate example.
Try the time-varying example.
Read the spectral conventions.
Architecture
See the development notes for the shared scalar/matrix model and time-frequency evaluation. Scalar time-varying power inference is available through fit(). Multivariate time-varying inference is not yet implemented.
Documentation
Build the docs locally with:
source .venv/bin/activate
.venv/bin/jupyter-book build docs
The public docs focus on package usage, configuration, outputs, API reference, and implementation notes. Domain-specific examples are intentionally kept out of the main docs for now and can be added later as separate studies.
References
Eilers, P. H. C., & Marx, B. D. (1996). Flexible smoothing with B-splines and penalties. Statistical Science, 11(2), 89-121.
Maturana-Russel, J., & Meyer, R. (2021). P-spline spectral density estimation with a discrete penalty. arXiv:1905.01832.
Vajpeyi, A., Meyer, R., Maturana-Russel, P., & Liu, J. (2026). Multivariate Bayesian P-spline estimation of spectral density matrices, with application to LISA TDI noise. arXiv:2607.04833. DOI:10.48550/arXiv.2607.04833.
Metadata
Release files for LogPSplinePSD 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| logpsplinepsd-0.2.0.tar.gz | 4.5 MB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| logpsplinepsd-0.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 4.6 MB
Release files / logpsplinepsd-0.2.0.tar.gz
| Download URL | logpsplinepsd-0.2.0.tar.gz |
|---|---|
| Size | 4.5 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
fe276e30f148a44287f9a7162ef8b8a714b081e4c0a5878f0a3d95aed65a5a1d
|
|
BLAKE2b-256 checksum How to use checksums |
c1d1b37d743ecb40eaedd39b69f6c283d64cb75742067e872b6de6c63856bfba
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.0.1 CPython/3.12.8
|
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 Oct 1, 2026.
Transparency logRelease files / logpsplinepsd-0.2.0-py3-none-any.whl
| Download URL | logpsplinepsd-0.2.0-py3-none-any.whl |
|---|---|
| Size | 128.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d9d1b518126f255982cc67de229950d95ffcc46f8e1b7b01c23ea3e4b348f25c
|
|
BLAKE2b-256 checksum How to use checksums |
ea131579e50940323a606fc87667adf1ee950af3940965f4fdad97e3834d4c0a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.0.1 CPython/3.12.8
|
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 Oct 1, 2026.
Transparency log