lib5c.algorithms.variance.cross_rep module¶
-
lib5c.algorithms.variance.cross_rep.
cross_rep_variance
(obs, model='lognorm', min_disp=1e-08, method='mme')[source]¶ Estimates pixel-wise variance across replicates.
- Parameters
obs (dict or list of np.ndarray) – Dict values or list entries are are square, symmetric count matrices across replicates.
model ({'lognorm', 'nbinom', 'norm'}) – Statistical model to use.
min_disp (float) – Force a minimum value of the dispersion parameter.
method ({'mme', 'mle'}) – When model=’nbinom’, pass ‘mle’ to run maximum likelihood estimation for each pixel independently. Pass ‘mme’ to use method-of-moments variance estimation. Has no effect if model=’lognorm’.
- 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