Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

Is there any smarter way to compute Residual Sum of Squares(RSS) in Multiple Linear Regression other then fitting the model -> find coefficients -> find fitted values -> find residuals -> find norm of residuals... If I need only RSS and nothing else. For example, in best subset selection, we need to determine RSS of many reduced models..

share|improve this question

1 Answer 1

[update] Upps, just saw your comment at @Nameless, that you have 10000 variables. So I think, that covariaton-approach is useless too. Should I delete the answer? [/update]

One method needs only the inversion of the covariation matrix, don't know whether this is already smart enough?

Construct the datamatrix $D$ with the top row from the rowvector of $Y$-values, then the rowvectors of $X$-variables/values. If $X$ and $Y$-variables are not centered append one more row containing only 1. (If you have, say 3 $X$-variables and $n$ cases, you have then a $4 \times n$ or $ 5 \times n$ matrix).

Then compute the dotproduct of D with itself $C= D \cdot D^t$ and the inverse $B=C^{-1}$ Then take the reciprocal of the top-left entry of $B$, say $s = 1/B_{1,1}$ Then s is the sum-of-squares of the residuals.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.