# Creating a least-squares matrix of partial derivatives

1. Jun 7, 2012

### BifSlamkovich

In the ordinary least squares procedure I have obtained an expression for the sum of squared residuals, S, and then took the partial derivatives of it wrt β0 and β1. Help me to condense it into the matrix, -2X'y + 2X'Xb.

∂S/∂β0 = -2y1x11 + 2x110x11 + β1x12) + ... + -2ynxn1 + 2xn10xn1 + β1xn2)

∂S/∂β1 = -2y1x12 + 2x120x11 + β1x12) + ... + -2ynxn2 + 2xn20xn1 + β1xn2)

At least, help me to understand why the two partial derivatives equal the matrix above.

2. Jun 8, 2012

### HallsofIvy

Staff Emeritus
Since you haven't told us what "yi" or "xij" are or what they have to do with S, $\beta_0$, or $\beta_1$, it is impossible to answer your question.