A guide to the nested array structure in the model_utils.yield_stdev
method
#534
MoAly98
started this conversation in
Show and tell
Replies: 1 comment
-
Some print statements describing arrays that I wrote while debugging print("Total Variance before manipulation: total_variance: \n", total_variance)
print(
"Guide: \n",
"Each element is a list. Each list represents variance on one sample, up to the (n_sample)th element. The elements, up to (n_bin)th of the list are the variances in each bin (from all channels unraveled). Each of the elements after is the sum of bin variances in each channel. A sample variance list then has length = n_bins+n_channels. The lists after the (n_sample)th one represent the total error on all samples, following same structure as before. This printed vector then has length = n_samples+1",
"\n",
)
print(
"Total sqrt(variance) in each bin, for each sample, for each channel: total_stdev_per_bin: \n",
total_stdev_per_bin,
)
print(
"Guide: \n",
"Each element is a list. Each list represents the errors in one channel. The elements of each channel list are also lists. Up to the (n_sample)th element, each of those second-level lists represents errors for one sample. The elements of each sample list are the errors on this sample per bin in the channel. Hence, each sample is represented by a list of size n_bins. After the (n_sample)th element, there is an additional element for per-bin errors on the sum of samples in the channel. Hence, each channel is represented by a list of size n_samples+1. This printed vector then has length = n_channels.",
"\n",
)
print(
"Total sqrt(variance) in each channel, for each sample: total_stdev_per_channel: \n",
total_stdev_per_channel,
)
print(
"Guide: \n",
"Each element is a list. Each list represents a channel. The elements of a channel's list, up to the (n_sample)th element, are the error on each sample from all bins in channel combined. The channel's list has an additional element with the error on the sum of all samples from all bins in the channel combined. The length of each channel's list is then n_samples+1. The length of the printed vector is n_channels.",
"\n",
) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Context
The structure of arrays holding the uncertainties in a given model within cabinetry is non-trivial, and the code involves a substantial amount of slicing to re-shape the arrays. This thread intends to present the structure of different variables within this function in matrix form. This is probably not very useful for a user, but helps a dev to remind themselves of all the structures without spending too long following the code closely. Each of the subsections will have a PDF of the matrix representing a given variable. The subsection title is the variable name, and below it there is a short description of the variable.
total_variance
This is an array holding the total variance estimate in the model, with each element [List] representing a sample, and for each sample list, the elements are the variances per bin in the model, where bins from all channels are concatenated. The last 2 elements of a sample's list is the sample's variance in each channel, summing contributions from all individual bins.
total_stdev_per_bin
This is an array holding the errors per sample in each bin of each channel in the model. Each element of this array [List] represents a channel. Each element [List] of the channel's list represents a sample. Each element in a sample's list is the error on the sample per bin of the channel. The last element in a channel's list stores the per-bin error on the samples sum in the channel.
total_stdev_per_channel
This is an array holding the errors per sample per channel. Each element in this array [List] represents a channel. Each element of a channel's list is the error on one sample in the channel, combining contributions from all bins in the channel. The last element of a channel's list is the error on the samples sum in the channel.
Beta Was this translation helpful? Give feedback.
All reactions