## cumulative product based on a series

For questions regarding the import, export and manipulation of data in EViews, including graphing and basic statistics.

Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Steve

akoh
Posts: 4
Joined: Thu Dec 07, 2023 7:55 pm

### cumulative product based on a series

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

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13375
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?

akoh
Posts: 4
Joined: Thu Dec 07, 2023 7:55 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?
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 month-on-month change from my model forecasts. thereafter i want to apply the month-on-month 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!

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

### Re: cumulative product based on a series

Code: Select all

``` series z = @cumprod(y)*@last(x) ```

akoh
Posts: 4
Joined: Thu Dec 07, 2023 7:55 pm

### Re: cumulative product based on a series

Code: Select all

``` series z = @cumprod(y)*@last(x) ```
Thanks Gareth!