Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🍏 Apple Inc. (AAPL): Memory Cost Absorption & Valuation Model

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.


📌 Overview & Financial Thesis

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:

  1. 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.
  2. 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.
  3. 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.

🚀 Key Features

  • 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 yfinance and edgartools for financial statement parsing and peer vendor gross margin tracking (MU, WDC).

📁 Project Structure

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

About

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.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages