Page 1 of 1
Re: Running variance plot
Posted: Tue Sep 11, 2012 7:53 am
by EViews Gareth
Not quite sure what you're asking.
Re: Running variance plot
Posted: Tue Sep 11, 2012 10:36 am
by EViews Gareth
s_r(n)²=1/(n-1)*sum[t=1 to n](x(t)-mean)²
ok, I'm going to assume that you wish to generate a series following the above formula. Without knowing what the components of that formula are, it is pretty difficult to tell you how to do so.
Re: Running variance plot
Posted: Tue Sep 11, 2012 1:59 pm
by EViews Gareth
The @trend, @cumsum and @mean functions will get you there. Something like:
Code: Select all
series s_r = 1/(@trend)*@cumsum(x-@mean(x))
Re: Running variance plot
Posted: Tue Sep 11, 2012 2:15 pm
by EViews Glenn
While Gareth has given you the command that matches your expression, the problem with this as a cumulative variance is that the mean adjustment to the original data uses a mean that isn't cumulative. So it's not quite a cumulative variance.
So while I'm not sure what you want, I will point out that there are recursive formulae for the variance:
http://mathworld.wolfram.com/SampleVari ... ation.html
http://blogs.sas.com/content/iml/2012/0 ... -variance/
Re: Running variance plot
Posted: Wed Sep 12, 2012 9:39 am
by EViews Glenn
That's fine if you are happy with that calculation. The only thing I was pointing out is that you are computing your variance using a mean that is taken from the full sample which is slightly different from the "draw the variance estimated from the first n terms" interpretation.
Re: Running variance plot
Posted: Fri Sep 14, 2012 3:43 pm
by EViews Glenn
That is correct.