random-processes
Generate random processes with specified autocorrelation properties.
Quick start
Exponential: R(tau) = D * exp(-lambda * |tau|)
from random_processes import generate, exponential_kernel
k = exponential_kernel(D=1.0, lam=2.0)
t, x = generate(k, duration=100.0, dt=0.01, seed=42)
Oscillating: R(tau) = D * exp(-lambda * |tau|) * cos(w0 * tau)
from random_processes import generate, oscillating_kernel
k = oscillating_kernel(D=2.0, lam=0.5, w0=10.0)
t, x = generate(k, duration=200.0, dt=0.005, seed=42)
Custom kernel:
import numpy as np
from random_processes import generate, AutocorrKernel
k = AutocorrKernel(func=lambda tau: np.exp(-tau**2), name="gaussian")
t, x = generate(k, duration=50.0, dt=0.01, seed=7)
Multivariate correlated noise
import numpy as np
from random_processes import generate, exponential_kernel, oscillating_kernel
kernels = [exponential_kernel(D=1.0, lam=2.0), oscillating_kernel(D=0.5, lam=1.0, w0=3.0)]
corr = np.array([[1.0, 0.7],
[0.7, 1.0]])
t, X = generate(kernels, corr=corr, duration=100.0, dt=0.01, seed=42)
# X.shape == (2, 10000)
Visualization
from random_processes.visualization import plot_realization, plot_correlation
import matplotlib.pyplot as plt
fig, axes = plt.subplots(2, 1, figsize=(10, 6))
plot_realization(t, x, ax=axes[0])
plot_correlation(t, x, k, ax=axes[1])
plt.tight_layout()
plt.show()
Testing
Confidence bands use Fisher z-transform with effective sample size to account for correlation in the data. This is an approximation (exact intervals require Bartlett's formula), but sufficient for validation purposes.
Scalar (with plots / without):
python -c "from random_processes.testing import run_test_suite; run_test_suite()"
python -c "from random_processes.testing import run_test_suite; run_test_suite(show_plots=False)"
Multivariate (with plots / without):
python -c "from random_processes.testing import run_multi_test_suite; run_multi_test_suite()"
python -c "from random_processes.testing import run_multi_test_suite; run_multi_test_suite(show_plots=False)"
Requirements
- Python >= 3.10
- numpy
- scipy
- matplotlib (for visualization)
Metadata
Release files for random-processes 0.1.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 | Provenance | Actions |
|---|---|---|---|---|
| random_processes-0.1.0.tar.gz | 9.9 kB | Without provenance | Details for random_processes-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| random_processes-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for random_processes-0.1.0-py3-none-any.whl |
Total release size: 21.6 kB
Release files / random_processes-0.1.0.tar.gz
| Download URL | random_processes-0.1.0.tar.gz |
|---|---|
| Size | 9.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
39be7f14884f2b433633be65eaccf949529cb612da73e5cb70a8f79944713336
|
|
BLAKE2b-256 checksum How to use checksums |
f23547337e9b8352e40ca2e9b94b4aefb1da1e881874cc9e3f8004c56080ca5f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.8.9
|
Release files / random_processes-0.1.0-py3-none-any.whl
| Download URL | random_processes-0.1.0-py3-none-any.whl |
|---|---|
| Size | 11.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9e86105654013dc4fb6014d96639aef621d0a8686556a290c9b4c9d57bc5d2e6
|
|
BLAKE2b-256 checksum How to use checksums |
d25fef8441db007d08f7a3b903963e73106e09012457b906b2ee0bd4b652b75d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.8.9
|
Security for random-processes 0.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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
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.