Calculates the root mean squared error \(\left( \mathrm{RMSE} \right)\) using $$ \mathrm{RMSE} = \sqrt{\frac{1}{n} \sum_{i = 1}^{n} \left( \mathbf{y} - \mathbf{X} \boldsymbol{\hat{\beta}} \right)^{2}} \\ = \sqrt{\frac{1}{n} \sum_{i = 1}^{n} \left( \mathbf{y} - \mathbf{\hat{y}} \right)^{2}} \\ = \sqrt{\frac{\mathrm{RSS}}{n}} . $$
RMSE(X, y)
X |
|
---|---|
y | Numeric vector of length |
Returns the root mean squared error.
Wikipedia: Root-mean-square deviation
Other assessment of model quality functions:
.MSE()
,
.R2fromESS()
,
.R2fromRSS()
,
.RMSE()
,
.Rbar2()
,
.model()
,
MSE()
,
R2()
,
Rbar2()
,
model()
Ivan Jacob Agaloos Pesigan
# Simple regression------------------------------------------------ X <- jeksterslabRdatarepo::wages.matrix[["X"]] X <- X[, c(1, ncol(X))] y <- jeksterslabRdatarepo::wages.matrix[["y"]] RMSE(X = X, y = y)#> [1] 7.56011# Multiple regression---------------------------------------------- X <- jeksterslabRdatarepo::wages.matrix[["X"]] # age is removed X <- X[, -ncol(X)] RMSE(X = X, y = y)#> [1] 6.492972