Skip to main content

Taylor moment expansion (TME) in Python

Please see the documentation of the package in https://tme.readthedocs.io.

Install

Install via pip install tme or python setup.py install (Please note that if you would like to use JaX, please install jax by yourself beforehand).

Examples

import tme.base_jax as tme
import jax.numpy as jnp
from jax import jit, vmap

# Define SDE coefficients.
alp = 1.


def drift(x):
    return jnp.array([x[1],
                      x[0] * (alp - x[0] ** 2) - x[1]])


def dispersion(x):
    return jnp.array([0, x[0]])


# Jit the 3-order TME mean and cov approximation functions
@jit
def tme_m_cov(x, dt):
    return tme.mean_and_cov(x, dt, drift, dispersion, order=3)


# Compute E[X(t) | X(0)=x0]
x0 = jnp.array([0., -1])
ts = jnp.array([0.25, 0.5, 1.])

m_t, cov_t = vmap(tme_m_cov, in_axes=[None, 0])(x0, ts)

Inside folder examples, there are a few Jupyter notebooks showing how to use the TME method (in SymPy and JaX).

License

The GNU General Public License v3 or later

Metadata

Release files for tme 0.2.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 tme 0.2.0
File Size Uploaded Provenance Actions
tme-0.2.0.tar.gz 12.3 kB Without provenance Details for tme-0.2.0.tar.gz

Built distribution (wheel)

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

Total release size: 23.1 kB

Release files / tme-0.2.0.tar.gz

Download URL tme-0.2.0.tar.gz
Size 12.3 kB
Tags Source
SHA-256 checksum
How to use checksums
7c804ba47684106d96295b4e8f583d78d56d77a98577c906bf5a14f65c4453ee
BLAKE2b-256 checksum
How to use checksums
f7a775afd80d0757bf370fb7591351842874a9223ff7b9f096966c8179d0880b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.7

Release files / tme-0.2.0-py3-none-any.whl

Download URL tme-0.2.0-py3-none-any.whl
Size 10.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bb486924edbfd4dbc37e8fbe511363996c631a96107fa255cdcb2f875b88e104
BLAKE2b-256 checksum
How to use checksums
5463bc6e246d26a3b1f9bf2d333da2c5488de3abfe4c2a2f632b7c291f6a7938
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.7

Security for tme 0.2.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.

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