You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/stdlib_experimental_stats.md
+16-18Lines changed: 16 additions & 18 deletions
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
# Descriptive statistics
2
2
3
3
*[`mean` - mean of array elements](#mean---mean-of-array-elements)
4
-
*[`moment` - raw and central moments of array elements](#moment---raw-and-central-moments-of-array-elements)
4
+
*[`moment` - central moments of array elements](#moment---central-moments-of-array-elements)
5
5
*[`var` - variance of array elements](#var---variance-of-array-elements)
6
6
7
7
## `mean` - mean of array elements
@@ -48,24 +48,24 @@ program demo_mean
48
48
end program demo_mean
49
49
```
50
50
51
-
## `moment` - raw and central moments of array elements
51
+
## `moment` - central moments of array elements
52
52
53
53
### Description
54
54
55
-
Returns the _k_-th order raw moment of all the elements of `array`, or of the elements of `array` along dimension `dim` if provided, and if the corresponding element in `mask` is `true`.
55
+
Returns the _k_-th order central moment of all the elements of `array`, or of the elements of `array` along dimension `dim` if provided, and if the corresponding element in `mask` is `true`.
56
56
57
-
If an array `center` is provided, the function returns the _k_-th order central moment of all the elements of `array`, or of the elements of `array` along dimension `dim` if provided, and if the corresponding element in `mask` is `true`.
57
+
If a scalar or an array `center` is provided, the function returns the _k_-th order moment about 'center', of all the elements of `array`, or of the elements of `array` along dimension `dim` if provided, and if the corresponding element in `mask` is `true`.
The _k_-th order moment about `center` is defined as :
69
69
70
70
```
71
71
moment(array) = 1/n sum_i (array(i) - center)^k
@@ -85,7 +85,7 @@ The _k_-th order central moment is defined as :
85
85
86
86
`dim`: Shall be a scalar of type `integer` with a value in the range from 1 to n, where n is the rank of `array`.
87
87
88
-
`center` (optional): Shall be a scalar of the same type of `array` if `array` is `real` or `complex`, or of type `real(dp)` if `array` is of type `integer`. If `dim` is provided, `center` shall be an array (with a shape similar to that of `array` with dimension `dim` dropped) of the same type of `array` if `array` is `real` or `complex`, or of type `real(dp)` if `array` is of type `integer`.
88
+
`center` (optional): Shall be a scalar of the same type of `result` if `dim` is not provided. If `dim` is provided, `center` shall be a scalar or an array (with a shape similar to that of `array` with dimension `dim` dropped) of the same type of `result`.
89
89
90
90
`mask` (optional): Shall be of type `logical` and either by a scalar or an array of the same shape as `array`.
91
91
@@ -94,9 +94,9 @@ The _k_-th order central moment is defined as :
94
94
If `array` is of type `real` or `complex`, the result is of the same type as `array`.
95
95
If `array` is of type `integer`, the result is of type `real(dp)`.
96
96
97
-
If `dim` is absent, a scalar with the _k_-th raw (or central if `center` is provided) moment of all elements in `array` is returned. Otherwise, an array of rank n-1, where n equals the rank of `array`, and a shape similar to that of `array` with dimension `dim` dropped is returned.
97
+
If `dim` is absent, a scalar with the _k_-th (central) moment of all elements in `array` is returned. Otherwise, an array of rank n-1, where n equals the rank of `array`, and a shape similar to that of `array` with dimension `dim` dropped is returned.
98
98
99
-
If `mask` is specified, the result is the _k_-th raw (or central if `center` is provided) moment of all elements of `array` corresponding to `true` elements of `mask`. If every element of `mask` is `false`, the result is IEEE `NaN`.
99
+
If `mask` is specified, the result is the _k_-th (central) moment of all elements of `array` corresponding to `true` elements of `mask`. If every element of `mask` is `false`, the result is IEEE `NaN`.
0 commit comments