Skip to main content

Implementation of the Pade-partial fraction approximation for inverting the Laplace transform of the first passage time distribution.

Project description

Pade-Partial Fraction Approximation

This package is an implementation of the Pade-partial fraction approximation for the inversion of the Laplace transform as proposed in Computation of the Distribution of the Absorption Time of the Drifted Diffusion with Stochastic Resetting and Mixed Boundary Conditions by Turin, Magalang, Aguilar, Colombani, Sanchez-Taltavull, and Gatto[^1]

Installation

Install the package from PyPI:

pip install ppf_approx

Usage

The main function of this package is the ppf function, with the following syntax:

ppf(m_ord, n_ord, v, D, x0, r, tval, correction = True)

Here is a description of each argument:

  • m_ord : Integer. Numerator order of the Pade approximation.
  • n_ord : Integer. Denominator order of the Pade approximation.
  • v : Float. Drift constant.
  • D : Float. Diffusion constant. Must be positive.
  • x0 : Float. Initial position. Must be from $0 \leq x_0 < 1$
  • r : Float. Resetting constant. Must be non-negative.
  • tval : Array. Range of time values at which the PPF will be performed. Single values are accepted.
  • correction : Boolean, optional. Determines whether the PPF will perform the correction steps or not. The default is True.

The function can be used to generate whole distributions $t \in [0, \infty]$, segments $t \in [t_1, t_2]$, or single values of time $t$. The outputs will always be in arrays. This is an example of the usage of the ppf function:

import numpy as np
import ppf_approx

v = -0.01
D = 0.0001
x0 = 0.8
r = (1/3)*(1/365)
tvals = np.linspace(0,200, 10)

app_fptvals = ppf(2, 3, v, D, x0, r, tvals)

Sample output:

>>> app_fptvals
array([0., 0., 0.01115898, 0.01866108, 0.01345554, 0.00637309, 0.00200653, 0.00027748, 0., 0.])

Auxiliary Functions

This package also contains auxiliary functions which are expressions for the bounded and biased Brownian motion with stochastic resetting that were derived in the reference[^1]:

  1. lt_fptd computes for the Laplace-transformed FPT distribution.
  2. mfpt computes for the analytical mean FPT from the Laplace-transformed FPT distribution.

[^1]: Turin, R., Magalang, J., Aguilar, J., Colombani, L., Sanchez-Taltavull, D., & Gatto, R. (2024). Computation of the distribution of the absorption time of the drifted diffusion with stochastic resetting and mixed boundary conditions (arXiv:2311.03939). arXiv. https://doi.org/10.48550/arXiv.2311.03939

Written with StackEdit.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ppf_approx-0.1.1.tar.gz (5.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ppf_approx-0.1.1-py3-none-any.whl (6.2 kB view details)

Uploaded Python 3

File details

Details for the file ppf_approx-0.1.1.tar.gz.

File metadata

  • Download URL: ppf_approx-0.1.1.tar.gz
  • Upload date:
  • Size: 5.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.0 CPython/3.12.4

File hashes

Hashes for ppf_approx-0.1.1.tar.gz
Algorithm Hash digest
SHA256 5fd51715759708040043513aa58aa82bf313ab21d161cbf969e1b245b311e765
MD5 ea9c1a1dffa1cc6058e726f6df795174
BLAKE2b-256 ddcebd5c482f2a8c8a4708a6bed13ad0b7f367cc2f3ac78b0aaec44065e53b34

See more details on using hashes here.

File details

Details for the file ppf_approx-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: ppf_approx-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 6.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.0 CPython/3.12.4

File hashes

Hashes for ppf_approx-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 83827ba553dc22f9a491f011cb3ecc5e5e8743040b64da5a57be3bbff8de4089
MD5 4c132c1614f44550c3c0ad5c6b02a264
BLAKE2b-256 4a3d4b90f27504551ea4891a7745002afab83386b1b9e752dd160af1af267b4c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page