Skip to content

Commit 8f626cd

Browse files
committed
covariance_dev: following @ivan-pi s comments
1 parent 7b1ebc7 commit 8f626cd

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

src/stdlib_experimental_stats.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Per default, the covariance is defined as:
1818
cov(array) = 1/(n-1) sum_i (array(i) - mean(array) * (array(i) - mean(array)))
1919
```
2020

21-
where n is the number of elements.
21+
where `n` is the number of elements.
2222

2323
The scaling can be changed with the logical argument `corrected`. If `corrected` is `.false.`, then the sum is scaled with `n`, otherwise with `n-1`.
2424

@@ -31,9 +31,9 @@ The scaling can be changed with the logical argument `corrected`. If `corrected`
3131

3232
`array`: Shall be a rank-1 or a rank-2 array of type `integer`, `real`, or `complex`.
3333

34-
`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`.
34+
`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`.
3535

36-
`mask` (optional): Shall be of type `logical` and either by a scalar or an array of the same shape as `array`.
36+
`mask` (optional): Shall be of type `logical` and either a scalar or an array of the same shape as `array`.
3737

3838
`corrected` (optional): Shall be a scalar of type `logical`. If `corrected` is `.true.` (default value), the sum is scaled with `n-1`. If `corrected` is `.false.`, then the sum is scaled with `n`.
3939

@@ -78,16 +78,16 @@ Returns the mean of all the elements of `array`, or of the elements of `array` a
7878

7979
`array`: Shall be an array of type `integer`, `real`, or `complex`.
8080

81-
`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`.
81+
`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`.
8282

83-
`mask` (optional): Shall be of type `logical` and either by a scalar or an array of the same shape as `array`.
83+
`mask` (optional): Shall be of type `logical` and either a scalar or an array of the same shape as `array`.
8484

8585
### Return value
8686

8787
If `array` is of type `real` or `complex`, the result is of the same type as `array`.
8888
If `array` is of type `integer`, the result is of type `real(dp)`.
8989

90-
If `dim` is absent, a scalar with the mean 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.
90+
If `dim` is absent, a scalar with the mean 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.
9191

9292
If `mask` is specified, the result is the mean of all elements of `array` corresponding to `true` elements of `mask`. If every element of `mask` is `false`, the result is IEEE `NaN`.
9393

@@ -121,7 +121,7 @@ The _k_-th order central moment is defined as :
121121
moment(array) = 1/n sum_i (array(i) - mean(array))^k
122122
```
123123

124-
where n is the number of elements.
124+
where `n` is the number of elements.
125125

126126
The _k_-th order moment about `center` is defined as :
127127

@@ -141,18 +141,18 @@ The _k_-th order moment about `center` is defined as :
141141

142142
`order`: Shall be an scalar of type `integer`.
143143

144-
`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`.
144+
`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`.
145145

146146
`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`.
147147

148-
`mask` (optional): Shall be of type `logical` and either by a scalar or an array of the same shape as `array`.
148+
`mask` (optional): Shall be of type `logical` and either a scalar or an array of the same shape as `array`.
149149

150150
### Return value
151151

152152
If `array` is of type `real` or `complex`, the result is of the same type as `array`.
153153
If `array` is of type `integer`, the result is of type `real(dp)`.
154154

155-
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.
155+
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.
156156

157157
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`.
158158

@@ -185,7 +185,7 @@ Per default, the variance is defined as the best unbiased estimator and is compu
185185
var(array) = 1/(n-1) sum_i (array(i) - mean(array))^2
186186
```
187187

188-
where n is the number of elements.
188+
where `n` is the number of elements.
189189

190190
The use of the term `n-1` for scaling is called Bessel 's correction. The scaling can be changed with the logical argument `corrected`. If `corrected` is `.false.`, then the sum is scaled with `n`, otherwise with `n-1`.
191191

@@ -200,9 +200,9 @@ The use of the term `n-1` for scaling is called Bessel 's correction. The scalin
200200

201201
`array`: Shall be an array of type `integer`, `real`, or `complex`.
202202

203-
`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`.
203+
`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`.
204204

205-
`mask` (optional): Shall be of type `logical` and either by a scalar or an array of the same shape as `array`.
205+
`mask` (optional): Shall be of type `logical` and either a scalar or an array of the same shape as `array`.
206206

207207
`corrected` (optional): Shall be a scalar of type `logical`. If `corrected` is `.true.` (default value), the sum is scaled with `n-1`. If `corrected` is `.false.`, then the sum is scaled with `n`.
208208

@@ -211,7 +211,7 @@ The use of the term `n-1` for scaling is called Bessel 's correction. The scalin
211211
If `array` is of type `real` or `complex`, the result is of type `real` corresponding to the type of `array`.
212212
If `array` is of type `integer`, the result is of type `real(dp)`.
213213

214-
If `dim` is absent, a scalar with the variance 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.
214+
If `dim` is absent, a scalar with the variance 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.
215215

216216
If `mask` is specified, the result is the variance of all elements of `array` corresponding to `true` elements of `mask`. If every element of `mask` is `false`, the result is IEEE `NaN`.
217217

0 commit comments

Comments
 (0)