Once we have built a model, \(\hat{\mathbf{y}} = \mathbf{X}\hat\beta\), we can calculate predicted y, \(\hat{\mathbf{y}}_0\) values for a new set of predictors, \(\mathbf{x}_0\).
Once we have built a model, \(\hat{\mathbf{y}} = \mathbf{X}\hat\beta\), we can calculate predicted y, \(\hat{\mathbf{y}}_0\) values for a new set of predictors, \(\mathbf{x}_0\).
$$\hat{\mathbf{y}}_0=\mathbf{x}_0^T\hat\beta$$
Once we have built a model, \(\hat{\mathbf{y}} = \mathbf{X}\hat\beta\), we can calculate predicted y, \(\hat{\mathbf{y}}_0\) values for a new set of predictors, \(\mathbf{x}_0\).
$$\hat{\mathbf{y}}_0=\mathbf{x}_0^T\hat\beta$$
For example, if we fit a model \(\hat{y} = 1.2+2.5x_1+3x_2\)
And would like to know the predicted value for someone with \(x_1 = 3\) and \(x_2 = 2\), we would calculate
Once we have built a model, \(\hat{\mathbf{y}} = \mathbf{X}\hat\beta\), we can calculate predicted y, \(\hat{\mathbf{y}}_0\) values for a new set of predictors, \(\mathbf{x}_0\).
$$\hat{\mathbf{y}}_0=\mathbf{x}_0^T\hat\beta$$
For example, if we fit a model \(\hat{y} = 1.2+2.5x_1+3x_2\)
And would like to know the predicted value for someone with \(x_1 = 3\) and \(x_2 = 2\), we would calculate
$$\hat{\mathbf{y}}_0 = \begin{bmatrix}1&3&2\end{bmatrix} \begin{bmatrix}1.2\\2.5\\3\end{bmatrix}$$
Once we have built a model, \(\hat{\mathbf{y}} = \mathbf{X}\hat\beta\), we can calculate predicted y, \(\hat{\mathbf{y}}_0\) values for a new set of predictors, \(\mathbf{x}_0\).
$$\hat{\mathbf{y}}_0=\mathbf{x}_0^T\hat\beta$$
For example, if we fit a model \(\hat{y} = 1.2+2.5x_1+3x_2\)
And would like to know the predicted value for someone with \(x_1 = 3\) and \(x_2 = 2\), we would calculate
$$\hat{\mathbf{y}}_0 = \begin{bmatrix}1&3&2\end{bmatrix} \begin{bmatrix}1.2\\2.5\\3\end{bmatrix}$$ $$\hat{\mathbf{y}}_0 = 14.7$$
Application Exercise
We are interested in predicting a chicken's weight based on their diet using the chickwts
dataset
There are ✌️ kinds of predictions that can be made from regression models
There are ✌️ kinds of predictions that can be made from regression models
There are ✌️ kinds of predictions that can be made from regression models
There are ✌️ kinds of predictions that can be made from regression models
This matters for estimating the uncertainty
What is the difference?
What is the difference?
Example: What would a chicken who eats sunflowers weigh on average?
The prediction is \(\mathbf{x}_0^T\beta\), estimated by \(\mathbf{x}_0^T\hat\beta\).
Example: What would a chicken who eats sunflowers weigh on average?
The prediction is \(\mathbf{x}_0^T\beta\), estimated by \(\mathbf{x}_0^T\hat\beta\).
What is the variance of this prediction?
Application Exercise
Show that the variance of \(\mathbf{x}_0^T\hat\beta\) is
$$\textrm{var}(\mathbf{x}_0^T\hat\beta) = \mathbf{x}_0^T(\mathbf{X}^T\mathbf{X})^{-1}\mathbf{x}_0\sigma^2$$
$$\hat{\mathbf{y}_0}\pm t*\hat\sigma\sqrt{\mathbf{x}_0^T(\mathbf{X}^T\mathbf{X})^{-1}\mathbf{x}_0}$$
Example: Suppose you want to feed your chicken sunflowers, what will your chicken's predicted weight be?
The prediction is \(\mathbf{x}_0^T\beta + \epsilon\).
What is the expected value? What is the variance?
Application Exercise
$$(1 + \mathbf{x}_0^T(\mathbf{X}^T\mathbf{X})^{-1}\mathbf{x}_0)\sigma^2$$
$$\hat{\mathbf{y}}_0\pm t^*\hat\sigma\sqrt{1+\mathbf{x}_0^T(\mathbf{X}^T\mathbf{X})^{-1}\mathbf{x}_0}$$
Which is larger?
$$(\mathbf{x}_0^T(\mathbf{X}^T\mathbf{X})^{-1}\mathbf{x}_0)\sigma^2$$
or
$$(1 + \mathbf{x}_0^T(\mathbf{X}^T\mathbf{X})^{-1}\mathbf{x}_0)\sigma^2$$
Which is larger?
$$(\mathbf{x}_0^T(\mathbf{X}^T\mathbf{X})^{-1}\mathbf{x}_0)\sigma^2$$
or
$$(1 + \mathbf{x}_0^T(\mathbf{X}^T\mathbf{X})^{-1}\mathbf{x}_0)\sigma^2$$
Once we have built a model, \(\hat{\mathbf{y}} = \mathbf{X}\hat\beta\), we can calculate predicted y, \(\hat{\mathbf{y}}_0\) values for a new set of predictors, \(\mathbf{x}_0\).
Keyboard shortcuts
↑, ←, Pg Up, k | Go to previous slide |
↓, →, Pg Dn, Space, j | Go to next slide |
Home | Go to first slide |
End | Go to last slide |
Number + Return | Go to specific slide |
b / m / f | Toggle blackout / mirrored / fullscreen mode |
c | Clone slideshow |
p | Toggle presenter mode |
t | Restart the presentation timer |
?, h | Toggle this help |
Esc | Back to slideshow |