How abdulgh/eigenvalueclipping works
Project Type and Purpose
• This is a command-line‐driven, Dockerized C++ application for estimating stock returns & covariances and computing optimal portfolios (Sharpe/min-variance etc.).
• It ingests time series data (from Tiingo or CSV), runs various statistical estimators, and outputs performance metrics and optional plots.
Top‐Level Components
a. External Services & Data Sources
• Tiingo REST API (HTTP GET)
• Local CSV files (in ./csv/)
b. Data Access Layer
• src/http module: performs GET requests to Tiingo
• src/io module: reads/writes timeseries via mmap or CSV
c. Core Processing Layer
• src/stats module subdivided into:
• Return Estimators (historical, uniform, CAPM, James-Stein)
• Covariance Estimators (sample, Marchenko–Pastur clipping)
• Portfolio Optimizer (min-variance, Sharpe max)
d. Utilities
• src/util module: CSV parsing, date utilities, download helpers, ticker iteration
• src/common.h & src/run.h: global config & orchestration
e. User‐Facing Application
• src/main.cpp: bootstraps Docker/CMake build, reads config (.env), invokes the orchestration
• Optional graphics runner if SHOW_GFX=ON
f. Testing & CI
• test/ folder: unit tests for date utils, I/O, HTTP caching, power-method, integration
Infrastructure & Build
• Dockerfile + .dockerignore: containerizes the runtime environment, sets up g++/OpenMP
• CMakeLists.txt: defines build targets, flags, and the SHOW_GFX option
• tickers.txt: input list of S&P500 symbols