Hi all, i had a query on my mind to seek your guidance please.
suppose i have a series x = (1, 2, 3), and a series y = (1.1, 1.5, 1.9)
I wish to get a new series z with 3 elements, where z is
3* 1.1, (i.e., last element of x times 1st element of y)
3*1.1*1.5, (i.e., multiply the 1st element of z with the 2nd element of y)
3*1.1*1.5*1.9 (i.e., multiply the 2nd element of z with the 3rd element of y)
may i know how i can code up the above please?
thanks
cumulative product based on a series
Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Steve

 Fe ddaethom, fe welon, fe amcangyfrifon
 Posts: 13369
 Joined: Tue Sep 16, 2008 5:38 pm
Re: cumulative product based on a series
So the first two elements in X are irrelevant? Really you just have a scalar for X?
Follow us on Twitter @IHSEViews
Re: cumulative product based on a series
Hi Gareth, thanks for responding. the context is that X is observed monthly data, and the last element of X is the last observed actual. Y is the monthonmonth change from my model forecasts. thereafter i want to apply the monthonmonth change to my last observed actual. can i know if you have any guidance please? the end product ideally should be a monthly time series too. thanks again!So the first two elements in X are irrelevant? Really you just have a scalar for X?

 Fe ddaethom, fe welon, fe amcangyfrifon
 Posts: 13369
 Joined: Tue Sep 16, 2008 5:38 pm
Re: cumulative product based on a series
Code: Select all
series z = @cumprod(y)*@last(x)
Follow us on Twitter @IHSEViews
Re: cumulative product based on a series
Thanks Gareth!Code: Select all
series z = @cumprod(y)*@last(x)
Who is online
Users browsing this forum: No registered users and 2 guests