Jump to content

Weighted least squares

From Wikipedia, the free encyclopedia

Weighted least squares(WLS), also known asweighted linear regression,[1][2]is a generalization ofordinary least squaresandlinear regressionin which knowledge of the unequalvarianceof observations (heteroscedasticity) is incorporated into the regression. WLS is also a specialization ofgeneralized least squares,when all the off-diagonal entries of thecovariance matrixof the errors, are null.

Formulation

[edit]

The fit of a model to a data point is measured by itsresidual,,defined as the difference between a measured value of the dependent variable,and the value predicted by the model,:

If the errors are uncorrelated and have equal variance, then the function is minimised at,such that.

TheGauss–Markov theoremshows that, when this is so,is abest linear unbiased estimator(BLUE). If, however, the measurements are uncorrelated but have different uncertainties, a modified approach might be adopted.Aitkenshowed that when a weighted sum of squared residuals is minimized,is theBLUEif each weight is equal to the reciprocal of the variance of the measurement

The gradient equations for this sum of squares are

which, in a linear least squares system give the modified normal equations, The matrixabove is as defined in thecorresponding discussion of linear least squares.

When the observational errors are uncorrelated and theweight matrix,W=Ω−1,is diagonal, these may be written as

If the errors are correlated, the resulting estimator is theBLUEif the weight matrix is equal to the inverse of thevariance-covariance matrixof the observations.

When the errors are uncorrelated, it is convenient to simplify the calculations to factor the weight matrix as.The normal equations can then be written in the same form as ordinary least squares:

where we define the following scaled matrix and vector:

This is a type ofwhitening transformation;the last expression involves anentrywise division.

Fornon-linear least squaressystems a similar argument shows that the normal equations should be modified as follows.

Note that for empirical tests, the appropriateWis not known for sure and must be estimated. For thisfeasible generalized least squares(FGLS) techniques may be used; in this case it is specialized for a diagonal covariance matrix, thus yielding a feasible weighted least squares solution.

If the uncertainty of the observations is not known from external sources, then the weights could be estimated from the given observations. This can be useful, for example, to identify outliers. After the outliers have been removed from the data set, the weights should be reset to one.[3]

Motivation

[edit]

In some cases the observations may be weighted—for example, they may not be equally reliable. In this case, one can minimize the weighted sum of squares: wherewi> 0 is the weight of theith observation, andWis thediagonal matrixof such weights.

The weights should, ideally, be equal to thereciprocalof thevarianceof the measurement. (This implies that the observations are uncorrelated. If the observations arecorrelated,the expressionapplies. In this case the weight matrix should ideally be equal to the inverse of thevariance-covariance matrixof the observations).[3] The normal equations are then:

This method is used initeratively reweighted least squares.

Solution

[edit]

Parameter errors and correlation

[edit]

The estimated parameter values are linear combinations of the observed values

Therefore, an expression for the estimatedvariance-covariance matrixof the parameter estimates can be obtained byerror propagationfrom the errors in the observations. Let the variance-covariance matrix for the observations be denoted byMand that of the estimated parameters byMβ.Then

WhenW=M−1,this simplifies to

When unit weights are used (W=I,theidentity matrix), it is implied that the experimental errors are uncorrelated and all equal:M=σ2I,whereσ2is thea priorivariance of an observation. In any case,σ2is approximated by thereduced chi-squared:

whereSis the minimum value of the weightedobjective function:

The denominator,,is the number ofdegrees of freedom;seeeffective degrees of freedomfor generalizations for the case of correlated observations.

In all cases, thevarianceof the parameter estimateis given byand thecovariancebetween the parameter estimatesandis given by.Thestandard deviationis the square root of variance,,and the correlation coefficient is given by.These error estimates reflect onlyrandom errorsin the measurements. The true uncertainty in the parameters is larger due to the presence ofsystematic errors,which, by definition, cannot be quantified. Note that even though the observations may be uncorrelated, the parameters are typicallycorrelated.

Parameter confidence limits

[edit]

It is oftenassumed,for want of any concrete evidence but often appealing to thecentral limit theorem—seeNormal distribution#Occurrence and applications—that the error on each observation belongs to anormal distributionwith a mean of zero and standard deviation.Under that assumption the following probabilities can be derived for a single scalar parameter estimate in terms of its estimated standard error(givenhere):

  • 68% that the intervalencompasses the true coefficient value
  • 95% that the intervalencompasses the true coefficient value
  • 99% that the intervalencompasses the true coefficient value

The assumption is not unreasonable whenn>>m.If the experimental errors are normally distributed the parameters will belong to aStudent's t-distributionwithnmdegrees of freedom.WhennmStudent's t-distribution approximates a normal distribution. Note, however, that these confidence limits cannot take systematic error into account. Also, parameter errors should be quoted to one significant figure only, as they are subject tosampling error.[4]

When the number of observations is relatively small,Chebychev's inequalitycan be used for an upper bound on probabilities, regardless of any assumptions about the distribution of experimental errors: the maximum probabilities that a parameter will be more than 1, 2, or 3 standard deviations away from its expectation value are 100%, 25% and 11% respectively.

Residual values and correlation

[edit]

Theresidualsare related to the observations by

whereHis theidempotent matrixknown as thehat matrix:

andIis theidentity matrix.The variance-covariance matrix of the residuals,Mris given by

Thus the residuals are correlated, even if the observations are not.

When,

The sum of weighted residual values is equal to zero whenever the model function contains a constant term. Left-multiply the expression for the residuals byXTWT:

Say, for example, that the first term of the model is a constant, so thatfor alli.In that case it follows that

Thus, in the motivational example, above, the fact that the sum of residual values is equal to zero is not accidental, but is a consequence of the presence of the constant term, α, in the model.

If experimental error follows anormal distribution,then, because of the linear relationship between residuals and observations, so should residuals,[5]but since the observations are only a sample of the population of all possible observations, the residuals should belong to aStudent's t-distribution.Studentized residualsare useful in making a statistical test for anoutlierwhen a particular residual appears to be excessively large.

See also

[edit]

References

[edit]
  1. ^"Weighted regression".
  2. ^"Visualize a weighted regression".
  3. ^abStrutz, T. (2016). "3".Data Fitting and Uncertainty (A practical introduction to weighted least squares and beyond).Springer Vieweg.ISBN978-3-658-11455-8.
  4. ^Mandel, John (1964).The Statistical Analysis of Experimental Data.New York: Interscience.
  5. ^Mardia, K. V.; Kent, J. T.; Bibby, J. M. (1979).Multivariate analysis.New York: Academic Press.ISBN0-12-471250-9.