Metadata-Version: 2.3
Name: mvgarch
Version: 2.0.2
Summary: Multivariate GARCH modelling in Python
Author: Jack Tobin
Author-email: Jack Tobin <tobjack330@gmail.com>
License: MIT License
         
         Copyright (c) 2022 jamesjtobin
         
         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.
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: POSIX :: Linux
Requires-Dist: matplotlib
Requires-Dist: numpy
Requires-Dist: pandas
Requires-Dist: arch
Requires-Dist: pmdarima
Requires-Dist: scipy
Requires-Python: >=3.11
Project-URL: Homepage, https://github.com/jamesjtobin/mvgarch
Project-URL: Bug Tracker, https://github.com/jamesjtobin/mvgarch/issues
Description-Content-Type: text/markdown

# mvgarch
Multivariate GARCH modelling in Python

## Description
This project performs a basic multivariate GARCH modelling exercise in Python. Such approaches are available in other environments such as R, but there is yet to exist a tractable framework for performing the same tasks in Python. This package should help alleviate such limitations and allow Python users to deploy multivariate GARCH models easily.

## Installation

```bash
$ pip install mvgarch
```

## Usage

```python
# get return data
# returns = pd.DataFrame() of periodic returns of shape (n_periods, n_assets)

# import modules
from mvgarch.mgarch import DCCGARCH
from mvgarch.ugarch import UGARCH

# FIT UNIVARIATE GARCH MODEL

# get one of the return series
asset = returns.iloc[:, 0]

# fit a gjr-garch(1, 1) model to the first return series
garch = UGARCH(order=(1, 1))
garch.spec(returns=asset)
garch.fit()

# FIT MULTIVARIATE DCC GARCH MODEL

# make a list of garch(1, 1) objects
garch_specs = [UGARCH(order=(1, 1)) for _ in range(n_tickers)]

# fit DCCGARCH to the return data
dcc = DCCGARCH()
dcc.spec(ugarch_objs=garch_specs, returns=returns)
dcc.fit()

# forecast 4 weeks ahead
dcc.forecast(n_ahead=4)
```

## Contributing
Pull requests are welcome.

## License
[MIT](https://choosealicense.com/licenses/mit/)
