Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: Calculating Determinant of Hessian Matrix Over Obervations


From   Asgar Khademvatani <[email protected]>
To   [email protected]
Subject   st: Calculating Determinant of Hessian Matrix Over Obervations
Date   Mon, 01 Oct 2007 05:34:06 -0600

Dear All,

I have 43 observation on t he variables A, B, and C. I am trying to make 43 symmetry Hessian matrix(2 by 2) and calculate each matrix determinant and list the calculated determinants for each observation. I have made the following loop but it is subject to error as follows;

forvalues i = 1/43 {
matrix H = (A[`i'], B[`i'] \ B[`i'], C[`i'])
gen det_H = det(H)
di "`i'"
matrix list Ha_g_1
list det_H
}
I am getting the following error as follows;

+----------+
| det_H |
|----------|
1. | 6.28e-13 |
2. | 6.28e-13 |
3. | 6.28e-13 |
4. | 6.28e-13 |
5. | 6.28e-13 |
|----------|
6. | 6.28e-13 |
7. | 6.28e-13 |
8. | 6.28e-13 |
9. | 6.28e-13 |
10. | 6.28e-13 |
|----------|
11. | 6.28e-13 |
12. | 6.28e-13 |
13. | 6.28e-13 |
14. | 6.28e-13 |
15. | 6.28e-13 |
|----------|
16. | 6.28e-13 |
17. | 6.28e-13 |
18. | 6.28e-13 |
19. | 6.28e-13 |
20. | 6.28e-13 |
|----------|
21. | 6.28e-13 |
22. | 6.28e-13 |
23. | 6.28e-13 |
24. | 6.28e-13 |
25. | 6.28e-13 |
|----------|
26. | 6.28e-13 |
27. | 6.28e-13 |
28. | 6.28e-13 |
29. | 6.28e-13 |
30. | 6.28e-13 |
|----------|
31. | 6.28e-13 |
32. | 6.28e-13 |
33. | 6.28e-13 |
34. | 6.28e-13 |
35. | 6.28e-13 |
|----------|
36. | 6.28e-13 |
37. | 6.28e-13 |
38. | 6.28e-13 |
39. | 6.28e-13 |
40. | 6.28e-13 |
|----------|
41. | 6.28e-13 |
42. | 6.28e-13 |
43. | 6.28e-13 |
+----------+
det_H already defined
r(110);

end of do-file
r(110);

Could you please help me out what is wrong with the above loop?

Thank you

Asgar
*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/




© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index