Weighted histogram type
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
real(kind=dp), | public, | allocatable | :: | bins(:) |
Bin weights |
||
integer(kind=i4), | public | :: | min_index |
Lower bound of bins |
|||
integer(kind=i4), | public | :: | max_index |
Upper bound of bins |
|||
real(kind=dp), | public | :: | total_weight |
Sum of all weights |
Initialize the histogram with a given range of bins.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(weighted_histogram_t), | intent(inout) | :: | this |
Histogram object |
||
integer, | intent(in) | :: | min_index |
Lower bound index |
||
integer, | intent(in) | :: | max_index |
Upper bound index |
Reset all bin weights and total weight to zero.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(weighted_histogram_t), | intent(inout) | :: | this |
Histogram object |
Add a weighted value to a given bin index.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(weighted_histogram_t), | intent(inout) | :: | this |
Histogram object |
||
integer(kind=i4), | intent(in) | :: | index |
Bin index |
||
real(kind=dp), | intent(in) | :: | weight |
Weight to add |
Compute the mean value of the histogram.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(weighted_histogram_t), | intent(in) | :: | this |
Histogram object |
||
real(kind=dp), | intent(in), | optional | :: | normalization_factor |
Normalization factor for index scaling |
Compute the variance of the histogram.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(weighted_histogram_t), | intent(in) | :: | this |
Histogram object |
||
real(kind=dp), | intent(in), | optional | :: | normalization_factor |
Normalization factor for index scaling |
Compute the k-th statistical moment of the histogram. The moment is normalized by the total weight.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(weighted_histogram_t), | intent(in) | :: | this |
Histogram object |
||
integer(kind=i4), | intent(in) | :: | k |
Moment order (k ≥ 0) |
||
real(kind=dp), | intent(in), | optional | :: | normalization_factor |
Normalization factor for index scaling |