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 β(adsbygoogle = window.adsbygoogle || []).push({}); _{0}and β_{1}. Help me to condense it into the matrix, -2X'y + 2X'Xb.

∂S/∂β_{0}= -2y_{1}x_{11}+ 2x_{11}(β_{0}x_{11}+ β_{1}x_{12}) + ... + -2y_{n}x_{n1}+ 2x_{n1}(β_{0}x_{n1}+ β_{1}x_{n2})

∂S/∂β_{1}= -2y_{1}x_{12}+ 2x_{12}(β_{0}x_{11}+ β_{1}x_{12}) + ... + -2y_{n}x_{n2}+ 2x_{n2}(β_{0}x_{n1}+ β_{1}x_{n2})

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

**Physics Forums | Science Articles, Homework Help, Discussion**

Dismiss Notice

Join Physics Forums Today!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Creating a least-squares matrix of partial derivatives

**Physics Forums | Science Articles, Homework Help, Discussion**