mae: mae

Description Usage Arguments Details Value Examples

View source: R/mae.R

Description

Calculates the mean absolute error (MAE) from observed and predicted values.

Usage

1
mae(observed, predicted)

Arguments

observed

Numeric vector of observed values

predicted

Numeric vector of predicted values. The length shall be the same as for observed.

Details

mae = mean(abs(observed - predicted))

Value

The mean absolute error (MAE) calculated from the observed and the predicted values.

Examples

1
2
3
o<-1:5
p<-c(2,2,4,3,5)
mae(observed=o, predicted=p)

soilmapper/mapsRinteractive documentation built on March 7, 2020, 8:49 a.m.