--- myst: substitutions: bloc1: python: 1-7,17-104 cpp: 3-8,13-87 bloc2: python: 39-42 cpp: 22-25 --- (use_case_python_macro_dataserver_compute_quantile)= # Macro "**{{"dataserverComputeQuantile." + extension}}**" ## Objective The objective of this macro is to test the classical quantile estimation and compare it to the Wilks estimation for a dummy gaussian distribution. Four different estimations of the 95% quantile value are done (along with one estimation of th 99% quantile) for illustration purposes: - using the usual method with a 200-points sample. - using the usual method with a 400-points sample. - using the Wilks method with a 95% confidence level (with 59-points sample). - using the Wilks method with a 95% confidence level (with 400-points sample). - using the Wilks method with a 99% confidence level (with 90-points sample). ## Macro {{uranie}} {{ "```{literalinclude} " + parent_dir + "/roottest/uranie/doc/dataserver/use_cases/" + language + "/dataserverComputeQuantile." + extension + "\n" + ":language: " + language + "\n" + ":lines: " + bloc1[language] + "\n" + "```" }} In this macro, a dummy dataserver is created with a single attribute named "x". Four histograms are prepared to store the resulting value. Then the same loop will be used to computed 10000 values of every quantile with different switchs to use one method instead of the other, or to change the number of points in the sample and/or the confidence level. All this is defined in the small part before the loop: {{ "```{literalinclude} " + parent_dir + "/roottest/uranie/doc/dataserver/use_cases/" + language + "/dataserverComputeQuantile." + extension + "\n" + ":language: " + language + "\n" + ":lines: " + bloc2[language] + "\n" + "```" }} Then the computation is performed, first for the usual method (first two iterations of `iq`), then for the Wilks estimation (last two iterations of `iq`). Every computational result is stored in the corresponding histogram which is finally displayed and shown in the following subsection. ## Graph {{ "```{" "figure" "} " + parent_dir + "/roottest/build/uranie/doc/dataserver/use_cases/" + language + "/dataserverComputeQuantile.png\n" ":align: center\n" ":name: usecases_dataserverComputeQuantile\n" + figure_scale_reduced + "\n" "\n" "Graph of the macro `\"dataserverComputeQuantile." + extension + "\"`\n" "```" }}