Skip to main content

Numerical solution of stochastic Volterra integral equations via a stochastic operational matrix based on block pulse functions.

Project description

tests build docs pypi pyversions licence

A python package for computing a numerical solution of stochastic Volterra integral equations of the second kind

stochastic-volterra-integral-equation

where

  • X-t is an unknown process,

  • f is a continuous function,

  • k-1-k-2 are continuous and square integrable functions,

  • B-t is the Brownian motion (see Wiener process) and

  • ito-integral is the Itô-integral (see Itô calculus)

by a stochastic operational matrix based on block pulse functions as suggested in Maleknejad et. al (2012) [1].

nssvie is distributed under the terms of the GNU GPLv3 license.

Install

Install using either of the following two methods.

1. Install from PyPi

pypi pyversions format

The nssvie package is available on PyPi and can be installed using pip

pip install nssvie

2. Install from Source

release licence

Install directly from the source code by

git clone https://github.com/dsagolla/nssvie.git
cd nssvie
pip install .

Dependencies

nssvie uses

  • NumPy for many calculations,

  • SciPy for computing the block pulse coefficients and

  • stochastic for sampling the Brownian Motion

Usage

Consider the following example of a stochastic Volterra integral equation

example-1-eq

so

  • example-1-f ,

  • example-1-k-1 and

  • example-1-k-2.

>>> from nssvie import StochasticVolterraIntegralEquations

>>> # Define the function and the kernels of the stochastic Volterra
>>> # integral equation
>>> def f(t):
>>>     return 1.0

>>> def k1(s,t):
>>>     return s**2

>>> def k2(s,t):
>>>     return s

>>> # Generate the stochastic Volterra integral equation
>>> svie = StochasticVolterraIntegralEquations(
>>>     f=f, kernel_2=k1, kernel_1=k2, T=0.5
>>> )

>>> # Calculate numerical solution with m=20 intervals
>>> svie_solution = svie.solve_method(m=20, solve_method="bpf")

The parameters are

  • f: the function f.

  • kernel_1, kernel_2: the kernels k-1-k-2.

  • T: the right hand side of \([0,T)\). Default is 1.0.

  • m: the number of intervals to divide \([0,T)\). Default is 50.

  • solve_method: the choosen method based on orthogonal functions. Default is bpf.

for the stochastic Volterra integral equation above.

Citation

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

nssvie-0.0.4.tar.gz (302.2 kB view hashes)

Uploaded Source

Built Distribution

nssvie-0.0.4-py3-none-any.whl (21.2 kB view hashes)

Uploaded Python 3

Supported by

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