log_rician

Import in python using from mcutils.utils.noise import log_rician

mcutils.utils.noise.log_rician(observed, signal, noise_var, derivative='None', log_bessel='approximate')[source]

Models the noise as a Rician distribution

Parameters
  • observed – observed signal

  • signal – model signal

  • noise_var – variance of the noise

  • derivative

    set to one of:

    • ”None”: no derivative

    • ”signal”: add derivatives wrt signal

    • ”noise_var”: add derivative wrt noise variance

    • ”both”: add derivatives wrt signal and noise variance

  • log_bessel

    method to evaluate the log-bessel function; one of:

    • ”approximate”: Uses scipy if possible and approximations if too small or large (error of up to 1%, but typically much smaller)

    • ”scipy”: uses the default scipy interpretation, which will return -np.inf or np.inf if too small/large

    • ”precise”: Uses mpmath to precisely evaluate the value. This is very slow

    • ”interpolate”: use cubic interpolation between pre-computed “precise” values. Will become slow if values vary too much.

Returns

log(P) of the Rician distribution