2.2.5.9. Exponential law

This law describes an exponential with a rate parameter \(\lambda\) and a minimum \(x_{\rm min}\), as

\[f(x) = \lambda \times e^{- \lambda \times (x-x_{\rm min})} \; {\rm 1\kern-0.28emI}_{[x_{\rm min},+\infty[}(x)\]

The rate parameter \(\lambda\) should be greater than 0.0001.

Uranie code to simulate an Exponential random variable is:

tds = DataServer.TDataServer("tdssampler", "Sampler Uranie demo")
tds.addAttribute(DataServer.TExponentialDistribution("exp", 0.5))

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

tds.Draw("exp")

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

../../../_images/TExponentialDistribution.png

Figure 2.15 Example of PDF, CDF and inverse CDF for Exponential distributions.

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

tds.getAttribute("exp").setBounds(0.4,6.0)  # truncate the law

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

../../../_images/TExponentialTruncatedDistribution.png

Figure 2.16 Example of PDF, CDF and inverse CDF for a Exponential truncated distribution.