--- myst: substitutions: bloc: stocha: python: 6-12 cpp: 5-11 trunc: python: "14" cpp: "13" --- ```{include} /../core/dataserver/attribute/introducing_tstochastic_attribute/weibull_equation.md ``` Both $\lambda$ and $k$ should be greater than 0.0001. {{ uranie }} code to simulate a Weibull random variable is: {{ "```{literalinclude} " + parent_dir + "/roottest/uranie/doc/dataserver/attribute/" + language + "/weibull." + extension + "\n" + ":language: " + language + "\n" + ":lines: " + bloc["stocha"][language] + "\n" + "```" }} ```{include} /../core/dataserver/attribute/introducing_tstochastic_attribute/weibull_figure.md ``` Is it also possible to set boundaries to the infinite span of this distribution to create a truncated Weibull law. This can be done by calling the following method: {{ "```{literalinclude} " + parent_dir + "/roottest/uranie/doc/dataserver/attribute/" + language + "/weibull." + extension + "\n" + ":language: " + language + "\n" + ":lines: " + bloc["trunc"][language] + "\n" + "```" }} The resulting PDF, CDF and inverse CDF, with and without truncation, can be seen, in this case, in {numref}`dataserver_tweibull_trunc_distribution` for a given set of parameters and various boundaries. {{ "```{" "figure" "} " + parent_dir + "/roottest/build/uranie/doc/dataserver/attribute/python/TWeibullTruncatedDistribution.png\n" ":align: center\n" ":name: dataserver_tweibull_trunc_distribution\n" + figure_scale + "\n" "\n" "Example of PDF, CDF and inverse CDF for a Weibull truncated distribution.\n" "```" }}