Metadata-Version: 2.1
Name: stochax
Version: 0.0.2
Author-email: agdiiura <andreadiiura@gmail.com>
License: MIT License
        
        Copyright (c) 2024 Andrea
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: Homepage, https://github.com/agdiiura/stochax
Project-URL: Documentation, https://stochax.readthedocs.io/en/stable/index.html
Project-URL: Repository, https://github.com/agdiiura/stochax.git
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: joblib>=1.3.2
Requires-Dist: pandas>=2.2.1
Requires-Dist: numpy>=1.26.0
Requires-Dist: plotly>=5.20.0
Requires-Dist: scikit-learn>=1.4.0
Requires-Dist: scipy>=1.12.0
Requires-Dist: arch>=6.3.0
Provides-Extra: build
Requires-Dist: ruff>=0.5.0; extra == "build"
Requires-Dist: colorama>=0.4.6; extra == "build"
Requires-Dist: coverage>=7.0; extra == "build"
Requires-Dist: isort>=5.12.0; extra == "build"
Requires-Dist: pre-commit>=3.3.0; extra == "build"
Requires-Dist: setuptools-git-versioning>=1.13.4; extra == "build"
Requires-Dist: unittest-xml-reporting>=3.2.0; extra == "build"
Provides-Extra: docs
Requires-Dist: mkdocs>=1.6.0; extra == "docs"
Requires-Dist: mkdocstrings>=0.25.0; extra == "docs"

# stochax 📈

Stochastic processes in python



[![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white)](https://github.com/pre-commit/pre-commit)

The file `pyproject.toml` contains the packages needed for the installation.
The code requires `python3.12+`.

### Installation
To install the package the simplest procedure is:
```bash
pip install stochax
```
Now you can test the installation... In a python shell:

```python
import stochax as sx

sx.__version__
```

#### Installation from source
Once you have cloned the repository
```bash
pip install .
```
To use the develop mode just write `pip install -e .`.


## Examples
### Data simulation
```python
import stochax as sx

abm = sx.ArithmeticBrownianMotion(mu=0.25, sigma=1.7)
realizations = abm.simulate(
    initial_value=1,
    n_steps=5
)

print(realizations)
```
```
          0
0  1.000000
1  3.567428
2  4.163523
3  4.874200
4  6.132376
5  5.651274
```
### Model fit
```python
import stochax as sx

abm = sx.ArithmeticBrownianMotion(mu=0.25, sigma=1.7)
realizations = abm.simulate(
    initial_value=1,
    n_steps=100
)
gbm = sx.GeometricBrownianMotion()
gbm.calibrate(realizations)

print(gbm)
```
```
GeometricBrownianMotion(mu=0.08278617288074738, sigma=0.33330614384487633)
```
Further examples can be found the [examples](examples) folder.
