statsmodels.genmod.families.family.Tweedie

class statsmodels.genmod.families.family.Tweedie(link=None, var_power=1.0, link_power=0)[source]

Tweedie family.

Parameters:

link : a link instance, optional

The default link for the Tweedie family is the log link when the link_power is 0. Otherwise, the power link is default. Available links are log and Power.

var_power : float, optional

The variance power.

link_power : float, optional

The link power.

Notes

Logliklihood function not implemented because of the complexity of calculating an infinite series of summations. The variance power can be estimated using the estimate_tweedie_power function that is part of the GLM class.

Attributes

Tweedie.link (a link instance) The link function of the Tweedie instance
Tweedie.variance (varfunc instance) variance is an instance of statsmodels.family.varfuncs.Power
Tweedie.link_power (float) The power of the link function, or 0 if its a log link.
Tweedie.var_power (float) The power of the variance function.

Methods

deviance(endog, mu[, freq_weights, scale]) Returns the value of the deviance function.
fitted(lin_pred) Fitted values based on linear predictors lin_pred.
loglike(endog, mu[, freq_weights, scale]) The log-likelihood function in terms of the fitted mean response.
predict(mu) Linear predictors based on given mu values.
resid_anscombe(endog, mu) The Anscombe residuals for the Tweedie family
resid_dev(endog, mu[, scale]) Tweedie Deviance Residual
starting_mu(y) Starting value for mu in the IRLS algorithm.
variance alias of Power
weights(mu) Weights for IRLS steps

Methods

deviance(endog, mu[, freq_weights, scale]) Returns the value of the deviance function.
fitted(lin_pred) Fitted values based on linear predictors lin_pred.
loglike(endog, mu[, freq_weights, scale]) The log-likelihood function in terms of the fitted mean response.
predict(mu) Linear predictors based on given mu values.
resid_anscombe(endog, mu) The Anscombe residuals for the Tweedie family
resid_dev(endog, mu[, scale]) Tweedie Deviance Residual
starting_mu(y) Starting value for mu in the IRLS algorithm.
weights(mu) Weights for IRLS steps