Reference / binference.priors.LogisticRandomWalk

binference.priors.LogisticRandomWalk

class binference.priors.LogisticRandomWalk(order=2, *, scale=None, mean=None, trend_scale=3.0)[source]

Random-walk (intrinsic GMRF) smoothness prior on log-fractions over a grid.

The order-th differences of \(\eta = \log\rho\) (between adjacent bins along each axis) are Gaussian with standard deviation scale: order=1 penalises jumps, order=2 penalises curvature. N-D grids use the Kronecker-sum (ICAR-type) precision. Polynomial modes not penalised by the random walk (e.g. a linear trend for order=2) get a broad Gaussian prior set by trend_scale. On N-D grids these are the products of each axis’s unpenalised polynomials, so for order=2 in 2-D the surface \(xy\) is unpenalised too (and \(x^2y^2\) for order=3).

Differences are taken at the bin centres in the measure coordinate \(u\), in units of their mean spacing along each axis. On bins of equal width they are the differences between adjacent bins. On unequal bins a step over a wider gap may be larger. The natural size of scale depends on the number of bins per axis.

Parameters:
order{1, 2, 3}

Order of the differences.

scaleHyperprior or float

Standard deviation of the differences; inferred with a HalfNormal(1.0) prior by default.

meanarray_like (K,), optional

Mean of the log-fractions, e.g. log(reference) to shrink toward reference fractions. Defaults to a density flat in the measure coordinate, so differences penalise the log-density.

trend_scalefloat

Prior size of the unpenalised polynomial trends. It is the standard deviation of the root-mean-square size, across the grid, of each such mode. On bins of equal width, a linear trend of root-mean-square size t changes the log-density by about 3.5 t end to end, whatever their number.

__init__(order=2, *, scale=None, mean=None, trend_scale=3.0)[source]

Methods

__init__([order, scale, mean, trend_scale])

bind(bins)