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_ker * boundary_factor * Delta / n_basis, withDeltahalf the range andf_ker= 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 shortest the basis resolves (f_ker * boundary_factor * Delta / n_basis) 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. By default, as many as the axis’s narrowest bin fits across its range in the measure coordinate: one per bin on bins of equal width. The default is at most four per bin and 1024 in all (
floor(1024 ** (1 / D))per axis: 1024 on 1-D grids, 32 per axis on 2-D grids). Raise it for shorter length scales; that 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)