ArticleslgStudy

mathematics

Cook's distance

Cook's distance is a mathematics topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Cook's distance rather than just read about it. In short: In statistics, Cook's distance or Cook's D is a commonly used estimate of the influence of a data point when performing a least-squares regression analysis. In a practical ordinary least squares analysis, Cook's distance can be used in several ways: to indicate influential data points that are particularly worth checking for validity; or to indicate regions of the design space where it would be good to be able to ob…

Key takeaways

  • Cook's distance belongs to mathematics; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Cook's distance to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Cook's distance from memory before moving on to harder problems.

Reference excerpt

In statistics, Cook's distance or Cook's D is a commonly used estimate of the influence of a data point when performing a least-squares regression analysis. In a practical ordinary least squares analysis, Cook's distance can be used in several ways: to indicate influential data points that are particularly worth checking for validity; or to indicate regions of the design space where it would be good to be able to obtain more data points. It is named after the American statistician R. Dennis Cook, who introduced the concept in 1977.

Definition Data points with large residuals (outliers) and/or high leverage may distort the outcome and accuracy of a regression. Cook's distance measures the effect of deleting a given observation. Points with a large Cook's distance are considered to merit closer examination in the analysis. For the algebraic expression, first define

𝐲n×1=𝐗n×p𝜷p×1+𝜺n×1 where 𝜺∼𝒩(0,σ2𝐈) is the error term, 𝜷=[β0β1…βp−1]𝖳 is the coefficient matrix, p is the number of covariates or predictors for each observation, and 𝐗 is the design matrix including a constant. The least squares estimator then is 𝐛=(𝐗𝖳𝐗)−1𝐗𝖳𝐲, and consequently the fitted (predicted) values for the mean of 𝐲 are

𝐲^=𝐗𝐛=𝐗(𝐗𝖳𝐗)−1𝐗𝖳𝐲=𝐇𝐲 where 𝐇≡𝐗(𝐗𝖳𝐗)−1𝐗𝖳 is the projection matrix (or hat matrix). The i-th diagonal element of 𝐇, given by hii≡𝐱i𝖳(𝐗𝖳𝐗)−1𝐱i, is known as the leverage of the i-th observation. Similarly, the i-th element of the residual vector 𝐞=𝐲−𝐲^=(𝐈−𝐇)𝐲 is denoted by ei. Cook's distance Di of observation i(for i=1,…,n) is defined as the sum of all the changes in the regression model when observation i is removed from it

Di=∑j=1n(y^j−y^j(i))2ps2 where p is the rank of the model (i.e., number of independent variables in the design matrix) and y^j(i) is the fitted response value obtained when excluding i, and s2=𝐞⊤𝐞n−p is the mean squared error of the regression model. Equivalently, it can be expressed using the leverage (hii):

Di=ei2ps2[hii(1−hii)2].

Detecting highly influential observations There are different opinions regarding what cut-off values to use for spotting highly influential points. Since Cook's distance is in the metric of an F distribution with p and n−p (as defined for the design matrix 𝐗 above) degrees of freedom, the median point (i.e., F0.5(p,n−p)) can be used as a cut-off. Since this value is close to 1 for large n, a simple operational guideline of Di>1 has been suggested. Note that in general the Cook's distance does not measure correctly the influence of observations.

Relationship to other influence measures (and interpretation) Di can be expressed using the leverage (0≤hii≤1) and the square of the internally Studentized residual (0≤ti2), as follows:

Di=ei2ps2⋅hii(1−hii)2=1p⋅ei21n−p∑j=1nε^j2(1−hii)⋅hii1−hii=1p⋅ti2⋅hii1−hii. The benefit in the last formulation is that it clearly shows the relationship between ti2 and hii to Di (while p and n are the same for all observations). If ti2 is large then it (for non-extreme values of hii) will increase Di. If hii is close to 0 then Di will be small, while if hii is close to 1 then Di will become very large (as long as ti2>0, i.e.: that the observation i is not exactly on the regression line that was fitted without observation i). Di is related to DFFITS through the following relationship (note that σ^σ^(i)ti=ti(i) is the externally studentized residual, and σ^,σ^(i) are defined here):

Di=1p⋅ti2⋅hii1−hii=1p⋅σ^(i)2σ^2⋅σ^2σ^(i)2⋅ti2⋅hii1−hii=1p⋅σ^(i)2σ^2⋅(ti(i)hii1−hii)2=1p⋅σ^(i)2σ^2⋅DFFITS2 Di can be interpreted as the distance one's estimates move within the confidence ellipsoid that represents a region of plausible values for the parameters. This is shown by an alternative but equivalent representation of Cook's distance in terms of changes to the estimates of the regression parameters between the cases, where the particular observation is either included or excluded from the regression analysis. An alternative to Di has been proposed. Instead of considering the influence a single observation has on the overall model, the statistics Si serves as a measure of how sensitive the prediction of the i-th observation is to the deletion of each observation in the original data set. It can be formulated as a weighted linear combination of the Dj's of all data points. Again, the projection matrix is involved in the calculation to obtain the required weights:

Si=∑j=1n(y^i−y^i(j))2ps2hii=∑j=1nhij2⋅Djhii⋅hjj=∑j=1nρij2⋅Dj In this context, ρij (≤1) resembles the correlation between the predictions y^i and y^j. In contrast to Di, the distribution of Si is asymptotically normal for large sample sizes and models with many predictors. In absence of outliers the expected value of Si is approximately p−1. An influential observation can be identified if

|Si−med⁡(S)|≥4.5⋅MAD⁡(S) with med⁡(S) as the median and MAD⁡(S) as the median absolute deviation of all S-values within the original data set, i.e., a robust measure of location and a robust measure of scale for the distribution of Si. The factor 4.5 covers approx. 3 standard deviations of S around its centre. When compared to Cook's distance, Si was found to perform well for high- and intermediate-leverage outliers, even in presence of masking effects for which Di failed. Interestingly, Di and Si are closely related because they can both be expressed in terms of the matrix 𝐓 which holds the effects of the deletion of the j-th data point on the i-th prediction:

𝐓=[y^1−y^1(1)y^1−y^1(2)y^1−y^1(3)⋯y^1−y^1(n−1)y^1−y^1(n)y^2−y^2(1)y^2−y^2(2)y^2−y^2(3)⋯y^2−y^2(n−1)y^2−y^2(n)⋮⋮⋮⋱⋮⋮y^n−1−y^n−1(1)y^n−1−y^n−1(2)y^n−1−y^n−1(3)⋯y^n−1−y^n−1(n−1)y^n−1−y^n−1(n)y^n−y^n(1)y^n−y^n(2)y^n−y^n(3)⋯y^n−y^n(n−1)y^n−y^n(n)] =𝐇𝐄𝐆=𝐇[e100⋯000e20⋯00⋮⋮⋮⋱⋮⋮000⋯en−10000⋯0en][11−h1100⋯00011−h220⋯00⋮⋮⋮⋱⋮⋮000⋯11−hn−1,n−10000⋯011−hnn] With 𝐓 at hand, 𝐃 is given by:

𝐃=[D1D2⋮Dn−1Dn]=1ps2diag⁡(𝐓𝖳𝐓)=1ps2diag⁡(𝐆𝐄𝐇𝖳𝐇𝐄𝐆)=diag⁡(𝐌) where 𝐇𝖳𝐇=𝐇 if 𝐇 is symmetric and idempotent, which is not necessarily the case. In contrast, 𝐒 can be calculated as:

… excerpt ends here. Continue reading the full article.

Worked examples

Example 1 — a first encounter with Cook's distance

Start with the simplest possible case. Write down what Cook's distance claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In mathematics, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Cook's distance before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Cook's distance ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Cook's distance

In research
Cook's distance appears in mathematics research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Cook's distance in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Cook's distance is common in secondary-school and first-year university syllabi. It links to neighbouring topics Regression diagnostics, Statistical distance, Statistical outliers, so understanding it makes those chapters shorter.
In everyday life
Look for Cook's distance outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Cook's distance” →

How to study Cook's distance in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Cook's distance means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Cook's distance out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Cook's distance in simple terms?

In statistics, Cook's distance or Cook's D is a commonly used estimate of the influence of a data point when performing a least-squares regression analysis. In a practical ordinary least squares analysis, Cook's distance can be used in several ways: to indicate influential data points that are part…

Why does Cook's distance matter?

Because it connects several mathematics ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Cook's distance?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Cook's distance.

Tags

  • Regression diagnostics
  • Statistical distance
  • Statistical outliers

Keep exploring