Skip to main content

Financial Research Data Services

Project description

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)

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

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

Uploaded Source

Built Distributions

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

Uploaded CPython 3.11 Windows x86-64

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

Uploaded CPython 3.11 Windows x86

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

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 details)

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 details)

Uploaded CPython 3.11 macOS 10.9+ x86-64

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

Uploaded CPython 3.10 Windows x86-64

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

Uploaded CPython 3.10 Windows x86

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

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 details)

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 details)

Uploaded CPython 3.10 macOS 10.9+ x86-64

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

Uploaded CPython 3.9 Windows x86-64

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

Uploaded CPython 3.9 Windows x86

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

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 details)

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 details)

Uploaded CPython 3.9 macOS 10.9+ x86-64

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

Uploaded CPython 3.8 Windows x86-64

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

Uploaded CPython 3.8 Windows x86

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

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 details)

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 details)

Uploaded CPython 3.8 macOS 10.9+ x86-64

File details

Details for the file frds-2.4.1.tar.gz.

File metadata

  • Download URL: frds-2.4.1.tar.gz
  • Upload date:
  • Size: 182.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.18

File hashes

Hashes for frds-2.4.1.tar.gz
Algorithm Hash digest
SHA256 492b4c0c3bef3fc1dc52287fcb79dc1798c646cc8369dfc064dc2bf64a36e5fb
MD5 f3eae568be0064bd06247cd3c99a7f63
BLAKE2b-256 746c7c40a8eea8e2c112ea95c394eb6d15106c46c126e938586b00cb92e6372a

See more details on using hashes here.

File details

Details for the file frds-2.4.1-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: frds-2.4.1-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 228.5 kB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.18

File hashes

Hashes for frds-2.4.1-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 7f94668c3ec6cd02b9341a4f9ee2360294ef7fcbc78981f8589f94f3363bdf4e
MD5 e064d6d4f891bd1a6cfed32a05ef941d
BLAKE2b-256 5ba9c9fb1d59f54ec142e47f8dccb52041d3aa18be8dbcf96d7b1a1875a82049

See more details on using hashes here.

File details

Details for the file frds-2.4.1-cp311-cp311-win32.whl.

File metadata

  • Download URL: frds-2.4.1-cp311-cp311-win32.whl
  • Upload date:
  • Size: 224.4 kB
  • Tags: CPython 3.11, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.18

File hashes

Hashes for frds-2.4.1-cp311-cp311-win32.whl
Algorithm Hash digest
SHA256 9bca9eb189cfc3272f0271c970a4c317c785e337c97a00956bf19c245a95f2a4
MD5 367dc3fd2171e68b869c6477728e6463
BLAKE2b-256 12b2695d933fb1753b24a9478af0a9dd7bf12ca14cf439937d732ac1104a3c3f

See more details on using hashes here.

File details

Details for the file frds-2.4.1-cp311-cp311-musllinux_1_1_x86_64.whl.

File metadata

File hashes

Hashes for frds-2.4.1-cp311-cp311-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 d065aedcba348e062faabdc37b209a8bd08498bd676fc10730d9850fe5705492
MD5 0aa0c80d21615f2cfbecc5a5c7487578
BLAKE2b-256 fa33823aa35264ea03a1de0b7652dc80a6ea2ba2e434f7f00875b8e88e7e783e

See more details on using hashes here.

File details

Details for the file frds-2.4.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for frds-2.4.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 aa35e55543162c9d9c5b9791c130c3d9eabb2a7bb47a904c0b4bfc9237e3d0dc
MD5 b8046bbb919519fba5cbe6cba85b0ea2
BLAKE2b-256 61fd40000e3f7773b56f1f696d6ddbe4fc565c475463b89576fd8b89550a7b35

See more details on using hashes here.

File details

Details for the file frds-2.4.1-cp311-cp311-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for frds-2.4.1-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 647b85b248820c4b95cf434d2d60988dde8993cbb846a327c981e3b17a941baa
MD5 620547458d7119e92227125a61df93c2
BLAKE2b-256 77bdd7ff1ce6d2b6c5e00c749b3580ac39c8679f4cc1cf53722a54cf9ac9b520

See more details on using hashes here.

File details

Details for the file frds-2.4.1-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: frds-2.4.1-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 228.5 kB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.18

File hashes

Hashes for frds-2.4.1-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 119d33460b2fbb1690873fa697f57ca7e2df4b60c473d8a8c6309dc0f98765b7
MD5 2976ca39c7abb49dc738c66389780d44
BLAKE2b-256 9c3e88309dd32714cff87c0b5adf646fa77d145c3660c2d42a8ea82bd227e467

See more details on using hashes here.

File details

Details for the file frds-2.4.1-cp310-cp310-win32.whl.

File metadata

  • Download URL: frds-2.4.1-cp310-cp310-win32.whl
  • Upload date:
  • Size: 224.4 kB
  • Tags: CPython 3.10, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.18

File hashes

Hashes for frds-2.4.1-cp310-cp310-win32.whl
Algorithm Hash digest
SHA256 54868679816b52bcd328fb67151d4e8cf267594e90662c5bb209a7938fb7ed8e
MD5 f3e461295036089926df49c43c4c8214
BLAKE2b-256 1fc546685dc1ae5008cfeda48b9b5fa12827d63b6cbf75ce580bfce939c5e76f

See more details on using hashes here.

File details

Details for the file frds-2.4.1-cp310-cp310-musllinux_1_1_x86_64.whl.

File metadata

File hashes

Hashes for frds-2.4.1-cp310-cp310-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 d64e85573a08fcb2f2a0d9f1fdec4bbc9a913e4761d2a4c69fecb8258235c4bc
MD5 a4b8699e64bfdeb9f636e23f7457b8da
BLAKE2b-256 2b4f7e8c123fe9b60d5af6ba7b9f0bbfe8f9cfe280a3b8bd1f68d022dd776530

See more details on using hashes here.

File details

Details for the file frds-2.4.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for frds-2.4.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 11e874753aa72a9ca26171f31180f14d69626b4258f3bf6bf8b87863f089fc90
MD5 11cda254df008a36a03c741fb1811f4e
BLAKE2b-256 4a4db5b9a66e558c8c89cc25e4b2a8223047616299c6813af073fdf68b7824ed

See more details on using hashes here.

File details

Details for the file frds-2.4.1-cp310-cp310-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for frds-2.4.1-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 97b1a3cbfe5599d93f7709eb511c6d4714b7d1c16996a68b40864426e3484016
MD5 e1ef1717b558685f743d4fd2f8dcc175
BLAKE2b-256 7c2b8e5b6eb381e230c12e3f535f20a4538c2b23f827ee0682fdf4f8a86a3f2c

See more details on using hashes here.

File details

Details for the file frds-2.4.1-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: frds-2.4.1-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 228.5 kB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.18

File hashes

Hashes for frds-2.4.1-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 a440de7e66e056d9f436a601fed4435d7d1f02f43cf6eab311d0ca6c7cb387d8
MD5 c30c55a7bf9a12319cef304bb3f1c6e9
BLAKE2b-256 5eec10fad74bf05ee21cba94d554f77628ae94af75b80bdfc00c21d086efbb24

See more details on using hashes here.

File details

Details for the file frds-2.4.1-cp39-cp39-win32.whl.

File metadata

  • Download URL: frds-2.4.1-cp39-cp39-win32.whl
  • Upload date:
  • Size: 224.4 kB
  • Tags: CPython 3.9, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.18

File hashes

Hashes for frds-2.4.1-cp39-cp39-win32.whl
Algorithm Hash digest
SHA256 bd0b80f192857d7543947e37f207c71553df7bff5e9bece741ca44bc68c0a6e8
MD5 31189a0a47148e6495299eaf1838d236
BLAKE2b-256 f79210804080cc8195f321f7f0b1d9360278f506ac127ab01cd29f4b2c2e5c6d

See more details on using hashes here.

File details

Details for the file frds-2.4.1-cp39-cp39-musllinux_1_1_x86_64.whl.

File metadata

File hashes

Hashes for frds-2.4.1-cp39-cp39-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 d3280d59a608e985312338b7584ec54581f8d232556e9db518e05b2840212766
MD5 645c007bf18df3bb7adf6f99a0bb3f27
BLAKE2b-256 163a7b4130c5d8894a24ed379eb85a0d79a01026c8edf25add68f85b9af42c78

See more details on using hashes here.

File details

Details for the file frds-2.4.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for frds-2.4.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 90f820f0cc454ccadd23023ac9e1bb2b83a0b2de3abe6f57bd1880f50aeeb03d
MD5 0a8c3f909ef4bfdd0bdf90a7f3a744b3
BLAKE2b-256 38a002e79aec6a08bde01bb841b62345a18a9a714d246b09ddc3bc64806394c7

See more details on using hashes here.

File details

Details for the file frds-2.4.1-cp39-cp39-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for frds-2.4.1-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 b55df150a83a6a95200c96fd06afaf4c184d19dd238d7e17fb93ee61f1e170e1
MD5 21e1f4e81b9721fbefb66b3c29177d69
BLAKE2b-256 5c37a252c970939848b7e070a94257ac565f70a331621b8661b3c421336cfaf0

See more details on using hashes here.

File details

Details for the file frds-2.4.1-cp38-cp38-win_amd64.whl.

File metadata

  • Download URL: frds-2.4.1-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 228.6 kB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.18

File hashes

Hashes for frds-2.4.1-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 e05316f157636e1b4d1b351b65c6b594a818243825f0e93137cbdfb1aeee1cc5
MD5 0037533d3aae2442208828f99d15a44d
BLAKE2b-256 3472448f58068a0af8eaecf56e1c3c4f5bee3bd49f1acad5eac30493c950c3b4

See more details on using hashes here.

File details

Details for the file frds-2.4.1-cp38-cp38-win32.whl.

File metadata

  • Download URL: frds-2.4.1-cp38-cp38-win32.whl
  • Upload date:
  • Size: 224.5 kB
  • Tags: CPython 3.8, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.18

File hashes

Hashes for frds-2.4.1-cp38-cp38-win32.whl
Algorithm Hash digest
SHA256 10b8b7abe867010597eac0671f9b5a68052817878143029fb9b449dd0810ca5e
MD5 e7efcab5a40f8774d0424f5f528314b6
BLAKE2b-256 586a8ad4974dde32ff99c10a78b0372069e348ffeb35bf50113108cf67d3aa7f

See more details on using hashes here.

File details

Details for the file frds-2.4.1-cp38-cp38-musllinux_1_1_x86_64.whl.

File metadata

File hashes

Hashes for frds-2.4.1-cp38-cp38-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 d294149d146c502e9c18ebc84c84bafa0d1e9ac45f9a9d0084811355116aafd6
MD5 63012a7e65f9486a5b753d02bbea2153
BLAKE2b-256 44215f65c76438a5fc4cd560e7fdf6a314dbef92f62618ec4cdae73ce0c834fe

See more details on using hashes here.

File details

Details for the file frds-2.4.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for frds-2.4.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 02745f4f98ada00638610013ea552b92fcd56adbf640c9e340e7f1af45e19770
MD5 be528a52f5063affeb7c7389a7f97f51
BLAKE2b-256 d2b32a3cc9484a68e494f01206fc8a0371c2cfd21e8de16be74b881d5a4c1db0

See more details on using hashes here.

File details

Details for the file frds-2.4.1-cp38-cp38-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for frds-2.4.1-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 92fc421001780024065a503a46690e8aa96d6c0944e35c1d2b24fcfa0c37aaa5
MD5 7fb2e172a5faef399dc30e1dfe8d87b4
BLAKE2b-256 7d48036f90f217a1dfc2b39f4d2dc51a9db08355cdbf6ad0960e8cfe519308f7

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page