how to forecast a series with a upper bound of growth rate

For questions regarding programming in the EViews programming language.

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

zngtian
Posts: 6
Joined: Thu Dec 08, 2011 12:31 pm

how to forecast a series with a upper bound of growth rate

Postby zngtian » Mon Sep 24, 2012 7:42 am

Hi,
I have a programming problem in Eviews. I want to forecast a series, called y, from an equation, generating a series called y1. Then I want to control the growth rate of y1, for example, the highest growth rate is set to 2%. A pseudo program code could look like the following

growth_rate = 0.02
if (y1(t) - y1(t-1))/y(t-1) > grow_rate
y1(t) = y1(t-1) * (1 + grow_rate)
end

How can I realize it in Eviews? Thanks

Zheng

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

Re: how to forecast a series with a upper bound of growth ra

Postby EViews Gareth » Mon Sep 24, 2012 7:50 am

Code: Select all

!gr = 0.02 series yf = @recode((y1 - y1(-1))/y1(-1) > !gr, y1, y1(-1)*(1+!gr))

zngtian
Posts: 6
Joined: Thu Dec 08, 2011 12:31 pm

Re: how to forecast a series with a upper bound of growth ra

Postby zngtian » Mon Sep 24, 2012 8:00 am

Code: Select all

!gr = 0.02 series yf = @recode((y1 - y1(-1))/y1(-1) > !gr, y1, y1(-1)*(1+!gr))
Thanks!. That's neat!
Zheng


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests