Learn R Programming

scorer (version 0.1.0)

rmse: Calculate root mean squared error.

Description

rmse takes actual and forecast numeric vectors and returns a numeric vector where forecast is subtracted from the actual, the errors are then squared, the average of those squared error is taken, and lastly, the root taken of that mean squared error value.

Usage

rmse(actual, forecast, na.rm = TRUE, ...)

Arguments

actual
a numeric vector of actuals.
forecast
a numeric vector of forecasts.
na.rm
a logical value indicating whether NA values should be stripped before the computation proceeds.
...
additional arguments to be passed to mean()

Value

  • a numeric vector of length one: the mean of of absolute percent errors.

Examples

Run this code
# Examples
rmse(1:100, 100:1)

Run the code above in your browser using DataLab