Equal risk contribution weights on an ill-conditioned covariance
Compute equal-risk-contribution weights for a given covariance matrix to tight tolerance and verify risk contributions.
instruction.md
What the agent sees (CONVENTIONS.md is appended automatically)
Equal risk contribution
Given /app/data/cov.csv (6 x 6, annualised), find long-only fully-invested weights such that each asset's risk contribution w_i (Sigma w)_i / (w' Sigma w) equals 1/6 to within 1e-8.
Write /app/output/weights.json {weights, risk_contributions, portfolio_vol, iterations, method}.
Verification
reward.json metrics · weights sum to 1.00
| Metric | Weight | Check |
|---|---|---|
| rc_equal | 0.6 | max |RC_i - 1/6| < 1e-7. |
| weights | 0.4 | abs 1e-5 vs oracle (solution is unique). |
Harbor scaffold
Generated from this record — task.toml, Dockerfile, verifier, oracle stub
schema_version = "1.4" [task] name = "portfolio-agent-evals/pf-opt-risk-parity" version = "1.0.0" description = "Compute equal-risk-contribution weights for a given covariance matrix to tight tolerance and verify risk contributions." keywords = ["etf", "portfolio", "rebalance", "tax-and-optimization", "optimization", "numerical-methods"] [metadata] author_name = "portfolio-agent-evals" difficulty = "medium" category = "quant-finance" tags = ["tax-and-optimization", "tier-2", "rebalance", "partial"] theme = "Tax-Aware & Constrained Optimization" tier = 2 reward_type = "partial" [agent] timeout_sec = 900.0 [verifier] timeout_sec = 60.0 [environment] # Offline by design: all data is synthetic and generated at build time. network_mode = "none" cpus = 2 memory_mb = 4096 storage_mb = 10240 build_timeout_sec = 900.0
Traps
Each must carry signal: a trap-blind solution must lose credit
- Ill-conditioning stalls naive gradient methods.
- Weights must be normalised after solving the log-barrier form.
Inputs
Fixtures mounted in the environment
- /app/data/cov.csvCovariance derived from the clean panel and scaled to condition number ~1e5.
Outputs
What the verifier reads from /app/output
- /app/output/weights.jsonJSONERC solution.
Anti-gaming
Covariance is seeded.
Oracle notes
solution/solve.sh must score 1.0 on five seeds
Cyclical coordinate descent (Griveau-Billion et al.) or Newton on the log-barrier problem.
Reviews (0)
Design review before a task is marked ready