Learn R Programming

MetricsWeighted (version 0.1.0)

mse: Mean-squared error

Description

Weighted mean-squared error of prediction. Equals mean unit normal deviance.

Usage

mse(actual, predicted, w = NULL, ...)

Arguments

actual

Observed values.

predicted

Predicted values.

w

Optional case weights.

...

Further arguments passed to weighted_mean.

Value

A numeric vector of length one.

See Also

rmse, deviance_normal.

Examples

Run this code
# NOT RUN {
mse(1:10, (1:10)^2)
mse(1:10, (1:10)^2, w = rep(1, 10))
mse(1:10, (1:10)^2, w = 1:10)

# }

Run the code above in your browser using DataLab