sample_gaussian_bins#

anri.fwd.sample_gaussian_bins(mu, erf_scale, bin_centres, half_widths)[source]#

Integrated intensity of a multivariate Gaussian over an array of axis-aligned bins.

Parameters:
  • mu (Array) – [n] centroid of the Gaussian in (slow, fast, omega[, dty]) coordinates.

  • erf_scale (Array) – [n] per-axis scaling factors \(s_i = \frac{1}{\sigma_i \sqrt{2}}\) precomputed by prepare_gaussian_bin().

  • bin_centres (Array) – [m, n] coordinates of m bin centres to evaluate.

  • half_widths (Array) – [n] half-width \(h_i\) of each bin along each axis, derived from the bin spacing of (slow, fast, omega[, dty]). Each axis carries its own physical units — pixels for slow and fast, degrees for omega, um for dty — so half-widths are not assumed uniform across axes.

Returns:

intensities (jax.Array) – [m] integrated intensity at each bin, fully differentiable with respect to mu and erf_scale.

Notes

For a 1-D Gaussian with mean \(\mu_i\) and standard deviation \(\sigma_i\), the probability mass in the interval \((a, b]\) is [1]:

\[\operatorname{P}(a < x \leq b) = \frac{1}{2}\left[ \operatorname{erf}\!\left(\frac{b - \mu_i}{\sigma_i\sqrt{2}}\right) - \operatorname{erf}\!\left(\frac{a - \mu_i}{\sigma_i\sqrt{2}}\right) \right]\]

Substituting bin edges \(a = x_{ji} - h_i\) and \(b = x_{ji} + h_i\) and writing \(s_i = \frac{1}{\sigma_i\sqrt{2}}\):

\[\operatorname{P}(x_{ji} - h_i < x \leq x_{ji} + h_i) = \frac{1}{2}\left[ \operatorname{erf}\!\left((x_{ji} + h_i - \mu_i) \cdot s_i\right) - \operatorname{erf}\!\left((x_{ji} - h_i - \mu_i) \cdot s_i\right) \right]\]

The full \(n\)-dimensional bin intensity is the product of marginal integrals over each axis:

\[I_j = \prod_{i=1}^{n} \frac{1}{2}\left[ \operatorname{erf}\!\left((x_{ji} + h_i - \mu_i) \cdot s_i\right) - \operatorname{erf}\!\left((x_{ji} - h_i - \mu_i) \cdot s_i\right) \right]\]

This factorisation is exact when \(\Sigma\) is diagonal and accurate when bin widths are small relative to the correlation length of \(\Sigma\).

References

See also

prepare_gaussian_bin

Precomputes \(s_i\) from a covariance matrix.

peak_to_pixels

Evaluates a single peak over a local window using this function.