repl.txt (4189B)
1 2 {{alias}}( N, correction, x, stride ) 3 Computes the standard deviation of a single-precision floating-point strided 4 array ignoring `NaN` values. 5 6 The `N` and `stride` parameters determine which elements in `x` are accessed 7 at runtime. 8 9 Indexing is relative to the first index. To introduce an offset, use a typed 10 array view. 11 12 If `N <= 0`, the function returns `NaN`. 13 14 If every indexed element is `NaN`, the function returns `NaN`. 15 16 Parameters 17 ---------- 18 N: integer 19 Number of indexed elements. 20 21 correction: number 22 Degrees of freedom adjustment. Setting this parameter to a value other 23 than `0` has the effect of adjusting the divisor during the calculation 24 of the standard deviation according to `N - c` where `c` corresponds to 25 the provided degrees of freedom adjustment. When computing the standard 26 deviation of a population, setting this parameter to `0` is the standard 27 choice (i.e., the provided array contains data constituting an entire 28 population). When computing the corrected sample standard deviation, 29 setting this parameter to `1` is the standard choice (i.e., the provided 30 array contains data sampled from a larger population; this is commonly 31 referred to as Bessel's correction). 32 33 x: Float32Array 34 Input array. 35 36 stride: integer 37 Index increment. 38 39 Returns 40 ------- 41 out: number 42 The standard deviation. 43 44 Examples 45 -------- 46 // Standard Usage: 47 > var x = new {{alias:@stdlib/array/float32}}( [ 1.0, -2.0, NaN, 2.0 ] ); 48 > {{alias}}( x.length, 1, x, 1 ) 49 ~2.0817 50 51 // Using `N` and `stride` parameters: 52 > x = new {{alias:@stdlib/array/float32}}( [ -2.0, 1.0, 1.0, -5.0, 2.0, -1.0 ] ); 53 > var N = {{alias:@stdlib/math/base/special/floor}}( x.length / 2 ); 54 > var stride = 2; 55 > {{alias}}( N, 1, x, stride ) 56 ~2.0817 57 58 // Using view offsets: 59 > var x0 = new {{alias:@stdlib/array/float32}}( [ 1.0, -2.0, 3.0, 2.0, 5.0, -1.0 ] ); 60 > var x1 = new {{alias:@stdlib/array/float32}}( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); 61 > N = {{alias:@stdlib/math/base/special/floor}}( x0.length / 2 ); 62 > stride = 2; 63 > {{alias}}( N, 1, x1, stride ) 64 ~2.0817 65 66 {{alias}}.ndarray( N, correction, x, stride, offset ) 67 Computes the standard deviation of a single-precision floating-point strided 68 array ignoring `NaN` values and alternative indexing semantics. 69 70 While typed array views mandate a view offset based on the underlying 71 buffer, the `offset` parameter supports indexing semantics based on a 72 starting index. 73 74 Parameters 75 ---------- 76 N: integer 77 Number of indexed elements. 78 79 correction: number 80 Degrees of freedom adjustment. Setting this parameter to a value other 81 than `0` has the effect of adjusting the divisor during the calculation 82 of the standard deviation according to `N - c` where `c` corresponds to 83 the provided degrees of freedom adjustment. When computing the standard 84 deviation of a population, setting this parameter to `0` is the standard 85 choice (i.e., the provided array contains data constituting an entire 86 population). When computing the corrected sample standard deviation, 87 setting this parameter to `1` is the standard choice (i.e., the provided 88 array contains data sampled from a larger population; this is commonly 89 referred to as Bessel's correction). 90 91 x: Float32Array 92 Input array. 93 94 stride: integer 95 Index increment. 96 97 offset: integer 98 Starting index. 99 100 Returns 101 ------- 102 out: number 103 The standard deviation. 104 105 Examples 106 -------- 107 // Standard Usage: 108 > var x = new {{alias:@stdlib/array/float32}}( [ 1.0, -2.0, NaN, 2.0 ] ); 109 > {{alias}}.ndarray( x.length, 1, x, 1, 0 ) 110 ~2.0817 111 112 // Using offset parameter: 113 > var x = new {{alias:@stdlib/array/float32}}( [ 1.0, -2.0, 3.0, 2.0, 5.0, -1.0 ] ); 114 > var N = {{alias:@stdlib/math/base/special/floor}}( x.length / 2 ); 115 > {{alias}}.ndarray( N, 1, x, 2, 1 ) 116 ~2.0817 117 118 See Also 119 -------- 120