Series creation with growth rate

For questions regarding programming in the EViews programming language.

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

superjocker
Posts: 27
Joined: Mon Mar 30, 2020 5:45 pm

Series creation with growth rate

Postby superjocker » Tue Mar 31, 2020 5:33 am

Hi, I am trying to create a series say "VC", where the first observation of this series "VC" is 100 and from the second observation onwards use the formula series VC=(1+HP)*(VC(-1)), where HP is a series of growth rates. Please, if someone could help me would be very appreciate.

Thanks

startz
Non-normality and collinearity are NOT problems!
Posts: 3797
Joined: Wed Sep 17, 2008 2:25 pm

Re: Series creation with growth rate

Postby startz » Tue Mar 31, 2020 6:27 am

Hi, I am trying to create a series say "VC", where the first observation of this series "VC" is 100 and from the second observation onwards use the formula series VC=(1+HP)*(VC(-1)), where HP is a series of growth rates. Please, if someone could help me would be very appreciate.

Thanks

Code: Select all

series vc =100 smpl 2 @last vc = (1+HP)*VC(-1)

superjocker
Posts: 27
Joined: Mon Mar 30, 2020 5:45 pm

Re: Series creation with growth rate

Postby superjocker » Tue Mar 31, 2020 6:36 am

Thanks, but it didnt work, actually I had tried something similar with the same result, just NAs. No problem creating the VC=100 series, but then when defining the smpl and running the formula, just get NAs.

startz
Non-normality and collinearity are NOT problems!
Posts: 3797
Joined: Wed Sep 17, 2008 2:25 pm

Re: Series creation with growth rate

Postby startz » Tue Mar 31, 2020 6:41 am

What's in the HP series?

superjocker
Posts: 27
Joined: Mon Mar 30, 2020 5:45 pm

Re: Series creation with growth rate

Postby superjocker » Tue Mar 31, 2020 6:49 am

What's in the HP series?
just growth rates like
na
0.03
0.05
0.07
0.08
0.001
0.025

so I need to end up with
series VC
100
103---------->100*(1+0.03)
108.15---------->103*(1+0.05)

startz
Non-normality and collinearity are NOT problems!
Posts: 3797
Joined: Wed Sep 17, 2008 2:25 pm

Re: Series creation with growth rate

Postby startz » Tue Mar 31, 2020 6:51 am

Perhaps post your EViews workfile.

superjocker
Posts: 27
Joined: Mon Mar 30, 2020 5:45 pm

Re: Series creation with growth rate

Postby superjocker » Tue Mar 31, 2020 7:02 am

'fondo A
import "D:\Usuario\eorellana\Desktop\Box Sync\Eduardoraran\AFPs\RENTABILIDADES FONDOS.xlsx" range="HISTORICOS A"!$AS$3:$AU$20000 colhead=1 na="#N/A" @freq D7 9/26/2002 @smpl @all



'UF
import "D:\Usuario\eorellana\Desktop\Box Sync\Eduardoraran\AFPs\UF Actual.xlsx" range="UF Diaria"!$A$1:$C$20000 colhead=1 na="#N/A" @freq D7 9/26/2002 @smpl @all


series vc_areal=100

smpl 2 @last

vc_areal=(1+(((1+rent_diaria_a)/(1+rent_diaria_uf))-1))*(vc_areal(-1))


What I gave you was a simplification but (((1+rent_diaria_a)/(1+rent_diaria_uf))-1)) is just a rate. Also I am importing data from an Excel from an specific range, dont know if that is doing something.

startz
Non-normality and collinearity are NOT problems!
Posts: 3797
Joined: Wed Sep 17, 2008 2:25 pm

Re: Series creation with growth rate

Postby startz » Tue Mar 31, 2020 7:12 am

Save your workfile to something like foo.wf1 and post that. That's the only way for anyone else to see what EViews thinks it has.

superjocker
Posts: 27
Joined: Mon Mar 30, 2020 5:45 pm

Re: Series creation with growth rate

Postby superjocker » Tue Mar 31, 2020 7:44 am

The formula:

series vc_areal=100

smpl 2 @last

vc_areal=(1+(((1+rent_diaria_a)/(1+rent_diaria_uf))-1))*(vc_areal(-1))
Attachments
FOO.WF1
(1.1 MiB) Downloaded 287 times

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

Re: Series creation with growth rate

Postby EViews Gareth » Tue Mar 31, 2020 7:47 am

Use:

Code: Select all

smpl @first+1 @last
rather than

Code: Select all

smpl 2 @last
Your workfile is dated, so "2" corresponds to the date "2" rather than the 2nd observation.

superjocker
Posts: 27
Joined: Mon Mar 30, 2020 5:45 pm

Re: Series creation with growth rate

Postby superjocker » Tue Mar 31, 2020 8:07 am

Thank you, it worked!!! thank you very much, you are the best.

Thank you again


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests