Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikipediaThe Free Encyclopedia
Search

Residual sum of squares

From Wikipedia, the free encyclopedia
Statistical measure of the discrepancy between data and an estimation model
icon
This articleneeds additional citations forverification. Please helpimprove this article byadding citations to reliable sources. Unsourced material may be challenged and removed.
Find sources: "Residual sum of squares" – news ·newspapers ·books ·scholar ·JSTOR
(April 2013) (Learn how and when to remove this message)

Instatistics, theresidual sum of squares (RSS), also known as thesum of squared residuals (SSR) or thesum of squared estimate of errors (SSE), is thesum of thesquares ofresiduals (deviations predicted from actual empirical values of data). It is a measure of the discrepancy between the data and an estimation model, such as alinear regression. A small RSS indicates a tight fit of the model to the data. It is used as anoptimality criterion in parameter selection andmodel selection.

In general,total sum of squares =explained sum of squares + residual sum of squares. For a proof of this in the multivariateordinary least squares (OLS) case, seepartitioning in the general OLS model.

One explanatory variable

[edit]

In a model with a single explanatory variable, RSS is given by:[1]

RSS=i=1n(yif(xi))2{\displaystyle \operatorname {RSS} =\sum _{i=1}^{n}\left(y_{i}-f(x_{i})\right)^{2}}

whereyi is theith value of the variable to be predicted,xi is theith value of the explanatory variable, andf(xi){\displaystyle f(x_{i})} is the predicted value ofyi (also termedyi^{\displaystyle {\hat {y_{i}}}}).In a standard linear simpleregression model,yi=α+βxi+εi{\displaystyle y_{i}=\alpha +\beta x_{i}+\varepsilon _{i}\,}, whereα{\displaystyle \alpha } andβ{\displaystyle \beta } arecoefficients,y andx are theregressand and theregressor, respectively, and ε is theerror term. The sum of squares of residuals is the sum of squares ofε^i{\displaystyle {\widehat {\varepsilon \,}}_{i}}; that is

RSS=i=1n(ε^i)2=i=1n(yi(α^+β^xi))2{\displaystyle \operatorname {RSS} =\sum _{i=1}^{n}\left({\widehat {\varepsilon }}_{i}\right)^{2}=\sum _{i=1}^{n}\left(y_{i}-({\widehat {\alpha \,}}+{\widehat {\beta }}\,x_{i})\right)^{2}}

whereα^{\displaystyle {\widehat {\alpha \,}}} is the estimated value of the constant termα{\displaystyle \alpha } andβ^{\displaystyle {\widehat {\beta \,}}} is the estimated value of the slope coefficientβ{\displaystyle \beta }.

Matrix expression for the OLS residual sum of squares

[edit]

The general regression model withn observations andk explanators, the first of which is a constant unit vector whose coefficient is the regression intercept, is

y=Xβ+e{\displaystyle y=X\beta +e}

wherey is ann × 1 vector of dependent variable observations, each column of then ×k matrixX is a vector of observations on one of thek explanators,β{\displaystyle \beta } is ak × 1 vector of true coefficients, ande is ann× 1 vector of the true underlying errors. Theordinary least squares estimator forβ{\displaystyle \beta } is

Xβ^=yXTXβ^=XTyβ^=(XTX)1XTy.{\displaystyle {\begin{aligned}&X{\hat {\beta }}=y\\[1ex]\iff &X^{\operatorname {T} }X{\hat {\beta }}=X^{\operatorname {T} }y\\[1ex]\iff &{\hat {\beta }}=\left(X^{\operatorname {T} }X\right)^{-1}X^{\operatorname {T} }y.\end{aligned}}}

The residual vectore^=yXβ^=yX(XTX)1XTy{\displaystyle {\hat {e}}=y-X{\hat {\beta }}=y-X(X^{\operatorname {T} }X)^{-1}X^{\operatorname {T} }y}; so the residual sum of squares is:

RSS=e^Te^=e^2,{\displaystyle \operatorname {RSS} ={\hat {e}}^{\operatorname {T} }{\hat {e}}=\left\|{\hat {e}}\right\|^{2},}

(equivalent to the square of thenorm of residuals). In full:

RSS=yTyyTX(XTX)1XTy=yT[IX(XTX)1XT]y=yT[IH]y,{\displaystyle {\begin{aligned}\operatorname {RSS} &=y^{\operatorname {T} }y-y^{\operatorname {T} }X\left(X^{\operatorname {T} }X\right)^{-1}X^{\operatorname {T} }y\\[1ex]&=y^{\operatorname {T} }\left[I-X\left(X^{\operatorname {T} }X\right)^{-1}X^{\operatorname {T} }\right]y\\[1ex]&=y^{\operatorname {T} }\left[I-H\right]y,\end{aligned}}}

whereH is thehat matrix, or the projection matrix in linear regression.

Relation with Pearson's product-moment correlation

[edit]

Theleast-squares regression line is given by

y=ax+b,{\displaystyle y=ax+b,}

whereb=y¯ax¯{\displaystyle b={\bar {y}}-a{\bar {x}}} anda=SxySxx{\displaystyle a={\frac {S_{xy}}{S_{xx}}}}, whereSxy=i=1n(x¯xi)(y¯yi){\displaystyle S_{xy}=\sum _{i=1}^{n}({\bar {x}}-x_{i})({\bar {y}}-y_{i})} andSxx=i=1n(x¯xi)2.{\displaystyle S_{xx}=\sum _{i=1}^{n}({\bar {x}}-x_{i})^{2}.}

Therefore,

RSS=i=1n(yif(xi))2=i=1n(yi(axi+b))2=i=1n(yiaxiy¯+ax¯)2=i=1n[a(x¯xi)(y¯yi)]2=a2Sxx2aSxy+Syy=SyyaSxy=Syy(1Sxy2SxxSyy){\displaystyle {\begin{aligned}\operatorname {RSS} &=\sum _{i=1}^{n}\left(y_{i}-f(x_{i})\right)^{2}=\sum _{i=1}^{n}\left(y_{i}-(ax_{i}+b)\right)^{2}\\[1ex]&=\sum _{i=1}^{n}\left(y_{i}-ax_{i}-{\bar {y}}+a{\bar {x}}\right)^{2}=\sum _{i=1}^{n}\left[a\left({\bar {x}}-x_{i}\right)-\left({\bar {y}}-y_{i}\right)\right]^{2}\\[1ex]&=a^{2}S_{xx}-2aS_{xy}+S_{yy}=S_{yy}-aS_{xy}\\[1ex]&=S_{yy}\left(1-{\frac {S_{xy}^{2}}{S_{xx}S_{yy}}}\right)\end{aligned}}}

whereSyy=i=1n(y¯yi)2.{\displaystyle S_{yy}=\sum _{i=1}^{n}({\bar {y}}-y_{i})^{2}.}

ThePearson product-moment correlation is given byr=SxySxxSyy;{\displaystyle r={\frac {S_{xy}}{\sqrt {S_{xx}S_{yy}}}};} therefore,RSS=Syy(1r2).{\displaystyle \operatorname {RSS} =S_{yy}(1-r^{2}).}

See also

[edit]

References

[edit]
  1. ^Archdeacon, Thomas J. (1994).Correlation and regression analysis : a historian's guide. University of Wisconsin Press. pp. 161–162.ISBN 0-299-13650-7.OCLC 27266095.
  • Draper, N.R.; Smith, H. (1998).Applied Regression Analysis (3rd ed.). John Wiley.ISBN 0-471-17082-8.
Retrieved from "https://en.wikipedia.org/w/index.php?title=Residual_sum_of_squares&oldid=1324122400"
Categories:
Hidden categories:

[8]ページ先頭

©2009-2026 Movatter.jp