Page 1 of 1

@mean and @sum

Posted: Tue Aug 06, 2013 7:21 am
by paues
While it is possible to specify a sample period for when using @mean and @sum to calculate a series (below)...

Code: Select all

series mySeries=1 series tmp2=@sum(mySeries,"2005 2005") series tmp2=@mean(mySeries,"2005 2005")
... it does not seem to be possible to do so when calculating a control variable or a scalar.

Code: Select all

!tmp3=@sum(mySeries,"2005 2005") !tmp4=@mean(mySeries,"2005 2005") scalar tmp5=@sum(mySeries,"2005 2005") scalar tmp6=@mean(mySeries,"2005 2005")
I am using EViews 8 Enterprise Edition (Aug 1 2013 build).

Re: @mean and @sum

Posted: Tue Aug 06, 2013 8:00 am
by EViews Gareth
That's correct, and not really a bug so much as a missing feature :D

Re: @mean and @sum

Posted: Tue Aug 06, 2013 8:39 am
by paues
Even though I see your point :D , the command reference specifies that @mean and @sum take a sample as their second argument. Is the feature coming up? (While it is easy to code by oneself it would be very helpful.)

Re: @mean and @sum

Posted: Tue Aug 06, 2013 8:49 am
by EViews Gareth
Doubtful. There are two expression evaluaters in EViews, those that return series and those that return matrix/scalars. The two are completely separate. The first understands about samples, the other (since matrices/scalars don't depend on workfile structure) does not. For a similar reason you can't do:

Code: Select all

scalar p = @max(@movav(x,2))
but you can do:

Code: Select all

series p = @max(@movav(x,2))
because the series evaluater understands @movav, but the matrix one doesn't.

Yes this is unfortunate. Yes it is a pain. Yes we should fix it. Unfortunately it requires re-writing most of EViews :(