Implementing Count, Regression Beta, and Regression Residual Alpha Factors
Summary
The document explains practical definitions for three functions used in the Guotai Junan Alpha191 factor set. Count is illustrated as summing a binary condition over a rolling window, such as counting days when the current close exceeds the previous close. This turns a Boolean comparison into a rolling frequency or tally.
Regression beta is defined as the rolling regression coefficient of one series against another, illustrated with returns regressed on closing prices. Regression residual is then calculated by subtracting the beta-scaled second series from the first. The examples use a five-period window, and the residual is described in relation to the same window as the beta estimate. The text gives definitions and code-style examples but no factor rationale, empirical results, or guidance on missing data, intercept handling, or implementation differences across libraries.
Key ideas
- Count can be implemented by converting a condition into ones and zeros, then summing over a rolling window.
- The example count measures how often the current close exceeds the previous close over five periods.
- Regression beta is the rolling coefficient from regressing one time series on another.
- The regression residual is formed by subtracting the beta-scaled second series from the first.
- The document gives implementation examples but no empirical validation or details about regression conventions.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.