cointegration lag choice

For questions regarding programming in the EViews programming language.

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

loooooo
Posts: 11
Joined: Wed Dec 14, 2011 4:11 am

cointegration lag choice

Postby loooooo » Thu Dec 22, 2011 10:37 am

Hi all,

I wrote the code posted below, and seems to be working ok, except that the number of lags, which is needed to be specified as follows: grp.coint(s,numlag)
Here I want numlag to be called from the matrix "vl" but it only takes the default value 4, even with the code written as below.
What should be done?
Your help will be very much appreciated.

Code: Select all

%file = "C:\Desktop\Mydata.xls" wfopen(page=Sheet1) %file smpl 1/01/2005 1/01/2010 genr dbid = d(bid) genr dask = d(ask) var varl.ls 1 2 dbid dask show varl.laglen(20,vname = vl) close varl var varc.ls 1 2 bid ask close varc group grp bid ask grp.coint(s,vl(3))

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

Re: cointegration lag choice

Postby EViews Gareth » Thu Dec 22, 2011 10:38 am

Try extracting the number into a program variable first:

Code: Select all

group grp bid ask !temp = vl(3) grp.coint(s,!temp)

loooooo
Posts: 11
Joined: Wed Dec 14, 2011 4:11 am

Re: cointegration lag choice

Postby loooooo » Thu Dec 22, 2011 10:42 am

This is working beautifully.
Thanks Gareth!!


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests