lib5c.algorithms.variance.deviation module

lib5c.algorithms.variance.deviation.deviation_variance(obs, exp, model='lognorm', min_disp=1e-08)[source]

Estimates pixel-wise variance as the squared deviation between observed and expected values.

Parameters
  • exp (obs,) – Square, symmetric matrix of observed and expected values, respectively.

  • model ({'lognorm', 'nbinom', 'norm'}) – Statistical model to use.

  • min_disp (float) – Force a minimum value of the dispersion parameter.

Returns

The first three elements are the mean parameter estimate, dispersion estimate, and variance estimate, respectively, for each pixel. The fourth element is a boolean matrix showing which pixels are considered to be overdispersed.

Return type

tuple of np.ndarray