({{, (RefLink[DispersionEstimatorFunction, paclet:ref/DispersionEstimatorFunction]) 
is an option for generalized linear model fitting functions that specifies the estimator for the dispersion parameter.}})

OpenersNotesSection(Spacer1)Details

(RefLink[DispersionEstimatorFunction, paclet:ref/DispersionEstimatorFunction]) is an option for (RefLink[GeneralizedLinearModelFit, paclet:ref/GeneralizedLinearModelFit]), (RefLink[LogitModelFit, paclet:ref/LogitModelFit]), and (RefLink[ProbitModelFit, paclet:ref/ProbitModelFit]).

With (RefLink[DispersionEstimatorFunction, paclet:ref/DispersionEstimatorFunction])->"PearsonChiSquare", the estimator is ∑(((Subscript[w, i])((Subscript[y, i])-(Subscript[(OverHat[y]), i])))^2)/((n-p)v((Subscript[(OverHat[y]), i]))) where n is the number of data points, p is the number of parameters, and v is the variance function for the distribution.

With (RefLink[DispersionEstimatorFunction, paclet:ref/DispersionEstimatorFunction])->(RefLink[Automatic, paclet:ref/Automatic]), the following estimates are used:

Non-default values can be used to model overdispersion in "Binomial" and "Poisson" models.

With the setting (RefLink[DispersionEstimatorFunction, paclet:ref/DispersionEstimatorFunction])->f, the common dispersion is estimated by f[y,(OverHat[y]),w] where y={(Subscript[y, 1]),(Subscript[y, 2]),…} is the list of observations, (OverHat[y])={(Subscript[(OverHat[y]), 1]),(Subscript[(OverHat[y]), 2]),…} is the list of predicted values, and w={(Subscript[w, 1]),(Subscript[w, 2]),…} is the list of weights for the measurements (Subscript[y, i]).

OpenersPrimaryExamplesSection(Spacer1)Examples  (3)

OpenersExampleSection0(Spacer1)Basic Examples  (1)

Fit a Poisson model:

data={{1,1},{2,1},{3,4},{5,6}};

m=GeneralizedLinearModelFit[data,x,x,ExponentialFamily->"Poisson"]

Compute the covariance matrix using the default dispersion estimate:

m["CovarianceMatrix"]

Estimate the dispersion by Pearson's (χ^2):

m=GeneralizedLinearModelFit[data,x,x,ExponentialFamily->"Poisson",DispersionEstimatorFunction->"PearsonChiSquare"];m["CovarianceMatrix"]

Estimate the dispersion by the mean squared error:

m=GeneralizedLinearModelFit[data,x,x,ExponentialFamily->"Poisson",DispersionEstimatorFunction->(Mean[(#1-#2)^2]&)];m["CovarianceMatrix"]

OpenersExampleSection1(Spacer1)Scope  (2)

Define the estimate within the (RefLink[FittedModel, paclet:ref/FittedModel]):

data={{1,1},{2,1},{3,4},{5,6}};

m=GeneralizedLinearModelFit[data,x,x,ExponentialFamily->"Poisson"]

m["CovarianceMatrix"]

m["CovarianceMatrix",DispersionEstimatorFunction->(2&)]

m["CovarianceMatrix",DispersionEstimatorFunction->"PearsonChiSquare"]

m["CovarianceMatrix",DispersionEstimatorFunction->(Mean[(#1-#2)^2]&)]

Fit a logit model:

data={{1,0},{1,1},{1,1},{2,0},{2,0},{2,1},{2,1},{2,1},{2,1}};

logit=LogitModelFit[data,x,x]

Estimate the dispersion by the sum of squared errors:

logit["EstimatedDispersion",DispersionEstimatorFunction->(Total[(#1-#2)^2]&)]

Fit a probit model:

probit=ProbitModelFit[data,x,x]

Estimate the dispersion by the mean squared error:

probit["EstimatedDispersion",DispersionEstimatorFunction->(Mean[(#1-#2)^2]&)]

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(RefLink[GeneralizedLinearModelFit, paclet:ref/GeneralizedLinearModelFit])  ▪  (RefLink[LogitModelFit, paclet:ref/LogitModelFit])  ▪  (RefLink[ProbitModelFit, paclet:ref/ProbitModelFit])  ▪  (RefLink[ExponentialFamily, paclet:ref/ExponentialFamily])  ▪  (RefLink[VarianceEstimatorFunction, paclet:ref/VarianceEstimatorFunction])}})}})

({{DocumentationFooterIconsRelatedGuide.png, ({{Related Guides}, {▪(RefLinkPlain[Statistical Model Analysis, paclet:guide/StatisticalModelAnalysis])}})}})