Tutorial illustrating the use of the Student and F distributions
void mathStudent()
{
TCanvas *DistCanvas =
new TCanvas(
"DistCanvas",
"Distribution graphs", 10, 10, 800, 650);
gPad->SetFrameFillColor(19);
TF1* fgaus =
new TF1(
"gaus",
"TMath::Gaus(x, [0], [1], [2])", -5, 5);
TF1* student =
new TF1(
"student",
"TMath::Student(x,[0])", -5, 5);
leg->AddEntry(student->
DrawCopy(
"lsame"),
"10 degrees of freedom",
"l");
leg->AddEntry(student->
DrawCopy(
"lsame"),
"3 degrees of freedom",
"l");
leg->AddEntry(student->
DrawCopy(
"lsame"),
"1 degree of freedom",
"l");
gPad->SetFrameFillColor(19);
TF1 *studentI =
new TF1(
"studentI",
"TMath::StudentI(x, [0])", -5, 5);
studentI->
SetTitle(
"Student cumulative dist.");
TF1* fDist =
new TF1(
"fDist",
"TMath::FDist(x, [0], [1])", 0, 2);
gPad->SetFrameFillColor(19);
TF1* fDistI =
new TF1(
"fDist",
"TMath::FDistI(x, [0], [1])", 0, 2);
fDistI->
SetTitle(
"Cumulative dist. function for F");
gPad->SetFrameFillColor(19);
}
virtual void SetFillColor(Color_t fcolor)
Set the fill area color.
virtual void SetLineStyle(Style_t lstyle)
Set the line style.
virtual void SetLineWidth(Width_t lwidth)
Set the line width.
virtual void SetLineColor(Color_t lcolor)
Set the line color.
TVirtualPad * cd(Int_t subpadnumber=0)
Set current canvas & pad.
virtual void SetTitle(const char *title="")
Set function title if title has the form "fffffff;xxxx;yyyy", it is assumed that the function title i...
virtual TF1 * DrawCopy(Option_t *option="") const
Draw a copy of this function with its current attributes.
virtual void SetParameters(const Double_t *params)
virtual void SetParameter(Int_t param, Double_t value)
This class displays a legend box (TPaveText) containing several legend entries.
TLegendEntry * AddEntry(const TObject *obj, const char *label="", Option_t *option="lpf")
Add a new entry to this legend.
virtual void Draw(Option_t *option="")
Draw this legend with its current attributes.
virtual void Divide(Int_t nx=1, Int_t ny=1, Float_t xmargin=0.01, Float_t ymargin=0.01, Int_t color=0)
Automatic pad generation by division.
- Author
- Anna Kreshuk
Definition in file mathStudent.C.