An interactive quantitative finance and econometrics platform designed to model Apple Inc.'s Gross Margin (GM) sensitivity to memory component price shocks (DRAM / 3D NAND), conduct 1-day post-earnings event studies, and simulate 63-day Post-Earnings Announcement Drift (PEAD) trajectories.
Standard P/E and EPS discount models fail when evaluating supply chain commodity cost spikes because component price inflation hits Hardware Cost of Goods Sold (COGS) long before impacting reported GAAP EPS. Memory components (DRAM & NAND) constitute ~12% of Apple's total hardware Bill of Materials (BOM).
This application bridges financial supply chain mechanics with econometric modeling:
-
Layer 1 (Gross Margin Bridge): Quantifies exact Gross Margin compression (
$\text{bps}$ ) and EPS squeeze based on vendor contract hedging ratios and memory price shocks. -
Layer 2A (1-Day Event Study): Fits an Ordinary Least Squares (OLS) regression with Huber-White (
$HC_1$ ) robust standard errors to estimate earnings-day abnormal returns relative to $QQQ. - Layer 2B (63-Day PEAD & Multiple Drift): Fits ElasticNet and XGBoost regressors to predict 3-month excess returns and forward P/E multiple expansion/contraction.
- Interactive Streamlit Dashboard: Real-time sensitivity sliders for memory price inflation, hedge ratios, BOM weight, and management guidance revisions.
- Gross Profit Absorption Waterfall Chart: Visualizes step-by-step margin destruction from baseline gross profit down to revised gross profit.
- 63-Day Relative Return Trajectories: Plotly time-series tracking Base, Bull (+2% margin expansion), and Bear (-2% margin contraction) stock paths vs $QQQ.
- Automated Data Ingestion: Integrated via
yfinanceandedgartoolsfor financial statement parsing and peer vendor gross margin tracking (MU,WDC).
aapl_memory_model/
├── app.py # Streamlit interactive dashboard UI & Plotly charts
├── data_engine.py # Financial statement ingestion, peer margins & GM squeeze logic
├── model_pipeline.py # OLS event study, ElasticNet, and XGBoost ML pipelines
├── config.py # SEC EDGAR identity, ticker constants & sensitivity defaults
├── LLM_HANDOVER.txt # Complete code base & troubleshooting context dump for LLMs
└── .gitignore # Ignores venv, bytecode, and OS configuration files