Sum of time series

For questions regarding programming in the EViews programming language.

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

marcsean
Posts: 14
Joined: Fri Jun 17, 2011 11:16 pm

Sum of time series

Postby marcsean » Fri Jun 17, 2011 11:30 pm

Hello,
I have problems creating time series.
Here is the setup:

K is a variable and l runs from 1 to K.
With this notation, I have created the series h{!K}{!j}.
E.g. K=2: Series being created are h11 and h21 h22.
Now I want to create H{!K} = (1/{!K})*???
Here is an example
E.g. K=2 H1= 1/1 * h11
H2= 1/2 * (h21+h22)
Herein is my problem: How do I create this sum / the sum of two time series?
K and l are defined within the programm.
Thank You!

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

Sum of time series

Postby EViews Gareth » Sat Jun 18, 2011 1:30 am

Put them in a group and then use @rsum

marcsean
Posts: 14
Joined: Fri Jun 17, 2011 11:16 pm

Re: Sum of time series

Postby marcsean » Sat Jun 18, 2011 4:32 am

The second step comprehensible.
Is there any possibility to create the groups dynamically and not each for itself?
group g1 containing h11
group g2 containing h21 h22
group g3 containing h31 h32 h33
up to group gm containing hm1 …. hmm? (m varies)
Is there a procedure to add series to a group? with the group series1 series2 command it appears to be quite complicated

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

Re: Sum of time series

Postby EViews Gareth » Sat Jun 18, 2011 10:14 am

group.add

marcsean
Posts: 14
Joined: Fri Jun 17, 2011 11:16 pm

Re: Sum of time series

Postby marcsean » Sun Jun 19, 2011 2:05 am

Thank you, it worked fine!

Just one further question:
Is there any possibility to extract a certain value from a series?
E.g. I want to have the fifth value of a series and work with it like a number in order to generate further series by arithmetic operations.
E.g. name fith value of series 1 a; series 2 = a*series1.

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

Sum of time series

Postby EViews Gareth » Sun Jun 19, 2011 8:43 am

Use the @elem function


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests