Page 1 of 1

Storing @quantile in a series

Posted: Mon Nov 05, 2018 11:31 am
by nevernotnone
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?

Re: Storing @quantile in a series

Posted: Mon Nov 05, 2018 11:35 am
by nevernotnone
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

Re: Storing @quantile in a series

Posted: Mon Nov 05, 2018 12:14 pm
by EViews Gareth
Hard to debug without the full program, but try this:

Code: Select all

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

Re: Storing @quantile in a series

Posted: Mon Nov 05, 2018 12:18 pm
by EViews Matt
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

Re: Storing @quantile in a series

Posted: Mon Nov 05, 2018 1:48 pm
by EViews Gareth
The e makes my response much better