Skip to content

Commit fc1934e

Browse files
committed
refactor: apply suggested changes
1 parent a5ea81b commit fc1934e

File tree

11 files changed

+65
-66
lines changed

11 files changed

+65
-66
lines changed

lib/node_modules/@stdlib/stats/strided/ztest2/README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ limitations under the License.
2222

2323
# ztest2
2424

25-
> Compute a two-sample Z-test for a strided array.
25+
> Compute a two-sample Z-test.
2626
2727
<section class="intro">
2828

@@ -48,7 +48,7 @@ var ztest2 = require( '@stdlib/stats/strided/ztest2' );
4848

4949
#### ztest2( NX, NY, alternative, alpha, diff, sigmax, sigmay, x, strideX, y, strideY, out )
5050

51-
Computes a two-sample Z-test for a strided array.
51+
Computes a two-sample Z-test.
5252

5353
```javascript
5454
var Results = require( '@stdlib/stats/base/ztest/two-sample/results/float64' );
@@ -119,7 +119,7 @@ var bool = ( out === results );
119119

120120
#### ztest2.ndarray( NX, NY, alternative, alpha, diff, sigmax, sigmay, x, strideX, offsetX, y, strideY, offsetY, out )
121121

122-
Computes a two-sample Z-test for a strided array using alternative indexing semantics.
122+
Computes a two-sample Z-test using alternative indexing semantics.
123123

124124
```javascript
125125
var Results = require( '@stdlib/stats/base/ztest/two-sample/results/float64' );
@@ -140,7 +140,7 @@ The function has the following additional parameters:
140140
- **offsetX**: starting index for `x`.
141141
- **offsetY**: starting index for `y`.
142142

143-
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 perform a two-sample Z-test over every other element in `x` and `y` starting from the second element
143+
While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, offset parameters support indexing semantics based on starting indices. For example, to perform a two-sample Z-test over every other element in `x` and `y` starting from the second element
144144

145145
```javascript
146146
var Results = require( '@stdlib/stats/base/ztest/two-sample/results/float64' );
@@ -166,7 +166,7 @@ var bool = ( out === results );
166166

167167
- As a general rule of thumb, a Z-test is most reliable when `N >= 50`. For smaller sample sizes or when the standard deviation is unknown, prefer a t-test.
168168
- Both functions support array-like objects having getter and setter accessors for array element access (e.g., [`@stdlib/array/base/accessor`][@stdlib/array/base/accessor]).
169-
- Depending on the environment, the typed versions ([`dztest2`][@stdlib/stats/strided/dztest2], [`sztest2`][@stdlib/stats/strided/sztest2], etc.) are likely to be significantly more performant.
169+
<!-- - Depending on the environment, the typed versions ([`dztest2`][@stdlib/stats/strided/dztest2], [`sztest2`][@stdlib/stats/strided/sztest2], etc.) are likely to be significantly more performant. -->
170170

171171
</section>
172172

@@ -227,9 +227,9 @@ console.log( out.toString() );
227227

228228
[@stdlib/array/base/accessor]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/base/accessor
229229

230-
[@stdlib/stats/strided/dztest2]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/stats/strided/dztest
230+
<!-- [@stdlib/stats/strided/dztest2]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/stats/strided/dztest -->
231231

232-
[@stdlib/stats/strided/sztest2]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/stats/strided/sztest
232+
<!-- [@stdlib/stats/strided/sztest2]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/stats/strided/sztest -->
233233

234234
[mdn-typed-array]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray
235235

lib/node_modules/@stdlib/stats/strided/ztest2/benchmark/benchmark.ndarray.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ function main() {
9797
for ( i = min; i <= max; i++ ) {
9898
len = pow( 10, i );
9999
f = createBenchmark( len );
100-
bench( pkg+':len='+len, f );
100+
bench( pkg+':ndarray:len='+len, f );
101101
}
102102
}
103103

lib/node_modules/@stdlib/stats/strided/ztest2/docs/repl.txt

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

2-
{{alias}}( NX, NY, alternative, alpha, diff, sigmax, sigmay, x, strideX, y, strideY, out )
3-
Computes a two-sample Z-test for a strided array.
2+
{{alias}}( NX, NY, alt, alpha, diff, sigmax, sigmay, x, sx, y, sy, out )
3+
Computes a two-sample Z-test.
44

55
The `N` and stride parameters determine which elements in the strided array
66
are accessed at runtime.
@@ -19,9 +19,9 @@
1919
alternative: string
2020
Alternative hypothesis. Must be one of the following:
2121

22-
- two-sided: `x` has same mean as `y`
23-
- greater: `x` has larger mean than `y`
24-
- less: `x` has smaller mean than `y`
22+
- two-sided: `x` has same mean as `y`.
23+
- greater: `x` has larger mean than `y`.
24+
- less: `x` has smaller mean than `y`.
2525

2626
alpha: number
2727
Significance level.
@@ -67,13 +67,12 @@
6767
> res.toString()
6868

6969

70-
{{alias}}.ndarray( NX, NY, alternative, alpha, diff, sigmax, sigmay, x, strideX, offsetX, y, strideY, offsetY, out )
71-
Computes a two-sample Z-test for a strided array using alternative indexing
72-
semantics.
70+
{{alias}}.ndarray( NX, NY, alt, alpha, diff, sigmax, sigmay, x, sx, ox, y, sy, oy, out )
71+
Computes a two-sample Z-test using alternative indexing semantics.
7372

7473
While typed array views mandate a view offset based on the underlying
75-
buffer, the offset parameter supports indexing semantics based on a starting
76-
index.
74+
buffer, offset parameters support indexing semantics based on starting
75+
indices.
7776

7877
Parameters
7978
----------
@@ -86,9 +85,9 @@
8685
alternative: string
8786
Alternative hypothesis. Must be one of the following:
8887

89-
- two-sided: `x` has same mean as `y`
90-
- greater: `x` has larger mean than `y`
91-
- less: `x` has smaller mean than `y`
88+
- two-sided: `x` has same mean as `y`.
89+
- greater: `x` has larger mean than `y`.
90+
- less: `x` has smaller mean than `y`.
9291

9392
alpha: number
9493
Significance level.

lib/node_modules/@stdlib/stats/strided/ztest2/docs/types/index.d.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ interface BaseResults {
9696
ci: Float64Array;
9797

9898
/**
99-
* Difference in means under the null hypothesis
99+
* Difference in means under the null hypothesis.
100100
*/
101101
nullValue: number;
102102

@@ -131,7 +131,7 @@ interface Results extends BaseResults {
131131
*/
132132
interface Routine {
133133
/**
134-
* Computes a two-sample Z-test for a strided array.
134+
* Computes a two-sample Z-test.
135135
*
136136
* @param NX - number of indexed elements in `x`
137137
* @param NY - number of indexed elements in `y`
@@ -163,7 +163,7 @@ interface Routine {
163163
<T extends BaseResults>( NX: number, NY: number, alternative: Alternative, alpha: number, diff: number, sigmax: number, sigmay: number, x: InputArray, strideX: number, y: InputArray, strideY: number, out: T ): Results;
164164

165165
/**
166-
* Computes a two-sample Z-test for a strided array using alternative indexing semantics.
166+
* Computes a two-sample Z-test using alternative indexing semantics.
167167
*
168168
* @param NX - number of indexed elements in `x`
169169
* @param NY - number of indexed elements in `y`
@@ -198,7 +198,7 @@ interface Routine {
198198
}
199199

200200
/**
201-
* Computes a two-sample Z-test for a strided array.
201+
* Computes a two-sample Z-test.
202202
*
203203
* @param NX - number of indexed elements in `x`
204204
* @param NY - number of indexed elements in `y`

lib/node_modules/@stdlib/stats/strided/ztest2/docs/types/test.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ import ztest2 = require( './index' );
137137
ztest2( x.length, y.length, 'two-sided', 0.05, 0.0, 1.0, ( x: number ): number => x, x, 1, y, 1, new Float64Results() ); // $ExpectError
138138
}
139139

140-
// The compiler throws an error if the function is provided a eigth argument which is not an array-like object...
140+
// The compiler throws an error if the function is provided an eighth argument which is not an array-like object...
141141
{
142142
const x = new Float64Array( 10 );
143143
const y = new Float64Array( 10 );
@@ -182,7 +182,7 @@ import ztest2 = require( './index' );
182182
ztest2( x.length, y.length, 'two-sided', 0.05, 0.0, 1.0, 1.0, x, 1, ( x: number ): number => x, 1, new Float64Results() ); // $ExpectError
183183
}
184184

185-
// The compiler throws an error if the function is provided a eleventh argument which is not a number...
185+
// The compiler throws an error if the function is provided an eleventh argument which is not a number...
186186
{
187187
const x = new Float64Array( 10 );
188188
const y = new Float64Array( 10 );
@@ -197,7 +197,7 @@ import ztest2 = require( './index' );
197197
ztest2( x.length, y.length, 'two-sided', 0.05, 0.0, 1.0, 1.0, x, 1, y, ( x: number ): number => x, new Float64Results() ); // $ExpectError
198198
}
199199

200-
// The compiler throws an error if the function is provided an twelfth argument which is not a results object...
200+
// The compiler throws an error if the function is provided a twelfth argument which is not a results object...
201201
{
202202
const x = new Float64Array( 10 );
203203
const y = new Float64Array( 10 );
@@ -348,7 +348,7 @@ import ztest2 = require( './index' );
348348
ztest2.ndarray( x.length, y.length, 'two-sided', 0.05, 0.0, 1.0, ( x: number ): number => x, x, 1, 0, y, 1, 0, new Float64Results() ); // $ExpectError
349349
}
350350

351-
// The compiler throws an error if the `ndarray` method is provided a eigth argument which is not an array-like object...
351+
// The compiler throws an error if the `ndarray` method is provided an eigth argument which is not an array-like object...
352352
{
353353
const x = new Float64Array( 10 );
354354
const y = new Float64Array( 10 );
@@ -378,7 +378,7 @@ import ztest2 = require( './index' );
378378
ztest2.ndarray( x.length, y.length, 'two-sided', 0.05, 0.0, 1.0, 1.0, x, ( x: number ): number => x, 0, y, 1, 0, new Float64Results() ); // $ExpectError
379379
}
380380

381-
// The compiler throws an error if the `ndarray` method is provided an tenth argument which is not a number...
381+
// The compiler throws an error if the `ndarray` method is provided a tenth argument which is not a number...
382382
{
383383
const x = new Float64Array( 10 );
384384
const y = new Float64Array( 10 );
@@ -393,7 +393,7 @@ import ztest2 = require( './index' );
393393
ztest2.ndarray( x.length, y.length, 'two-sided', 0.05, 0.0, 1.0, 1.0, x, 1, ( x: number ): number => x, y, 1, 0, new Float64Results() ); // $ExpectError
394394
}
395395

396-
// The compiler throws an error if the `ndarray` method is provided a eleventh argument which is not an array-like object...
396+
// The compiler throws an error if the `ndarray` method is provided an eleventh argument which is not an array-like object...
397397
{
398398
const x = new Float64Array( 10 );
399399
const y = new Float64Array( 10 );
@@ -423,7 +423,7 @@ import ztest2 = require( './index' );
423423
ztest2.ndarray( x.length, y.length, 'two-sided', 0.05, 0.0, 1.0, 1.0, x, 1, 0, y, ( x: number ): number => x, 0, new Float64Results() ); // $ExpectError
424424
}
425425

426-
// The compiler throws an error if the `ndarray` method is provided an thirteenth argument which is not a number...
426+
// The compiler throws an error if the `ndarray` method is provided a thirteenth argument which is not a number...
427427
{
428428
const x = new Float64Array( 10 );
429429
const y = new Float64Array( 10 );

lib/node_modules/@stdlib/stats/strided/ztest2/lib/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
'use strict';
2020

2121
/**
22-
* Compute a two-sample Z-test for a strided array.
22+
* Compute a two-sample Z-test.
2323
*
2424
* @module @stdlib/stats/strided/ztest2
2525
*

lib/node_modules/@stdlib/stats/strided/ztest2/lib/main.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ var ndarray = require( './ndarray.js' );
2727
// MAIN //
2828

2929
/**
30-
* Computes a two-sample Z-test for a strided array.
30+
* Computes a two-sample Z-test.
3131
*
3232
* @param {PositiveInteger} NX - number of indexed elements in `x`
3333
* @param {PositiveInteger} NY - number of indexed elements in `y`

lib/node_modules/@stdlib/stats/strided/ztest2/lib/ndarray.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ var WORKSPACE = new Float64Array( 2 );
4444
// MAIN //
4545

4646
/**
47-
* Computes a two-sample Z-test for a strided array using alternative indexing semantics.
47+
* Computes a two-sample Z-test using alternative indexing semantics.
4848
*
4949
* @param {PositiveInteger} NX - number of indexed elements in `x`
5050
* @param {PositiveInteger} NY - number of indexed elements in `y`
@@ -117,11 +117,11 @@ function ztest2( NX, NY, alternative, alpha, diff, sigmax, sigmay, x, strideX, o
117117
yvar = sigmay * sigmay;
118118
stderr = sqrt( ( xvar / NX ) + ( yvar / NY ) );
119119

120-
// Compute the arithmetic mean of the input array:
120+
// Compute the arithmetic means of the input arrays:
121121
xmean = mean( NX, x, strideX, offsetX );
122122
ymean = mean( NY, y, strideY, offsetY );
123123

124-
// Compute the test statistic (i.e., the z-score, which is the distance of the sample mean from the population mean in units of standard error):
124+
// Compute the test statistic (i.e., the z-score, which is the standardized difference between the sample means of x and y, adjusted by the hypothesized difference, in units of the standard error):
125125
stat = ( xmean - ymean - diff ) / stderr;
126126

127127
// Compute the p-value and confidence interval...

lib/node_modules/@stdlib/stats/strided/ztest2/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@stdlib/stats/strided/ztest2",
33
"version": "0.0.0",
4-
"description": "Compute a two-sample Z-test for a strided array.",
4+
"description": "Compute a two-sample Z-test.",
55
"license": "Apache-2.0",
66
"author": {
77
"name": "The Stdlib Authors",

lib/node_modules/@stdlib/stats/strided/ztest2/test/test.main.js

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,15 @@ tape( 'main export is a function', function test( t ) {
4646
t.end();
4747
});
4848

49-
tape( 'the function performs a two-sample Z-test over a strided array (alternative=two-sided)', function test( t ) {
49+
tape( 'the function performs a two-sample Z-test (alternative=two-sided)', function test( t ) {
5050
var results;
5151
var out;
5252
var x;
5353
var y;
5454

5555
results = new Float64Results();
5656

57-
// Generate an array with a sufficiently large sample size to effectively guarantee expected results:
57+
// Generate arrays with a sufficiently large sample size to effectively guarantee expected results:
5858
x = normal( 10000, 0.0, 1.0, {
5959
'dtype': 'generic'
6060
});
@@ -80,7 +80,7 @@ tape( 'the function performs a two-sample Z-test over a strided array (alternati
8080
t.strictEqual( isfinite( out.ci[ 0 ] ), true, 'returns expected value' );
8181
t.strictEqual( isfinite( out.ci[ 1 ] ), true, 'returns expected value' );
8282

83-
// Generate an array with a sufficiently large sample size to effectively guarantee expected results:
83+
// Generate arrays with a sufficiently large sample size to effectively guarantee expected results:
8484
x = normal( 10000, 4.0, 1.0, {
8585
'dtype': 'generic'
8686
});
@@ -100,15 +100,15 @@ tape( 'the function performs a two-sample Z-test over a strided array (alternati
100100
t.end();
101101
});
102102

103-
tape( 'the function performs a two-sample Z-test over a strided array (alternative=greater)', function test( t ) {
103+
tape( 'the function performs a two-sample Z-test (alternative=greater)', function test( t ) {
104104
var results;
105105
var out;
106106
var x;
107107
var y;
108108

109109
results = new Float64Results();
110110

111-
// Generate an array with a sufficiently large sample size to effectively guarantee expected results:
111+
// Generate arrays with a sufficiently large sample size to effectively guarantee expected results:
112112
x = normal( 10000, 0.0, 1.0, {
113113
'dtype': 'generic'
114114
});
@@ -125,7 +125,7 @@ tape( 'the function performs a two-sample Z-test over a strided array (alternati
125125
t.strictEqual( isfinite( out.ci[ 0 ] ), true, 'returns expected value' );
126126
t.strictEqual( out.ci[ 1 ], PINF, 'returns expected value' );
127127

128-
// Generate an array with a sufficiently large sample size to effectively guarantee expected results:
128+
// Generate arrays with a sufficiently large sample size to effectively guarantee expected results:
129129
x = normal( 10000, 0.0, 1.0, {
130130
'dtype': 'generic'
131131
});
@@ -145,15 +145,15 @@ tape( 'the function performs a two-sample Z-test over a strided array (alternati
145145
t.end();
146146
});
147147

148-
tape( 'the function performs a two-sample Z-test over a strided array (alternative=less)', function test( t ) {
148+
tape( 'the function performs a two-sample Z-test (alternative=less)', function test( t ) {
149149
var results;
150150
var out;
151151
var x;
152152
var y;
153153

154154
results = new Float64Results();
155155

156-
// Generate an array with a sufficiently large sample size to effectively guarantee expected results:
156+
// Generate arrays with a sufficiently large sample size to effectively guarantee expected results:
157157
x = normal( 10000, 2.0, 1.0, {
158158
'dtype': 'generic'
159159
});
@@ -170,7 +170,7 @@ tape( 'the function performs a two-sample Z-test over a strided array (alternati
170170
t.strictEqual( out.ci[ 0 ], NINF, 'returns expected value' );
171171
t.strictEqual( isfinite( out.ci[ 1 ] ), true, 'returns expected value' );
172172

173-
// Generate an array with a sufficiently large sample size to effectively guarantee expected results:
173+
// Generate arrays with a sufficiently large sample size to effectively guarantee expected results:
174174
x = normal( 10000, 0.0, 1.0, {
175175
'dtype': 'generic'
176176
});
@@ -245,7 +245,7 @@ tape( 'the function supports a stride parameter', function test( t ) {
245245
N = 10000;
246246
results = new Float64Results();
247247

248-
// Generate an array with a sufficiently large sample size to effectively guarantee expected results:
248+
// Generate arrays with a sufficiently large sample size to effectively guarantee expected results:
249249
x = normal( N*2, 0.0, 1.0, {
250250
'dtype': 'generic'
251251
});
@@ -265,7 +265,7 @@ tape( 'the function supports a stride parameter', function test( t ) {
265265
t.strictEqual( isfinite( out.ci[ 0 ] ), true, 'returns expected value' );
266266
t.strictEqual( isfinite( out.ci[ 1 ] ), true, 'returns expected value' );
267267

268-
// Generate an array with a sufficiently large sample size to effectively guarantee expected results:
268+
// Generate arrays with a sufficiently large sample size to effectively guarantee expected results:
269269
x = normal( N*2, 4.0, 1.0, {
270270
'dtype': 'generic'
271271
});
@@ -298,7 +298,7 @@ tape( 'the function supports a negative stride parameter', function test( t ) {
298298
N = 10000;
299299
results = new Float64Results();
300300

301-
// Generate an array with a sufficiently large sample size to effectively guarantee expected results:
301+
// Generate arrays with a sufficiently large sample size to effectively guarantee expected results:
302302
x = normal( N*2, 0.0, 1.0, {
303303
'dtype': 'generic'
304304
});
@@ -318,7 +318,7 @@ tape( 'the function supports a negative stride parameter', function test( t ) {
318318
t.strictEqual( isfinite( out.ci[ 0 ] ), true, 'returns expected value' );
319319
t.strictEqual( isfinite( out.ci[ 1 ] ), true, 'returns expected value' );
320320

321-
// Generate an array with a sufficiently large sample size to effectively guarantee expected results:
321+
// Generate arrays with a sufficiently large sample size to effectively guarantee expected results:
322322
x = normal( N*2, 100.0, 1.0, {
323323
'dtype': 'generic'
324324
});

0 commit comments

Comments
 (0)