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).Smoothness is measured per bin step, so the natural scale of
scaledepends on the binning.- 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 (a linear trend of root-mean-square size
tchanges the log-density by about3.5 tend to end), whatever the number of bins.
Methods
__init__([order, scale, mean, trend_scale])bind(bins)Attributes
kind"fractions"(a distribution on the simplex) or"rates"