Say I want to compound annually a series like the CPI index at a rate of 3%p.a. I can't come up with anything better than the following code:
Code: Select all
create a 2010 2030
series inf=na
inf(1)=100
!infl_rt=0.03
%lastvaldt=@otod(@ilast(inf))
!lastval=@last(inf)
smpl {%lastvaldt} @last
series inf=!lastval*(1+!infl_rt)^@trend
smpl @all
Thanks,
Javier
