Tutorials¶
Learn Portfolio Analysis through hands-on examples.
Interactive Notebooks¶
The best way to learn is by doing. Open these notebooks in Google Colab:
1. Basic Portfolio Analysis¶
What you'll learn:
- Loading historical price data
- Calculating performance metrics
- Comparing portfolios to benchmarks
- Running Monte Carlo simulations
- Visualizing portfolio performance
Time: ~20 minutes
2. Factor Analysis Demo¶
What you'll learn:
- Understanding Fama-French factors
- Running factor regressions (CAPM, FF3, FF5, Carhart)
- Interpreting alpha and factor betas
- Decomposing returns by factor
- Rolling factor analysis
- Factor-aware optimization
Time: ~30 minutes
3. Interactive Portfolio Analysis¶
What you'll learn:
- Using interactive widgets
- Real-time portfolio adjustments
- Preset portfolio templates
- Dynamic visualization
Time: ~15 minutes
Video Tutorials¶
Coming soon! Subscribe to Engineer Investor for updates.
Example Portfolios¶
Classic 60/40¶
Three-Fund Portfolio¶
All-Weather Portfolio¶
Factor Tilted¶
tickers = ['VTI', 'VBR', 'VTV', 'MTUM', 'BND']
weights = [0.25, 0.15, 0.15, 0.15, 0.30]
# Tilts: Small-cap value, Value, Momentum
Common Workflows¶
Workflow 1: Evaluate Your Portfolio¶
- Load your holdings and weights
- Calculate performance metrics
- Compare to a benchmark
- Run factor regression to understand exposures
- Generate a tear sheet report
Workflow 2: Optimize Allocation¶
- Define your investment universe
- Set constraints (max weight, long-only, etc.)
- Run optimization (max Sharpe or min volatility)
- Analyze the efficient frontier
- Backtest the optimal portfolio
Workflow 3: Factor Analysis¶
- Load portfolio returns
- Fetch Fama-French factors
- Run regression to estimate betas
- Decompose returns by factor
- Identify factor tilts and alpha
Streamlit Web App¶
For a no-code experience, try the Streamlit App:
- Select tickers from dropdown
- Adjust weights with sliders
- View instant performance metrics
- Compare to benchmarks
- Download results
Getting Help¶
- GitHub Issues: Report bugs
- Discussions: Ask questions
- Twitter: @egr_investor