monte_carlo_factor_mining
Run Monte Carlo simulations of random stock portfolios to identify significant factors driving Sharpe ratios. Outputs factor rankings, Pearson r, R², and scatter data for hypothesis generation.
Instructions
蒙地卡羅隨機選股因子挖掘(B2 Factor Mining)— 翻轉「哪個組合最好」(brute force selection bias 必死)為「好組合的共同特徵是什麼」。跑 N 個隨機組合 → 對每個組合算因子暴露(動能 / 波動度 / 規模 / 產業集中度...)→ 對 (factor, sharpe) 做迴歸找出顯著因子。輸出:因子排序 + Pearson r + R² + scatter raw data。屬研究工具,輸出應做新策略假設源、不該直接交易。
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| market | No | 市場 TW 或 US,預設 TW | |
| startDate | Yes | 回測起日 YYYY-MM-DD | |
| endDate | Yes | 回測迄日 YYYY-MM-DD | |
| nPicks | No | 隨機抽幾檔(2-50,預設 10) | |
| nSimulations | No | 次數(100-5000,預設 1000) |