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
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`.
24
+
25
+
26
+
### Syntax
27
+
28
+
`result = cov(array, dim [, mask [, corrected]])`
29
+
30
+
### Arguments
31
+
32
+
`array`: Shall be a 1-rank or a 2-rank array of type `integer`, `real`, or `complex`.
33
+
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`.
35
+
36
+
`mask` (optional): Shall be of type `logical` and either by a scalar or an array of the same shape as `array`.
37
+
38
+
`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`.
39
+
40
+
### Return value
41
+
42
+
If `array` is of rank 1 and of type `real` or `complex`, the result is of the same type `real` corresponding to the type of `array`.
43
+
If `array` is of rank 2 and of type `real` or `complex`, the result is of the same type as `array`.
44
+
If `array` is of type `integer`, the result is of type `real(dp)`.
45
+
46
+
If `array` is of rank 1, a scalar with the covariance (that is the variance) of all elements in `array` is returned.
47
+
If `array` is of rank 2, a 2-rank array is returned.
48
+
49
+
If `mask` is specified, the result is the covariance 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