Page 1 of 1

Root Mean Square Error

Posted: Mon Dec 01, 2014 2:26 am
by rbelhach95
Dear Tom,

I would lke to compute RMSE, my observed and focasted matrices are of sizes (M,P), I could compute the RMSE column by column, but I would like to do it for the whole database, is this code correct?
Many thanks for your help
Rachid

source "C:\ Desktop\ uforeerrors.src"
do i = 1, M
sample(smpl=%valid(observed)) observed(i) / goodsource1(i)
sample(smpl=%valid(forecasted)) forecasted(i) / goodsource2(i)
@UForeErrors goodsource1(i) goodsource2(i)
end do i

Re: Root Mean Square Error

Posted: Mon Dec 01, 2014 7:34 am
by TomDoan
I'm not sure what you mean. How can the observed be different size than the forecasted for computing RMSE? You can only calculate this over the range that overlaps. As is reads, that looks wrong since the samples of the two don't match up.

Re: Root Mean Square Error

Posted: Mon Dec 01, 2014 8:56 am
by rbelhach95
Thanks Tom for your inputs. Sorry I wasn't very clear, they are both of the same size MxP. I ran the code but I get error
Thanks
Rachid

Re: Root Mean Square Error

Posted: Mon Dec 01, 2014 9:20 am
by TomDoan
How can the SMPL options be different? As you've written that, those won't match up. Also @UFOREERRORS will only do one pair. If you want a single RMSE's across all pairs, you'll have to compute that yourself. (It's just the sqrt(sum of squared errors / number of terms)).

Re: Root Mean Square Error

Posted: Mon Dec 01, 2014 9:35 am
by rbelhach95
I get it, in fact, they don' t match up. Many thanks
Rachid