Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
kb:linear_regression [2022-03-02 02:29] – ↷ Page name changed from kb:inear_regression to kb:linear_regression jaeyoung | kb:linear_regression [2024-04-30 04:03] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 88: | Line 88: | ||
In other words, $R^2$ describes how much of the variation in $y$ is captured by the regression. | In other words, $R^2$ describes how much of the variation in $y$ is captured by the regression. | ||
+ | |||
+ | ==== Predictive distribution ==== | ||
+ | |||
+ | Predictive error is the difference between the prediction and true value. | ||
+ | |||
+ | $$ \hat{Y}(x) - a^* - b^*x = \frac{1}{n} \sum_{i = 1}^{n} \varepsilon_i \left\{ 1 + \frac{(x_i - \bar{x})(x - \bar{x})}{\sigma_x^2} \right\} $$ | ||
+ | |||
+ | The expectation is $0$, of course: | ||
+ | |||
+ | $$ \mathbb{E}[\hat{Y}(x) - a^* - b^*x] = 0 $$ | ||
+ | |||
+ | The variance is: | ||
+ | |||
+ | $$ \mathrm{Var}[\hat{Y}(x) - a^* - b^*x] = \mathbb{E}[(\hat{Y}(x) - a^* - b^*x)^2] = \frac{\sigma^2}{n} \left( \frac{(x - \bar{x})^2}{\sigma_x^2} \frac{n-1}{n} + 1 \right) $$ | ||
+ | |||
+ | The distribution is Gaussian if $\varepsilon_i$ are Gaussian. If it is Gaussian, then we can easily compute [[kb: | ||
===== Multivariate linear regression ===== | ===== Multivariate linear regression ===== |