Storing @quantile in a series

For questions regarding programming in the EViews programming language.

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

nevernotnone
Posts: 3
Joined: Mon Jan 25, 2016 8:35 am

Storing @quantile in a series

Postby nevernotnone » Mon Nov 05, 2018 11:31 am

Hello,

I have a pseudo bootstrapping program where I wind up with a whole bunch of paths stored as matrices, then at each point we draw a number of points from the these as our results (vague I know, please forgive).
Long story short, we were pulling a bunch of quantiles into a table to organize them and it was fine. Now we want to instead store them as series, and this is where I get an issue.

Specifically,

Code: Select all

!z11=@sum(v1temp)/!zsimno
smpl {%zdatel}+!i {%zdatel}+!i
'This works to store the percentile of a reference series, generated earlier
{%zzname}_pct = !z11

' This doesn't work
{%zzname}_5d = 1 * @quantile(v{%zzname}!i, !z11+0.05)


When I run this, I get a message "VURCAQ1" is not series in GENR URCAQ_5D = @QUANTILE(VURCAQ1, 0.5992+0.05)". I tried adding the "1*" to try to get around it. I don't quite get it as when I store the percentile of a the reference, I don't get a problem. Similarly, setting it as "{%zzname}_5d = 1" winds up with, well, a series of 1's over the horizon I loop over.

Similarly, the structure from before, with a table called z_SERIESNAME_fin works i.e.

Code: Select all

z_{%zzname}_fin(!i+1,9) = @quantile(v{%zzname}!i, !z11-0.05)


Why am I having trouble storing a scalar as a single observation of a series?

nevernotnone
Posts: 3
Joined: Mon Jan 25, 2016 8:35 am

Re: Storing @quantile in a series

Postby nevernotnone » Mon Nov 05, 2018 11:35 am

Sorry, this is in Eviews 10+

Larger code, truncated:

Code: Select all

for !i=1 to !zfoc
      vector(!zsimno) v{%zzname}!i=@rowextract(sm_{%zzname},!zt1+!i)
      vector(!zsimno) v1temp=0
      for !s1=1 to !zsimno
         if v{%zzname}!i(!s1)<{%zzname}_{%zext}(!zt1+!i) then
            v1temp(!s1)=1
         endif
      next
      smpl {%zdatel}+!i {%zdatel}+!i
      {%zzname}_pct = !z11
      {%zzname}_5d = @quantile(v{%zzname}!i, !z11+0.05)

'etc


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

Re: Storing @quantile in a series

Postby EViews Gareth » Mon Nov 05, 2018 12:14 pm

Hard to debug without the full program, but try this:

Code: Select all

!temp = @quantile(v{%zzname}!i, !z11+0.05)
{%zzname}_5d = !temp
Follow us on Twitter @IHSEViews

EViews Matt
EViews Developer
Posts: 560
Joined: Thu Apr 25, 2013 7:48 pm

Re: Storing @quantile in a series

Postby EViews Matt » Mon Nov 05, 2018 12:18 pm

Hello,

In a series-generating expression, @quantile cannot operate on a vector. You can easily work around this by invoking @quantile in a non-series-generating expression, e.g.,

Code: Select all

!tmp = @quantile(v{%zzname}!i, !z11+0.05)
{%zzname}_5d = !tmp

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

Re: Storing @quantile in a series

Postby EViews Gareth » Mon Nov 05, 2018 1:48 pm

The e makes my response much better
Follow us on Twitter @IHSEViews


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 28 guests