0
我有一個真實的數據和預測的數據,我想計算整體MAPE和MSE。數據是時間序列,每列代表不同星期的數據。如下所示,我預測每個項目52周的每個值。什麼是最好的總體計算R的錯誤。計算平均MAPE和MSE的有效方法R
real = matrix(
c("item1", "item2", "item3", "item4", .5, .7, 0.40, 0.6, 0.3, 0.29, 0.7, 0.09, 0.42, 0.032, 0.3, 0.37),
nrow=4,
ncol=4)
colnames(real) <- c("item", "week1", "week2", "week3")
predicted = matrix(
c("item1", "item2", "item3", "item4", .55, .67, 0.40, 0.69, 0.13, 0.9, 0.47, 0.19, 0.22, 0.033, 0.4, 0.37),
nrow=4,
ncol=4)
colnames(predicted) <- c("item", "week1", "week2", "week3")