time-to-botec

Benchmark sampling in different programming languages
Log | Files | Refs | README

repl.txt (4222B)


      1 
      2 {{alias}}( N, correction, x, stride )
      3     Computes the standard error of the mean for a double-precision floating-
      4     point strided array using a one-pass algorithm proposed by Youngs and
      5     Cramer.
      6 
      7     The `N` and `stride` parameters determine which elements in `x` are accessed
      8     at runtime.
      9 
     10     Indexing is relative to the first index. To introduce an offset, use a typed
     11     array view.
     12 
     13     If `N <= 0`, the function returns `NaN`.
     14 
     15     Parameters
     16     ----------
     17     N: integer
     18         Number of indexed elements.
     19 
     20     correction: number
     21         Degrees of freedom adjustment. Setting this parameter to a value other
     22         than `0` has the effect of adjusting the divisor during the calculation
     23         of the standard deviation according to `N - c` where `c` corresponds to
     24         the provided degrees of freedom adjustment. When computing the standard
     25         deviation of a population, setting this parameter to `0` is the standard
     26         choice (i.e., the provided array contains data constituting an entire
     27         population). When computing the corrected sample standard deviation,
     28         setting this parameter to `1` is the standard choice (i.e., the provided
     29         array contains data sampled from a larger population; this is commonly
     30         referred to as Bessel's correction).
     31 
     32     x: Float64Array
     33         Input array.
     34 
     35     stride: integer
     36         Index increment.
     37 
     38     Returns
     39     -------
     40     out: number
     41         Standard error of the mean.
     42 
     43     Examples
     44     --------
     45     // Standard Usage:
     46     > var x = new {{alias:@stdlib/array/float64}}( [ 1.0, -2.0, 2.0 ] );
     47     > {{alias}}( x.length, 1, x, 1 )
     48     ~1.20185
     49 
     50     // Using `N` and `stride` parameters:
     51     > x = new {{alias:@stdlib/array/float64}}( [ -2.0, 1.0, 1.0, -5.0, 2.0, -1.0 ] );
     52     > var N = {{alias:@stdlib/math/base/special/floor}}( x.length / 2 );
     53     > var stride = 2;
     54     > {{alias}}( N, 1, x, stride )
     55     ~1.20185
     56 
     57     // Using view offsets:
     58     > var x0 = new {{alias:@stdlib/array/float64}}( [ 1.0, -2.0, 3.0, 2.0, 5.0, -1.0 ] );
     59     > var x1 = new {{alias:@stdlib/array/float64}}( x0.buffer, x0.BYTES_PER_ELEMENT*1 );
     60     > N = {{alias:@stdlib/math/base/special/floor}}( x0.length / 2 );
     61     > stride = 2;
     62     > {{alias}}( N, 1, x1, stride )
     63     ~1.20185
     64 
     65 {{alias}}.ndarray( N, correction, x, stride, offset )
     66     Computes the standard error of the mean for a double-precision floating-
     67     point strided array using a one-pass algorithm proposed by Youngs and Cramer
     68     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: Float64Array
     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         Standard error of the mean.
    104 
    105     Examples
    106     --------
    107     // Standard Usage:
    108     > var x = new {{alias:@stdlib/array/float64}}( [ 1.0, -2.0, 2.0 ] );
    109     > {{alias}}.ndarray( x.length, 1, x, 1, 0 )
    110     ~1.20185
    111 
    112     // Using offset parameter:
    113     > var x = new {{alias:@stdlib/array/float64}}( [ 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     ~1.20185
    117 
    118     See Also
    119     --------
    120