Learn R Programming

liver (version 1.19)

mse: Mean Squared Error (MSE)

Description

Computes mean squared error.

Usage

mse(pred, actual, weight = 1, na.rm = FALSE)

Value

the computed mean squared error (numeric value).

Arguments

pred

a numerical vector of estimated values.

actual

a numerical vector of actual values.

weight

a numerical vector of weights the same length as pred.

na.rm

a logical value indicating whether NA values in pred should be stripped before the computation proceeds.

Author

Reza Mohammadi a.mohammadi@uva.nl and Kevin Burke kevin.burke@ul.ie

See Also

mae

Examples

Run this code
pred   = c(2.3, -1.4, 0, 3.45)
actual = c(2.1, -0.9, 0, 2.99)
  
mse(pred, actual)
   

Run the code above in your browser using DataLab