Mathematical Finance research

Portfolio Research
Infrastructure

WRDS CRSP CIZ Waterloo CPU26 Python

I built a point-in-time WRDS/CRSP data pipeline, ran portfolio experiments on Waterloo CPU26, and evaluated realized risk, turnover and trading costs.

Data CRSP equity historyCompute Waterloo CPU26Output Risk and cost tables

Architecture

Data flow SSH access
Data flow: WRDS CRSP CIZ, server-side point-in-time filtering, bounded PostgreSQL streaming, then Waterloo CPU26. Inside CPU26: persistent parallel controller, covariance and portfolio construction, out-of-sample risk, turnover and costs, then QA and manuscript outputs. A separate dashed SSH access and control lane connects to CPU26; tmux jobs survive local SSH or VPN disconnects.
WRDS queries run against the database. Portfolio computation runs on CPU26; SSH provides access and job control.

Technologies

  • Python
  • WRDS PostgreSQL
  • CRSP CIZ
  • SSH
  • Waterloo CPU26
  • tmux
  • multiprocessing
  • Git

Workflow

Point-in-Time Data

SQL joins CRSP records by their effective dates and ranks eligible stocks by market capitalization.

Remote Compute

The CPU26 documentation lists SSH access, CPU and memory capacity, and resource checks.

Overnight Runs

tmux runs continue after an SSH or VPN disconnect, and checkpoints let interrupted jobs resume.

Parallel Experiments

The simulation report lists completed shards, worker-count timings and a resumption test.

Portfolio Construction

Table 2 compares realized risk for portfolios with 10, 20 and 50 holdings.

Selected Outputs

Table G.2 compares portfolio risk, turnover, returns and modeled trading costs.

Completed Runs

Historical Portfolio Run

27 August 2026

432/432Monthly tasks completedZero failed tasks
7.35MSource rows streamed7,354,481 rows in 230 SQL chunks
32Parallel workersOne numerical-library thread per process
17m 21sRun duration1,041.2 seconds

Configured limits 140-worker ceiling · 40 GiB minimum RAM headroom · 6-hour runtime limit · one numerical thread per process. The run used 32 workers.

Random-subset portfolio experiment using monthly historical equity returns.

Monte Carlo Compute Run

22 August 2026

28.32MMonte Carlo replicationsSynthetic data
55,371Completed shardsCheckpointed experiment partitions
32Worker processesOne thread per process
1h 37m 33sRun durationSynthetic run

The resumed pilot produced the same CSV, byte for byte, after the worker count changed.

Git commits and environment recordsConfiguration and protocol hashesNo-lookahead and invariant checksSummary tables and diagnostics

Portfolio Results

The study compares portfolios selected from the estimated covariance matrix with portfolios selected after switching correlation signs.

1990–2025Monthly holding periods
200 equitiesPoint-in-time universe
504 sessionsTrailing estimation window
10, 20 or 50Holdings per sparse portfolio
Realized risk

Observed portfolios had lower mean variance than the sign-orbit average.

Sign switches preserve eigenvalues, individual variances and absolute correlations. All portfolios are evaluated on the same subsequent returns.

10 holdings0.0318 0.0518
20 holdings0.0282 0.0459
50 holdings0.0275 0.0385

Mean annualized realized variance · observed / sign-orbit mean

This historical comparison holds the estimator, portfolio rule and evaluation dates fixed while changing covariance signs.

Portfolio Choice under
Spectral Covariance Ambiguity

Evidence

Scroll to inspect the full source or table. Press Escape to close.