Learn R Programming

berryFunctions (version 1.11.0)

rmse: RMSE

Description

Root Mean Squared Error

Usage

rmse(a, b, quiet = FALSE)

Arguments

a
Vector with values.
b
Another vector of the same length.
quiet
Should NA-removal warnings be suppressed? Helpful within functions. DEFAULT: FALSE

Value

Numeric.

Details

Formula used: sqrt( sum((a-b)^2)/length(b) )

References

http://en.wikipedia.org/wiki/Mean_squared_error

See Also

rsquare

Examples

Run this code

x <- rnorm(20)
y <- 2*x + rnorm(20)
plot(x,y)
yp <- predict(lm(y~x))
plot(y, yp)
abline(a=0,b=1)
rmse(y,yp)

Run the code above in your browser using DataLab