Re: [ROOT] Incorrect mean and sigma calculation in TPrincipal?

From: Rene Brun (Rene.Brun@cern.ch)
Date: Mon Oct 15 2001 - 17:52:13 MEST


Hi Suyong,

Thanks for reporting this problem. I have received a bug fix from
the author Christian Holm Christiansen. Now in CVS.

Rene Brun

Suyong Choi wrote:
> 
> Hi,
> 
> It seems like the first data input is discarded and the sigma
> isn't right either. I'm using v3.01 on IRIX 6.5
> 
> root [0]  TPrincipal pca1(2,"");
> root [1]    Double_t *data=new Double_t[2];
> root [2]    data[0]=10.0;data[1]=10.0;
> root [3]    pca1.AddRow(data);
> root [4]    pca1.Print();
> Variable #  | Mean Value |   Sigma    | Eigenvalue
> -------------+------------+------------+------------
>           1 |         10 |          0 |          0
>           2 |         10 |          0 |          0
> 
> root [5]    data[0]=5.0;data[1]=5.0;
> root [6]    pca1.AddRow(data);
> root [7]    pca1.Print();
> Variable #  | Mean Value |   Sigma    | Eigenvalue
> -------------+------------+------------+------------
>           1 |          5 |          0 |          0
>           2 |          5 |          0 |          0
> 
> root [8]    data[0]=0.0;data[1]=0.0;
> root [9]    pca1.AddRow(data);
> root [10]    pca1.Print();
> Variable #  | Mean Value |   Sigma    | Eigenvalue
> -------------+------------+------------+------------
>           1 |        2.5 |          0 |          0
>           2 |        2.5 |          0 |          0
> 
> root [11] pca1.MakePrincipals()
> root [12]    pca1.Print();
> Variable #  | Mean Value |   Sigma    | Eigenvalue
> -------------+------------+------------+------------
>           1 |        2.5 |      1.768 |          1
>           2 |        2.5 |      1.768 |   1.11e-16
> 
> Regards,
> Suyong



This archive was generated by hypermail 2b29 : Tue Jan 01 2002 - 17:51:02 MET