[Gretl-users] eigen values

Allin Cottrell cottrell at wfu.edu
Mon Feb 18 13:47:47 EST 2008


On Mon, 18 Feb 2008, Talha Yalta wrote:

> While preparing the notes for my econometrics class, I noticed that
> for Table_10.5.gdt from the Gujarati dataset, Gujarati reports that
> the Condition Index is found by SAS as \sqrt{3.0/0.00002422} (the
> squareroot of the biggest eigenvalue divided by the smallest)
> 
> When I choose from the menu: View--Principal components, I see the
> eigen values reported as 2.9720 and 0.0009 (instead of 0.00002422)
> 
> Can this be due to an accuracy error?

Yes: the inaccuracy consists in using the wrong dataset, and not 
taking logs ;-)

If you look carefully at Appendix 7A.5 you'll see that the SAS 
output is based on data from Table_7.3.gdt, with logs taken of all 
variables.  Repeat what Jack suggested with the right data

open Table_7.3.gdt
logs Y X2 X3
ols l_Y 0 l_X2 l_X3
matrix X = { const l_X2 l_X3 }
l = sqrt(diag(X'X))
matrix X = X ./ l'
l = eigensym(X'X, null)
CN = maxc(l)/minc(l)
printf "CN = %g, (square root = %g)\n", CN, sqrt(CN)

and you'll find the same results as given by SAS (apart from the 
slightly inaccurate reporting of the largest eigenvalue as 3.0 in 
Gujarati, rather than 2.9996).

Allin.


More information about the Gretl-users mailing list