polars_online.corr.equicorr_row¶
- polars_online.corr.equicorr_row(row: Any) float[source]¶
Estimate the common correlation from one standardized row, by Engle and Kelly’s closed form.
Use it to compute, offline, the per-row estimate a
decomodel reads: Engle and Kelly’s Lemma 2.3. For the mean correlation of a whole matrix, useequicorr().Parameters
rowOne row of
nstandardized values (each series less its mean, over its standard deviation).
Returns
A float:
u = (S1**2 - S2) / ((n - 1) * S2), S1 = sum(x), S2 = sum(x * x)
with
xthe row. It isnanbelow two entries or atS2 = 0.Examples
print(round(po.corr.equicorr_row([1.2, 0.8, 1.0, -0.2]), 3))
0.504
See also
equicorr(), the mean correlation of a matrix.equicorr_loglik(), the row’s log-density at a common correlation.