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.3.0.tar.gz (182.1 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

frds-2.3.0-cp311-cp311-win_amd64.whl (228.4 kB view details)

Uploaded CPython 3.11Windows x86-64

frds-2.3.0-cp311-cp311-win32.whl (224.3 kB view details)

Uploaded CPython 3.11Windows x86

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

Uploaded CPython 3.11musllinux: musl 1.1+ x86-64

frds-2.3.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (603.6 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

frds-2.3.0-cp311-cp311-macosx_10_9_x86_64.whl (219.7 kB view details)

Uploaded CPython 3.11macOS 10.9+ x86-64

frds-2.3.0-cp310-cp310-win_amd64.whl (228.4 kB view details)

Uploaded CPython 3.10Windows x86-64

frds-2.3.0-cp310-cp310-win32.whl (224.3 kB view details)

Uploaded CPython 3.10Windows x86

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

Uploaded CPython 3.10musllinux: musl 1.1+ x86-64

frds-2.3.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (602.5 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

frds-2.3.0-cp310-cp310-macosx_10_9_x86_64.whl (219.7 kB view details)

Uploaded CPython 3.10macOS 10.9+ x86-64

frds-2.3.0-cp39-cp39-win_amd64.whl (228.4 kB view details)

Uploaded CPython 3.9Windows x86-64

frds-2.3.0-cp39-cp39-win32.whl (224.3 kB view details)

Uploaded CPython 3.9Windows x86

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

Uploaded CPython 3.9musllinux: musl 1.1+ x86-64

frds-2.3.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (602.1 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64

frds-2.3.0-cp39-cp39-macosx_10_9_x86_64.whl (219.7 kB view details)

Uploaded CPython 3.9macOS 10.9+ x86-64

frds-2.3.0-cp38-cp38-win_amd64.whl (228.5 kB view details)

Uploaded CPython 3.8Windows x86-64

frds-2.3.0-cp38-cp38-win32.whl (224.4 kB view details)

Uploaded CPython 3.8Windows x86

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

Uploaded CPython 3.8musllinux: musl 1.1+ x86-64

frds-2.3.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (603.0 kB view details)

Uploaded CPython 3.8manylinux: glibc 2.17+ x86-64

frds-2.3.0-cp38-cp38-macosx_10_9_x86_64.whl (219.8 kB view details)

Uploaded CPython 3.8macOS 10.9+ x86-64

File details

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

File metadata

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

File hashes

Hashes for frds-2.3.0.tar.gz
Algorithm Hash digest
SHA256 e4e7d4c6521501270c49f6fd648f99af0a193f7931014ce28a0f3dda7c14b1a0
MD5 e132f70838eea3877f481ae8c38d240a
BLAKE2b-256 78fe832443d3dcc8ae5a9f8a7156a50dc5ab308ac218d5dd8675f8dfe2b1dfa9

See more details on using hashes here.

File details

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

File metadata

  • Download URL: frds-2.3.0-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 228.4 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.3.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 e0c759a21cc4f4e4db91eb0fb075f63cefc53d2173931737a718f94ce1680ad1
MD5 dc46490dc419ee4458d6b8bfb0a84232
BLAKE2b-256 552954a6b505e9ce407ee86030faa646c13263f68d1eef051e8905e865d88c39

See more details on using hashes here.

File details

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

File metadata

  • Download URL: frds-2.3.0-cp311-cp311-win32.whl
  • Upload date:
  • Size: 224.3 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.3.0-cp311-cp311-win32.whl
Algorithm Hash digest
SHA256 77ecacc7ee204f861621ec5f05b646ba8a926bce36d76bc6f85f7aee127a21b7
MD5 5953510236fa9d533c99246e9ea522c3
BLAKE2b-256 dda96c434e85e1bc99c6b9f29e51b0e008148f2a475d1743c0fe437672f8220e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for frds-2.3.0-cp311-cp311-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 bab5bec838aa0487cb8e2fc61b68a71746264ef9332c31762d6c0f9e331f46fe
MD5 421b80f2f252140f417fbb2d8f0e797f
BLAKE2b-256 ee2ec428e5fc70ad3f3414eb42ecfa5d0b56ec955b9b229cf54943d94a844bc7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for frds-2.3.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 606d280d0adaebaf3d09db287d66baeaa89f4994c4e6ba249f68680fc9e86e5d
MD5 bfc82189b2ad36a6b57eb9aaa191120b
BLAKE2b-256 4727b91759005f57010f1341e76ddcc44d8e35a014c982b28960917bf3ac9507

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for frds-2.3.0-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 34f22c67d8cd4a7d2e31c74b5f35ce68527de7778ac01314259586938b13f961
MD5 244f8472fc36a9faca4e0af92748fe3f
BLAKE2b-256 f3331cb075c2019811588605d26f0f0dbe794e1e5c8166fe47b7d57804a670fb

See more details on using hashes here.

File details

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

File metadata

  • Download URL: frds-2.3.0-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 228.4 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.3.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 df419fa14a39a0fc9feebbfe798df58b7af707de5e88ba416d78eb82f9b14363
MD5 75f7c2fd000d63036b8f1ca0e0ef2e5c
BLAKE2b-256 c47c44ff26dc37d4daaa52492f5c9f7eede00f737d29f4c1e8a723f7e697ecd5

See more details on using hashes here.

File details

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

File metadata

  • Download URL: frds-2.3.0-cp310-cp310-win32.whl
  • Upload date:
  • Size: 224.3 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.3.0-cp310-cp310-win32.whl
Algorithm Hash digest
SHA256 055c1fccc32f75b80d36d5e0f5e113c87e75622ea5c145779b1e591aefe26253
MD5 691f054de3a85f6ebb3b8c8fc691b6fe
BLAKE2b-256 bd902bfa6db835f7a42ce8f938a3bc73fed5c6daf409b0548a0034741f01bd0d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for frds-2.3.0-cp310-cp310-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 1f4983093f05b2fc87f0c522fffbfc4e9df150e13ca29c4341a4ce5dfc5b7d9e
MD5 5286ad42a66eac1233b510697fb253fa
BLAKE2b-256 973b9d68d40d490a2a0e1598998668fc46429989e0be2c4e9fdf4b6a6d5ca40c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for frds-2.3.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 57710651b007aa83c982a0d69c0b0f9b60fa29431a9765916acb7487f415910c
MD5 57107c551b02102c626d454a2e21d0bc
BLAKE2b-256 90df665a5905c59a94e92728bedba50f4dabbffe2194556e82fb56da9b3810a7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for frds-2.3.0-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 f43a094d61625e4d57b1a660b3005aea679e29de06379697372e28c1831ea301
MD5 63862d3f5e4f9d99d31c3f301673b919
BLAKE2b-256 ca7b677a4ac52a4ec9a14d388f9ff049140d4774412505b9353f2003420e0351

See more details on using hashes here.

File details

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

File metadata

  • Download URL: frds-2.3.0-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 228.4 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.3.0-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 4ad735f1daa708f38e61eda297d60a811e2f983a3da9399e14eca516a8b54f19
MD5 05da585180279fab39a421c4151fc574
BLAKE2b-256 97c29bb31a2696218839c5a64d7c34d12ce972d68b020b8a38a04bfc71f9f102

See more details on using hashes here.

File details

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

File metadata

  • Download URL: frds-2.3.0-cp39-cp39-win32.whl
  • Upload date:
  • Size: 224.3 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.3.0-cp39-cp39-win32.whl
Algorithm Hash digest
SHA256 1c547c2e80e903c537aadb33e1f381fecc93d265bf6fc0d1aa8c3e294e94aa4b
MD5 a7ce006b304cb8d7dcaa29e469a440a5
BLAKE2b-256 8dc95b25a3d83296f2de04259b90a83163a19ab407bf58693371ca70ce82bdaf

See more details on using hashes here.

File details

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

File metadata

  • Download URL: frds-2.3.0-cp39-cp39-musllinux_1_1_x86_64.whl
  • Upload date:
  • Size: 1.2 MB
  • Tags: CPython 3.9, musllinux: musl 1.1+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.18

File hashes

Hashes for frds-2.3.0-cp39-cp39-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 18b267974788d9255711d266500e172ce6a7ab60c412ab421a45aa6b03071657
MD5 aa9c06c6a3f3b0824508e4d14024a7ec
BLAKE2b-256 e2be9d98d9b3070200f444592d555e0aa25e060d91dd1cd82df6e000bc33cb92

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for frds-2.3.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 e33e4144ee24f12aa052a11225b3d1141417dff66e7f271b41b43581b796c086
MD5 2c7122547eec3c500f94de8a0c1db5a8
BLAKE2b-256 3b06e942f26c58b09dfc28e0cc5486acd3da8d6d83f7079d1d9f50f2339cf591

See more details on using hashes here.

File details

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

File metadata

  • Download URL: frds-2.3.0-cp39-cp39-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 219.7 kB
  • Tags: CPython 3.9, macOS 10.9+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.18

File hashes

Hashes for frds-2.3.0-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 098d465c950905a88ce3263dac20ca29f59eaa1c0602e348ba9f9658bcf93a37
MD5 d24cbfbd8ad2bfd6602078786b6277f3
BLAKE2b-256 faafcee2fd91489d5092285a828756f2b125c04193a41cffd0622e4d947d62fb

See more details on using hashes here.

File details

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

File metadata

  • Download URL: frds-2.3.0-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 228.5 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.3.0-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 7225b2caec03b9a5992b7fbff4227b2c17e762a2ae1b544d0cdd46bf37bb9340
MD5 d919a53824e1275a6370f500614bfe3e
BLAKE2b-256 ca4bb8e14fcc4c2112f9d3b627ee09ef8f131a93d394f22bde7a431a66f07ba7

See more details on using hashes here.

File details

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

File metadata

  • Download URL: frds-2.3.0-cp38-cp38-win32.whl
  • Upload date:
  • Size: 224.4 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.3.0-cp38-cp38-win32.whl
Algorithm Hash digest
SHA256 7f6ed837b2ac29f661b5d3941c43539036366884f3a1bf5640256b123980544b
MD5 d265d75bb9ece57d6f4af31254906af4
BLAKE2b-256 cb3320b493665123602879ebf089bf9cf7ca62e33334f6ebd3ca69383411ef9c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: frds-2.3.0-cp38-cp38-musllinux_1_1_x86_64.whl
  • Upload date:
  • Size: 1.2 MB
  • Tags: CPython 3.8, musllinux: musl 1.1+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.18

File hashes

Hashes for frds-2.3.0-cp38-cp38-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 ce4066202a1d9f6e257fb1a7f5564272c853205dbb243ace38f01b0f9f69374a
MD5 94ff61ee989d438f6adcc175adda3cc1
BLAKE2b-256 1422332dbb7ac2dff44783fd92f0ca55ae4e966e7a6f472af3c6904881aebedc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for frds-2.3.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 51a5e161065677588563a2be59db9985cdd023d62ca1705123653a3b562bb653
MD5 6f1cb621ca2570ede246eb13af2e0c21
BLAKE2b-256 48e897481ed8608b8d8c24db4003d20b9d4b3eeba7fdd4d7eba47ea1337f8d77

See more details on using hashes here.

File details

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

File metadata

  • Download URL: frds-2.3.0-cp38-cp38-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 219.8 kB
  • Tags: CPython 3.8, macOS 10.9+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.18

File hashes

Hashes for frds-2.3.0-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 042fae395f21a0902811b25a6359d98c94051b9c6b4c4cc4397c0e597e553211
MD5 edc52f3b1c675fdd249c8fe7ce5e883f
BLAKE2b-256 878144fff7ff4816020b8a2f32cdc273a4d06f10666a20e5733cb5dcca39beab

See more details on using hashes here.

Supported by

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