Hi, I am having some trouble using proc optmodel for the first time. I have the below table of 3 forecasts and the actual outturn for each month: Month FC1 FC2 FC3 AC 1 111 125 120 118 2 208 151 183 172 3 157 166 155 154 . . . 12 202 215 199 209 What I am trying to find is which combination of the 3 forecasts would have given the minimal absolute error over the whole year, subject to 3 constraints. The trouble I am having with it is loading my observations in and summing over the whole period. I have got it to work below for the first record by manually entering the values but any help would be appreciated. Also, is there a way to output the solution to a dataset rather than print? Thanks. proc optmodel;
var w1, w2, w3;
minimize absErr = abs(((w1*111)+(w2*125)+(w3*120))-118);
con bound1: w1+w2+w3=1;
con bound2: max(w1,w2,w3)<= 1;
con bound3: min(w1,w2,w3)>= 0;
solve;
print w1 w2 w3;
quit;
... View more