Collapse axes by statistical calculations.
Missing data array elements and those with zero weight are omitted from the calculation.
The following collapse methods are available over any subset of the field’s axes:
Method | Notes |
---|---|
Maximum | The maximum of the values. |
Minimum | The minimum of the values. |
Sum | The sum of the values. |
Mid-range | The average of the maximum and the minimum of the values. |
Range | The absolute difference between the maximum and the minimum of the values. |
Mean | The unweighted mean, \(m\), of \(N\) values \(x_i\) is
\[m=\frac{1}{N}\sum_{i=1}^{N} x_i\]
The weighted mean, \(\tilde{m}\), of \(N\) values \(x_i\) with corresponding weights \(w_i\) is
\[\tilde{m}=\frac{1}{\sum_{i=1}^{N} w_i}
\sum_{i=1}^{N} w_i x_i\]
|
Standard deviation | The unweighted standard deviation, \(s\), of \(N\) values \(x_i\) with mean \(m\) and with \(N-ddof\) degrees of freedom (\(ddof\ge0\)) is
\[s=\sqrt{\frac{1}{N-ddof} \sum_{i=1}^{N}
(x_i - m)^2}\]
The weighted standard deviation, \(\tilde{s}_N\), of \(N\) values \(x_i\) with corresponding weights \(w_i\), weighted mean \(\tilde{m}\) and with \(N\) degrees of freedom is
\[\tilde{s}_N=\sqrt{\frac{1}
{\sum_{i=1}^{N} w_i}
\sum_{i=1}^{N} w_i(x_i -
\tilde{m})^2}\]
The weighted standard deviation, \(\tilde{s}\), of \(N\) values \(x_i\) with corresponding weights \(w_i\) and with \(N-ddof\) degrees of freedom (\(ddof>0\)) is
\[\tilde{s}=\sqrt{\frac{a \sum_{i=1}^{N}
w_i}{a \sum_{i=1}^{N} w_i -
ddof}} \tilde{s}_N\]
where \(a\) is the smallest positive number whose product with each weight is an integer. \(a \sum_{i=1}^{N} w_i\) is the size of a new sample created by each \(x_i\) having \(aw_i\) repeats. In practice, \(a\) may not exist or may be difficult to calculate, so \(a\) is either set to a predetermined value or an approximate value is calculated. The approximation is the smallest positive number whose products with the smallest and largest weights and the sum of the weights are all integers, where a positive number is considered to be an integer if its decimal part is sufficiently small (no greater than 10-8 plus 10-5 times its integer part). This approximation will never overestimate \(a\), so \(\tilde{s}\) will never be underestimated when the approximation is used. If the weights are all integers which are collectively coprime then setting \(a=1\) will guarantee that \(\tilde{s}\) is exact. |
Variance | The variance is the square of the standard deviation. |
Parameters : |
weights : optional
|
||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Returns : |
|