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 deviationscale:order=1penalises jumps,order=2penalises curvature. N-D grids use the Kronecker-sum (ICAR-type) precision. Polynomial modes not penalised by the random walk (e.g. a linear trend fororder=2) get a broad Gaussian prior set bytrend_scale. On N-D grids these are the products of each axis’s unpenalised polynomials, so fororder=2in 2-D the surface \(xy\) is unpenalised too (and \(x^2y^2\) fororder=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
scaledepends 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
tchanges the log-density by about3.5 tend to end, whatever their number.
Methods
__init__([order, scale, mean, trend_scale])bind(bins)