decompose_factors
Explain WHAT DRIVES the returns of a ticker, ETF or built-in portfolio by decomposing them into common factor exposures (market, size, value, momentum, quality, low-volatility, duration, credit) plus an idiosyncratic residual. Use this when the user asks why two assets move together, what a fund is really exposed to, whether a stock is a growth or value tilt, how much of a return is just market beta, whether it has real alpha, or what is driving a portfolio's returns. Returns betas (loadings), t-stats, an additive variance decomposition (shares sum to R²), annualized alpha, idiosyncratic vs total volatility, and for a portfolio the holdings that drive each factor. Computed by OLS regression on real price history via tradeable ETF proxies (long-short factor spreads): measured exposure, not a forecast. Provide exactly one of target (a ticker, computed live), template (a built-in model portfolio), strategy (a canonical strategy) or assets (your own allocation, including nested portfolios, rotations and strategies as holdings, computed live); portfolio ids are answered from precomputed monthly data through the stated month. Portfolios (ids and assets) use the five default factors (market, size, value, duration, credit), are monthly and ignore frequency and factors. For performance numbers use analyze_portfolio. Read-only.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| label | No | Optional display name for a custom `assets` portfolio. Default "Custom portfolio". | |
| assets | No | Your own allocation instead of an id, computed live (monthly, default factors; the answer also lists the holdings behind each factor). Same format as analyze_portfolio: plain tickers and nested portfolios, rotations or strategies via `sleeve`. Weights in percent, summing to ~100. | |
| target | No | Yahoo Finance ticker to decompose, e.g. AAPL, QQQ, TLT, ARKK. Omit when using `template` or `strategy`. | |
| factors | No | Factor ids to include. Default: MKT, SMB, HML, TERM, CREDIT (long history back to ~2001). All available: MKT, SMB, HML, MOM, QMJ, LOWVOL, TERM, CREDIT. The smart-beta trio (MOM, QMJ, LOWVOL) only has history from ~2011-2013, which shortens the analyzable window — factors without enough overlap are dropped and reported. | |
| overlay | No | Optional portfolio-level trend-filter overlay applied to the WHOLE book: hold the entire portfolio only while its own level is above its N-month moving average, otherwise cash. Composition is monthly (a 10-month filter ≈ the classic 200-day one). | |
| strategy | No | Canonical rule-based strategy whose returns to decompose, e.g. dual-momentum-gem. One of: dual-momentum-gem, tsmom-sp500, faber-trend-timing, sector-momentum-rotation, risk-parity-inverse-vol, gtaa-aggressive, adaptive-asset-allocation. Precomputed; default factors. | |
| template | No | Built-in model portfolio whose returns to decompose, e.g. all-weather. One of: golden-butterfly, all-weather, permanent, dragon, faber-ivy, faber-gaa, bogleheads-3fund, wealthfront-classic, betterment-core, classic-60-40, classic-40-60, swensen, ferri-core-four, couch-potato, coffeehouse, no-brainer, larry, buffett-90-10, total-sp500. Precomputed; default factors. | |
| frequency | No | Return frequency for the regression of a `target` ticker. Monthly (default) is standard for factor analysis. Ignored for `template` / `strategy` (always monthly). | 1mo |
| rebalance | No | Rebalancing cadence for custom portfolios (templates use their own). | yearly |