I am trying to write some code that will automatically calculate the (so-called) Symmetric Mean Percentage Error in relation to a series of forecasts.
The relevant equation is depicted here
.
I have written the following code to accomplish this task.
SMAPE = (sum(abs(Results(:,3)) ./ ((abs(Results(:,1))+
abs(Results(:,2))) /2))) * ((numel(Results(:,3)))^(-1));
My code works but has been criticized on the grounds that it is too long and difficult to read, and I agree that it is difficult to read. Could I have accomplished the same thing in a briefer way
How about defining the variables y and f, then it would be as simple as: