bayesplain.core.correlation.rho_grid

bayesplain.core.correlation.rho_grid(r, n, points=1201)[source]

Build a grid over (-1, 1) that resolves a sharply peaked posterior.

A uniform grid wastes most of its points far from the peak and, for large samples, may not place enough of them near it. This combines a coarse sweep of the whole interval with a fine sweep concentrated where the posterior actually has mass, located using the Fisher-z approximation.

Parameters:
r : float

Observed correlation.

n : int

Number of pairs.

points : int, default 1201

Approximate number of grid points in each of the two components.

Returns:

Strictly increasing grid, strictly inside (-1, 1).

Return type:

ndarray