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.2.tar.gz (4.9 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.2-py3-none-any.whl (6.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ppf_approx-0.1.2.tar.gz
  • Upload date:
  • Size: 4.9 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.2.tar.gz
Algorithm Hash digest
SHA256 04eeb3fd1396e2079d377dd9af805ca1ee562cf7810c69e9e0f63ba7dbd3ba44
MD5 b81a5bb670b2226f724fed6626a1c1f8
BLAKE2b-256 0c5beef7f06054cf5d9dba79238993ff5530e2b4d706c1ed3237b37016cc09cc

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ppf_approx-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 6.3 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 0878122e62e09e887b7b74f8426cca5c9f27a00a64829f758315cddefba3eb74
MD5 504b6c60e5d0aaa6cd710fd3a40500f4
BLAKE2b-256 42c06087a026c7a46ef70f794e6225121e1e0f00745624304362338fdedf43af

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