Skip to main content

The bundled opensource toolkit for book Navigate through the Factor Zoo: The Science of Factor Investing.

Project description

F.I.R.E. Factor Investment Research Engine

This repo is the bundled opensource toolkit for book Navigating the Factor Zoo:The Science of Quantitative Investing.

Installation

# for stable version
pip install firefin

# for test and nightly version
pip install -i https://test.pypi.org/simple/ firefin

# Install from source for loacl testing!!!
## replace $ThisRepoURL with the actual repo url
git clone $ThisRepoURL 
## install from source
pip install -e .

Usage

Download the data from here

run the command and download data put in correct path automatically.

# We have not released this repo yet, so you need download the data manually!!! See command below!!!
# Auto download data
firefin download

If you have already downloaded the data from here, you can run the command to check the data and put the data in the correct path

# replace path_to_data.tar.gz with the actual path
firefin load path_to_data.tar.gz

Start to code

import firefin

# get data
data = firefin.fetch_data(["open", "close", "volume"])
open_price = data["open"]


def pv_corr(close, volume):
    # price volume correlation
    return close.rolling(20).corr(volume)


factor = pv_corr(data["close"], data["volume"])

# compute forward returns
fr = firefin.compute_forward_returns(open_price.shift(-1), [1, 5, 10])

# evaluate factor
mng = firefin.Evaluator(factor, fr)
mng.get_ic("pearson")
mng.get_quantile_returns(5)

Features

  1. handy functions for fast factor computation
  2. various tools for factor evaluation

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

firefin-0.2.1.tar.gz (35.9 kB view details)

Uploaded Source

Built Distribution

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

firefin-0.2.1-py3-none-any.whl (45.0 kB view details)

Uploaded Python 3

File details

Details for the file firefin-0.2.1.tar.gz.

File metadata

  • Download URL: firefin-0.2.1.tar.gz
  • Upload date:
  • Size: 35.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for firefin-0.2.1.tar.gz
Algorithm Hash digest
SHA256 740685250906dd571ab54c81fdc33f734e0efc14e09dc259aad7560c39cafac4
MD5 5a34d083fe5841665215ad5f23a6c744
BLAKE2b-256 c5d78ac3709514b77cee0697ead7693f5763ba784073ea6bc4a6beb4621980b8

See more details on using hashes here.

Provenance

The following attestation bundles were made for firefin-0.2.1.tar.gz:

Publisher: pypi.yaml on fire-institute/fire

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file firefin-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: firefin-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 45.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for firefin-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6ff11c479e258a2eac40379b70a379c702e1e45b1c3b754ec409521a9628e3e0
MD5 c6d2c3e1c021f9289cd52d66f77ea76c
BLAKE2b-256 e4a4b641df8b78512e1049e2f007212b783f1b56fca19797d33cc2a21711df30

See more details on using hashes here.

Provenance

The following attestation bundles were made for firefin-0.2.1-py3-none-any.whl:

Publisher: pypi.yaml on fire-institute/fire

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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