Tutorial illustrating the use of the Student and F distributions
{
gPad->SetFrameFillColor(19);
TF1*
fgaus =
new TF1(
"gaus",
"TMath::Gaus(x, [0], [1], [2])", -5, 5);
fgaus->SetTitle(
"Student density");
leg->AddEntry(
fgaus->DrawCopy(),
"Normal(0,1)",
"l");
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.");
leg2->AddEntry(
studentI->DrawCopy(),
"10 degrees of freedom",
"l");
leg2->AddEntry(
studentI->DrawCopy(
"lsame"),
"3 degrees of freedom",
"l");
leg2->AddEntry(
studentI->DrawCopy(
"lsame"),
"1 degree of freedom",
"l");
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);
legF2->AddEntry(
fDistI->DrawCopy(
"lsame"),
"N=1 M=10",
"l");
legF2->AddEntry(
fDistI->DrawCopy(
"lsame"),
"N=10 M=1",
"l");
fDistI->SetParameters(10, 10);
legF2->AddEntry(
fDistI->DrawCopy(
"lsame"),
"N=10 M=10",
"l");
}
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
virtual void SetLineWidth(Width_t lwidth)
Set the line width.
virtual void SetLineColor(Color_t lcolor)
Set the line color.
void SetTitle(const char *title="") override
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.
- Author
- Anna Kreshuk
Definition in file pdf011_Student.C.