rheon.corr.absorption_shift¶
- rheon.corr.absorption_shift(ar_fast: Any, ar_slow: Any, *, scale: float | None = None) Any[source]¶
Compute Kritzman, Li, Page and Rigobon’s standardized absorption shift.
Use it to flag a rise in how much the series move as one: a fast absorption ratio against a slow one, in units of the slow one’s spread. Compute each ratio with
absorption()over windows of your choice.Parameters
ar_fast,ar_slowTwo series of absorption ratios aligned row by row, the first over a short window and the second over a long one.
scaleThe divisor. Default
None, the population standard deviation ofar_slowover the sample (dividing by the number of rows).
Returns
A float array,
(ar_fast - ar_slow) / scaleelementwise, ornanthroughout wherescaleis not above 0.Raises
ValueErrorar_fastandar_slowof different shapes.
Examples
fast = np.array([0.60, 0.62, 0.70, 0.80]) slow = np.array([0.60, 0.61, 0.63, 0.66]) print(rp.corr.absorption_shift(fast, slow).round(2))
[0. 0.44 3.06 6.11]
See also
absorption(), the ratio.
Notes
The function’s older name,
shift, is refused, and the error names this one: Polars usesshiftfor a lag.