So I am studying for a college final exam, and following a past exam paper at the moment.
The lecturer has provided us with solutions to the previous years exam paper, not very clear in some cases might I add.
Such example is the Root Mean Square Error question.
I have a table $$\begin{array}{|c|c|} \hline X_k & Y_k \\ \hline 1 & 0.6 \\ 2 & 1.9 \\ 3 & 4.3 \\ 4 & 7.6 \\ 5 & 12.6 \\ \hline \end{array}$$
He has given the Root Mean Square Error answer without showing any work on how he got it. I would like to know if anyone here can help me?
E(f(Xk)-Yk)^2 = 0.86609
E(f) = (1/5(0.86609))^1/2 = 0.416195
Any idea how he gets the 0.86609 value? Once I figure out that step, the rest is straight forward.
Any help to put me in the right direction is greatly appreciated.
An umbiased estimator of the residual MSE is given by $$\hat{\sigma}^2 = \dfrac{1}{5-1-1}\sum_{i=1}^{5}(\hat{y}_i - y_i)^2 = \dfrac{1}{3}\sum_{i=1}^{5}(\hat{y}_i - y_i)^2\text{.}$$ You then take the square root of this to get the RMSE. Assuming that $\hat{y}_i$ is computed using least squares on a simple linear regression, you will get $$\hat{y}_i = 2.97x_i - 3.51$$ as your regression line. This gives $$\begin{array}{|c|c|} \hline X_k & Y_k & \hat{Y}_k\\ \hline 1 & 0.6 & -0.54\\ 2 & 1.9 & 2.43\\ 3 & 4.3 & 5.40\\ 4 & 7.6 & 8.37\\ 5 & 12.6 & 11.34\\ \hline \end{array}$$
This is the code in R to generate the fitted values:
Now the thing is, my answers don't match what you have.
This matches with the
Routput as well:So I'm either guessing that some information is either missing or incorrect, or your lecturer has done this incorrectly.