Skip to contents

Compute root mean squared error.

Usage

rmse(object, data)

Arguments

object

fitted model

data

data.frame (defaults to NULL)

Value

numeric value

Details

The RMSE is the square root of the average of squared differences between prediction and actual observation and indicates the absolute fit of the model to the data. It can be interpreted as the standard deviation of the unexplained variance, and is in the same units as the response variable. Lower values indicate better model fit.

Author

Martin Haringa

Examples

x <- glm(nclaims ~ area, offset = log(exposure), family = poisson(),
 data = MTPL2)
rmse(x, MTPL2)
#> [1] 0.3564342