Forecast model that do not overwrite known values

For questions regarding programming in the EViews programming language.

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

Gloria
Posts: 9
Joined: Sat Dec 01, 2012 1:20 am

Forecast model that do not overwrite known values

Postby Gloria » Sat Dec 01, 2012 3:40 am

Hello,

I have 3 series with different ending dates (e.g. series1 in 2012:9, series2 in 2012:10, series3 in 2012:9). I am trying to run a forecasting model starting from the last period with values for all variables ( in the example 2012:9+1), but as series2 has already a value for 2012:10 I would like that the model keeps this value when solving. Is this possible in EViews?

For the moment I have programmed it so that I create a VAR, estimate the equations for the estimation sample and copy the estimated equations as the model equations including a @recode function. As I must do this for several VARs and several countries and/or the estimation sample might change, I would like to know if there is the an option for solving the model in order to not overwrite known values. Please see example program below.


'end_softdata = 2012:9;

' --- create empty group VARSOFT
GROUP VARSOFT

'order a list of series
' --- load ordered variables in the group
for %i SERIES1 SERIES2 SERIES3

VARSOFT.add {%i}
next
' --- create sample
for !i=1 to VARSOFT.@count 'counter for the variables in the group
%inamesoft = VARSOFT.@seriesname(!i)
%inisoft=@otod(@ifirst({%inamesoft}))
%finsoft=@otod(@ilast({%inamesoft}))
'smpl %finsoft+1 @last
next

'historical series
SERIES SERIES1_hist=SERIES1
SERIES SERIES2_hist=SERIES2
SERIES SERIES3_hist=SERIES3

'VAR
VAR VAR01
VAR01.LS SERIES1 SERIES2 SERIES3
MODEL VAR1 'SOFT MODEL
'VAR1.APPEND :VAR01

VAR1.APPEND series1 = @RECODE(series1_hist =NA,1.050615972 * series1(-1) + 0.1430958864 * series1(-2) - 0.2137090178 * series1(-3) - 0.08287320537 * series1(-4) - 0.004062949359 * series1(-5) + 0.1020872733 * series1(-6) + 0.11878156 * series2(-1) + 0.08387318105 * series2(-2) + 0.01445065705 * series2(-3) + 0.02491362013 * series2(-4) + 0.0035876477 * series2(-5) + 0.0446521193 * series2(-6) - 0.06307174018 * series3(-1) - 0.001300322111 * series3(-2) + 0.06391715485 * series3(-3) + 0.02151004069 * series3(-4) - 0.01229482953 * series3(-5) - 0.04151507081 * series3(-6) + 0.1883246979 , series1_hist)

VAR1.APPEND series2 = @RECODE(series2_hist=NA, 0.6839319378 * series1(-1) - 0.7791013633 * series1(-2) + 0.5605207964 * series1(-3) - 0.2696065569 * series1(-4) + 0.02464365171 * series1(-5) - 0.221710847 * series1(-6) - 0.108094511 * series2(-1) + 0.1257823213 * series2(-2) + 0.1543402288 * series2(-3) + 0.05477073286 * series2(-4) - 0.09883368602 * series2(-5) + 0.08157946449 * series2(-6) - 0.3678742195 * series3(-1) + 0.2271316556 * series3(-2) + 0.04471368308 * series3(-3) + 0.02946643161 * series3(-4) + 0.03527449231 * series3(-5) - 0.07147229889 * series3(-6) - 0.3537779653, series2_hist)

VAR1.APPEND series3 = @RECODE(series3_hist=NA, - 0.01184232597 * series1(-1) + 0.3088297763 * series1(-2) + 0.3612829292 * series1(-3) - 0.7240363101 * series1(-4) + 0.06717878137 * series1(-5) - 0.0008071256258 * series1(-6) + 0.4014346608 * series2(-1) + 0.4975351059 * series2(-2) + 0.4313042708 * series2(-3) + 0.07497739983 * series2(-4) - 0.05494459956 * series2(-5) + 0.1849620585 * series2(-6) + 0.2208402377 * series3(-1) + 0.3046651301 * series3(-2) + 0.2233036593 * series3(-3) + 0.1097012174 * series3(-4) + 0.02038600752 * series3(-5) + 0.05889779715 * series3(-6) - 0.5134558538, series3_hist)

SMPL %finsoft+1 %finsoft+12
VAR1.SOLVE(s=d)


Thanks,
Gloria

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

Re: Forecast model that do not overwrite known values

Postby EViews Gareth » Sat Dec 01, 2012 9:23 am

I'm not entirely sure I follow your question, but perhaps you simply want to exclude the variables for periods in which data exists, in which case you use the:

Code: Select all

model.exclude(actexist=true) series01 series02 series03
proc

Gloria
Posts: 9
Joined: Sat Dec 01, 2012 1:20 am

Re: Forecast model that do not overwrite known values

Postby Gloria » Sun Dec 02, 2012 12:33 am

Thanks, it works!

Luiza Rodrigues
Posts: 2
Joined: Wed Jan 30, 2013 9:34 am

Re: Forecast model that do not overwrite known values

Postby Luiza Rodrigues » Wed Jan 30, 2013 9:44 am

I am doing a VEC on export, gdp, dolar and CRBprices. From 2013q1, I'd like to produce two scenarios: 1) CRB prices stable comparing to 2012 and 2) CRB prices increase 20% comparing to 2012. Therefore, i created two series, named "CRBstable" and CRBplus20" to solve the model. The results of the two models are exactly the same, why? Probably because the solved model used past data and not my assumptions on CRBprices. How do i write a program in which i forecast "export" allowing CRB to be exogenous (defined by me)? I read the manual but coudn't understand hw to produce such result.

I wrote:

var var_exp_1
var var_exp_1.ec 1 4 export pibdolar dolar1 @ dummy CRBplus20
var_exp_1.makemodel(model_exp_1)

smpl 2013q1 2013q4
model_exp_1.solve
rename export_0 forecast_exp_1


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests