23 cout <<
"*************************************************" << endl;
24 cout <<
"* Principal Component Analysis *" << endl;
25 cout <<
"* *" << endl;
26 cout <<
"* Number of variables: " << setw(4) <<
n
28 cout <<
"* Number of data points: " << setw(8) <<
m
30 cout <<
"* Number of dependent variables: " << setw(4) <<
c
32 cout <<
"* *" << endl;
33 cout <<
"*************************************************" << endl;
49 for (
Int_t i = 0; i <
m; i++) {
53 for (
Int_t j = 0; j <
n -
c; j++) {
54 if (j % 3 == 0) data[j] = randomNum->
Gaus(5,1);
55 else if (j % 3 == 1) data[j] = randomNum->
Poisson(8);
56 else data[j] = randomNum->
Exp(2);
60 for (
Int_t j = 0 ; j <
c; j++) {
62 for (
Int_t k = 0; k <
n -
c - j; k++) data[
n -
c + j] += data[k];
66 principal->AddRow(data);
73 principal->MakePrincipals();
82 principal->MakeHistograms();
85 principal->MakeCode();
int Int_t
Signed integer 4 bytes (int).
double Double_t
Double 8 bytes.
Using a TBrowser one can browse all ROOT objects.
This is the base class for the ROOT Random number generators.
virtual Double_t Gaus(Double_t mean=0, Double_t sigma=1)
Samples a random number from the standard Normal (Gaussian) Distribution with the given mean and sigm...
virtual ULong64_t Poisson(Double_t mean)
Generates a random integer N according to a Poisson law.
virtual Double_t Exp(Double_t tau)
Returns an exponential deviate.