Reference / binference.priors.LogisticGP
binference.priors.LogisticGP¶
- class binference.priors.LogisticGP(kernel='matern32', amplitude=None, length_scale=None, mean=None, n_basis=None, boundary_factor=3.0)[source]¶
Gaussian-process prior on log-fractions over a 1-D or N-D grid.
Uses the Hilbert-space reduced-rank approximation (Solin & Sarkka 2020): a fixed sine basis on a box
boundary_factortimes larger than the grid, with weights scaled by the kernel’s spectral density, so amplitude and (per-axis) length scales are inferred jointly with the field. The field is stationary in the measure coordinate of the bins (log z forBins.log), so length scales are in that coordinate.- Parameters:
- kernel{“matern32”, “matern52”, “matern12”, “rbf”}
Covariance kernel.
- amplitudeHyperprior or float
Marginal standard deviation of the log-density field; inferred with a
HalfNormal(2.0)prior by default.- length_scaleHyperprior, float, or sequence or array (one per axis)
Length scale(s) in the measure coordinate. Default: per axis, an inverse gamma with 1% prior mass below the shortest length scale the grid and the basis resolve (the larger of two bin widths and
f * boundary_factor * S / n_basis, withShalf the range andf= 1.3, 1.8, 2.2 and 8.5 for the RBF, Matérn-5/2, -3/2 and -1/2 kernels) and 1% above the axis range, so the field is neither rougher than the prior can represent nor flatter than the data can constrain. Where that lower bound exceeds a quarter of the range (coarse grids), aLogNormalwith standard deviation 1 in log length and median the larger of the bound and half the range instead. A fixed length scale below the bound raises anInputWarning.- meanarray_like (K,), optional
Mean log-fractions (e.g. the log of reference fractions). Defaults to a density flat in the measure coordinate: the GP acts on the log-density.
- n_basisint or sequence, optional
Basis functions per axis. Default: one per bin, up to a total of 1024 (
min(K_d, floor(1024 ** (1 / D))): up to 1024 on 1-D grids, 32 per axis on 2-D grids); increase it for shorter length scales, which also lowers the default length-scale prior.- boundary_factorfloat
Ratio of the approximation box to the grid half-width. With the default 3, the centred covariance is within 4% of the exact kernel’s for length scales up to the range, where 1.5 pulled the edge bins towards the mean).
- __init__(kernel='matern32', amplitude=None, length_scale=None, mean=None, n_basis=None, boundary_factor=3.0)[source]¶
Methods
__init__([kernel, amplitude, length_scale, ...])bind(bins)Attributes
kind"fractions"(a distribution on the simplex) or"rates"