Skip to main content

armagarch package

The package provides a flexible framework for modelling time-series data. The main focus of the package is implementation of the ARMA-GARCH type models.

Full documentation is coming soon.

Installation

The latest stable version can be installed by using pip

pip install armagarch

The master branch can be installed with

git clone https://github.com/iankhr/armagarch
cd armagarch
python setup.py install

Example: Modelling conditional volatility of the US excess market returns

The code requires: NumPy, Pandas, SciPy, Shutil, Matplotlib, Pandas_datareader and Statsmodels

import armagarch as ag
import pandas_datareader as web
import matplotlib.pyplot as plt
import numpy as np

# load data from KennethFrench library
ff = web.DataReader('F-F_Research_Data_Factors_daily', 'famafrench')
ff = ff[0]

# define mean, vol and distribution
meanMdl = ag.ARMA(order = {'AR':1,'MA':0})
volMdl = ag.garch(order = {'p':1,'q':1})
distMdl = ag.normalDist()

# create a model
model = ag.empModel(ff['Mkt-RF'].to_frame(), meanMdl, volMdl, distMdl)
# fit model
model.fit()

# get the conditional mean
Ey = model.Ey

# get conditional variance
ht = model.ht
cvol = np.sqrt(ht)

# get standardized residuals
stres = model.stres

# make a prediction of mean and variance over next 3 days.
pred = model.predict(nsteps = 3)

# pred is a list of two-arrays with first array being prediction of mean
# and second array being prediction of variance

Authors

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Acknowledgments

Metadata

Release files for armagarch 1.0.4

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

Built distribution (wheel)

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

Release files / armagarch-1.0.4-py3-none-any.whl

Download URL armagarch-1.0.4-py3-none-any.whl
Size 43.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
65148fc727c329af5fb541b0261d2fc58eefb828f3d967639d8ebdaea3ecba2d
BLAKE2b-256 checksum
How to use checksums
c796b22b04e8fc98417940ef86ad8dab6cd1dc0a0102b4dbcdab74bf4bc0dd53
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.5

Release history Release notifications | RSS feed

This release

1.0.4 This release

1 release file

1.0.3

1 release file

1.0.2

2 release files

1.0

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