# Covariances/Erdas/Grass

Agustin Lobo lobo at Jasper.Stanford.EDU
Wed Apr 28 14:43:56 EDT 1993

```> From prasad at ghat.inhs.uiuc.edu Wed Apr 28 09:05:57 1993
> Date: Wed, 28 Apr 1993 11:00:12 -0500
> To: lobo at Jasper.Stanford.EDU
> Subject: Covariances/Erdas/Grass
> Content-Length: 1725
>
> Hi Agus:
> Here are the results from Erdas7.5 and grass4.1beta+Splus for your test data:
> As you can observe, the covariance matrix reported by Erdas and Grass differ - since this is an extremely small database, the resulting eigenvalues and eigenvectors do not differ much....but in case of large databases they do...resulting in large differences...I will do the covariance matrix by hand and determine which is right...Thanks much for the help. Please keep me informed. Since you must have already done this to test the output from grass, I assume Erdas is not reporting it correctly. Am I right? Let me know. Thanks. Anantha Prasad (prasad at ghat.inhs.uiuc.edu)
>
>
> NOTE: Erdas (Version 7.5) Covariance Matrix,Eigenvalues & Eigenvectors:
> Covariance Matrix:
>           1       2       3
>    1  338.24    4.59  -32.00
>    2    4.59 2016.23 -308.88
>    3  -32.00 -308.88 2227.68
>
>       Eigenvalues:   Var. %:    Total %:     Angle:     Scale:
>    1    2448.82       53.44       53.44       89.59        1
>    2    1795.64       39.19       92.63       20.97        1
>    3     337.70        7.37      100.00       69.04        1
> Eigenvectors:
>           1       2       3
>        -0.01   -0.01    1.00
>        -0.58    0.81    0.00
>         0.81    0.58    0.02
> ****************************************************************
> NOTE: Grass4.1beta Covariance Matrix:
>
> 352.333333 4.783333 -33.333333
> 4.783333 2100.243333 -321.750000
> -33.333333 -321.750000 2320.500000
>
> NOTE: Splus eigenvalues and eigenvectors:
> \$eigenvalues:
> [1] 2550.8538 1870.4541  351.7687
>
> \$eigenvectors:
>            [,1]        [,2]         [,3]
> [1,] -0.0136013  0.01019403 0.9998555328
> [2,] -0.5811429 -0.81380140 0.0003916771
> [3,]  0.8136878 -0.58105366 0.0169929433
>

ERDAS result is wrong, not by too much but wrong.
r.covar is correct.
Agus

```