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

Postby akoh » Fri Jul 12, 2024 2:18 am

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

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

Postby EViews Gareth » Fri Jul 12, 2024 9:24 am

So the first two elements in X are irrelevant? Really you just have a scalar for X?
Follow us on Twitter @IHSEViews

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

Re: cumulative product based on a series

Postby akoh » Sun Jul 14, 2024 7:22 pm

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

Postby EViews Gareth » Mon Jul 15, 2024 7:58 am

Code: Select all

series z = @cumprod(y)*@last(x)
Follow us on Twitter @IHSEViews

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

Re: cumulative product based on a series

Postby akoh » Thu Jul 18, 2024 7:12 pm

Code: Select all

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


Return to “Data Manipulation”

Who is online

Users browsing this forum: No registered users and 0 guests