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.0.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.0.0
File Size Uploaded Provenance Actions
logpsplinepsd-1.0.0.tar.gz 4.7 MB With provenance Details for logpsplinepsd-1.0.0.tar.gz

Built distribution (wheel)

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

Total release size: 4.8 MB

Release files / logpsplinepsd-1.0.0.tar.gz

Download URL logpsplinepsd-1.0.0.tar.gz
Size 4.7 MB
Tags Source
SHA-256 checksum
How to use checksums
274a35c5c6cda9f29c27e15335fe934dace99ca7c73ac8f50a8c2226fbec674f
BLAKE2b-256 checksum
How to use checksums
bee60cdf048117a2839f9a1b8db6e5a9165e024a7ca84ae67f80981d71e393d0
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 29, 2026.

Transparency log

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

Download URL logpsplinepsd-1.0.0-py3-none-any.whl
Size 135.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7b498b473ff817c1a9e5c3a429ddfc6339e23134abaec2fc555e6cb211b138a0
BLAKE2b-256 checksum
How to use checksums
ad285a29ab89faf9272446cc947c5822dcd928ed359d0542e82073a6d4ed2df3
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 29, 2026.

Transparency log

Security for LogPSplinePSD 1.0.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.0.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 Oct 29, 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