-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Expand file tree
/
Copy pathrepl.txt
More file actions
54 lines (44 loc) · 1.88 KB
/
repl.txt
File metadata and controls
54 lines (44 loc) · 1.88 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
{{alias}}( arrays )
Computes the standard deviation of a one-dimensional single-precision
floating-point ndarray, ignoring `NaN` values.
If provided an empty one-dimensional ndarray, the function returns `NaN`.
If the number of non-NaN elements minus the degrees of freedom adjustment
is less than or equal to `0`, the function returns `NaN`.
Parameters
----------
arrays: ArrayLikeObject<ndarray>
Array-like object containing two elements: a one-dimensional input
ndarray and a zero-dimensional ndarray specifying the degrees of
freedom adjustment. Providing a non-zero degrees of freedom adjustment
has the effect of adjusting the divisor during the calculation of the
standard deviation according to `N-c`, where `N` is the number of
non-NaN elements in the input ndarray and `c` corresponds to the
provided degrees of freedom adjustment. When computing the standard
deviation of a population, setting this parameter to `0` is the
standard choice. When computing the corrected sample standard deviation,
setting this parameter to `1` is the standard choice (commonly referred
to as Bessel's correction).
Returns
-------
out: number
The standard deviation.
Examples
--------
// Create input ndarray:
> var xbuf = new {{alias:@stdlib/array/float32}}(
... [ 1.0, -2.0, NaN, 2.0 ]
... );
> var dt = 'float32';
> var sh = [ xbuf.length ];
> var st = [ 1 ];
> var oo = 0;
> var ord = 'row-major';
> var x = new {{alias:@stdlib/ndarray/ctor}}( dt, xbuf, sh, st, oo, ord );
// Create correction ndarray:
> var opts = { 'dtype': dt };
> var correction = {{alias:@stdlib/ndarray/from-scalar}}( 1.0, opts );
// Compute the standard deviation:
> {{alias}}( [ x, correction ] )
~2.0817
See Also
--------