2.2.5.7. Trapezium law
This law describes a trapezium whose large base is defined between a minimum and a maximum and its small base lies between a low and an up value, as
\[f(x) = \frac{2}{(x_{\rm up}-x_{\rm low}) + (x_{\rm max}-x_{\rm min})} \times Y\]
where \(Y=1 \; {\rm for} \; x \in [x_{\rm low},x_{\rm up}]\), \(Y=\dfrac{(x - x_{\rm min})}{(x_{\rm low} - x_{\rm min})} \; {\rm for}\; x \in [x_{\rm min},x_{\rm low}]\) and \(Y=\dfrac{(x_{\rm max} - x)}{(x_{\rm max} - x_{\rm up})} \; {\rm for} \; x \in [x_{\rm up},x_{\rm max}]\).
Uranie code to simulate a Trapezium random variable is:
tds = DataServer.TDataServer("tdssampler", "Sampler Uranie demo")
tds.addAttribute(DataServer.TTrapeziumDistribution("tr", 0.0, 1.0, 0.25, 0.75) )
fsamp = Sampler.TSampling(tds, "lhs", 300)
fsamp.generateSample() # Create a representative sample
tds.Draw("tr")
Figure 2.13 shows the PDF, CDF and inverse CDF generated for different sets of parameters.
Figure 2.13 Example of PDF, CDF and inverse CDF for Trapezium distributions.