Hi James,

Here is some code I have adjusted for ecmf.

There should be 4 attachments to this email:

1) VECM_comp.m
2) ecmf_comp.m
3) ecmftest.m
4) bvarf_g_new.m

The main example program is VECM_comp.m. This code specifies some
endogenous data and then asks for forecasts up to 8 periods ahead using
ecmf_comp.m - this program returns the bmat generated by ecmf.m and also
the bmat generated from ecm.m - the latter is the same as the estimate
produced by Eviews. Furthermore, on line 147 of ecmf_comp I noticed that
the forecasts call the wrong element of the endogenous data (I think).
See also my code - ecmftest.m where I have used the bmat from ecm.m and
also rewritten the forecasting code (although this will not work for the
case where the researcher only wants 1-step-ahead forecasts, at
present). ecmftest.m produces the same forecasts as Eviews. A quick look
at becmf.m suggests that it suffers from exactly the same problems (both
wrong bmat and wrong element call).

I also spotted a bug in bvarf_g where the original code did not work
with exogneous variables, in my case with a time trend. The problem
arose because either the dimension of the exogenous data is correct for
estimation in bvar_g but too small for forecasting, or correct for
forecasting but too large for estimation. See notes on line 172.

I hope this helps,

Adam

PS. Most, if not all, of my comments are preceded with "ADAM's NOTE:" to
aid easy searching to see what I have adjusted.

James P. LeSage schreef op 25-4-2008 15:34:
> Adam,
>
> Yes, please send the code. I would like to see what the issue is.
>
> This probably impacts my becmf.m and recmf.m functions as well.
>
> James P. LeSage
> Texas State University - San Marcos
> Department of Finance and Economics
> 601 University Drive
> San Marcos, TX 78666
> -----Original Message-----
> From: Adam Elbourne [mailto:A.C.Elbourne@cpb.nl]
> Sent: Friday, April 25, 2008 5:14 AM
> To: james.lesage@txstate.edu
> Subject: ecmf.m in Econometrics Toolbox
>
> Dear Professor LeSage,
>
> I have been using your MATLAB toolbox for some forecasting and I noticed
> that the forecasts from your toolbox differed from those produced using
> Eviews for VECM models. Upon further inspection, I traced the cause of
> the discrepency: the bhat in ecmf.m is not the same as the bhat in ecm.m
> (the latter is identical to the one from Eviews). Once I changed the
> ecmf.m program to get ecm.m to generate the results I managed to
> eventually get results that agreed. I can send you my new code if you
> would like, although my programming skills are not the greatest (that's
> why I was using Eviews, right? :-) ) and the new version is 6 times
> slower than the old version.
>
> Yours Sincerely
>
> Adam Elbourne
>
>

--
Adam Elbourne
Centraal Planbureau
Bezoekadres: Centraal Planbureau, Van Stolkweg 14, 2585 JR Den Haag
Postadres: Postbus 80510, 2508 GM Den Haag
Telefoon: (070) 338 33 29
Telefax: (070) 338 33 50
Internet: http://www.cpb.nl/


--
================================================================================
Dit bericht kan informatie bevatten die niet voor u is bestemd. Indien u niet
de geadresseerde bent of dit bericht abusievelijk aan u is toegezonden, wordt
u verzocht dat aan de afzender te melden en het bericht te verwijderen.
De Staat aanvaardt geen aansprakelijkheid voor schade, van welke aard ook, die
verband houdt met risico's verbonden aan het elektronisch verzenden van
berichten.

This message may contain information that is not intended for you. If you are
not the addressee or if this message was sent to you by mistake, you are
requested to inform the sender and delete the message. The State accepts no
liability for damage of any kind resulting from the risks inherent in the
electronic transmission of messages.
================================================================================
