Skip to main content

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

MIT

Release files for mvgarch 2.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mvgarch 2.0.2
File Size Uploaded
mvgarch-2.0.2.tar.gz 7.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for mvgarch 2.0.2
File Interpreter ABI Platform
mvgarch-2.0.2-py3-none-any.whl Python 3 none any Details

Total release size: 16.7 kB

Release files / mvgarch-2.0.2.tar.gz

Download URL mvgarch-2.0.2.tar.gz
Size 7.8 kB
Tags Source
SHA-256 checksum
How to use checksums
dbf5ec54b55af9d4176f905925c926440c9ed243fc437b7c2d55ff16364a0bab
BLAKE2b-256 checksum
How to use checksums
976c1099d93786e861b04e481b778bf791ce4cb8b62ad42362089b11a2cf5d0f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / mvgarch-2.0.2-py3-none-any.whl

Download URL mvgarch-2.0.2-py3-none-any.whl
Size 8.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1e203fff31a864df8bf922c3aab6cbf2c7fe38dcdb243f86398a1775626d5150
BLAKE2b-256 checksum
How to use checksums
bc7ca439de99b112b548d3590341ac3a458c0b7c2fa44248e64cc172e0305a4e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release history Release notifications | RSS feed

This release

2.0.2 This release

2 release files

1.2.4

2 release files

1.2.2

2 release files

1.2.1

2 release files

1.2.0

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page