skfolio.attribution.AssetBreakdown#
- class skfolio.attribution.AssetBreakdown(names, vol_contrib, pct_total_variance, mu_contrib, weight, weight_std, systematic_vol_contrib, systematic_mu_contrib, idio_vol_contrib, idio_mu_contrib, vol, mu, corr_with_ptf)[source]#
Per-asset attribution breakdown.
Decomposes each asset’s volatility and return contribution into systematic and idiosyncratic components.
For single-point attribution, arrays have shape
(n_assets,). For rolling attribution, arrays have shape(n_windows, n_assets).- Attributes:
- namesndarray of shape (n_assets,)
Asset names. Always 1D.
- weightndarray of shape (n_assets,) or (n_windows, n_assets)
Portfolio asset weights.
- weight_stdndarray of shape (n_assets,) or (n_windows, n_assets), or None
Standard deviation of asset weights over time.
Nonewhen weights are not time-varying.- vol_contribndarray of shape (n_assets,) or (n_windows, n_assets)
Total asset volatility contribution. Sums to
total.vol.- systematic_vol_contribndarray of shape (n_assets,) or (n_windows, n_assets)
Asset volatility contribution attributed to factor exposures. Sums to
systematic.vol_contrib.- idio_vol_contribndarray of shape (n_assets,) or (n_windows, n_assets)
Asset volatility contribution not attributed to factor exposures. Sums to
idio.vol_contrib.- mu_contribndarray of shape (n_assets,) or (n_windows, n_assets)
Total asset return contribution. Sums to
total.mu.- systematic_mu_contribndarray of shape (n_assets,) or (n_windows, n_assets)
Asset return contribution attributed to factor exposures. Sums to`systematic.mu`.
- idio_mu_contribndarray of shape (n_assets,) or (n_windows, n_assets)
Asset return contribution not attributed to factor exposures. Sums to
idio.mu.- pct_total_variancendarray of shape (n_assets,) or (n_windows, n_assets)
Percentage of total portfolio variance.
- volndarray of shape (n_assets,) or (n_windows, n_assets)
Standalone asset volatility: \(\sqrt{(B F B^\top + D)_{ii}}\).
- mundarray of shape (n_assets,) or (n_windows, n_assets)
Standalone asset return: expected return for predicted attribution and mean return for realized attribution.
- corr_with_ptfndarray of shape (n_assets,) or (n_windows, n_assets)
Asset correlation with portfolio returns.