# fit an MM-regression model
library("robustbase")
data("coleman")
fit <- lmrob(Y~., data=coleman)
# compute the prediction loss
mspe(coleman$Y, predict(fit))
rmspe(coleman$Y, predict(fit))
mape(coleman$Y, predict(fit))
tmspe(coleman$Y, predict(fit), trim=0.1)
rtmspe(coleman$Y, predict(fit), trim=0.1)
Run the code above in your browser using DataLab