Lattice Builder Manual Software Package for Constructing Rank-1 Lattices
Other Examples

# Examining the Distribution of Merit Values

In this example, we examine the quantiles of the distribution of normalized weighted $$\mathcal P_{2\alpha}$$ merit values. The pipeline is setup as in the previous examples, but without using the low-pass filter. Next, we use the Boost Accumulators library to configure a quantile accumulator:

using namespace boost::accumulators;
accumulator_set<Real, features<tag::count, tag::min, tag::max, tag::mean, tag::tail_quantile<left>>>
acc(tag::tail<left>::cache_size = numSamples);
auto meritSeq = latSeqOverCBC.meritSeq(latSeq);
for (const auto& val : meritSeq)
acc(val);

Then, we output the results with:

unsigned int numBins = 20;
printTableRow("# mean:", mean(acc));
printTableRow("prob", "quantile");
printTableRow(0.0, min(acc));
for (unsigned int i = 1; i < numBins; i++) {
double p = double(i) / numBins;
Real q = quantile(acc, quantile_probability = p);
printTableRow(p, q);
}
printTableRow(1.0, max(acc));

The complete code can be found in quantiles.cc and, when launched with the following arguments:

quantiles 256 3 0.7

it outputs:

# mean: 3.46885028e-01
prob    quantile
0.000   1.60698706e-02
0.050   1.64301703e-02
0.100   1.85088223e-02
0.150   1.91739909e-02
0.200   2.17884732e-02
0.250   2.26753647e-02
0.300   2.30818567e-02
0.350   2.70081994e-02
0.400   3.03617579e-02
0.450   3.53505227e-02
0.500   3.89350427e-02
0.550   4.54389138e-02
0.600   4.82196883e-02
0.650   6.27055832e-02
0.700   7.08631375e-02
0.750   9.24164492e-02
0.800   1.12953531e-01
0.850   1.79950795e-01
0.900   2.89334083e-01
0.950   8.67254772e-01
1.000   1.37803954e+01