Running variance plot
Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13604
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Running variance plot
Not quite sure what you're asking.
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13604
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Running variance plot
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.
s_r(n)²=1/(n-1)*sum[t=1 to n](x(t)-mean)²
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13604
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Running variance plot
The @trend, @cumsum and @mean functions will get you there. Something like:
Code: Select all
series s_r = 1/(@trend)*@cumsum(x-@mean(x))
-
EViews Glenn
- EViews Developer
- Posts: 2682
- Joined: Wed Oct 15, 2008 9:17 am
Re: Running variance plot
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/
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/
-
EViews Glenn
- EViews Developer
- Posts: 2682
- Joined: Wed Oct 15, 2008 9:17 am
Re: Running variance plot
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.
-
EViews Glenn
- EViews Developer
- Posts: 2682
- Joined: Wed Oct 15, 2008 9:17 am
Re: Running variance plot
That is correct.
Who is online
Users browsing this forum: No registered users and 2 guests
