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
The parameter \(\gamma\) should be greater than 0.0001.
Uranie code to simulate a Cauchy random variable is:
tds = DataServer.TDataServer("tdssampler", "Sampler Uranie demo")
tds.addAttribute(DataServer.TCauchyDistribution("cau", 0.3, 1.0))
fsamp = Sampler.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.
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.
Figure 2.18 Example of PDF, CDF and inverse CDF for a Cauchy truncated distribution.