2.2.5.17. Student Law

Warning

This distribution is available only if the ROOT “mathmore” feature has been installed when your ROOT version was brought (you can check this by running root-config --has-mathmore. If not found, this law cannot be used.

The Student law is simply defined with a single parameter: the degree-of-freedom (DoF). The probability density function is then set as

\[f(x) = \frac{1}{\sqrt{k\pi}} \frac{ \Gamma\left( \frac{k+1}{2} \right)} { \Gamma\left( \frac{k}{2} \right)}\left(1+\frac{t^{2}}{k} \right)^{-\frac{k+1}{2}}\]

where \(\Gamma\) is the Euler’s gamma function.

Uranie code to simulate an student random variable is:

tds = DataServer.TDataServer("tdssampler", "Sampler Uranie demo")
tds.addAttribute(DataServer.TStudentDistribution("stu", 5))

fsamp = Sampler.TSampling(tds, "lhs", 300)
fsamp.generateSample()  # Create a representative sample

tds.Draw("stu")

Figure 2.30 shows the PDF, CDF and inverse CDF generated for different sets of parameters.

../../../_images/TStudentDistribution.png

Figure 2.30 Example of PDF, CDF and inverse CDF for Student distributions.

Is it also possible to set boundaries to the infinite span of this distribution to create a truncated Student law. This can be done by calling the following method:

tds.getAttribute("stu").setBounds(-1.4,2.0)  # truncate the law

The resulting PDF, CDF and inverse CDF, with and without truncation, can be seen, in this case, in Figure 2.31 for a given set of parameters and various boundaries.

../../../_images/TStudentTruncatedDistribution.png

Figure 2.31 Example of PDF, CDF and inverse CDF for a Student truncated distribution.