NuMFor 9f2ab49 (2024-04-08)
Numerical (Modern) Fortran. Library for Simple Numerical computing
|
The module histograms
provides infrastructure for the calculation of histograms. i.e: a count of frequency.
More...
Data Types | |
type | histog |
type histogram holds the data from an histogram More... | |
Functions/Subroutines | |
type(histog) function, public | histogram (a, nbins, bins, range, weights, density) |
Computes the histogram of an array of data. | |
The module histograms
provides infrastructure for the calculation of histograms. i.e: a count of frequency.
type(histog) function, public histogram | ( | real(dp), dimension(:), intent(in), target | a, |
integer, intent(in), optional | nbins, | ||
real(dp), dimension(:), intent(in), optional | bins, | ||
real(dp), dimension(2), intent(in), optional | range, | ||
real(dp), dimension(size(a)), intent(in), optional | weights, | ||
logical, intent(in), optional | density ) |
Computes the histogram of an array of data.
[bins(i), bins(i+1) )
which is closed on the left and open on the right (does not include the upper limit) except for the last one which includes both limits bins
nor Nbins
are present the routine will calculate automatically the number of bins from the input data.[in] | a | Input data |
[in] | nbins | Number of equal-width bins to use |
[in] | bins | A monotonically increasing array of bin edges, including the rightmost edge, allowing for non-uniform bin widths. |
[in] | range | The lower and upper range of the bins. If not provided uses min and max |
[in] | weights | Array of weights, of the same size as a . Each value in a only contributes its associated weight towards the bin count (instead of 1) |
[in] | density | If True , the result is the probability density function at the bin, normalized such that the integral over the range is 1. |
References grids::linspace(), array_utils::mean(), basic::print_msg(), basic::small, array_utils::std(), and basic::zero.
Referenced by histog::clean().