Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Chapter 2: Simple Linear Regression

SectionsΒΆ

SummaryΒΆ

2.1 OverviewΒΆ

2.2 Partial DerivativesΒΆ

2.3 Finding Optimal ParametersΒΆ

βˆ‚Rsqβˆ‚w0=βˆ’2nβˆ‘i=1n(yiβˆ’(w0+w1xi))\frac{\partial R_\text{sq}}{\partial w_0} = -\frac{2}{n}\sum_{i=1}^n \big(y_i - (w_0 + w_1 x_i)\big)
βˆ‚Rsqβˆ‚w1=βˆ’2nβˆ‘i=1nxi(yiβˆ’(w0+w1xi))\frac{\partial R_\text{sq}}{\partial w_1} = -\frac{2}{n}\sum_{i=1}^n x_i \big(y_i - (w_0 + w_1 x_i)\big)

2.4 CorrelationΒΆ

2.5 Least SquaresΒΆ

ModelOptimal parametersMinimum MSE
h(xi)=wh(x_i) = wwβˆ—=yΛ‰w^* = \bar yΟƒy2\sigma_y^2
h(xi)=w0+w1xih(x_i) = w_0 + w_1 x_iw1βˆ—=rΟƒyΟƒxw_1^* = r\frac{\sigma_y}{\sigma_x}, β€…β€Šw0βˆ—=yΛ‰βˆ’w1βˆ—xΛ‰\; w_0^* = \bar y - w_1^* \bar xΟƒy2(1βˆ’r2)≀σy2\sigma_y^2 (1 - r^2) \le \sigma_y^2