Error G0121 : Matrix not positive definite when running HATEJEMI-J code

I get the following error when running the http://ideas.repec.org/c/boc/bocode/g00006.html HATEMI-J 2008 Cointegration test 

(0) : error G0121 : Matrix not positive definite Currently active call: estimate Stack trace:    estimate    main

I cant find a fix anywhere and will greatly appreciate if you could help me.
My data is as follows:
 

obs = 31;
var = 2;
z = { -5.38779 12,
2.484997 9.524,
3.626955 13.768,
5.233792 19.745,
4.469212 10.638,
-0.2147 14.183,
1.612049 25.053,
3.127786 33.838,
1.335943 12.453,
5.536156 11.857,
8.369726 8.227,
-7.61562 23.236,
9.250567 22.775,
-10.8848 34.659,
12.95329 83.148,
9.511627 37.733,
6.379389 9.137,
1.05549 29.779,
3.479903 44.759,
0.772329 29.597,
-4.23494 22.7,
1.681314 14.741,
5.383482 9.586,
5.371655 11.424,
2.536827 15.464,
2.041141 13.922,
9.067643 7.949,
8.009348 8.716,
8.650593 8.422,
6.328793 7.41,
4.255747 7.624 };

2 Answers



1



accepted

The code is failing right at the end, because the moment matrix computed in the estimate procedure called on around line 191. If you comment out the code from line 185-192, the code will run. You will miss the last print out of b, se and t, but everything else will run.

I have attached a file with a running version of the code. I will look into this a little more and see if I can figure out what this last part should be doing.

aptech

1,773


0



Thanks doing some further research on what that par does as well. Waiting for your next post

Your Answer

2 Answers

1
accepted

The code is failing right at the end, because the moment matrix computed in the estimate procedure called on around line 191. If you comment out the code from line 185-192, the code will run. You will miss the last print out of b, se and t, but everything else will run.

I have attached a file with a running version of the code. I will look into this a little more and see if I can figure out what this last part should be doing.

0

Thanks doing some further research on what that par does as well. Waiting for your next post


You must login to post answers.

Have a Specific Question?

Get a real answer from a real person

Need Support?

Get help from our friendly experts.