32 ROOT::Math::MathMoreLibrary::Load();
38 TF1* pdf =
new TF1(
"pdf",
"ROOT::Math::tdistribution_pdf(x,3.0)", a,b);
39 TF1* cum =
new TF1(
"cum",
"ROOT::Math::tdistribution_cdf(x,3.0)", a,b);
41 TH1D* quant =
new TH1D(
"quant",
"", 9, 0, 0.9);
43 for(
int i=1; i < 10; i++)
44 quant->Fill((i-0.5)/10.0, ROOT::Math::tdistribution_quantile((1.0*i)/10, 3.0 ) );
48 for(
int i=1; i<9; i++)
49 xx[i]= quant->GetBinContent(i);
53 for(
int i=0; i < 9; i++) {
54 int nbin = n * (xx[i+1]-xx[i])/3.0 + 1.0;
57 pdfq[i]=
new TH1D(name,
"", nbin,xx[i],xx[i+1] );
58 for(
int j=1; j<nbin; j++) {
59 double x= j*(xx[i+1]-xx[i])/nbin + xx[i];
60 pdfq[i]->SetBinContent(j, ROOT::Math::tdistribution_pdf(x,3));
64 TCanvas *Canvas =
new TCanvas(
"DistCanvas",
"Student Distribution graphs", 10, 10, 800, 700);
65 pdf->SetTitle(
"Student t distribution function");
66 cum->SetTitle(
"Cumulative for Student t");
67 quant->SetTitle(
"10-quantiles for Student t");
74 cum->SetLineColor(kRed);
78 quant->SetLineWidth(2);
79 quant->SetLineColor(kBlue);
82 pdfq[0]->SetTitle(
"Student t & its quantiles");
86 pdfq[0]->SetTitle(
"Student t & its quantiles");
87 for(
int i=0; i < 9; i++) {
89 pdfq[i]->SetFillColor(i+1);
90 pdfq[i]->Draw(
"same");