Learn R Programming

liver (version 1.0)

mse: Mean Squared Error (MSE)

Description

Computes mean squared error.

Usage

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

Arguments

pred

a numerical vector of estimated values.

true

a numerical vector of true 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.

Value

The computed mean squared error (numeric value).

Examples

Run this code
# NOT RUN {
pred = c( 2.3, -1.4, 0, 3.45 )
true = c( 2.1, -0.9, 0, 2.99 )
  
mse( pred, true )
   
# }

Run the code above in your browser using DataLab