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
@@ -89,18 +88,16 @@ The function has the following parameters:
89
88
-**N**: number of indexed elements.
90
89
-**correction**: degrees of freedom adjustment. Setting this parameter to a value other than `0` has the effect of adjusting the divisor during the calculation of the [standard deviation][standard-deviation] according to `N-c` where `c` corresponds to the provided degrees of freedom adjustment. When computing the [standard deviation][standard-deviation] of a population, setting this parameter to `0` is the standard choice (i.e., the provided array contains data constituting an entire population). When computing the corrected sample [standard deviation][standard-deviation], setting this parameter to `1` is the standard choice (i.e., the provided array contains data sampled from a larger population; this is commonly referred to as Bessel's correction).
The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the [standard error of the mean][standard-error] of every other element in `x`,
93
+
The `N` and stride parameters determine which elements in the strided array are accessed at runtime. For example, to compute the [standard error of the mean][standard-error] of every other element in `x`,
The function has the following additional parameters:
139
132
140
-
-**offset**: starting index for `x`.
133
+
-**offsetX**: starting index for `x`.
141
134
142
-
While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the [standard error of the mean][standard-error] for every other value in `x` starting from the second value
135
+
While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, the offset parameter supports indexing semantics based on a starting index. For example, to calculate the [standard error of the mean][standard-error] for every other element in `x` starting from the second element
var discreteUniform =require( '@stdlib/random/array/discrete-uniform' );
180
169
var dsem =require( '@stdlib/stats/base/dsem' );
181
170
182
-
var x;
183
-
var i;
184
-
185
-
x =newFloat64Array( 10 );
186
-
for ( i =0; i <x.length; i++ ) {
187
-
x[ i ] =round( (randu()*100.0) -50.0 );
188
-
}
171
+
var x =discreteUniform( 10, -50, 50, {
172
+
'dtype':'float64'
173
+
});
189
174
console.log( x );
190
175
191
176
var v =dsem( x.length, 1, x, 1 );
@@ -196,6 +181,127 @@ console.log( v );
196
181
197
182
<!-- /.examples -->
198
183
184
+
<!-- C interface documentation. -->
185
+
186
+
* * *
187
+
188
+
<sectionclass="c">
189
+
190
+
## C APIs
191
+
192
+
<!-- Section to include introductory text. Make sure to keep an empty line after the intro `section` element and another before the `/section` close. -->
193
+
194
+
<sectionclass="intro">
195
+
196
+
</section>
197
+
198
+
<!-- /.intro -->
199
+
200
+
<!-- C usage documentation. -->
201
+
202
+
<sectionclass="usage">
203
+
204
+
### Usage
205
+
206
+
```c
207
+
#include"stdlib/stats/base/dsem.h"
208
+
```
209
+
210
+
#### stdlib_strided_dsem( N, correction, \*X, strideX )
211
+
212
+
Computes the [standard error of the mean][standard-error] of a double-precision floating-point strided array.
- **N**: `[in] CBLAS_INT` number of indexed elements.
224
+
- **correction**: `[in] double` degrees of freedom adjustment. Setting this parameter to a value other than `0` has the effect of adjusting the divisor during the calculation of the [standard deviation][standard-deviation] according to `N-c` where `c` corresponds to the provided degrees of freedom adjustment. When computing the [standard deviation][standard-deviation] of a population, setting this parameter to `0` is the standard choice (i.e., the provided array contains data constituting an entire population). When computing the corrected sample [standard deviation][standard-deviation], setting this parameter to `1` is the standard choice (i.e., the provided array contains data sampled from a larger population; this is commonly referred to as Bessel's correction).
225
+
- **X**: `[in] double*` input array.
226
+
- **strideX**: `[in] CBLAS_INT` stride length for `X`.
double v = stdlib_strided_dsem_ndarray( 4, 1.0, x, 2, 0 );
240
+
// returns ~1.29099
241
+
```
242
+
243
+
The function accepts the following arguments:
244
+
245
+
- **N**: `[in] CBLAS_INT` number of indexed elements.
246
+
- **correction**: `[in] double` degrees of freedom adjustment. Setting this parameter to a value other than `0` has the effect of adjusting the divisor during the calculation of the [standard deviation][standard-deviation] according to `N-c` where `c` corresponds to the provided degrees of freedom adjustment. When computing the [standard deviation][standard-deviation] of a population, setting this parameter to `0` is the standard choice (i.e., the provided array contains data constituting an entire population). When computing the corrected sample [standard deviation][standard-deviation], setting this parameter to `1` is the standard choice (i.e., the provided array contains data sampled from a larger population; this is commonly referred to as Bessel's correction).
247
+
- **X**: `[in] double*` input array.
248
+
- **strideX**: `[in] CBLAS_INT` stride length for `X`.
249
+
- **offsetX**: `[in] CBLAS_INT` starting index for `X`.
0 commit comments