forecasts using BVAR

Questions and discussions on Vector Autoregressions
Deepika
Posts: 43
Joined: Fri Apr 17, 2015 12:55 am

forecasts using BVAR

Unread post by Deepika »

Hi Tom

I am trying to forecast a variable y using BVAR. it is the dependent variable and given as log. However i want to generate forecast comparison statistics for antilog of lny. My commands are as follows:

Code: Select all

OPEN DATA "C:\UsersData\Deepika\exchange rate paper of mam\data for exchange rate.xlsx"
CALENDAR(M) 1996:7
DATA(FORMAT=XLSX,ORG=COLUMNS) 1996:07 2013:12 lny x1 x2 x3
procedure runtheil
option choice type 1 symmetric general
option real tightness 0.2
option real decay 1
option real other 0.7
local integer time
system(model=bvar)
variables Lny x1 x2 x3 
lags 1 to 2
det constant
specify(type=symmetric, lagtype=harmonic, tightness=.2, decay=1) .7
end(system)
theil(setup,model=bvar, steps=12, from=2007:01, to=2008:01)
estimate(noprint) 1996:07 2006:12
theil(print)
do time=2007:01;2008:01
  Kalman
  theil(print)
end do time
theil(dump)
END
@runtheil(tightness=.2,type=symmetric,decay=1,other=.7)
This gives me forecast accuracy measures for lny. But how do i get the forecast accuracy measures for y. This would involve generating antilog of lny. I would appreciate any help in this.

Thanks and Regards
Deepika
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: forecasts using BVAR

Unread post by TomDoan »

See

https://estima.com/docs/RATS%2010%20Use ... f#page=182

Since you don't have actual data for y on the data file, you need to generate it for comparison. So

set y = exp(lny)
frml(identity) yid y = exp(lny)

then replace the theil(setup... with

theil(setup,model=bvar+yid steps=12, from=2007:01, to=2008:01)

Everything else should go through.
Deepika
Posts: 43
Joined: Fri Apr 17, 2015 12:55 am

Re: forecasts using BVAR

Unread post by Deepika »

Hi Tom

Thanks for replying. But now when in run the following commands i get an error:

Code: Select all

OPEN DATA "C:\UsersData\Deepika\exchange rate paper of mam\data for exchange rate.xlsx"
CALENDAR(M) 1996:7
DATA(FORMAT=XLSX,ORG=COLUMNS) 1996:07 2013:12 LEXRATE DTB DIIP DM32 DINF DTRB3 DTRB2 FDIFII VOL1 FDI2 VOL2 $
 OF INT FRDM3 D2007 VOLS ECM1_LAG ECM2_LAG ECM3_LAG ECM4_LAG DLEXRATE DLEXRATE1 DDTB1 DDIIP1 DDM321 DFRDM31 $
 DVOLS1 DLEXRATE2 DDTB2 DDIIP2 DDM322 DFRDM32 DVOLS2 ECM5_LAG ECM22 ECM23 ECM32 ECM42 DLEXRATE3 DDTB3 $
 DDIIP3 DDM323 DFRDM33 DVOLS3 DOF DINT ECMLAG22 C ECM33 TREND ECM34 DECM32 DECM23INF DDINF DDINF1 DDTB $
 DDIIP DDM32 DFRDM3 DVOLS INDEX NIFTY FII DIFFINDEX
procedure runtheil
option choice type 1 symmetric general
option real tightness 0.2
option real decay 1
option real other 0.7
local integer time
system(model=bvar)
variables LEXRATE DTB DIIP DM32 DINF DTRB3 DTRB2 FDIFII OF INT FRDM3 D2007 VOLS
lags 1 to 2
det constant
specify(type=symmetric,tightness=.2, decay=1) .7
end(system)
set exrate = exp(lexrate)
frml(identity) exrateid exrate = exp(lexrate)
theil(setup,model=bvar+exrateid, steps=12, from=2007:01, to=2008:01)
estimate(noprint) 1996:07 2006:12
theil(print)
do time=2007:01;2008:01
  Kalman
  theil(print)
end do time
theil(dump)
END
@runtheil(tightness=.2,type=symmetric,decay=1,other=.7)
ERROR says:

Can't Interpret MODEL + FRML[REAL]
## SX27. Illegal Combination of Data Types for Operation
>>>>odel=bvar+exrateid,<<<<

Can you help me on this?
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: forecasts using BVAR

Unread post by TomDoan »

Update to version 10. The convenient mixing of linear and non-linear equations in a model is a new feature.
Post Reply