Financial Research Data Services

# FRDS - Financial Research Data Services

frds is a Python library to simplify the complexities often encountered in financial research. It provides a collection of ready-to-use methods for computing a wide array of measures in the literature.

It is developed by Dr. Mingze Gao from the University of Sydney, as a personal project during his postdoctoral research fellowship.

## Installation

pip install frds


## Note

This library is still under development and breaking changes may be expected.

## Supported measures and algorithms

For a complete list of supported built-in measures, please check frds.io/measures/ and frds.io/algorithms.

Supported Measures

• Absorption Ratio
• Contingent Claim Analysis
• Lerner Index (Banks)
• Long-Run Marginal Expected Shortfall (LRMES)
• Marginal Expected Shortfall
• Option Prices
• SRISK
• Systemic Expected Shortfall
• Z-score

Algorithms

• GARCH(1,1)
• GARCH(1,1) - CCC
• GARCH(1,1) - DCC
• GJR-GARCH(1,1)
• GJR-GARCH(1,1) - DCC

## Examples

Some simple examples.

### Absorption Ratio

For example, Kritzman, Li, Page, and Rigobon (2010) propose an Absorption Ratio that measures the fraction of the total variance of a set of asset returns explained or absorbed by a fixed number of eigenvectors. It captures the extent to which markets are unified or tightly coupled.

>>> import numpy as np
from frds.measures import AbsorptionRatio
>>> data = np.array( # Hypothetical 6 daily returns of 3 assets.
...             [
...                 [0.015, 0.031, 0.007, 0.034, 0.014, 0.011],
...                 [0.012, 0.063, 0.027, 0.023, 0.073, 0.055],
...                 [0.072, 0.043, 0.097, 0.078, 0.036, 0.083],
...             ]
...         )
ar = AbsorptionRatio(data)
ar.estimate()
0.7746543307660252


### Bivariate GARCH-CCC

Use frds.algorithms.GARCHModel_CCC to estimate a bivariate Constant Conditional Correlation (CCC) GARCH model. The results are as good as those obtained in Stata, marginally better based on log-likelihood.

>>> import pandas as pd
>>> from pprint import pprint
>>> from frds.algorithms import GARCHModel_CCC
>>> data_url = "https://www.stata-press.com/data/r18/stocks.dta"
>>> nissan = df["nissan"].to_numpy() * 100
>>> toyota = df["toyota"].to_numpy() * 100
>>> model_ccc = GARCHModel_CCC(toyota, nissan)
>>> res = model_ccc.fit()
>>> pprint(res)
Parameters(mu1=0.02745814255283541,
omega1=0.03401400758840226,
alpha1=0.06593379740524756,
beta1=0.9219575443861723,
mu2=0.009390068254041505,
omega2=0.058694325049554734,
alpha2=0.0830561828957614,
beta2=0.9040961791372522,
rho=0.6506770477876749,
loglikelihood=-7281.321453218112)


## Project details

### Source Distribution

frds-2.4.1.tar.gz (182.2 kB view hashes)

Uploaded Source

### Built Distributions

frds-2.4.1-cp311-cp311-win_amd64.whl (228.5 kB view hashes)

Uploaded CPython 3.11 Windows x86-64

frds-2.4.1-cp311-cp311-win32.whl (224.4 kB view hashes)

Uploaded CPython 3.11 Windows x86

frds-2.4.1-cp311-cp311-musllinux_1_1_x86_64.whl (1.2 MB view hashes)

Uploaded CPython 3.11 musllinux: musl 1.1+ x86-64

frds-2.4.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (603.7 kB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

frds-2.4.1-cp311-cp311-macosx_10_9_x86_64.whl (219.8 kB view hashes)

Uploaded CPython 3.11 macOS 10.9+ x86-64

frds-2.4.1-cp310-cp310-win_amd64.whl (228.5 kB view hashes)

Uploaded CPython 3.10 Windows x86-64

frds-2.4.1-cp310-cp310-win32.whl (224.4 kB view hashes)

Uploaded CPython 3.10 Windows x86

frds-2.4.1-cp310-cp310-musllinux_1_1_x86_64.whl (1.2 MB view hashes)

Uploaded CPython 3.10 musllinux: musl 1.1+ x86-64

frds-2.4.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (602.6 kB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

frds-2.4.1-cp310-cp310-macosx_10_9_x86_64.whl (219.8 kB view hashes)

Uploaded CPython 3.10 macOS 10.9+ x86-64

frds-2.4.1-cp39-cp39-win_amd64.whl (228.5 kB view hashes)

Uploaded CPython 3.9 Windows x86-64

frds-2.4.1-cp39-cp39-win32.whl (224.4 kB view hashes)

Uploaded CPython 3.9 Windows x86

frds-2.4.1-cp39-cp39-musllinux_1_1_x86_64.whl (1.2 MB view hashes)

Uploaded CPython 3.9 musllinux: musl 1.1+ x86-64

frds-2.4.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (602.2 kB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

frds-2.4.1-cp39-cp39-macosx_10_9_x86_64.whl (219.8 kB view hashes)

Uploaded CPython 3.9 macOS 10.9+ x86-64

frds-2.4.1-cp38-cp38-win_amd64.whl (228.6 kB view hashes)

Uploaded CPython 3.8 Windows x86-64

frds-2.4.1-cp38-cp38-win32.whl (224.5 kB view hashes)

Uploaded CPython 3.8 Windows x86

frds-2.4.1-cp38-cp38-musllinux_1_1_x86_64.whl (1.2 MB view hashes)

Uploaded CPython 3.8 musllinux: musl 1.1+ x86-64

frds-2.4.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (603.1 kB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

frds-2.4.1-cp38-cp38-macosx_10_9_x86_64.whl (219.9 kB view hashes)

Uploaded CPython 3.8 macOS 10.9+ x86-64