Skip to main content

Python library for asset pricing research

Project description

PyAnomaly is a comprehensive python library for asset pricing research with a focus on firm characteristic and factor generation. It covers the majority of the firm characteristics published in the literature and contains various analytic tools that are commonly used in asset pricing research, such as quantile portfolio construction, factor regression, and cross-sectional regression. The purpose of PyAnomaly is NOT to generate firm characteristics in a fixed manner. Rather, we aim to build a package that can serve as a standard library for asset pricing research and help reduce non-standard errors.

PyAnomaly is a live project and we plan to add more firm characteristics and functionalities going forward. We also welcome contributions from other scholars.

PyAnomaly is very efficient, comprehensive, and flexible.

Efficiency

PyAnomaly can generate over 200 characteristics from 1950 in around one hour including the time to download data from WRDS. To achieve this, PyAnomaly utilizes numba, multiprocessing, and asyncio packages when possible, but not too heavily to maximize readability of the code.

Comprehensiveness

PyAnomaly supports over 200 firm characteristics published in the literature. It covers most characteristics in Green et al. (2017) and Jensen et al. (2021), except those that use IBES data. It also provides various tools for asset pricing research.

Flexibility

PyAnomaly adopts the object-oriented programming design philosophy and is easy to customize or add functionalities. This means users can easily change the definition of an existing characteristic, add a new characteristic, or change configurations to run the program. For instance, a user can choose whether to update annual accounting variables quarterly (using Compustat.fundq) or annually (using Compustat.funda), or whether to use the latest market equity or the year-end market equity, when generating firm characteristics.

Main Features

  • Efficient data download from WRDS using asynco.

  • Over 200 firm characteristics generation. You can choose which firm characteristics to generate.

  • Fama-French 3-factor and Hou-Zhou-Zhang 4-factor portfolios.

  • Analytics

    • Cross-section regression

    • 1-D sort

    • 2-D sort

    • Rolling regression

    • Quantile portfolio

    • Long-short portfolio

    • Portfolio performance analysis

  • Data tools

    • Data filtering

    • Winsorizing

    • Trimming

    • Data population

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

pyassetpricing-0.923.tar.gz (84.4 kB view details)

Uploaded Source

Built Distribution

pyassetpricing-0.923-py3-none-any.whl (89.6 kB view details)

Uploaded Python 3

File details

Details for the file pyassetpricing-0.923.tar.gz.

File metadata

  • Download URL: pyassetpricing-0.923.tar.gz
  • Upload date:
  • Size: 84.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for pyassetpricing-0.923.tar.gz
Algorithm Hash digest
SHA256 dd880a0aa7cb27ba16fc67ff09b30257c8bcfb951f5a4f354be40aa814449b5d
MD5 db01fdd862fdd03562ed756fbd1b7533
BLAKE2b-256 0d1f855ab99f8367cc918228a8b907ae32f17d9cd4dbe600b8f8ff0c47167a43

See more details on using hashes here.

File details

Details for the file pyassetpricing-0.923-py3-none-any.whl.

File metadata

  • Download URL: pyassetpricing-0.923-py3-none-any.whl
  • Upload date:
  • Size: 89.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for pyassetpricing-0.923-py3-none-any.whl
Algorithm Hash digest
SHA256 34307c9835e82718fb48635c1179db9c73eec386b032e9db0e372854fde7d039
MD5 84feb4699e7262124a1942b4c0073c4b
BLAKE2b-256 66a66b75af9080174825419a953c5616bf5c3e337db9a150dfabbd8f67b9383b

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