lib5c.algorithms.variance.combined module

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

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

Parameters
  • obs (dict or list of np.ndarray) – Dict values or list entries are are square, symmetric count matrices across replicates.

  • exp (np.ndarray) – Square, symmetric matrix of expected values.

  • rep (int or str) – The index into obs identifying which replicate to compute variance estimates for.

  • model ({'lognorm', '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