Rounding errors

For questions regarding programming in the EViews programming language.

Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt

Marc
Posts: 4
Joined: Wed May 09, 2012 2:25 am

Rounding errors

Postby Marc » Wed May 09, 2012 4:35 pm

I think that I've run into an annoying problem with rounding errors. The Standard deviation
when I display something in a histogram ( for 12 observations ) is not the same as when I
use a command to calculate it. This problem disappears when I use a significantly larger sample. Is
there anyway to fix it ?

The image displays it. You will see that the standard deviation from the command window generates series 0.061237 is
not the same as in the histogram 0.063960. This is strange to me because the slope in the OLS does give the result
corresponding with the correct result, which is 0.061237. The difference of the variance is not significant(0.003750 compared with
0.00409 but if the machine code should calculate them in both settings ( command window and histogram ) in the same way, so
why is there a difference ?

Perhaps it may be due my outdated version.

Image

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13604
Joined: Tue Sep 16, 2008 5:38 pm

Re: Rounding errors

Postby EViews Gareth » Wed May 09, 2012 4:54 pm

Use the @stdev command to calculate it, or if you really want to use the square root of the variance, use @sqrt(@vars(price)).

The difference you're noticing is due to the difference between population and sample variance (i.e. divide by n or n-1).

Marc
Posts: 4
Joined: Wed May 09, 2012 2:25 am

Re: Rounding errors

Postby Marc » Wed May 09, 2012 5:26 pm

I completely forgot about this. I will make sure not to forget it in the future when evaluating histograms, especially when I have the entire population available for analysis.

thanks for the answer, quick too. Beginning to get into Eviews already.


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests