2024-11-26
Today
Next week, we will go through the formative coding section together.
Lines can be described using the following formula: \(y = \alpha + \beta x\)
OLS regression finds the line that minimises the sum of squared errors:
\[ SSE = \sum^{n}_{i=1}{(y_i - \hat{y}_i)^2} \]
Where:
Screenshot from course textbook PDF version, p. 104 (= p. 78 in published book).
Out-of-sample prediction:
Coefficients:
Estimate Std. Error t value
(Intercept) 0.793346 0.0304079 26.09
age -0.006956 0.0005246 -13.26
Overfitting:
Today
\[ \sigma^{2}_{X} = \frac{\sum^{N}_{i}{(X_i - \mu_{X})^2}}{N} \]
\[ cov(X,Y) = \frac{\sum^{N}_{i=1}(X_i - \mu_X) \cdot (Y_i - \mu_Y)}{N} \]
\[ corr(X,Y) = \frac{cov(X, Y)}{\sigma_X \cdot \sigma_Y} \]
\[ r^2 = corr(X,Y)^2 = \left(\frac{cov(X, Y)}{\sigma_X \cdot \sigma_Y}\right)^2 \]
\[ \sigma_X = \sqrt{\sigma^{2}_{X}} = \sqrt{\frac{\sum^{N}_{i}{(X_i - \mu_{X})^2}}{N}} \]
GV249 AT8 | 🤔 Question? 🙋 raise your hand or 🖥️ use the Moodle Forum.