log_non_central_chi¶
Import in python using from mcutils.utils.noise import log_non_central_chi
-
mcutils.utils.noise.
log_non_central_chi
(observed, signal, noise_var, ncoils, derivative='None', log_bessel='approximate')[source]¶ Models the noise as a non-central chi distribution
- Parameters
observed – observed signal
signal – model signal
noise_var – variance of the noise
ncoils – number of coils (equal to degrees of freedom divided by 2)
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 non-central chi distribution and its derivatives if set