factor_tearsheetΒΆ
Defined in fynance.plot
- factor_tearsheet(factor, prices, n_quantiles=5, horizons=(1, 5, 10, 21), w=63, figsize=None, save=None)[source]
Build a full Alphalens-style factor tear-sheet figure.
Composes four panels into a 2x2
Figurefrom a factor panel and its price panel: quantile cumulative returns, the long-short spread equity, the rolling Information Coefficient and the IC decay by horizon. The one-bar forward return (built fromprices) is the target for the quantile and rolling-IC panels; the decay panel uses non-overlappinghorizonsreturns.Alignment.
factor[t]is the score known at bart; the forward returns are built frompricesso no future information leaks in.- Parameters:
- factorarray-like
Factor panel
(T, N).- pricesarray-like
Price panel
(T, N)with the same time index asfactor.- n_quantilesint, optional
Number of factor quantiles (default
5).- horizonstuple of int, optional
Forward horizons for the IC-decay panel (default
(1, 5, 10, 21)).- wint, optional
Trailing window of the rolling IC (default
63).- figsizetuple of float, optional
Figure size; defaults to
(11, 7).- savestr, optional
If given, the figure is written to this path with
savefig.
- Returns:
- matplotlib.figure.Figure