SDEs
-
Simulating SDEs using Euler discretization.
-
Euler scheme does not require derivatives, but Milstein and Runge-Kutta discretization schemes do...
-
List of processes implemented:
-
'BM', 'GBM', 'OU', 'ExponentialOU', '(Heston) GBMSA', 'srGBM', 'SBM', 'BrownianBridge', 'BrownianMeander', 'BrownianExcursion', 'DysonBM', 'StickyBM', 'ReflectingBM', 'CorrelatedBM', 'CorrelatedGBM', 'CircleBM', 'dDimensionalBM', '3dGBM', '3dOU', 'StochasticLogisticGrowth', 'StochasticExponentialDecay', 'SinCosVectorNoiseIto', 'PolynomialItoProcess', 'WrightFisherDiffusion', 'WeibullDiffusion', 'WeibullDiffusion2', 'ExpTC', 'MRSqrtDiff',
'VG', 'VGSA', 'Merton', 'ATSM', 'ATSM_SV', 'CEV', 'CIR', 'Vasicek', 'ExponentialVasicek', 'SABR', 'ShiftedSABR',
'DTDG', 'CKLS', 'HullWhite', 'LotkaVolterra', 'TwoFactorHullWhite', 'BlackKarasinski', 'Chen', 'LongstaffSchwartz', 'BDT', 'HoLee', 'CIR++', 'CIR2++', 'KWF','Bates','GeneralBergomi', 'OneFactorBergomi', 'RoughBergomi', 'RoughVolatility', 'RfSV', 'SinRFSV', 'TanhRFSV', 'ARIMA', 'GARCH', 'GARCHJump', 'VIX', 'GaussTanhPolyRFSV', 'LaplaceTanhPolyRFSV', 't_TanhPolyRFSV', 'CauchyTanhPolyRFSV', 'triangularTanhPolyRFSV', 'GumbelTanhPolyRFSV', 'LogisticTanhPolyRFSV',
'SCP_mean_reverting', 'SCP_modified_OU', 'SCP_tanh_Ito', 'SCP_arctan_Ito', 'SCQuanto', 'WrightFisherSC', 'Jacobi',
'fBM', 'GFBM', 'fOU', 'fIM', 'tanh_fOU', 'Poly_fOU', 'fStochasticLogisticGrowth', 'fStochasticExponentialDecay', 'fBM_WrightFisherDiffusion', 'fSV', 'Bessel', 'SquaredBessel', 'ConicDiffusionMartingale', 'ConicUnifDiffusionMartingale', 'ConicHalfUnifDiffusionMartingale', 'SinFourierDecompBB', 'MixedFourierDecompBB', 'kCorrelatedGBMs', 'kCorrelatedBMs'
-
-
StochasticProcessSimulator.py script can be used to obtain paths from the desired SDE/process.
-
The main function of interest is StochasticProcessSimulator() which produces the paths and includes the options of plotting and recording execution time(s).
-
READ_ME_SPS.txt describes all of the function arguments and their default settings.
-
Simulating_SDEs_Euler_all_plots.ipynb shows an example of how this function can be used to produce plots of all the types of SDEs.
-
Simulating_SDEs_Euler_simple_examples.ipynb (versions 1-4 of notebook) shows some simple examples of how this function can be used to produce stylized plots...
-
NB: In StochasticProcessSimulator(), 'kCorrelatedGBMs' and 'kCorrelatedBMs' are implemented without the option of producing plots...
-
3dBMCube.ipynb and 3dBMSphere.ipynb are two examples demonstrating how StochasticProcessSimulator() can be integrated with more specific plotting requirements to produce plots of 3d BM paths constrained to a cube and sphere, respectively.
Installation
StochasticProcessSimulator is available on pypi and can be installed as follows
pip install StochasticProcessSimulator
Dependencies
StochasticProcessSimulator relies on
numpyfor random number generation and math functions,scipyandstatsmodelsfor support for some specific distributions,matplotlibfor creating visualisations.
Quick-Start
StochasticProcessSimulator allows you to simulate and plot paths from different stochastic processes in a simple way.
For instance, the following code
from StochasticProcessSimulator import StochasticProcessSimulator as SPS
simulator = SPS(
process_type='GBM', do_plot=True)
paths = simulator.simulate()
produces the following output:
Future work:
- add handling of parameter inputs that break validity conditions...
- add Milstein and Runge-Kutta discretization schemes...
- add more SDEs/processes...
- This is a very rough implementation, and there are lots of improvements to be made. Any suggestions and improvements are welcome and appreciated.
Release files for StochasticProcessSimulator 0.1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| StochasticProcessSimulator-0.1.3.tar.gz | 20.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| StochasticProcessSimulator-0.1.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 39.6 kB
Release files / StochasticProcessSimulator-0.1.3.tar.gz
| Download URL | StochasticProcessSimulator-0.1.3.tar.gz |
|---|---|
| Size | 20.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d13d5fad43e23680dbf0ed60796a8f4db5f93e58ab155cc8f2aea74b5312641d
|
|
BLAKE2b-256 checksum How to use checksums |
8fb6813861ffb5422a7bb01b7e75beb482b244268e3e5a0f2c6b6c1ba90e5e8b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.0 CPython/3.8.18
|
Release files / StochasticProcessSimulator-0.1.3-py3-none-any.whl
| Download URL | StochasticProcessSimulator-0.1.3-py3-none-any.whl |
|---|---|
| Size | 19.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
69a3fcff161d50c1a1bb948a1c712958ef0166f8bcb802c419601ade14f868fb
|
|
BLAKE2b-256 checksum How to use checksums |
b7a937e63ecc77bd99774a64656756c66e8c6d0d3b10a3fddcb4a181cbce09bb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.0 CPython/3.8.18
|