samplepaths 0.1.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. samplepaths/__init__.py +96 -0
  2. samplepaths/base/__init__.py +11 -0
  3. samplepaths/base/base_process.py +52 -0
  4. samplepaths/base/base_sequence_process.py +10 -0
  5. samplepaths/base/base_time_process.py +124 -0
  6. samplepaths/continuous/__init__.py +37 -0
  7. samplepaths/continuous/bessel_process.py +87 -0
  8. samplepaths/continuous/brownian_bridge.py +93 -0
  9. samplepaths/continuous/brownian_excursion.py +99 -0
  10. samplepaths/continuous/brownian_meander.py +148 -0
  11. samplepaths/continuous/brownian_motion.py +116 -0
  12. samplepaths/continuous/cauchy_process.py +106 -0
  13. samplepaths/continuous/fractional_brownian_motion.py +58 -0
  14. samplepaths/continuous/gamma_process.py +162 -0
  15. samplepaths/continuous/geometric_brownian_motion.py +166 -0
  16. samplepaths/continuous/inverse_gaussian_process.py +193 -0
  17. samplepaths/continuous/mixed_poisson_process.py +114 -0
  18. samplepaths/continuous/multifractional_brownian_motion.py +128 -0
  19. samplepaths/continuous/poisson_process.py +114 -0
  20. samplepaths/continuous/squared_bessel_process.py +61 -0
  21. samplepaths/continuous/variance_gamma_process.py +156 -0
  22. samplepaths/continuous/wiener_process.py +36 -0
  23. samplepaths/diffusion/__init__.py +17 -0
  24. samplepaths/diffusion/constant_elasticity_variance_process.py +81 -0
  25. samplepaths/diffusion/cox_ingersoll_ross_process.py +70 -0
  26. samplepaths/diffusion/diffusion_process.py +175 -0
  27. samplepaths/diffusion/extended_vasicek_process.py +72 -0
  28. samplepaths/diffusion/ornstein_uhlenbeck_process.py +61 -0
  29. samplepaths/diffusion/vasicek_process.py +66 -0
  30. samplepaths/discrete/__init__.py +17 -0
  31. samplepaths/discrete/bernoulli_process.py +78 -0
  32. samplepaths/discrete/chinese_restaurant_process.py +194 -0
  33. samplepaths/discrete/dirichlet_process.py +97 -0
  34. samplepaths/discrete/markov_chain.py +131 -0
  35. samplepaths/discrete/moran_process.py +122 -0
  36. samplepaths/discrete/random_walk.py +115 -0
  37. samplepaths/noise/__init__.py +25 -0
  38. samplepaths/noise/colored/__init__.py +19 -0
  39. samplepaths/noise/colored/blue_noise.py +32 -0
  40. samplepaths/noise/colored/brownian_noise.py +18 -0
  41. samplepaths/noise/colored/colored_noise.py +120 -0
  42. samplepaths/noise/colored/pink_noise.py +32 -0
  43. samplepaths/noise/colored/red_noise.py +32 -0
  44. samplepaths/noise/colored/violet_noise.py +32 -0
  45. samplepaths/noise/colored/white_noise.py +32 -0
  46. samplepaths/noise/fractional_gaussian_noise.py +219 -0
  47. samplepaths/noise/gaussian_noise.py +78 -0
  48. samplepaths/py.typed +0 -0
  49. samplepaths/random.py +50 -0
  50. samplepaths/utils/__init__.py +48 -0
  51. samplepaths/utils/validation.py +176 -0
  52. samplepaths-0.1.0.dist-info/METADATA +159 -0
  53. samplepaths-0.1.0.dist-info/RECORD +55 -0
  54. samplepaths-0.1.0.dist-info/WHEEL +4 -0
  55. samplepaths-0.1.0.dist-info/licenses/LICENSE +22 -0
@@ -0,0 +1,159 @@
1
+ Metadata-Version: 2.5
2
+ Name: samplepaths
3
+ Version: 0.1.0
4
+ Summary: Generate realizations of stochastic processes
5
+ Project-URL: Homepage, https://github.com/samplepaths/samplepaths
6
+ Project-URL: Documentation, https://samplepaths.readthedocs.io/
7
+ Project-URL: Repository, https://github.com/samplepaths/samplepaths
8
+ Project-URL: Issues, https://github.com/samplepaths/samplepaths/issues
9
+ Project-URL: Author, https://girgis.me
10
+ Author-email: Bassem Girgis <brgirgis@gmail.com>, Christopher Flynn <crf204@gmail.com>
11
+ Maintainer-email: Bassem Girgis <brgirgis@gmail.com>
12
+ License-Expression: MIT
13
+ License-File: LICENSE
14
+ Keywords: monte carlo,processes,simulation,stochastic
15
+ Classifier: Development Status :: 4 - Beta
16
+ Classifier: Intended Audience :: Science/Research
17
+ Classifier: Natural Language :: English
18
+ Classifier: Operating System :: OS Independent
19
+ Classifier: Programming Language :: Python :: 3
20
+ Classifier: Programming Language :: Python :: 3.12
21
+ Classifier: Programming Language :: Python :: 3.13
22
+ Classifier: Programming Language :: Python :: 3.14
23
+ Classifier: Programming Language :: Python :: Implementation :: CPython
24
+ Classifier: Topic :: Scientific/Engineering
25
+ Classifier: Topic :: Scientific/Engineering :: Mathematics
26
+ Classifier: Topic :: Scientific/Engineering :: Physics
27
+ Classifier: Typing :: Typed
28
+ Requires-Python: >=3.12
29
+ Requires-Dist: numpy>=2.2.6
30
+ Requires-Dist: scipy>=1.15.3
31
+ Description-Content-Type: text/x-rst
32
+
33
+ samplepaths
34
+ ============
35
+
36
+ |tests| |docs| |pypi| |license|
37
+
38
+ .. |tests| image:: https://github.com/samplepaths/samplepaths/actions/workflows/tests.yml/badge.svg
39
+ :target: https://github.com/samplepaths/samplepaths/actions/workflows/tests.yml
40
+
41
+ .. |docs| image:: https://readthedocs.org/projects/samplepaths/badge/?version=latest
42
+ :target: https://samplepaths.readthedocs.io/
43
+
44
+ .. |pypi| image:: https://img.shields.io/pypi/v/samplepaths.svg
45
+ :target: https://pypi.org/project/samplepaths/
46
+
47
+ .. |license| image:: https://img.shields.io/badge/license-MIT-blue.svg
48
+ :target: https://github.com/samplepaths/samplepaths/blob/master/LICENSE
49
+
50
+
51
+ A Python package for generating realizations of stochastic processes.
52
+
53
+ ``samplepaths`` is an independently maintained fork of
54
+ `stochastic <https://github.com/crflynn/stochastic>`_ by Christopher Flynn,
55
+ modernized for current Python, ``numpy`` and ``scipy`` releases and shipped
56
+ with type hints. It is maintained by `Bassem Girgis <https://girgis.me>`_.
57
+
58
+ Installation
59
+ ------------
60
+
61
+ Install ``samplepaths`` from PyPI using pip
62
+
63
+ .. code-block:: shell
64
+
65
+ pip install samplepaths
66
+
67
+ ``samplepaths`` requires Python 3.12 or newer.
68
+
69
+ Dependencies
70
+ ~~~~~~~~~~~~
71
+
72
+ ``samplepaths`` uses ``numpy`` for many calculations and ``scipy`` for sampling
73
+ specific random variables.
74
+
75
+ Quickstart
76
+ ----------
77
+
78
+ Every process is a class with a ``sample(n)`` method which generates a
79
+ realization as a ``numpy`` array.
80
+
81
+ .. code-block:: python
82
+
83
+ from samplepaths import BrownianMotion
84
+
85
+ bm = BrownianMotion(drift=1, scale=2, t=10)
86
+ path = bm.sample(1000) # 1001 values on [0, 10]
87
+ times = bm.times # the matching time values
88
+
89
+ Pass a ``numpy.random.Generator`` for reproducible results, or seed the
90
+ generator shared by all processes:
91
+
92
+ .. code-block:: python
93
+
94
+ import numpy as np
95
+ from samplepaths import BrownianMotion
96
+ from samplepaths import random
97
+
98
+ bm = BrownianMotion(rng=np.random.default_rng(42))
99
+
100
+ random.seed(value=42)
101
+
102
+ Some processes can be sampled at times of your choice, and some have
103
+ additional sampling methods:
104
+
105
+ .. code-block:: python
106
+
107
+ from samplepaths import BrownianMotion
108
+ from samplepaths import FractionalGaussianNoise
109
+ from samplepaths import GeometricBrownianMotion
110
+
111
+ values = BrownianMotion(drift=1).sample_at([0, 3, 10, 11, 11.2, 20])
112
+ prices = GeometricBrownianMotion(drift=0.05, volatility=0.2).sample_with_initial(252, initial=100.0)
113
+ noise = FractionalGaussianNoise(hurst=0.6).sample_hosking(32)
114
+
115
+ Processes
116
+ ---------
117
+
118
+ All processes can be imported from ``samplepaths`` or from the subpackage of
119
+ their family. Diffusion processes are approximated using the Euler-Maruyama
120
+ method.
121
+
122
+ * ``samplepaths.continuous``: BesselProcess, BrownianBridge,
123
+ BrownianExcursion, BrownianMeander, BrownianMotion, CauchyProcess,
124
+ FractionalBrownianMotion, GammaProcess, GeometricBrownianMotion,
125
+ InverseGaussianProcess, MixedPoissonProcess,
126
+ MultifractionalBrownianMotion, PoissonProcess, SquaredBesselProcess,
127
+ VarianceGammaProcess, WienerProcess
128
+ * ``samplepaths.diffusion``: DiffusionProcess (generalized),
129
+ ConstantElasticityVarianceProcess, CoxIngersollRossProcess,
130
+ ExtendedVasicekProcess, OrnsteinUhlenbeckProcess, VasicekProcess
131
+ * ``samplepaths.discrete``: BernoulliProcess, ChineseRestaurantProcess,
132
+ DirichletProcess, MarkovChain, MoranProcess, RandomWalk
133
+ * ``samplepaths.noise``: BlueNoise, BrownianNoise, ColoredNoise,
134
+ FractionalGaussianNoise, GaussianNoise, PinkNoise, RedNoise, VioletNoise,
135
+ WhiteNoise
136
+
137
+ Documentation
138
+ -------------
139
+
140
+ The documentation is at https://samplepaths.readthedocs.io/. It contains a
141
+ user guide for every family of processes and an API reference.
142
+
143
+ To build it locally, run ``make docs`` and open
144
+ ``docs/_build/html/index.html``.
145
+
146
+ Development
147
+ -----------
148
+
149
+ .. code-block:: shell
150
+
151
+ make install # create the environment with uv
152
+ make check # lint, type check, test and build the docs
153
+
154
+ Run ``make`` to list all targets.
155
+
156
+ License
157
+ -------
158
+
159
+ ``samplepaths`` is released under the MIT license. See the ``LICENSE`` file.
@@ -0,0 +1,55 @@
1
+ samplepaths/__init__.py,sha256=DAi6Szcgoeo8BVyqU65IQD6Vx-m3zWWt3wS7aQ01cJI,2070
2
+ samplepaths/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
+ samplepaths/random.py,sha256=3OzhNta9vKOwIMCjc47OFj0nj4AJes41-pyYvIrUL08,1273
4
+ samplepaths/base/__init__.py,sha256=hn52aaimAda9FltwU9GEt7rxcf2lUMlaKar-wWNfH-Q,262
5
+ samplepaths/base/base_process.py,sha256=fk_O3pSL2byRe5VxVvdDju6vntCK-0QKcGxFwOKpAus,1441
6
+ samplepaths/base/base_sequence_process.py,sha256=S0etobwMf8BZM4wAHX26AwN7NruZTQSIQ5PPPTU5y64,238
7
+ samplepaths/base/base_time_process.py,sha256=SQzYx2Dd2S3ZV35NSoLk4bbElkfIChh8YAjhsdFFzOU,3812
8
+ samplepaths/continuous/__init__.py,sha256=mvQ7mEunvPApdFfHPSIePYuoz88bqWfNMZTXkDK6NnM,1286
9
+ samplepaths/continuous/bessel_process.py,sha256=K1gjDZZjR64WgjFSjscDkwj25GR-I4qSTxZpCEdC91s,2556
10
+ samplepaths/continuous/brownian_bridge.py,sha256=ECqq2vuW_0A_fszZYjZLsgUCuHfccgzJbY1x6pdDaOk,2409
11
+ samplepaths/continuous/brownian_excursion.py,sha256=u6tq08sBDhy1iNFrqmr_XOwRzXxKuri870E3LCuTCS0,2716
12
+ samplepaths/continuous/brownian_meander.py,sha256=ACXrfuzDRAhLOHdEEn-jeOshICaW3lnwm95mVRC6-_Y,4644
13
+ samplepaths/continuous/brownian_motion.py,sha256=CdHFQQMIgNOkdsrOit9xLyqAs_Y403QkBlb0u-Q_ouY,3253
14
+ samplepaths/continuous/cauchy_process.py,sha256=4Z3Elt5OO1PCKD6bxqEmojlJjbOIn-32LpYRKmyELEA,2725
15
+ samplepaths/continuous/fractional_brownian_motion.py,sha256=C3dQYbow4miesZZHBbqbR2a6RUi64blCKKuJubaKFSg,1890
16
+ samplepaths/continuous/gamma_process.py,sha256=YvhBX-4XmzpZny0W31sVyiKh4BLxuB7IuCMM7Qpei6Q,5157
17
+ samplepaths/continuous/geometric_brownian_motion.py,sha256=zR8LkLrowu_tuxwTA9Jybm35tV3H-FWOyufJyjOP2ag,5084
18
+ samplepaths/continuous/inverse_gaussian_process.py,sha256=xBP5Gcs5H4JneokTEeiu_eCp7RlA6nYBkyktUkL-Na8,5779
19
+ samplepaths/continuous/mixed_poisson_process.py,sha256=vl3rmkz82sHEteGtBfQ09vCGisBy39q_RocAuO-3WOc,3500
20
+ samplepaths/continuous/multifractional_brownian_motion.py,sha256=OhboXA3OyeQ9MB_epA6VN_hwhnWlGHg6wXlzelL9NDc,4185
21
+ samplepaths/continuous/poisson_process.py,sha256=UyqEHFu8TOpn5wwLPm95g4sg1UKjcv0HERwBA3t4PMw,3051
22
+ samplepaths/continuous/squared_bessel_process.py,sha256=fClYcbs691EBKr5XWXMQtxXZ7r2isk6VNTqH9b7s7cg,2004
23
+ samplepaths/continuous/variance_gamma_process.py,sha256=ZdnidLiejSjMn9GI4xaXt1MHYv51fndrO1GoBlOeh3Y,4420
24
+ samplepaths/continuous/wiener_process.py,sha256=-yvEBFIX4F8Lx6Qn3KWPLZFJGAk8_uBVTU_Q6Ii0QGE,840
25
+ samplepaths/diffusion/__init__.py,sha256=Bf6nlDfwBoIAKarZValkIZDFk-rHCos_eFFkBzHDE-c,629
26
+ samplepaths/diffusion/constant_elasticity_variance_process.py,sha256=rfsqtLtbj9pYuGlaWtssqG_W_XEgQDpGVH8HWKBytAw,2581
27
+ samplepaths/diffusion/cox_ingersoll_ross_process.py,sha256=rxQkyYomd36FGjrIeMgWvC-6cro9nkTwCtyLTZZ-QmE,2102
28
+ samplepaths/diffusion/diffusion_process.py,sha256=EpVMBA4-S2wZ3d1562n_x88_XAIia3144YIW_nt66K8,5748
29
+ samplepaths/diffusion/extended_vasicek_process.py,sha256=tzNcDI8VGZoehTbAc5XZYhij9PFoiwMCujjlLjshVUg,2240
30
+ samplepaths/diffusion/ornstein_uhlenbeck_process.py,sha256=PO7S0BWd5jzC7aUJe9l5tgelt83SBj3VGTpJ8nk8PDQ,1828
31
+ samplepaths/diffusion/vasicek_process.py,sha256=lvhyAzFJMEEFU9PWbkAnoFSF7nuQYTYeYoNCkY648mc,1992
32
+ samplepaths/discrete/__init__.py,sha256=k5MBpVhYhyroD24Tb0WQ5_uu-cNGdLgbibig03bO8-4,459
33
+ samplepaths/discrete/bernoulli_process.py,sha256=teYeagclvMApW8xX2WFWR0RCvOsZ790tFssna7wMJ9E,2030
34
+ samplepaths/discrete/chinese_restaurant_process.py,sha256=z74S3BN7lVXCGxGgeWuLpHKBdv7HmBZXZ7bUyQ-POiI,6847
35
+ samplepaths/discrete/dirichlet_process.py,sha256=UvesOoX2y7PfMVm2wN49GxglA11nJzxQFAkqOFiUMiQ,2874
36
+ samplepaths/discrete/markov_chain.py,sha256=PNevvYvWbnd4BGFCwf1VBgJXLyZm_Nqtk3Pfay46kGE,4247
37
+ samplepaths/discrete/moran_process.py,sha256=CBJU1MAeiQEZzV5bf1xoeWtLcPWINxqTGmsH0VDK4IM,3669
38
+ samplepaths/discrete/random_walk.py,sha256=boEb7kuPmFy9fKMqMw4lxROsoYbXaqcvfMya7E45mcM,3898
39
+ samplepaths/noise/__init__.py,sha256=52PIXP5B8gKdCcStYfreedPtdE-4JewSBaXEvJpht38,463
40
+ samplepaths/noise/fractional_gaussian_noise.py,sha256=4GCrJwuCxjgf5o4ke-upP7QHSIDfZ0O6mnGyMwlFeS0,7063
41
+ samplepaths/noise/gaussian_noise.py,sha256=J-UL3mwUztncU4_bsRC61QgI5t308KEio1jnampxtgg,2034
42
+ samplepaths/noise/colored/__init__.py,sha256=Q792ZIg2SeKbPsdquUaILtBUxk7rPXiI34FufX742Lc,431
43
+ samplepaths/noise/colored/blue_noise.py,sha256=LKtoLjWfc4hahnJdtZa5WGCqvp0z74GyI8MVmMLovfY,673
44
+ samplepaths/noise/colored/brownian_noise.py,sha256=aKq3z0QtEVsGIa84v-b56J9lZ7hA8QuKfjkRGx4ZyDA,431
45
+ samplepaths/noise/colored/colored_noise.py,sha256=5d5KiXr34Gh93DuEDguAao0zQ3Eun2wwpDR0qACBQkc,3711
46
+ samplepaths/noise/colored/pink_noise.py,sha256=9MVuF-_twq4362g43sTUWNxQ0Zv4N-rsq4shRow19TU,691
47
+ samplepaths/noise/colored/red_noise.py,sha256=jpbiK02bEYOslClZbWlBb0PGs43RaWE-Ip55pjWNPZA,689
48
+ samplepaths/noise/colored/violet_noise.py,sha256=oGW1ZHtsATyXfwTSQ3Q4tUj1YXJJZkKZ5CECC6HaVzs,681
49
+ samplepaths/noise/colored/white_noise.py,sha256=XS0NsTqLOctNDuSrXrzoXc71pz0C592T8HsBZElQwxo,675
50
+ samplepaths/utils/__init__.py,sha256=KT5pP1c4H3ggMRRzw1f55c81E9hnjKgncKL6db9VikY,1274
51
+ samplepaths/utils/validation.py,sha256=CIcdpPIhTggFH88MWZweDsNAfYnajCUwFh4_E-OolUc,5241
52
+ samplepaths-0.1.0.dist-info/METADATA,sha256=aetb-Enzb3h-u2LPIDvijnWp5NKlLaYIbeywXbSNbRY,5454
53
+ samplepaths-0.1.0.dist-info/WHEEL,sha256=2iZrJkDIkeDh0k9SikKMqFuRP-ua6mb4Ir1AsER4BEw,87
54
+ samplepaths-0.1.0.dist-info/licenses/LICENSE,sha256=eGUny2pB9JLGzk-1dMll_7XZm7V4g1ExLsGMuE4TXKA,1112
55
+ samplepaths-0.1.0.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: hatchling 1.33.0
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
@@ -0,0 +1,22 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2018-2020 Christopher Flynn
4
+ Copyright (c) 2026 Bassem Girgis
5
+
6
+ Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ of this software and associated documentation files (the "Software"), to deal
8
+ in the Software without restriction, including without limitation the rights
9
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ copies of the Software, and to permit persons to whom the Software is
11
+ furnished to do so, subject to the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be included in all
14
+ copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
+ SOFTWARE.