bayesplain.core.correlation.log_sampling_density

bayesplain.core.correlation.log_sampling_density(r, rho, n)[source]

Log density of an observed correlation given the true one.

Parameters:
r : float

Observed sample correlation, strictly inside (-1, 1).

rho : float or array_like

True correlation(s) to evaluate at, strictly inside (-1, 1).

n : int

Number of paired observations.

Returns:

log f(r | rho, n), matching the shape of rho.

Return type:

float or ndarray

Notes

Exact, not an approximation: this is the Hotelling density, and the hypergeometric factor is what makes it exact rather than the more familiar Fisher-z normal approximation.