Page 1 of 1

Series creation with growth rate

Posted: Tue Mar 31, 2020 5:33 am
by superjocker
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

Re: Series creation with growth rate

Posted: Tue Mar 31, 2020 6:27 am
by startz
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)

Re: Series creation with growth rate

Posted: Tue Mar 31, 2020 6:36 am
by superjocker
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.

Re: Series creation with growth rate

Posted: Tue Mar 31, 2020 6:41 am
by startz
What's in the HP series?

Re: Series creation with growth rate

Posted: Tue Mar 31, 2020 6:49 am
by superjocker
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)

Re: Series creation with growth rate

Posted: Tue Mar 31, 2020 6:51 am
by startz
Perhaps post your EViews workfile.

Re: Series creation with growth rate

Posted: Tue Mar 31, 2020 7:02 am
by superjocker
'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.

Re: Series creation with growth rate

Posted: Tue Mar 31, 2020 7:12 am
by startz
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.

Re: Series creation with growth rate

Posted: Tue Mar 31, 2020 7:44 am
by superjocker
The formula:

series vc_areal=100

smpl 2 @last

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

Re: Series creation with growth rate

Posted: Tue Mar 31, 2020 7:47 am
by EViews Gareth
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.

Re: Series creation with growth rate

Posted: Tue Mar 31, 2020 8:07 am
by superjocker
Thank you, it worked!!! thank you very much, you are the best.

Thank you again