portfolio

Optimize asset allocation with Markowitz, Black-Litterman, and hierarchical clustering methods.

173|28|Updated Jun 2, 2026
One-click install
npx skills add https://github.com/gauss314/skills --skill portfolio-gauss314
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: portfolio
Source: https://github.com/gauss314/skills/tree/main/skills/portfolio
Command: npx skills add https://github.com/gauss314/skills --skill portfolio-gauss314

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires numpy, pandas, scipy, and includes scripts (resource) and references (resource) and assets (resource) components.

What problem does it solve?

This skill solves the challenge of constructing robust, diversified investment portfolios that are resistant to market noise and instability, moving beyond simple mean-variance models.

Core Features & Use Cases

  • Advanced Optimization: Implements Markowitz, Black-Litterman (Bayesian), and Hierarchical (HRP/HERC/NCO) models.
  • Risk Management: Provides over 30 performance and risk metrics including VaR, CVaR, and Drawdown analysis.
  • Use Case: Use this skill to build a diversified portfolio of assets by clustering them hierarchically to reduce noise, then applying Black-Litterman to incorporate your specific market views.

Quick Start

Run the portfolio skill to calculate the optimal asset weights for a maximum Sharpe ratio using the provided sample returns file.

Frequently Asked Questions about portfolio

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How does Black-Litterman portfolio optimization improve on standard Markowitz mean-variance models?

Black-Litterman portfolio optimization improves on Markowitz by applying a Bayesian framework that incorporates your specific market views, producing asset allocations that are more resistant to market noise and instability than simple mean-variance outputs.

How do I calculate optimal asset weights for a maximum Sharpe ratio using Python?

You can calculate optimal asset weights for a maximum Sharpe ratio by running quantitative optimization with numpy and scipy, processing sample returns data to find the risk-efficient Capital Market Line allocation.

Can I compute VaR, CVaR, and Drawdown risk metrics without heavy external dependencies?

Yes, you can compute over 30 performance and risk metrics including VaR, CVaR, and Drawdown analysis using only numpy, pandas, and scipy, avoiding external heavy dependencies entirely.

What is hierarchical risk parity and when do I need it for asset allocation?

Hierarchical risk parity is a clustering-based asset allocation method that groups correlated assets to reduce noise. You need it when constructing diversified portfolios that resist instability better than standard mean-variance models.

Does this portfolio optimization approach work with pandas DataFrames for returns data?

Yes, the portfolio optimization approach works with pandas DataFrames, utilizing pandas alongside numpy and scipy to execute the mathematical computations required for asset allocation and risk measurement.

What are the limitations of hierarchical clustering for portfolio risk management?

Hierarchical clustering for portfolio risk management is limited by its reliance on historical return data quality; while it reduces noise through clustering, it cannot predict unprecedented market shocks that fall outside the Capital Market Line analysis.