portfolio-optimization-guide
Portfolio theory, optimization algorithms, and asset allocation methods
npx skills add brycewang-stanford/Auto-Empirical-Research-Skills --skill portfolio-optimization-guide --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# Portfolio Optimization Guide A skill for implementing and researching portfolio optimization methods, from classical mean-variance optimization to modern robust and factor-based approaches. Covers Markowitz theory, Black-Litterman, risk parity, and machine learning-enhanced portfolio construction. ## Mean-Variance Optimization ### Classical Markowitz Portfolio ```python import numpy as np from scipy.optimize import minimize def mean_variance_optimize(expected_returns: np.ndarray, cov_matrix: np.ndarray, target_return: float = None, risk_free_rate: float = 0.02) -> dict: """ Markowitz mean-variance optimization. expected_returns: array of expected returns for each asset cov_matrix: covariance matrix of asset returns target_return: target portfolio return (None for max Sharpe) """ n_assets = len(expected_returns) def portfolio_volatility(weights): return np.sqrt(weights @ cov_matrix @ weights) def neg_sharpe(weights): ret = weights @ expected_returns vol = portfolio_volatility(weights) return -(ret - risk_free_rate) / vol # Constraints constraints = [ {"type": "eq", "fun": lambda w: np.sum(w) - 1}, # weights sum to 1 ] if target_return is not None: constraints.append( {"type": "eq"
- Mean-Variance Optimization
- Classical Markowitz Portfolio
- Efficient Frontier
- Black-Litterman Model
- Incorporating Investor Views
- Risk Parity
- Equal Risk Contribution Portfolio
- Factor-Based Portfolio Construction
- Fama-French Factor Exposures
- Rebalancing and Transaction Costs
- Optimal Rebalancing with Costs
- Key Academic References
- Tools and Libraries
What does the portfolio-optimization-guide skill do?
Portfolio theory, optimization algorithms, and asset allocation methods
How do I install it?
Run `npx skills add brycewang-stanford/Auto-Empirical-Research-Skills --skill portfolio-optimization-guide --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From brycewang-stanford/Auto-Empirical-Research-Skills, a repository with 3,244 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.