This PR adds a bootstrap sampling stage that can be used to estimate MC uncertainties, and a few smaller fixes:
If a string was given for metric in the Analysis, it is now converted into a list of one string. All other functions in the class assume that metric is a list.
Add scales_as_log to the list of parameter attributes. Otherwise, putting it into the configuration is interpreted as a new parameter called scales_as_log.
The bootstrap stage creates a bootstrap sample of the entire input data sample, i.e. it randomly draws samples with replacement until the bootstrap sample has the same size as the original sample. Instead of manhandling the entire arrays, though, it adds equivalent weights to the samples, i.e. a sample that was selected twice gets a weight of 2, and so on.
The unit test ensures that
the bootstrap is repeatable with the same seed,
the average value in each bin approximately recovers that of the original sample,
and that the variance in each bin over bootstrap samples recovers approximately the sum of squared weights.
This PR adds a bootstrap sampling stage that can be used to estimate MC uncertainties, and a few smaller fixes:
metric
is a list.scales_as_log
to the list of parameter attributes. Otherwise, putting it into the configuration is interpreted as a new parameter calledscales_as_log
.The
bootstrap
stage creates a bootstrap sample of the entire input data sample, i.e. it randomly draws samples with replacement until the bootstrap sample has the same size as the original sample. Instead of manhandling the entire arrays, though, it adds equivalent weights to the samples, i.e. a sample that was selected twice gets a weight of 2, and so on.The unit test ensures that