What problem does it solve?
This Skill eliminates the complex and time-consuming manual calculations involved in mean-variance portfolio optimization. It helps users effortlessly determine optimal asset allocations, understand risk-return tradeoffs, and identify the tangency portfolio, saving significant effort and reducing the potential for error in financial analysis.
Core Features & Use Cases
- Optimal Portfolio Weights: Automatically calculates the precise allocation for each asset to maximize the Sharpe ratio, allowing for both long and short positions.
- Sharpe Ratio Maximization: Identifies the tangency portfolio—the most efficient risky portfolio that offers the highest expected return per unit of risk.
- Detailed Financial Explanation: Provides comprehensive interpretations of the optimization results, including the rationale behind asset allocations, diversification benefits, and the economic intuition of modern portfolio theory.
- Use Case: An investment analyst needs to quickly determine the optimal asset allocation for a client's multi-asset portfolio, considering various expected returns, risks, and correlations. This Skill interactively gathers the necessary data, performs the complex calculations, and presents a clear, actionable portfolio strategy with detailed explanations.
Quick Start
Run the interactive optimization script and follow the prompts:
python .claude/skills/mean-variance-optimization/scripts/optimize_portfolio.py