polars_online.corr.from_z

polars_online.corr.from_z(z: Any) → Any[source]

Map Fisher’s z back to a correlation, tanh(z), elementwise.

Use it to return an average, a difference or a bound computed on the z scale to the correlation scale. It is the inverse of to_z() away from that function’s clip.

Parameters

z

A value of z, or an array of them.

Returns

A float, or a float array of z’s shape, each in [-1, 1].

Examples

z = po.corr.to_z([0.2, 0.6])
print(po.corr.from_z(z.mean()).round(3))     # the mean correlation on the z scale
0.42

See also