Root Mean Square Error

Use this forum to post questions about syntax problems or general programming issues. Questions on implementing a particular aspect of econometrics should go in "Econometrics Issues" below.
rbelhach95
Posts: 115
Joined: Sat Feb 09, 2013 9:30 am

Root Mean Square Error

Unread post 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
Last edited by rbelhach95 on Mon Dec 01, 2014 2:32 am, edited 4 times in total.
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Root Mean Square Error

Unread post 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.
rbelhach95
Posts: 115
Joined: Sat Feb 09, 2013 9:30 am

Re: Root Mean Square Error

Unread post 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
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Root Mean Square Error

Unread post 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)).
rbelhach95
Posts: 115
Joined: Sat Feb 09, 2013 9:30 am

Re: Root Mean Square Error

Unread post by rbelhach95 »

I get it, in fact, they don' t match up. Many thanks
Rachid
Post Reply