From f35f65a1230773ceebb3365de0d4e9d0bb67c4a6 Mon Sep 17 00:00:00 2001 From: dmichalowicz Date: Wed, 18 May 2016 15:10:55 -0400 Subject: [PATCH] DOC: Add notes about masking --- zipline/pipeline/factors/technical.py | 29 +++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/zipline/pipeline/factors/technical.py b/zipline/pipeline/factors/technical.py index 88b141a5..d148677d 100644 --- a/zipline/pipeline/factors/technical.py +++ b/zipline/pipeline/factors/technical.py @@ -217,6 +217,15 @@ class RollingPearsonOfReturns(_RollingCorrelationOfReturns): correlation_length : int >= 1 Length of the lookback window over which to compute each correlation coefficient. + mask : zipline.pipeline.Filter, optional + A Filter describing which assets should have their correlation with the + target asset computed each day. + + Note + ---- + Computing this factor over many assets can be time consuming. It is + recommended that a mask be used in order to limit the number of assets over + which correlations are computed. Example ------- @@ -285,6 +294,15 @@ class RollingSpearmanOfReturns(_RollingCorrelationOfReturns): correlation_length : int >= 1 Length of the lookback window over which to compute each correlation coefficient. + mask : zipline.pipeline.Filter, optional + A Filter describing which assets should have their correlation with the + target asset computed each day. + + Note + ---- + Computing this factor over many assets can be time consuming. It is + recommended that a mask be used in order to limit the number of assets over + which correlations are computed. See Also -------- @@ -312,9 +330,16 @@ class RollingLinearRegressionOfReturns(CustomFactor, SingleInputMixin): returns require a window length of 2. regression_length : int >= 1 Length of the lookback window over which to compute each regression. + mask : zipline.pipeline.Filter, optional + A Filter describing which assets should be regressed against the target + asset each day. + + Notes + ----- + Computing this factor over many assets can be time consuming. It is + recommended that a mask be used in order to limit the number of assets over + which regressions are computed. - Note - ---- This factor is designed to return five outputs: - alpha, a factor that computes the intercepts of each regression. - beta, a factor that computes the slopes of each regression.