vecm - mgarch-bekk

Discussions of ARCH, GARCH, and related models
Alepruz
Posts: 7
Joined: Fri Apr 01, 2011 1:37 pm

vecm - mgarch-bekk

Unread post by Alepruz »

Dear Mr. Doan,

Let's suppose I have two series (futures and spot prices), and let's assume a vector error correction model with a garch-bekk is an appropiate model.

My preliminary code looks like this.

****estimate the VECM-GARCH-BEKK

@johmle(lags=2,det=rc,cv=cvector)
# Futures Spot
equation(coeffs=cvector) ecteq *
# Futures Spot constant

<<obsolete code deleted by moderator>>

Then I would estimate the model as:

garch(p=1,q=1,mv=bekk,model=ectmodel,pmethod=simplex,piters=5,method=bfgs,iters=400,hmatrices=hh,resids=at,hseries=fvar)

The model converges and I obtain some results, but there is no error correction term in the mean model. so I would like to ask you, does this one corresponds to the VAR representation of the VEC? or simply the ECT is not included in the model. If is the second how may I include it?

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

Re: vecm - mgarch-bekk

Unread post by TomDoan »

One thing to note is that DET=RC means that the constant is restricted to the cointegrating vector, so you don't want to include CONSTANT as a DETERMINISTIC in the system.
COMI
Posts: 24
Joined: Mon Sep 28, 2015 4:12 am

Re: vecm - mgarch-bekk

Unread post by COMI »

Thank you very much for your reply Tom. I got the point.
I have another question about my model. I would be grateful if you could possibly guide me again.

I have two endogenous variables (futures and spot price of gold) and two exogenous variables (exchange rate and a stock index).
I want to estimate a vecm bekk model based on these variable but I am just a beginner in RATS and I do not know how to build such a model.
Especially, it seems that there are tow cointegration vectors between my variables (I did it in Eviews 9).

I really your ned help for building my model in RATS.

How it is possible that there are tow cointegration vectors between my variables? How I can choose between them? How I can choose optimum lags for my model?

Here is my data:
data.xlsx
data
(19.61 KiB) Downloaded 956 times
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: vecm - mgarch-bekk

Unread post by TomDoan »

First, I get four unit roots in the four variables, so I'm not sure how you're getting two cointegrating vectors.
Second, how are you intending to use the presumed exogeneity of the two variables?
COMI
Posts: 24
Joined: Mon Sep 28, 2015 4:12 am

Re: vecm - mgarch-bekk

Unread post by COMI »

My purpose is to investigate the price discovery between futures and domestic spot price of gold in my country.
The price of gold in my country is just the global price of ounce (New York spot price) multiply the exchange rate.
So when I want to build a model for studying the relationship between future and domestic spot price of gold I should include the global spot price of gold and exchange rate.
I assume that those two latter variables are exogenous because they are not determined in my model (is it true?).
Optimum lag number of VAR model is 3 and so I do cointegration test with 2 lags for futures and domestic spot price of gold by assuming the exogeneity of the other two variables and an intercept in cointeration eqquation and VAR model. I run it in Eviews and the results show that there are to cointegration vectors between variables. I have attached the results.

I do not know what is wrong with these results and I don not know how I can build a VECM BEKK model in RATS.

I would be grateful if you could possibly guide me.
Best regards,
COMI.
Attachments
results.rtf
results
(22.27 KiB) Downloaded 850 times
Last edited by COMI on Tue Sep 29, 2015 12:19 pm, edited 1 time in total.
COMI
Posts: 24
Joined: Mon Sep 28, 2015 4:12 am

Re: vecm - mgarch-bekk

Unread post by COMI »

sorry Tom the name of one the variables in previous post of mine was incorrect that I corrected it.
The name of the variable is "global spot price of ounce" not "stock index". I attached my data again. Thanks.
Attachments
data.xlsx
(19.62 KiB) Downloaded 909 times
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: vecm - mgarch-bekk

Unread post by TomDoan »

Needless to say, it's not our job to explain to you how to use EViews better. However, if you have two series and you get two cointegrating vectors then you have NO cointegrating vectors because that only happens if the data were stationary. Except your data aren't stationary so clearly you did something very wrong. To start with, it seems clear from the results that you jammed the levels data into this when it should have been logs. However, fixing that probably won't change the outcome that much. The main problem is likely that you haven't figured out what those two variables being "exogenous" means to your model and picking "exogenous variables" in a dialog box without really thinking about what that means isn't a good idea.
COMI
Posts: 24
Joined: Mon Sep 28, 2015 4:12 am

Re: vecm - mgarch-bekk

Unread post by COMI »

Thank you Tom for your reply. I just want to estimate my model (VECM BEKK GARCH) in RATS but I am a beginner in using RATS and so I really need your help for doing my project in RATS.
I run my model without the two seemingly exogenous variable (global spot price of gold and exchange rate) in RATS and the results show that there is one coitegration vector between spot and futures price of gold. But I think that by excluding those variables the specification error may occurs.
I do not know how to fix this problem. Could you please help me in finding the correct model? Thank you very much again.
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: vecm - mgarch-bekk

Unread post by TomDoan »

1. They aren't cointegrated, so a VECM is unnecessary. You get that both from a (properly done) cointegration test and also because the loadings on the cointegrating vector in a VECM formulation are insignificant.
2. If they were cointegrated, wouldn't (1,-1) be the cointegrating vector (if done in logs as they should be)? Why would you estimate it?
3. They really don't have particularly strong GARCH properties. There's one big outlier at entry 137, and otherwise very little volatility clustering.
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: vecm - mgarch-bekk

Unread post by TomDoan »

COMI wrote:My purpose is to investigate the price discovery between futures and domestic spot price of gold in my country.
The price of gold in my country is just the global price of ounce (New York spot price) multiply the exchange rate.
So when I want to build a model for studying the relationship between future and domestic spot price of gold I should include the global spot price of gold and exchange rate.
I'm a bit confused about this. If the domestic price of gold is just a deterministic function of the global price and the exchange rate, then how can you include all three of those variables in the model?
COMI
Posts: 24
Joined: Mon Sep 28, 2015 4:12 am

Re: vecm - mgarch-bekk

Unread post by COMI »

Dear Tom,

Thank you for your helpful reply. Our country is a small one and so the domestic price of gold is approximately a function of its global spot price. Therefore, the price of gold in terms of domestic currency is approximately (not exactly) the product of its global price and exchange rate. But in inflationary times, domestic supply and demands also affect domestic price of gold (we experienced this in recent years).
You are wright that there isn't a long run relationship between futures and domestic price of gold based on the data I attached. But I have another set of data for a different period and it seems that there is a long run relationship between them. And it is reasonable that the global price of gold ( and maybe exchange rate) is (are) exogenous in my model because domestic market cannot have any effect on global price of gold.

I studied Pesaran et al 2000 (Structural analysis of vector error correction models with exogenous I(1) variables) and it is plausible that I need a VECMX BEKK (or VARX BEKK) model for examining the relationship between my variables. I don't know if there is a code or a procedure for estimating such models in RATS.

I would be grateful if you could possibly guide me through this problem.

Best regards,
COMI
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: vecm - mgarch-bekk

Unread post by TomDoan »

Did you read the paper that you cited? It describes what they mean by exogenous (which is weakly exogenous for the cointegrating vector) and how the assumption affects their interaction with the variables of interest. If you look at their empirical example, you will note the repeated use of "logarithm of the..." which you didn't do when you put that through EViews.

A VECM is simply a system of linear equations with a particular form. Once you figure out what the cointegration relationship(s) are, it's very simple. Figuring out the cointegration relationships is the most important step. If the (logs of the) global price, domestic price and exchange rate are cointegrated, there is one and only one cointegrating relationship which makes sense. Let the economics guide you.

If you are asking whether RATS has a menu item which will allow you to produce ten pages of complete nonsense at the push of a button, the answer is no. Fortunately, you had the common sense to realize that something wasn't right---I've seen 200 page master's theses which were entirely based upon point-and-click garbage-in, garbage-out. Now is the time to sit down, think about the economics, read the paper carefully and figure out what you need to estimate.

BTW, although the logs of the three key variables don't seem to be cointegrated, the residual is still relatively small, at least compared with the original values, so the deviation might be statistically "I(1)" but not necessarily economically significant.
COMI
Posts: 24
Joined: Mon Sep 28, 2015 4:12 am

Re: vecm - mgarch-bekk

Unread post by COMI »

I really appreciate your help in resolving the problem. I studied the paper again and Johansen methodology, too. There isn't any cointegration vector in my data.
I have another question. Weekends and non-trading holidays are different for domestic and foreign prices in my data. The domestic working week is Sunday to Wednesday. How can I handle missing data? Can I remove the days for both prices when price data are missing for one of the prices? Or Can I use the last price for missing data? Thank you very much.
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: vecm - mgarch-bekk

Unread post by TomDoan »

There are two ways of handling that---you can have zero returns for non-trading days, or you can shift to weekly data where the end-of-the-week is a common trading day in both markets. The former would probably make the most sense if you had the occasional extra non-trading day in one of the markets. However, you have almost half a week each week, so I would recommend going to the weekly data.
COMI
Posts: 24
Joined: Mon Sep 28, 2015 4:12 am

Re: vecm - mgarch-bekk

Unread post by COMI »

Dear Tom
I have written a code for a vecm- garch- bekk model as below:

Code: Select all

calendar(7)  2000:1:1
open data d:\new5.xlsx
data(org=col,format=xlsx)
@johmle(lags=10,det=constant,cv=cvector)
# lf lsb
equation(coeffs=cvector) ecteq *
# lf lsb

<<obsolete code deleted by moderator>>
And here is output:

Code: Select all

Likelihood Based Analysis of Cointegration
Variables:  LF LSB
Estimated from 2000:01:11 to 2001:06:07
Data Points 514 Lags 10 with Constant

Unrestricted eigenvalues and -T log(1-lambda)
   Rank     EigVal   Lambda-max  Trace  Trace-95%   LogL
         0                                        2638.0949
         1    0.0407    21.3527 23.3820   15.4100 2648.7712
         2    0.0039     2.0293  2.0293    3.8400 2649.7859

Cointegrating Vector for Largest Eigenvalue
LF         LSB
-65.335498 65.301447


MV-GARCH, BEKK - Estimation by BFGS
NO CONVERGENCE IN 149 ITERATIONS
LAST CRITERION WAS  0.0000000
ESTIMATION POSSIBLY HAS STALLED OR MACHINE ROUNDOFF IS MAKING FURTHER PROGRESS DIFFICULT
TRY HIGHER SUBITERATIONS LIMIT, TIGHTER CVCRIT, DIFFERENT SETTING FOR EXACTLINE OR ALPHA ON NLPAR
RESTARTING ESTIMATION FROM LAST ESTIMATES OR DIFFERENT INITIAL GUESSES MIGHT ALSO WORK
Daily(7) Data From 2000:01:12 To 2001:06:07
Usable Observations                       513
Log Likelihood                      2801.6238

    Variable                        Coeff      Std Error      T-Stat      Signif
************************************************************************************
Mean Model(DLF)
1.  DLF{1}                       -0.298426000  0.065156568     -4.58014  0.00000465
2.  DLF{2}                       -0.137152010  0.050928864     -2.69301  0.00708099
3.  DLF{3}                       -0.267874459  0.043739928     -6.12425  0.00000000
4.  DLF{4}                        0.144699016  0.034259543      4.22361  0.00002404
5.  DLF{5}                       -0.042298467  0.046208609     -0.91538  0.35999183
6.  DLF{6}                        0.083713792  0.027009683      3.09940  0.00193914
7.  DLF{7}                       -0.040380884  0.037412618     -1.07934  0.28043680
8.  DLF{8}                       -0.041588355  0.037819284     -1.09966  0.27148027
9.  DLF{9}                        0.071531266  0.037775452      1.89359  0.05827929
10. DLF{10}                       0.087826371  0.006673018     13.16142  0.00000000
11. DLSB{1}                       0.116377251  0.043015102      2.70550  0.00682022
12. DLSB{2}                      -0.013140608  0.035898219     -0.36605  0.71432642
13. DLSB{3}                       0.259313616  0.043007413      6.02951  0.00000000
14. DLSB{4}                      -0.235201948  0.039597808     -5.93977  0.00000000
15. DLSB{5}                       0.167880762  0.049174964      3.41395  0.00064029
16. DLSB{6}                      -0.060413326  0.029576639     -2.04260  0.04109177
17. DLSB{7}                       0.008664950  0.041262338      0.21000  0.83367034
18. DLSB{8}                       0.080091090  0.039251495      2.04046  0.04130457
19. DLSB{9}                      -0.027850412  0.048143889     -0.57848  0.56293821
20. DLSB{10}                     -0.037941481  0.024569038     -1.54428  0.12252044
21. ECT{1}                       -0.001990837  0.001071930     -1.85725  0.06327619
Mean Model(DLSB)
22. DLF{1}                       -0.419431013  0.067871717     -6.17976  0.00000000
23. DLF{2}                       -0.220584878  0.042402402     -5.20218  0.00000020
24. DLF{3}                       -0.236878421  0.038494229     -6.15361  0.00000000
25. DLF{4}                        0.022902976  0.037554390      0.60986  0.54195356
26. DLF{5}                       -0.040085910  0.036779367     -1.08990  0.27575626
27. DLF{6}                        0.061392327  0.033638176      1.82508  0.06798912
28. DLF{7}                       -0.054674317  0.033091206     -1.65223  0.09848747
29. DLF{8}                        0.017955611  0.033776352      0.53160  0.59500095
30. DLF{9}                        0.033887559  0.031616418      1.07183  0.28379450
31. DLF{10}                      -0.019031550  0.025441981     -0.74804  0.45443767
32. DLSB{1}                       0.416969441  0.061004815      6.83503  0.00000000
33. DLSB{2}                       0.136577756  0.050724650      2.69253  0.00709117
34. DLSB{3}                       0.174083842  0.043493583      4.00252  0.00006267
35. DLSB{4}                      -0.047442183  0.047824062     -0.99201  0.32119024
36. DLSB{5}                       0.097785917  0.046072573      2.12243  0.03380145
37. DLSB{6}                      -0.043527398  0.040061585     -1.08651  0.27725247
38. DLSB{7}                       0.009060969  0.036702719      0.24687  0.80500528
39. DLSB{8}                      -0.051208327  0.038710350     -1.32286  0.18588234
40. DLSB{9}                      -0.002691981  0.043277485     -0.06220  0.95040133
41. DLSB{10}                      0.034014087  0.030658508      1.10945  0.26723602
42. ECT{1}                        0.002948634  0.000907278      3.24998  0.00115414

43. C(1,1)                        0.010696414  0.001332621      8.02660  0.00000000
44. C(2,1)                        0.001541313  0.001120582      1.37546  0.16898982
45. C(2,2)                        0.000000294  0.007088997 4.14461e-005  0.99996693
46. A(1,1)                        0.357608489  0.097181629      3.67980  0.00023342
47. A(1,2)                        0.517206115  0.065416027      7.90641  0.00000000
48. A(2,1)                        0.221882644  0.097096844      2.28517  0.02230295
49. A(2,2)                        0.314773589  0.068860033      4.57121  0.00000485
50. B(1,1)                        0.682404251  0.152429717      4.47685  0.00000758
51. B(1,2)                        0.789746646  0.060192341     13.12038  0.00000000
52. B(2,1)                        0.052388909  0.214667982      0.24405  0.80719502
53. B(2,2)                       -0.531473853  0.149248784     -3.56099  0.00036946
54. D(1,1)                        0.155433653  0.166898865      0.93130  0.35169611
55. D(1,2)                        0.001551983  0.145678161      0.01065  0.99149990
56. D(2,1)                        0.332956603  0.224789458      1.48119  0.13855511
57. D(2,2)                        0.114486344  0.136371483      0.83952  0.40117857
I have a few questions:
1- why long run coefficients vector is (-65.335498 65.301447) or (1,-1)? does it show that my variables are not cointegrated? ( But trace test, above, shows there are)
2- Why are ECT terms so small?
3- How can I select optimal lag number for Johansen and VECM model?
4- How can I be sure that my hole model is ok regarding auto-correlation and heteroskedasticity?

Thank you very much.

Here is data:
Attachments
new5.xlsx
(23.54 KiB) Downloaded 814 times
Post Reply