Skip to content

Processed CRSP

This reusable panel remains at one record per CRSP security-month and adds trailing annualized return features for fiscal-date-aligned Compustat merges.

flowchart LR
    raw[(Project-raw CRSP monthly)] --> rolling[Add trailing annualized metrics]
    rolling --> output[(Processed CRSP monthly)]

    classDef support fill:#fff0cc,stroke:#a66b00,stroke-width:2px
    classDef reusable fill:#e2f2e7,stroke:#3b7a4b,stroke-width:2px
    class raw support
    class output reusable
Inputs
Dataset Location
Project-raw CRSP monthly /data/full/raw/crsp_monthly.parquet
Build
Component Location
Builder shared/data/build_processed_crsp.py
Runtime hct-tower-model-cuda-… (CPU execution)
Entry point python -m shared.data.build_processed_crsp --config shared/config/config_full.yaml
Output
Dataset File / location Grain Key and variables
Processed CRSP crsp.parquet in /data/full/processed/ Security-month Key: permno, mthcaldt; monthly returns plus ret_n, ret_cumulative, ret_annual, ret_vol, retx_n, retx_cumulative, and retx_annual

Each metric uses the calendar month and the preceding eleven calendar months. ret_cumulative and retx_cumulative are actual holding-period compounded returns over observed months. ret_annual and retx_annual annualize those returns as (1 + cumulative)^(12 / n) - 1; ret_vol annualizes monthly total return volatility as sd(monthly returns) × sqrt(12). Rows with fewer than six valid returns are retained but have missing annualized measures. The Compustat merge should select the latest CRSP month on or before datadate.

cd /hct-tower
python -m shared.data.build_processed_crsp \
  --config shared/config/config_full.yaml
slurm/submit.sh --task build-processed-crsp --config config_full.yaml