powered by
Calculates the mean absolute error (MAE) from observed and predicted values.
mae(observed, predicted)
Numeric vector of observed values
Numeric vector of predicted values. The length shall be the same as for observed.
The mean absolute error (MAE) calculated from the observed and the predicted values.
mae = mean(abs(observed - predicted))
# NOT RUN { o<-1:5 p<-c(2,2,4,3,5) mae(observed=o, predicted=p) # }
Run the code above in your browser using DataLab