Page 1 of 1

Standard deviation over recursive sample

Posted: Tue Dec 14, 2010 9:02 am
by Rosa.hh
Hi!

I am using Eviews 7 and I have a question about the standard deviation function. I have a database for the period 1990Q1 to 2009Q2. I want to calculate an explanatory variable' standard deviation for the second half of my sample using the information of the first half; keeping the first observation fixed. So I want to compute it first for 1999Q4 using info from 1990Q1-1999Q3; then for 2000Q1 using info from 1990Q1-1999Q4 and so on until 2009Q2.

I have tried the programs detailed below however although it gives me information for the second half of the period (as I want to), it is calculating the standard deviation using the info. for the second half of the period instead of using the first half which is what I want.

How can I estimate the stdev for the second half of my sample using the information of the first half?

Thank you very much in advance!

!halfobs=39
!endobs=78
for !c = 1 to !halfobs
smpl @all
smpl @last-(!halfobs-!c) @last
series stdev=@stdev(a_rer_gq)

Re: Standard deviation over recursive sample

Posted: Tue Dec 14, 2010 9:11 am
by EViews Gareth
Use the @cumstdev function. Something like:

Code: Select all

series temp = @cumstdev(a_rer_gq) smpl 1999q4 @last series stdev = temp(-1) d temp

Re: Standard deviation over recursive sample

Posted: Tue Dec 14, 2010 9:45 am
by Rosa.hh
Thank you very much Gareth!