statsmodels.genmod.families.family.Binomial

class statsmodels.genmod.families.family.Binomial(link=None, check_link=True)[source]

Binomial exponential family distribution.

Parameters:
linka link instance, optional

The default link for the Binomial family is the logit link. Available links are logit, probit, cauchy, log, loglog, and cloglog. See statsmodels.genmod.families.links for more information.

check_linkbool

If True (default), then and exception is raised if the link is invalid for the family. If False, then the link is not checked.

Attributes:
Binomial.linka link instance

The link function of the Binomial instance

Binomial.variancevarfunc instance

variance is an instance of statsmodels.genmod.families.varfuncs.binary

Methods

variance

See also

statsmodels.genmod.families.family.Family

Parent class for all links.

Link Functions

Further details on links.

Notes

endog for Binomial can be specified in one of three ways: A 1d array of 0 or 1 values, indicating failure or success respectively. A 2d array, with two columns. The first column represents the success count and the second column represents the failure count. A 1d array of proportions, indicating the proportion of successes, with parameter var_weights containing the number of trials for each row.

Methods

deviance(endog, mu[, var_weights, ...])

The deviance function evaluated at (endog, mu, var_weights, freq_weights, scale) for the distribution.

fitted(lin_pred)

Fitted values based on linear predictors lin_pred.

get_distribution(mu[, scale, var_weights, ...])

Frozen Binomial distribution instance for given parameters

initialize(endog, freq_weights)

Initialize the response variable.

loglike(endog, mu[, var_weights, ...])

The log-likelihood function in terms of the fitted mean response.

loglike_obs(endog, mu[, var_weights, scale])

The log-likelihood function for each observation in terms of the fitted mean response for the Binomial distribution.

predict(mu)

Linear predictors based on given mu values.

resid_anscombe(endog, mu[, var_weights, scale])

The Anscombe residuals

resid_dev(endog, mu[, var_weights, scale])

The deviance residuals

starting_mu(y)

The starting values for the IRLS algorithm for the Binomial family.

weights(mu)

Weights for IRLS steps

Properties

link

Link function for family

links

safe_links

valid

variance


Last update: Oct 03, 2024