Skip to main content

frds

FRDS - Financial Research Data Services

LICENSE DOWNLOADS Test Code style: black

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.

If there's any issue (likely), please contact me at mingze.gao@sydney.edu.au

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
  • Distress Insurance Premium
  • 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"
>>> df = pd.read_stata(data_url, convert_dates=["date"])
>>> 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)

Release files for frds 2.4.1

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

Source distribution (sdist)

Source distribution for frds 2.4.1
File Size Uploaded
frds-2.4.1.tar.gz 182.2 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for frds 2.4.1
File
frds-2.4.1-cp311-cp311-win_amd64.whl CPython 3.11 CPython 3.11 Windows x86-64 Details
frds-2.4.1-cp311-cp311-win32.whl CPython 3.11 CPython 3.11 Windows x86-32 Details
frds-2.4.1-cp311-cp311-musllinux_1_1_x86_64.whl CPython 3.11 CPython 3.11 Linux musl 1.1+ x86-64 Details
frds-2.4.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.17+ x86-64 Details
frds-2.4.1-cp311-cp311-macosx_10_9_x86_64.whl CPython 3.11 CPython 3.11 macOS 10.9+ x86-64 Details
frds-2.4.1-cp310-cp310-win_amd64.whl CPython 3.10 CPython 3.10 Windows x86-64 Details
frds-2.4.1-cp310-cp310-win32.whl CPython 3.10 CPython 3.10 Windows x86-32 Details
frds-2.4.1-cp310-cp310-musllinux_1_1_x86_64.whl CPython 3.10 CPython 3.10 Linux musl 1.1+ x86-64 Details
frds-2.4.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.10 CPython 3.10 Linux glibc 2.17+ x86-64 Details
frds-2.4.1-cp310-cp310-macosx_10_9_x86_64.whl CPython 3.10 CPython 3.10 macOS 10.9+ x86-64 Details
frds-2.4.1-cp39-cp39-win_amd64.whl CPython 3.9 CPython 3.9 Windows x86-64 Details
frds-2.4.1-cp39-cp39-win32.whl CPython 3.9 CPython 3.9 Windows x86-32 Details
frds-2.4.1-cp39-cp39-musllinux_1_1_x86_64.whl CPython 3.9 CPython 3.9 Linux musl 1.1+ x86-64 Details
frds-2.4.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.9 CPython 3.9 Linux glibc 2.17+ x86-64 Details
frds-2.4.1-cp39-cp39-macosx_10_9_x86_64.whl CPython 3.9 CPython 3.9 macOS 10.9+ x86-64 Details
frds-2.4.1-cp38-cp38-win_amd64.whl CPython 3.8 CPython 3.8 Windows x86-64 Details
frds-2.4.1-cp38-cp38-win32.whl CPython 3.8 CPython 3.8 Windows x86-32 Details
frds-2.4.1-cp38-cp38-musllinux_1_1_x86_64.whl CPython 3.8 CPython 3.8 Linux musl 1.1+ x86-64 Details
frds-2.4.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.8 CPython 3.8 Linux glibc 2.17+ x86-64 Details
frds-2.4.1-cp38-cp38-macosx_10_9_x86_64.whl CPython 3.8 CPython 3.8 macOS 10.9+ x86-64 Details

Total release size: 10.0 MB

Release files / frds-2.4.1.tar.gz

Download URL frds-2.4.1.tar.gz
Size 182.2 kB
Tags Source
SHA-256 checksum
How to use checksums
492b4c0c3bef3fc1dc52287fcb79dc1798c646cc8369dfc064dc2bf64a36e5fb
BLAKE2b-256 checksum
How to use checksums
746c7c40a8eea8e2c112ea95c394eb6d15106c46c126e938586b00cb92e6372a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.18

Release files / frds-2.4.1-cp311-cp311-win_amd64.whl

Download URL frds-2.4.1-cp311-cp311-win_amd64.whl
Size 228.5 kB
Tags CPython 3.11 Windows x86-64
SHA-256 checksum
How to use checksums
7f94668c3ec6cd02b9341a4f9ee2360294ef7fcbc78981f8589f94f3363bdf4e
BLAKE2b-256 checksum
How to use checksums
5ba9c9fb1d59f54ec142e47f8dccb52041d3aa18be8dbcf96d7b1a1875a82049
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.18

Release files / frds-2.4.1-cp311-cp311-win32.whl

Download URL frds-2.4.1-cp311-cp311-win32.whl
Size 224.4 kB
Tags CPython 3.11 Windows x86-32
SHA-256 checksum
How to use checksums
9bca9eb189cfc3272f0271c970a4c317c785e337c97a00956bf19c245a95f2a4
BLAKE2b-256 checksum
How to use checksums
12b2695d933fb1753b24a9478af0a9dd7bf12ca14cf439937d732ac1104a3c3f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.18

Release files / frds-2.4.1-cp311-cp311-musllinux_1_1_x86_64.whl

Download URL frds-2.4.1-cp311-cp311-musllinux_1_1_x86_64.whl
Size 1.2 MB
Tags CPython 3.11 Linux musl 1.1+ x86-64
SHA-256 checksum
How to use checksums
d065aedcba348e062faabdc37b209a8bd08498bd676fc10730d9850fe5705492
BLAKE2b-256 checksum
How to use checksums
fa33823aa35264ea03a1de0b7652dc80a6ea2ba2e434f7f00875b8e88e7e783e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.18

Release files / frds-2.4.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL frds-2.4.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 603.7 kB
Tags CPython 3.11 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
aa35e55543162c9d9c5b9791c130c3d9eabb2a7bb47a904c0b4bfc9237e3d0dc
BLAKE2b-256 checksum
How to use checksums
61fd40000e3f7773b56f1f696d6ddbe4fc565c475463b89576fd8b89550a7b35
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.18

Release files / frds-2.4.1-cp311-cp311-macosx_10_9_x86_64.whl

Download URL frds-2.4.1-cp311-cp311-macosx_10_9_x86_64.whl
Size 219.8 kB
Tags CPython 3.11 macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
647b85b248820c4b95cf434d2d60988dde8993cbb846a327c981e3b17a941baa
BLAKE2b-256 checksum
How to use checksums
77bdd7ff1ce6d2b6c5e00c749b3580ac39c8679f4cc1cf53722a54cf9ac9b520
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.18

Release files / frds-2.4.1-cp310-cp310-win_amd64.whl

Download URL frds-2.4.1-cp310-cp310-win_amd64.whl
Size 228.5 kB
Tags CPython 3.10 Windows x86-64
SHA-256 checksum
How to use checksums
119d33460b2fbb1690873fa697f57ca7e2df4b60c473d8a8c6309dc0f98765b7
BLAKE2b-256 checksum
How to use checksums
9c3e88309dd32714cff87c0b5adf646fa77d145c3660c2d42a8ea82bd227e467
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.18

Release files / frds-2.4.1-cp310-cp310-win32.whl

Download URL frds-2.4.1-cp310-cp310-win32.whl
Size 224.4 kB
Tags CPython 3.10 Windows x86-32
SHA-256 checksum
How to use checksums
54868679816b52bcd328fb67151d4e8cf267594e90662c5bb209a7938fb7ed8e
BLAKE2b-256 checksum
How to use checksums
1fc546685dc1ae5008cfeda48b9b5fa12827d63b6cbf75ce580bfce939c5e76f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.18

Release files / frds-2.4.1-cp310-cp310-musllinux_1_1_x86_64.whl

Download URL frds-2.4.1-cp310-cp310-musllinux_1_1_x86_64.whl
Size 1.2 MB
Tags CPython 3.10 Linux musl 1.1+ x86-64
SHA-256 checksum
How to use checksums
d64e85573a08fcb2f2a0d9f1fdec4bbc9a913e4761d2a4c69fecb8258235c4bc
BLAKE2b-256 checksum
How to use checksums
2b4f7e8c123fe9b60d5af6ba7b9f0bbfe8f9cfe280a3b8bd1f68d022dd776530
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.18

Release files / frds-2.4.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL frds-2.4.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 602.6 kB
Tags CPython 3.10 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
11e874753aa72a9ca26171f31180f14d69626b4258f3bf6bf8b87863f089fc90
BLAKE2b-256 checksum
How to use checksums
4a4db5b9a66e558c8c89cc25e4b2a8223047616299c6813af073fdf68b7824ed
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.18

Release files / frds-2.4.1-cp310-cp310-macosx_10_9_x86_64.whl

Download URL frds-2.4.1-cp310-cp310-macosx_10_9_x86_64.whl
Size 219.8 kB
Tags CPython 3.10 macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
97b1a3cbfe5599d93f7709eb511c6d4714b7d1c16996a68b40864426e3484016
BLAKE2b-256 checksum
How to use checksums
7c2b8e5b6eb381e230c12e3f535f20a4538c2b23f827ee0682fdf4f8a86a3f2c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.18

Release files / frds-2.4.1-cp39-cp39-win_amd64.whl

Download URL frds-2.4.1-cp39-cp39-win_amd64.whl
Size 228.5 kB
Tags CPython 3.9 Windows x86-64
SHA-256 checksum
How to use checksums
a440de7e66e056d9f436a601fed4435d7d1f02f43cf6eab311d0ca6c7cb387d8
BLAKE2b-256 checksum
How to use checksums
5eec10fad74bf05ee21cba94d554f77628ae94af75b80bdfc00c21d086efbb24
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.18

Release files / frds-2.4.1-cp39-cp39-win32.whl

Download URL frds-2.4.1-cp39-cp39-win32.whl
Size 224.4 kB
Tags CPython 3.9 Windows x86-32
SHA-256 checksum
How to use checksums
bd0b80f192857d7543947e37f207c71553df7bff5e9bece741ca44bc68c0a6e8
BLAKE2b-256 checksum
How to use checksums
f79210804080cc8195f321f7f0b1d9360278f506ac127ab01cd29f4b2c2e5c6d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.18

Release files / frds-2.4.1-cp39-cp39-musllinux_1_1_x86_64.whl

Download URL frds-2.4.1-cp39-cp39-musllinux_1_1_x86_64.whl
Size 1.2 MB
Tags CPython 3.9 Linux musl 1.1+ x86-64
SHA-256 checksum
How to use checksums
d3280d59a608e985312338b7584ec54581f8d232556e9db518e05b2840212766
BLAKE2b-256 checksum
How to use checksums
163a7b4130c5d8894a24ed379eb85a0d79a01026c8edf25add68f85b9af42c78
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.18

Release files / frds-2.4.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL frds-2.4.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 602.2 kB
Tags CPython 3.9 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
90f820f0cc454ccadd23023ac9e1bb2b83a0b2de3abe6f57bd1880f50aeeb03d
BLAKE2b-256 checksum
How to use checksums
38a002e79aec6a08bde01bb841b62345a18a9a714d246b09ddc3bc64806394c7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.18

Release files / frds-2.4.1-cp39-cp39-macosx_10_9_x86_64.whl

Download URL frds-2.4.1-cp39-cp39-macosx_10_9_x86_64.whl
Size 219.8 kB
Tags CPython 3.9 macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
b55df150a83a6a95200c96fd06afaf4c184d19dd238d7e17fb93ee61f1e170e1
BLAKE2b-256 checksum
How to use checksums
5c37a252c970939848b7e070a94257ac565f70a331621b8661b3c421336cfaf0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.18

Release files / frds-2.4.1-cp38-cp38-win_amd64.whl

Download URL frds-2.4.1-cp38-cp38-win_amd64.whl
Size 228.6 kB
Tags CPython 3.8 Windows x86-64
SHA-256 checksum
How to use checksums
e05316f157636e1b4d1b351b65c6b594a818243825f0e93137cbdfb1aeee1cc5
BLAKE2b-256 checksum
How to use checksums
3472448f58068a0af8eaecf56e1c3c4f5bee3bd49f1acad5eac30493c950c3b4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.18

Release files / frds-2.4.1-cp38-cp38-win32.whl

Download URL frds-2.4.1-cp38-cp38-win32.whl
Size 224.5 kB
Tags CPython 3.8 Windows x86-32
SHA-256 checksum
How to use checksums
10b8b7abe867010597eac0671f9b5a68052817878143029fb9b449dd0810ca5e
BLAKE2b-256 checksum
How to use checksums
586a8ad4974dde32ff99c10a78b0372069e348ffeb35bf50113108cf67d3aa7f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.18

Release files / frds-2.4.1-cp38-cp38-musllinux_1_1_x86_64.whl

Download URL frds-2.4.1-cp38-cp38-musllinux_1_1_x86_64.whl
Size 1.2 MB
Tags CPython 3.8 Linux musl 1.1+ x86-64
SHA-256 checksum
How to use checksums
d294149d146c502e9c18ebc84c84bafa0d1e9ac45f9a9d0084811355116aafd6
BLAKE2b-256 checksum
How to use checksums
44215f65c76438a5fc4cd560e7fdf6a314dbef92f62618ec4cdae73ce0c834fe
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.18

Release files / frds-2.4.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL frds-2.4.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 603.1 kB
Tags CPython 3.8 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
02745f4f98ada00638610013ea552b92fcd56adbf640c9e340e7f1af45e19770
BLAKE2b-256 checksum
How to use checksums
d2b32a3cc9484a68e494f01206fc8a0371c2cfd21e8de16be74b881d5a4c1db0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.18

Release files / frds-2.4.1-cp38-cp38-macosx_10_9_x86_64.whl

Download URL frds-2.4.1-cp38-cp38-macosx_10_9_x86_64.whl
Size 219.9 kB
Tags CPython 3.8 macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
92fc421001780024065a503a46690e8aa96d6c0944e35c1d2b24fcfa0c37aaa5
BLAKE2b-256 checksum
How to use checksums
7d48036f90f217a1dfc2b39f4d2dc51a9db08355cdbf6ad0960e8cfe519308f7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.18
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