Multivariate GARCH modelling in Python
Project description
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
$ pip install mvgarch
Usage
# 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
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
Built Distribution
File details
Details for the file mvgarch-1.2.0.tar.gz
.
File metadata
- Download URL: mvgarch-1.2.0.tar.gz
- Upload date:
- Size: 10.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4efe979d67ebbe970690e7585990c7ead3b313a801a7f87d6d57181925bd0a39 |
|
MD5 | 1cc35fadd1a71cc1e68785218f88416e |
|
BLAKE2b-256 | 1040bca0e057371244ad4c1a9acea4e8f7267d99b40f387e0c20048f2c0fb214 |
Provenance
The following attestation bundles were made for mvgarch-1.2.0.tar.gz
:
Publisher:
python-package.yml
on jack-tobin/mvgarch
-
Statement type:
https://in-toto.io/Statement/v1
- Predicate type:
https://docs.pypi.org/attestations/publish/v1
- Subject name:
mvgarch-1.2.0.tar.gz
- Subject digest:
4efe979d67ebbe970690e7585990c7ead3b313a801a7f87d6d57181925bd0a39
- Sigstore transparency entry: 146253613
- Sigstore integration time:
- Predicate type:
File details
Details for the file mvgarch-1.2.0-py3-none-any.whl
.
File metadata
- Download URL: mvgarch-1.2.0-py3-none-any.whl
- Upload date:
- Size: 9.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 13727e016c9fff13a42b6d43943d5ed306a5a39f56789b2145e3e5f18f235277 |
|
MD5 | 8c8a322d467c6af2c4fd9fe844f7410d |
|
BLAKE2b-256 | 7323730753b6a3987c4440031b74ffe9720890532b56953529d870b691363cd4 |
Provenance
The following attestation bundles were made for mvgarch-1.2.0-py3-none-any.whl
:
Publisher:
python-package.yml
on jack-tobin/mvgarch
-
Statement type:
https://in-toto.io/Statement/v1
- Predicate type:
https://docs.pypi.org/attestations/publish/v1
- Subject name:
mvgarch-1.2.0-py3-none-any.whl
- Subject digest:
13727e016c9fff13a42b6d43943d5ed306a5a39f56789b2145e3e5f18f235277
- Sigstore transparency entry: 146253616
- Sigstore integration time:
- Predicate type: