BUG: Correct AverageDollarVolume NaN handling

`AverageDollarVolume` used `nanmean`, which discards NaNs before
averaging, giving an ADV which is too high for any equities that have
any NaNs.

Changing the method to `nansum` divided by window length so that the
denominator is the same no matter whether there are NaNs or not.
This commit is contained in:
Nathan Wolfe
2016-06-28 17:20:09 -04:00
parent c89e957905
commit e70490a415
+1 -1
View File
@@ -156,7 +156,7 @@ class AverageDollarVolume(CustomFactor):
inputs = [USEquityPricing.close, USEquityPricing.volume]
def compute(self, today, assets, out, close, volume):
out[:] = nanmean(close * volume, axis=0)
out[:] = nansum(close * volume, axis=0) / len(close)
class _ExponentialWeightedFactor(SingleInputMixin, CustomFactor):