Metadata-Version: 2.4
Name: pytfbm
Version: 1.0.0
Summary: Package for simulating and detecting tempered fractional Brownian motions
Author-email: Jakub Malinowski <jakub.malinowski@pwr.edu.pl>
License-Expression: MIT
Project-URL: Homepage, https://github.com/Malinon/tfbm
Classifier: Programming Language :: Python :: 3
Classifier: Operating System :: OS Independent
Requires-Python: >=3.6
Description-Content-Type: text/x-rst
License-File: LICENSE.md
Requires-Dist: numpy
Requires-Dist: scipy>=1.14.1
Requires-Dist: mpmath>=1.3.0
Dynamic: license-file

pytfbm
===========

Package for simulating tempered fractional Brownian motions described in [1]_, [2]_, [3]_.

TFBM I
------

The stochastic processes :math:`B^{I}_{H,\lambda} = \{B^{I}_{H,\lambda}(t)\}_{t\in\mathbb{R}}` defined by the Wiener integral

.. math::

    B^{I}_{H,\lambda}(t) := \int_{\mathbb{R}} g^{I}_{H,\lambda,t}(s) \,dB_{s},

where

.. math::

    g^{I}_{H,\lambda,t}(s) := \left[(t - s)_{+}^{H- \frac{1}{2}} e^{-\lambda(t-s)_{+}} - (-s)_{+}^{H- \frac{1}{2}} e^{-\lambda(-s)_{+}}\right], \quad s \in \mathbb{R}

is called a tempered fractional Brownian motion of the first kind (TFBM I)

TFBM II
-------

The stochastic processes :math:`B^{II}_{H,\lambda} = \{B^{II}_{H,\lambda}(t)\}_{t\in\mathbb{R}}` defined by the Wiener integral

.. math::

    B^{II}_{H,\lambda}(t) := \int_{\mathbb{R}} g^{II}_{H,\lambda,t}(s) \,dB_{s},

where

.. math::

    g^{II}_{H,\lambda,t}(s) := (t - s)_{+}^{H- \frac{1}{2}} e^{-\lambda(t-s)_{+}} - (-s)_{+}^{H- \frac{1}{2}} e^{-\lambda(-s)_{+}} + \lambda \int_{0}^{t} (u - s)_{+}^{H- \frac{1}{2}} e^{-\lambda(u-s)_{+}} du, \quad s \in \mathbb{R},

is called a tempered fractional Brownian motion of the second kind (TFBM II).

TFBM III
--------

We consider the overdamped stochastic equation of motion of a particle in a viscous medium under the influence of a stochastic force :math:`\xi(t)`. A stochastic process :math:`B^{III}_{H,\lambda} = \{B^{III}_{H,\lambda}(t)\}_{t\in\mathbb{R}}` is called a tempered fractional Brownian motion of the third kind (TFBM III) if it satisfies the differential equation:

.. math::

    \frac{dB^{III}_{H,\lambda}(t)}{dt} = \frac{\xi(t)}{m\eta} = \nu(t),

where :math:`m` is the particle mass, :math:`\eta` the friction coefficient and :math:`\nu(t)` represents a velocity process with the autocorrelation function given by:

.. math::

    \gamma_{H}(\tau) = \frac{1}{\Gamma(2H - 1)} \tau^{2H-2}e^{-\tau /\tau^{*}}, \quad \tau > 0,

where :math:`\tau^* > 0` is a characteristic crossover time scale, and the Hurst parameter satisfies :math:`\frac{1}{2} \leq H < 1`.

Installation
------------

You can install the package using following commands:

.. code-block:: bash

    git clone https://github.com/Malinon/tfbm
    pip install ./tfbm

Example usage
-------------

.. code-block:: python

    import pytfbm

    # Create generator of TFBM I 
    tfbm1 = pytfbm.TFBM1(H=10, T=10, N=500, lambd=0.5)
    trajectories, increments = tfbm1.generate_samples(num_of_samples=100, get_increments=True)

Documentation
-------------

To generate documentation use Makefile:

.. code-block:: bash

    cd doc
    make html

Generation of the documentation requires sphinx and Read The Docs Theme:

.. code-block:: bash

    pip install -U sphinx
    pip install sphinx_rtd_theme

References
----------

.. [1] M\. M\. Meerschaert and F. Sabzikar. Tempered fractional Brownian motion. Statistics & Probability Letters, 83(10):2269–2275, 2013. `doi:10.1016/j.spl.2013.06.016 <https://doi.org/10.1016/j.spl.2013.06.016>`_

.. [2] F\. Sabzikar and D. Surgailis. Tempered fractional Brownian and stable motions of second kind. Statistics & Probability Letters, 132:17–27, 2018. `doi: 10.1016/j.spl.2017.08.015 <https://doi.org/10.1016/j.spl.2017.08.015>`_

.. [3] D\. Molina-Garcia, T. Sandev, H. Safdari, G. Pagnini, A. Chechkin, and R. Metzler. Crossover from anomalous to normal diffusion: truncated power-law noise correlations and applications to dynamics in lipid bilayers. New Journal of Physics 20, page 103027, 2018. `doi: 10.1088/1367-2630/aae4b2 <https://doi.org/10.1088/1367-2630/aae4b2>`_
