2.2.5.10. Cauchy law

This law describes a Cauchy-Lorentz distribution with a location parameter \(x_0\) and a scale parameter \(\gamma\), as

\[f(x) = \frac{\gamma}{\pi\times(\gamma^{2}+(x-x_{0})^{2})}\]

The parameter \(\gamma\) should be greater than 0.0001.

Uranie code to simulate a Cauchy random variable is:

    TDataServer *tds = new TDataServer("tdssampler", "Sampler Uranie demo");
    tds->addAttribute( new TCauchyDistribution("cau", 0.3, 1.0));
    
    TSampling *fsamp = new TSampling(tds, "lhs", 300);
    fsamp->generateSample(); // Create a representative sample
    
    tds->Draw("cau");

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

../../../_images/TCauchyDistribution.png

Figure 2.17 Example of PDF, CDF and inverse CDF for Cauchy distributions.

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

    tds->getAttribute("cau")->setBounds(-1.0,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.18 for a given set of parameters and various boundaries.

../../../_images/TCauchyTruncatedDistribution.png

Figure 2.18 Example of PDF, CDF and inverse CDF for a Cauchy truncated distribution.