Learn R Programming

berryFunctions (version 1.5.2)

rmse: Root Mean Squared Error

Description

Root Mean Squared Error

Usage

rmse(a,b)

Arguments

a
Vector with values.
b
Another vector of the same length.

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