BinomialProdLik¶
- class glimix_core.lik.BinomialProdLik(ntrials, link=None)[source]¶
Product of Binomial likelihoods.
The product can be written as
\[\prod_i \binom{n_i}{n_i y_i} p_i^{n_i y_i} (1-p_i)^{n_i - n_i y_i}\]where \(p_i\) is the probability of success.
- Parameters
ntrials (array_like) – Array of number of trials.
link (link_func) – Link function establishing \(g(p_i) = x_i\). Defaults to
None
, which leads to theglimix_core.link.LogitLink
link function.
Methods
__init__
(ntrials[, link])Initialize self.
mean
(x)Mean of the number of successful trials.
sample
(x[, random_state])Sample from the likelihood distribution.
Attributes
name
Get the name of this likelihood.
nsuccesses
Get or set an array of successful trials.
ntrials
Get the array of number of trials.
sample_size
Get the number of samples.