quantlab.factor.predefined.neutralized#
Neutralized factor: another factor’s outputs neutralized against industry and size.
A stock alpha often carries part of its signal through which industry a
stock is in and how large it is. NeutralizedFactor wraps any factor and
takes those parts out: on every bar each output is replaced by its residual
from a cross-sectional regression on industry, on the log market cap, or on
both (quantlab.factor.kunquant_cs.CrossSectionalNeutralize, by ordinary
least squares over every symbol), and the residual is z-scored again
(CrossSectionalZScore). The outputs keep the wrapped factor’s names, so
the wrapper replaces the factor in a model’s config without anything else
changing.
The wrapped factor computes, warms up and stores as it always does; the
wrapper reads its outputs with compute and the exposures (market cap and
industry) from its own dataset on the same bars, never earlier ones.
Classes
The outputs of |