Skip to main content

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

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 1.1.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 LogPSplinePSD 1.1.0
File Size Uploaded Provenance Actions
logpsplinepsd-1.1.0.tar.gz 5.0 MB With provenance Details for logpsplinepsd-1.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for LogPSplinePSD 1.1.0
File Interpreter ABI Platform Actions
logpsplinepsd-1.1.0-py3-none-any.whl Python 3 none any Details for logpsplinepsd-1.1.0-py3-none-any.whl

Total release size: 5.1 MB

Release files / logpsplinepsd-1.1.0.tar.gz

Download URL logpsplinepsd-1.1.0.tar.gz
Size 5.0 MB
Tags Source
SHA-256 checksum
How to use checksums
6a75da61d8dad7d6ac541060184a5104f92775dfa9a8dc762e282020884780e0
BLAKE2b-256 checksum
How to use checksums
42cbfbbe3c26a8c908206ccfd47b3e9ae88ba14c0e7f2ac68504a76ec6f0b5ed
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 Nov 5, 2026.

Transparency log

Release files / logpsplinepsd-1.1.0-py3-none-any.whl

Download URL logpsplinepsd-1.1.0-py3-none-any.whl
Size 156.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0f4e0c3706a8a79828d43416f94924740c61d623c8bbbcf7cdd201381af4b186
BLAKE2b-256 checksum
How to use checksums
e31a4af5aba08f8d0ec5af19a962479098a09f03e69b5e905168155b10339500
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 Nov 5, 2026.

Transparency log

Security for LogPSplinePSD 1.1.0

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.

Select from 2 files

Attestation for logpsplinepsd-1.1.0.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 Nov 5, 2026.

Transparency log

A 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.

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