Skip to content

Instantly share code, notes, and snippets.

@pn11
Created September 16, 2014 15:06
Show Gist options
  • Save pn11/08463ae4ba8c443a54bb to your computer and use it in GitHub Desktop.
Save pn11/08463ae4ba8c443a54bb to your computer and use it in GitHub Desktop.
TMath::KolmogorovProb() (http://root.cern.ch/root/html/src/TMath.cxx.html#RDBIQ) のソースが良くわからない(c1, c2, c3という謎の係数が出てくる)のでちゃんと正しい値なのか描いてみた件。
{
Int_t npoint = 10000;
Double_t x, xstart = 0., xend = 2.0;
TGraph *g1 = new TGraph();
for (Int_t ipoint=0; ipoint<npoint; ipoint++){
x = xstart + (xend - xstart) / double(npoint) * double(ipoint);
g1->SetPoint(ipoint, x, TMath::KolmogorovProb(x));
}
g1->SetTitle("Kolmogorov distribution");
g1->SetLineColor(kRed);
g1->GetXaxis()->SetTitle("X");
g1->GetYaxis()->SetTitle("P[X]");
g1->Draw("AL");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment