Standard exponential family distributions:
- GaussianFamily: Normal distribution for continuous data
- BinomialFamily: Binomial distribution for binary/proportion data
- PoissonFamily: Poisson distribution for count data
- GammaFamily: Gamma distribution for positive continuous data
Additional distributions (Phase 5 Milestone 1):
- BetaFamily: Beta distribution for proportions in (0, 1)
- InverseGaussianFamily: Inverse Gaussian for positive durations
Heavy-tailed and robust distributions (Phase 5.5):
- StudentTFamily: Student’s t for robust regression
- CauchyFamily: Cauchy distribution (t with df=1)
- NegativeBinomialFamily: Negative Binomial for overdispersed counts
- TweedieFamily: Tweedie for zero-inflated continuous data
The Gaussian family is the default for continuous response variables.
It uses the identity link function by default and has constant variance
V(mu) = variance.
Parameters:
variance (float or None, default=None) – Known variance parameter. Set to a known value for weighted least
squares; estimated from data when None (the default).
link (LinkFunction, optional) – Link function. Defaults to IdentityLink(), which is the canonical
link for the Gaussian family.
Variables:
default_link (LinkFunction) – The link function for this family (IdentityLink by default).
Examples
>>> importnumpyasnp>>> fromaurora.distributions.familiesimportGaussianFamily>>> fromaurora.models.glmimportfit_glm>>> family=GaussianFamily()>>> mu=np.array([1.0,2.0,3.0])>>> family.variance(mu)array([1., 1., 1.])>>> # Use with fit_glm>>> X=np.random.randn(100,2)>>> y=X@np.array([1.5,-0.5])+np.random.randn(100)>>> result=fit_glm(X,y,family=family)
Binomial distribution family for binary and proportion data.
This family follows the R binomial() convention: the response is a
proportion in [0, 1] and the mean parameter μ is a probability. The
variance function is V(μ) = μ(1 − μ) and the number of trials enters as
a prior weight (McCullagh & Nelder 1989, §2.3).
Binary (Bernoulli) data: pass 0/1 responses; no weights needed.
Grouped data: pass observed proportions y=successes/trials
and the trial counts as weights. With fit_glm use
fit_glm(X,proportions,family=BinomialFamily(),weights=trials).
A constant number of trials can also be set via BinomialFamily(n=k),
which fit_glm treats as weights=k when no explicit weights are
given. When trial counts are supplied (either way), the log-likelihood
includes the binomial coefficient term logC(n_i,n_i·y_i) so that
log_likelihood_/aic_ match R and statsmodels exactly.
param n:
Constant number of trials per observation. Used as the prior weight
in deviance/log_likelihood (and by fit_glm as
weights=n) when no explicit weights are passed. Leave at the
default 1.0 for binary data or when passing per-observation trial
counts through weights.
type n:
float, default=1.0
param link:
Link function. Defaults to LogitLink(), which is the canonical link
for the Binomial family. Alternatives include ProbitLink and CLogLogLink.
type link:
LinkFunction, optional
ivar default_link:
The link function for this family (LogitLink by default).
vartype default_link:
LinkFunction
ivar n_trials:
The constant trial count n given at construction.
vartype n_trials:
float
Examples
>>> importnumpyasnp>>> fromaurora.distributions.familiesimportBinomialFamily>>> fromaurora.models.glmimportfit_glm>>> family=BinomialFamily()>>> mu=np.array([0.2,0.5,0.8])>>> family.variance(mu)# V(mu) = mu * (1 - mu)array([0.16, 0.25, 0.16])>>> # Use with fit_glm for logistic regression>>> X=np.random.randn(200,2)>>> p=1.0/(1.0+np.exp(-(X@np.array([1.0,-0.5]))))>>> y=np.random.binomial(1,p)>>> result=fit_glm(X,y,family=family)
Compute binomial deviance on the probability scale.
Unit deviance d_i = 2 [y_i log(y_i/μ_i) + (1−y_i) log((1−y_i)/(1−μ_i))]
with the convention 0·log 0 = 0; the total deviance is Σ w_i d_i
(R convention, McCullagh & Nelder §2.3).
Gamma distribution family for positive continuous data.
The Gamma family is suitable for modeling strictly positive continuous
responses such as durations, costs, or sizes. The variance function is
V(mu) = mu^2 / shape. The canonical link is the inverse function.
Parameters:
shape (float, default=1.0) – Shape parameter (also called the dispersion parameter). Must be
positive. Controls the relationship between mean and variance:
Var(Y) = mu^2 / shape.
link (LinkFunction, optional) – Link function. Defaults to InverseLink(), which is the canonical link
for the Gamma family. Common alternatives include LogLink and
IdentityLink.
Variables:
default_link (LinkFunction) – The link function for this family (InverseLink by default).
Beta distribution for modeling continuous proportions in (0, 1).
Suitable for modeling success rates, conversion rates, market shares,
and any continuous outcome bounded in (0, 1). The distribution uses a
mean-precision parameterization where the precision parameter phi
controls dispersion independently of the mean.
Parameters:
phi (float or 'estimate', default=1.0) – Precision parameter (inverse dispersion).
- phi large: Low variance, concentrated around mean
- phi small: High variance, dispersed
- ‘estimate’: Estimate from data via method-of-moments
link (LinkFunction or None, default=None) – Link function. If None, uses LogitLink (canonical).
Also supports ProbitLink, CLogLogLink.
Variables:
phi (float or str) – Precision parameter or ‘estimate’ for automatic estimation.
default_link (LinkFunction) – The link function used to map the mean to the linear predictor.
The precision phi controls the dispersion:
- phi = 1: Uniform(0,1) when mu = 0.5
- phi -> inf: Concentration at mu (degenerate)
- phi -> 0: Bimodal distribution at 0 and 1
The variance function is V(mu) = mu(1-mu), same as binomial, but
the actual variance also depends on phi: Var(Y) = V(mu)/(phi+1).
The true variance is Var(Y) = μ(1-μ)/(φ+1), but in the GLM
framework we separate the variance function V(μ) from the
dispersion parameter. Here we return V(μ) = μ(1-μ).
Uses method-of-moments estimation based on the sample variance:
φ̂ = ȳ(1 − ȳ) / Var(y) − 1
Note
Limitation: this is the marginal MoM estimator — it uses
the sample mean/variance of y and ignores the fitted means
mu (kept for API compatibility only). With heterogeneous
means it is biased; a proper conditional estimator would solve
Σ (yᵢ−μ̂ᵢ)² / [μ̂ᵢ(1−μ̂ᵢ)] = n / (φ+1) style equations.
Parameters:
y (array) – Observed proportions.
mu (array, optional) – Fitted means. Currently unused (see note above).
Inverse Gaussian (Wald) distribution for positive continuous data.
Suitable for modeling time-to-event data (failure times), reaction times,
right-skewed positive continuous data, and insurance claim amounts. The
distribution arises naturally as the first passage time of Brownian motion
with positive drift.
Parameters:
lambda (float or 'estimate', default=1.0) – Shape parameter (controls dispersion).
- lambda large: Low variance, concentrated
- lambda small: High variance, dispersed
- ‘estimate’: Estimate from data via method-of-moments
link (LinkFunction or None, default=None) – Link function. If None, uses InverseSquareLink (canonical).
Common alternatives: LogLink, InverseLink, IdentityLink.
>>> # With log link (more common in practice)>>> family=InverseGaussianFamily(lambda_=2.0,link=LogLink())
Notes
The variance function is V(mu) = mu^3, which means variance increases
rapidly with the mean. This makes the inverse Gaussian suitable for
data where larger values are more variable.
The canonical link (inverse square) is rarely used in practice;
the log or inverse link are more common choices.
For failure time data, the inverse Gaussian arises naturally as the
distribution of the first passage time for Brownian motion with drift.
Student’s t distribution family for robust regression.
Provides robust regression that is less sensitive to outliers compared
to Gaussian regression. The degree of robustness is controlled by the
degrees of freedom parameter – lower values produce heavier tails and
greater downweighting of extreme observations.
Parameters:
df (float, default=5.0) – Degrees of freedom (nu). Controls tail heaviness:
- df=1: Cauchy distribution (very heavy tails, no moments)
- df=3-5: Heavy tails, robust to outliers
- df=10: Moderate tails
- df -> inf: Converges to Gaussian
link (str, default='identity') – Link function: ‘identity’ or ‘log’ (for positive responses).
Variables:
df (float) – Degrees of freedom parameter controlling tail heaviness.
default_link (LinkFunction) – The link function used to map the mean to the linear predictor.
The t-distribution is NOT in the exponential family, so standard
IRLS does not apply directly. We use iteratively reweighted least
squares with adaptive weights that downweight outliers:
w_i = (nu + 1) / (nu + z_i^2)
where z_i = (y_i - mu_i) / sigma is the standardized residual.
The variance is nu / (nu - 2) for nu > 2. For nu <= 2, variance is infinite.
Note
Backend support: this family is NumPy-only — its methods call
numpy/scipy directly and do not use the backend namespace
abstraction. Passing PyTorch tensors or JAX arrays is not
supported.
Examples
>>> fromaurora.models.glmimportfit_glm>>> fromaurora.distributions.familiesimportStudentTFamily>>> # Robust regression with df=5>>> result=fit_glm(X,y,family=StudentTFamily(df=5))
>>> # Very robust (heavy tails)>>> result=fit_glm(X,y,family=StudentTFamily(df=3))
The Cauchy distribution has extremely heavy tails and no finite moments.
It is maximally robust to outliers but may have convergence issues.
Use with caution – suitable only when extreme robustness is needed.
Parameters:
link (str, default='identity') – Link function: ‘identity’ or ‘log’.
Negative Binomial (NB2) distribution for overdispersed count data.
Models count data where the variance exceeds the mean:
Var(Y) = mu + mu^2 / theta. This is an extension of Poisson regression
for overdispersed data, commonly arising from unobserved heterogeneity,
clustered or hierarchical data, and temporal or spatial correlation.
Parameters:
theta (float or str, default=1.0) – Dispersion parameter (also called ‘size’ or ‘k’).
- theta -> inf: Converges to Poisson
- theta small: High overdispersion
- ‘estimate’: Estimate from data during fitting
link (str, default='log') – Link function: ‘log’ (default), ‘identity’, or ‘sqrt’.
Variables:
theta (float) – Dispersion parameter (accessed via property; raises ValueError
if not yet estimated when theta=’estimate’ was specified).
default_link (LinkFunction) – The link function used to map the mean to the linear predictor.
Tweedie distribution for zero-inflated positive continuous data.
A compound Poisson-Gamma distribution that naturally handles data with
a point mass at zero (no events) and continuous positive values (sum of
event magnitudes). The variance function is Var(Y) = phi * mu^p, where
the power parameter p controls the shape.
Special cases of the Tweedie family (for reference):
- p = 0: Gaussian
- p = 1: Poisson
- 1 < p < 2: Compound Poisson-Gamma (Tweedie proper)
- p = 2: Gamma
- p = 3: Inverse Gaussian
This class implements only the compound Poisson-Gamma case 1 < p < 2;
for the boundary cases use the dedicated families (GaussianFamily,
PoissonFamily, GammaFamily, InverseGaussianFamily).
Parameters:
power (float, default=1.5) – Variance power parameter p. For compound Poisson-Gamma, must be
in (1, 2). Common choices:
- p = 1.5: Balanced, works well for many applications
- p = 1.6-1.7: More right-skewed, common for insurance claims
- p closer to 1: More mass at zero
- p closer to 2: Less mass at zero, more Gamma-like
link (str, default='log') – Link function: ‘log’ (default), ‘identity’, or ‘power’.
The Tweedie distribution can be viewed as:
- N ~ Poisson(lambda) events occur
- Each event has magnitude X_i ~ Gamma(alpha, beta)
- Total Y = X_1 + … + X_N
This naturally creates exact zeros (N=0) and continuous positives (N>0).
The probability of zero is: P(Y=0) = exp(-lambda)
Examples
>>> fromaurora.models.glmimportfit_glm>>> fromaurora.distributions.familiesimportTweedieFamily>>> # Insurance claims (many zeros, heavy right tail)>>> result=fit_glm(X,claims,family=TweedieFamily(power=1.7))
>>> # Rainfall amounts (zeros for dry days)>>> result=fit_glm(X,rainfall,family=TweedieFamily(power=1.5))
The Tweedie density has no closed form. This method returns the
quasi-likelihood-D/(2φ), which drops the normalization
constant c(y,φ,p) of the full density (the series
evaluation of Dunn & Smyth 2005 is not implemented). As a
consequence, the returned value — and any AIC/BIC derived from
it — is not comparable across families, nor across different
values of the power parameter p or the dispersion φ. It is
only meaningful for comparing models that share the same family,
power and dispersion (e.g. nested mean models).
Estimate the power parameter via a deviance grid search.
Note
This is a heuristic: it minimizes the unit deviance over a
grid of powers. It is not a profile likelihood in p — the full
Tweedie density (Dunn & Smyth 2005 series evaluation) is not
implemented, and the quasi-likelihood ignores the normalization
constant that depends on p, so the criterion is not a valid
profile likelihood for the power parameter. Treat the result as
a rough starting value, not an MLE.
The family’s power attribute is always restored to its original
value before returning.
The Gaussian family is the default for continuous response variables.
It uses the identity link function by default and has constant variance
V(mu) = variance.
Parameters:
variance (float or None, default=None) – Known variance parameter. Set to a known value for weighted least
squares; estimated from data when None (the default).
link (LinkFunction, optional) – Link function. Defaults to IdentityLink(), which is the canonical
link for the Gaussian family.
Variables:
default_link (LinkFunction) – The link function for this family (IdentityLink by default).
Examples
>>> importnumpyasnp>>> fromaurora.distributions.familiesimportGaussianFamily>>> fromaurora.models.glmimportfit_glm>>> family=GaussianFamily()>>> mu=np.array([1.0,2.0,3.0])>>> family.variance(mu)array([1., 1., 1.])>>> # Use with fit_glm>>> X=np.random.randn(100,2)>>> y=X@np.array([1.5,-0.5])+np.random.randn(100)>>> result=fit_glm(X,y,family=family)
Binomial distribution family for binary and proportion data.
This family follows the R binomial() convention: the response is a
proportion in [0, 1] and the mean parameter μ is a probability. The
variance function is V(μ) = μ(1 − μ) and the number of trials enters as
a prior weight (McCullagh & Nelder 1989, §2.3).
Binary (Bernoulli) data: pass 0/1 responses; no weights needed.
Grouped data: pass observed proportions y=successes/trials
and the trial counts as weights. With fit_glm use
fit_glm(X,proportions,family=BinomialFamily(),weights=trials).
A constant number of trials can also be set via BinomialFamily(n=k),
which fit_glm treats as weights=k when no explicit weights are
given. When trial counts are supplied (either way), the log-likelihood
includes the binomial coefficient term logC(n_i,n_i·y_i) so that
log_likelihood_/aic_ match R and statsmodels exactly.
param n:
Constant number of trials per observation. Used as the prior weight
in deviance/log_likelihood (and by fit_glm as
weights=n) when no explicit weights are passed. Leave at the
default 1.0 for binary data or when passing per-observation trial
counts through weights.
type n:
float, default=1.0
param link:
Link function. Defaults to LogitLink(), which is the canonical link
for the Binomial family. Alternatives include ProbitLink and CLogLogLink.
type link:
LinkFunction, optional
ivar default_link:
The link function for this family (LogitLink by default).
vartype default_link:
LinkFunction
ivar n_trials:
The constant trial count n given at construction.
vartype n_trials:
float
Examples
>>> importnumpyasnp>>> fromaurora.distributions.familiesimportBinomialFamily>>> fromaurora.models.glmimportfit_glm>>> family=BinomialFamily()>>> mu=np.array([0.2,0.5,0.8])>>> family.variance(mu)# V(mu) = mu * (1 - mu)array([0.16, 0.25, 0.16])>>> # Use with fit_glm for logistic regression>>> X=np.random.randn(200,2)>>> p=1.0/(1.0+np.exp(-(X@np.array([1.0,-0.5]))))>>> y=np.random.binomial(1,p)>>> result=fit_glm(X,y,family=family)
Compute binomial deviance on the probability scale.
Unit deviance d_i = 2 [y_i log(y_i/μ_i) + (1−y_i) log((1−y_i)/(1−μ_i))]
with the convention 0·log 0 = 0; the total deviance is Σ w_i d_i
(R convention, McCullagh & Nelder §2.3).
Gamma distribution family for positive continuous data.
The Gamma family is suitable for modeling strictly positive continuous
responses such as durations, costs, or sizes. The variance function is
V(mu) = mu^2 / shape. The canonical link is the inverse function.
Parameters:
shape (float, default=1.0) – Shape parameter (also called the dispersion parameter). Must be
positive. Controls the relationship between mean and variance:
Var(Y) = mu^2 / shape.
link (LinkFunction, optional) – Link function. Defaults to InverseLink(), which is the canonical link
for the Gamma family. Common alternatives include LogLink and
IdentityLink.
Variables:
default_link (LinkFunction) – The link function for this family (InverseLink by default).
Beta distribution for modeling continuous proportions in (0, 1).
Suitable for modeling success rates, conversion rates, market shares,
and any continuous outcome bounded in (0, 1). The distribution uses a
mean-precision parameterization where the precision parameter phi
controls dispersion independently of the mean.
Parameters:
phi (float or 'estimate', default=1.0) – Precision parameter (inverse dispersion).
- phi large: Low variance, concentrated around mean
- phi small: High variance, dispersed
- ‘estimate’: Estimate from data via method-of-moments
link (LinkFunction or None, default=None) – Link function. If None, uses LogitLink (canonical).
Also supports ProbitLink, CLogLogLink.
Variables:
phi (float or str) – Precision parameter or ‘estimate’ for automatic estimation.
default_link (LinkFunction) – The link function used to map the mean to the linear predictor.
The precision phi controls the dispersion:
- phi = 1: Uniform(0,1) when mu = 0.5
- phi -> inf: Concentration at mu (degenerate)
- phi -> 0: Bimodal distribution at 0 and 1
The variance function is V(mu) = mu(1-mu), same as binomial, but
the actual variance also depends on phi: Var(Y) = V(mu)/(phi+1).
The true variance is Var(Y) = μ(1-μ)/(φ+1), but in the GLM
framework we separate the variance function V(μ) from the
dispersion parameter. Here we return V(μ) = μ(1-μ).
Uses method-of-moments estimation based on the sample variance:
φ̂ = ȳ(1 − ȳ) / Var(y) − 1
Note
Limitation: this is the marginal MoM estimator — it uses
the sample mean/variance of y and ignores the fitted means
mu (kept for API compatibility only). With heterogeneous
means it is biased; a proper conditional estimator would solve
Σ (yᵢ−μ̂ᵢ)² / [μ̂ᵢ(1−μ̂ᵢ)] = n / (φ+1) style equations.
Parameters:
y (array) – Observed proportions.
mu (array, optional) – Fitted means. Currently unused (see note above).
Inverse Gaussian (Wald) distribution for positive continuous data.
Suitable for modeling time-to-event data (failure times), reaction times,
right-skewed positive continuous data, and insurance claim amounts. The
distribution arises naturally as the first passage time of Brownian motion
with positive drift.
Parameters:
lambda (float or 'estimate', default=1.0) – Shape parameter (controls dispersion).
- lambda large: Low variance, concentrated
- lambda small: High variance, dispersed
- ‘estimate’: Estimate from data via method-of-moments
link (LinkFunction or None, default=None) – Link function. If None, uses InverseSquareLink (canonical).
Common alternatives: LogLink, InverseLink, IdentityLink.
>>> # With log link (more common in practice)>>> family=InverseGaussianFamily(lambda_=2.0,link=LogLink())
Notes
The variance function is V(mu) = mu^3, which means variance increases
rapidly with the mean. This makes the inverse Gaussian suitable for
data where larger values are more variable.
The canonical link (inverse square) is rarely used in practice;
the log or inverse link are more common choices.
For failure time data, the inverse Gaussian arises naturally as the
distribution of the first passage time for Brownian motion with drift.
Negative Binomial (NB2) distribution for overdispersed count data.
Models count data where the variance exceeds the mean:
Var(Y) = mu + mu^2 / theta. This is an extension of Poisson regression
for overdispersed data, commonly arising from unobserved heterogeneity,
clustered or hierarchical data, and temporal or spatial correlation.
Parameters:
theta (float or str, default=1.0) – Dispersion parameter (also called ‘size’ or ‘k’).
- theta -> inf: Converges to Poisson
- theta small: High overdispersion
- ‘estimate’: Estimate from data during fitting
link (str, default='log') – Link function: ‘log’ (default), ‘identity’, or ‘sqrt’.
Variables:
theta (float) – Dispersion parameter (accessed via property; raises ValueError
if not yet estimated when theta=’estimate’ was specified).
default_link (LinkFunction) – The link function used to map the mean to the linear predictor.
Student’s t distribution family for robust regression.
Provides robust regression that is less sensitive to outliers compared
to Gaussian regression. The degree of robustness is controlled by the
degrees of freedom parameter – lower values produce heavier tails and
greater downweighting of extreme observations.
Parameters:
df (float, default=5.0) – Degrees of freedom (nu). Controls tail heaviness:
- df=1: Cauchy distribution (very heavy tails, no moments)
- df=3-5: Heavy tails, robust to outliers
- df=10: Moderate tails
- df -> inf: Converges to Gaussian
link (str, default='identity') – Link function: ‘identity’ or ‘log’ (for positive responses).
Variables:
df (float) – Degrees of freedom parameter controlling tail heaviness.
default_link (LinkFunction) – The link function used to map the mean to the linear predictor.
The t-distribution is NOT in the exponential family, so standard
IRLS does not apply directly. We use iteratively reweighted least
squares with adaptive weights that downweight outliers:
w_i = (nu + 1) / (nu + z_i^2)
where z_i = (y_i - mu_i) / sigma is the standardized residual.
The variance is nu / (nu - 2) for nu > 2. For nu <= 2, variance is infinite.
Note
Backend support: this family is NumPy-only — its methods call
numpy/scipy directly and do not use the backend namespace
abstraction. Passing PyTorch tensors or JAX arrays is not
supported.
Examples
>>> fromaurora.models.glmimportfit_glm>>> fromaurora.distributions.familiesimportStudentTFamily>>> # Robust regression with df=5>>> result=fit_glm(X,y,family=StudentTFamily(df=5))
>>> # Very robust (heavy tails)>>> result=fit_glm(X,y,family=StudentTFamily(df=3))
Tweedie distribution for zero-inflated positive continuous data.
A compound Poisson-Gamma distribution that naturally handles data with
a point mass at zero (no events) and continuous positive values (sum of
event magnitudes). The variance function is Var(Y) = phi * mu^p, where
the power parameter p controls the shape.
Special cases of the Tweedie family (for reference):
- p = 0: Gaussian
- p = 1: Poisson
- 1 < p < 2: Compound Poisson-Gamma (Tweedie proper)
- p = 2: Gamma
- p = 3: Inverse Gaussian
This class implements only the compound Poisson-Gamma case 1 < p < 2;
for the boundary cases use the dedicated families (GaussianFamily,
PoissonFamily, GammaFamily, InverseGaussianFamily).
Parameters:
power (float, default=1.5) – Variance power parameter p. For compound Poisson-Gamma, must be
in (1, 2). Common choices:
- p = 1.5: Balanced, works well for many applications
- p = 1.6-1.7: More right-skewed, common for insurance claims
- p closer to 1: More mass at zero
- p closer to 2: Less mass at zero, more Gamma-like
link (str, default='log') – Link function: ‘log’ (default), ‘identity’, or ‘power’.
The Tweedie distribution can be viewed as:
- N ~ Poisson(lambda) events occur
- Each event has magnitude X_i ~ Gamma(alpha, beta)
- Total Y = X_1 + … + X_N
This naturally creates exact zeros (N=0) and continuous positives (N>0).
The probability of zero is: P(Y=0) = exp(-lambda)
Examples
>>> fromaurora.models.glmimportfit_glm>>> fromaurora.distributions.familiesimportTweedieFamily>>> # Insurance claims (many zeros, heavy right tail)>>> result=fit_glm(X,claims,family=TweedieFamily(power=1.7))
>>> # Rainfall amounts (zeros for dry days)>>> result=fit_glm(X,rainfall,family=TweedieFamily(power=1.5))
The Tweedie density has no closed form. This method returns the
quasi-likelihood-D/(2φ), which drops the normalization
constant c(y,φ,p) of the full density (the series
evaluation of Dunn & Smyth 2005 is not implemented). As a
consequence, the returned value — and any AIC/BIC derived from
it — is not comparable across families, nor across different
values of the power parameter p or the dispersion φ. It is
only meaningful for comparing models that share the same family,
power and dispersion (e.g. nested mean models).
Estimate the power parameter via a deviance grid search.
Note
This is a heuristic: it minimizes the unit deviance over a
grid of powers. It is not a profile likelihood in p — the full
Tweedie density (Dunn & Smyth 2005 series evaluation) is not
implemented, and the quasi-likelihood ignores the normalization
constant that depends on p, so the criterion is not a valid
profile likelihood for the power parameter. Treat the result as
a rough starting value, not an MLE.
The family’s power attribute is always restored to its original
value before returning.
Abstract base class for exponential family distributions.
Defines the interface that all distribution families must implement
for use in GLM, GAM, and GAMM fitting. Each subclass provides the
log-likelihood, deviance, variance function, and initialization
logic required by the IRLS fitting algorithm.
Subclasses include GaussianFamily, PoissonFamily, BinomialFamily,
GammaFamily, BetaFamily, InverseGaussianFamily, NegativeBinomialFamily,
StudentTFamily, TweedieFamily, and others.