rmse: Root mean square error

Description Usage Arguments Details Examples

Description

Calculate the root mean square error of vectors x and y.

Usage

1
rmse(x, y, na.rm = T)

Arguments

x, y

numerical vectors of same length.

na.rm

Remove NAs prior to calculation? Defaults to TRUE.

Details

sqrt( mean( ( x - y ) ^ 2 ) )

Examples

1
2
3
4
5
rmse(1:10,21:30)
# [1] 20
set.seed(42) # We want to produce the same results!
rmse(rnorm(10),rnorm(10))
# [1] 2.108466

nobodyinperson/meteoRology documentation built on May 23, 2019, 9:31 p.m.