Skip to content

Commit b7a0a28

Browse files
applied suggestions for fixes
1 parent f761317 commit b7a0a28

File tree

10 files changed

+32
-27
lines changed

10 files changed

+32
-27
lines changed

lib/node_modules/@stdlib/stats/base/dists/rademacher/cdf/test/test.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,25 +44,25 @@ tape( 'if provided `NaN`, the function returns `NaN`', function test( t ) {
4444

4545
tape( 'if provided `+infinity`, the function returns 1.0', function test( t ) {
4646
var y = cdf( PINF );
47-
t.equal( y, 1.0, 'returns 1.0');
47+
t.equal( y, 1.0, 'returns 1.0' );
4848
t.end();
4949
});
5050

5151
tape( 'if provided `-infinity`, the function returns 0.0', function test( t ) {
5252
var y = cdf( NINF );
53-
t.equal( y, 0.0, 'returns 0.0');
53+
t.equal( y, 0.0, 'returns 0.0' );
5454
t.end();
5555
});
5656

5757
tape( 'if provided -1.0, the function returns 0.5', function test( t ) {
5858
var y = cdf( -1.0 );
59-
t.equal( y, 0.5, 'returns 0.5');
59+
t.equal( y, 0.5, 'returns 0.5' );
6060
t.end();
6161
});
6262

6363
tape( 'if provided 1.0, the function returns 1.0', function test( t ) {
6464
var y = cdf( 1.0 );
65-
t.equal( y, 1.0, 'returns 1.0');
65+
t.equal( y, 1.0, 'returns 1.0' );
6666
t.end();
6767
});
6868

@@ -74,7 +74,7 @@ tape( 'the function returns 0.5 for values in `[-1,1)`', function test( t ) {
7474
for ( i = 0; i < 1e3; i++ ) {
7575
k = ( randu()*2.0 ) - 1.0;
7676
p = cdf( k );
77-
t.equal( p, 0.5, 'returns 0.5');
77+
t.equal( p, 0.5, 'returns 0.5' );
7878
}
7979
t.end();
8080
});

lib/node_modules/@stdlib/stats/base/dists/rademacher/lib/index.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,15 @@ setReadOnly( rademacher, 'cdf', require( '@stdlib/stats/base/dists/rademacher/cd
5454
*/
5555
setReadOnly( rademacher, 'mean', require( '@stdlib/stats/base/dists/rademacher/mean' ) );
5656

57+
/**
58+
* @name median
59+
* @memberof rademacher
60+
* @readonly
61+
* @type {Function}
62+
* @see {@link module:@stdlib/stats/base/dists/rademacher/median}
63+
*/
64+
setReadOnly( rademacher, 'median', require( '@stdlib/stats/base/dists/rademacher/median' ) );
65+
5766
/**
5867
* @name pmf
5968
* @memberof rademacher

lib/node_modules/@stdlib/stats/base/dists/rademacher/mean/docs/repl.txt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
22
{{alias}}()
33
Returns the expected value of a Rademacher distribution.
44

5-
Parameters
6-
----------
7-
85
Returns
96
-------
107
out: number

lib/node_modules/@stdlib/stats/base/dists/rademacher/mean/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "@stdlib/stats/base/dists/bernoulli/mean",
2+
"name": "@stdlib/stats/base/dists/rademacher/mean",
33
"version": "0.0.0",
44
"description": "Rademacher distribution expected value.",
55
"license": "Apache-2.0",

lib/node_modules/@stdlib/stats/base/dists/rademacher/mean/test/test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ tape( 'main export is a function', function test( t ) {
3232
t.end();
3333
});
3434

35-
tape( 'The function returns 0.0', function test( t ) {
35+
tape( 'the function returns 0.0', function test( t ) {
3636
var y = mean();
3737
t.equal( y, 0.0, 'returns 0.0' );
3838
t.end();

lib/node_modules/@stdlib/stats/base/dists/rademacher/pmf/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ y = pmf( 1.0 );
6363
// returns 0.5
6464

6565
y = pmf( 0.4 );
66-
// returns 0
66+
// returns 0.0
6767
```
6868

6969
If provided `NaN`, the function returns `NaN`.

lib/node_modules/@stdlib/stats/base/dists/rademacher/pmf/benchmark/benchmark.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,7 @@
2323
var bench = require( '@stdlib/bench' );
2424
var randu = require( '@stdlib/random/base/randu' );
2525
var isnan = require( '@stdlib/math/base/assert/is-nan' );
26-
var pmf = require( '@stdlib/stats/base/dists/rademacher/pmf/lib' );
27-
var EPS = require( '@stdlib/constants/math/float64-eps' );
26+
var pmf = require( '@stdlib/stats/base/dists/rademacher/pmf' );
2827
var pkg = require( './../package.json' ).name;
2928

3029

@@ -37,15 +36,15 @@ bench( pkg, function benchmark( b ) {
3736

3837
b.tic();
3938
for ( i = 0; i < b.iterations; i++ ) {
40-
x = ( randu()*( 2.0 + EPS ) ) - 1.0;
39+
x = ( randu()*( 2.0 ) ) - 1.0;
4140
p = pmf( x );
4241
if ( isnan( p ) ) {
43-
b.fail( 'something went wrong' );
42+
b.fail( 'should not return NaN' );
4443
}
4544
}
4645
b.toc();
4746
if ( isnan( p ) ) {
48-
b.fail( 'something went wrong' );
47+
b.fail( 'should not return NaN' );
4948
}
5049
b.pass( 'benchmark finished' );
5150
b.end();

lib/node_modules/@stdlib/stats/base/dists/rademacher/pmf/docs/repl.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
{{alias}}( x )
33
Evaluates the probability mass function (PMF) for Rademacher distribution.
44

5-
If provided `NaN`, `+infinity`, or `-infinity`, the function returns `NaN`.
5+
If provided `NaN`, the function returns `NaN`.
66

77
If `x < -1.0` or `x > 1.0`, the function returns `NaN`.
88

@@ -13,8 +13,8 @@
1313

1414
Returns
1515
-------
16-
y: number
17-
Success probability.
16+
out: number
17+
Evaluated PMF.
1818

1919
Examples
2020
--------
@@ -23,7 +23,7 @@
2323
> y = {{alias}}( 1.0 )
2424
0.5
2525
> y = {{alias}}( 0.4 )
26-
0
26+
0.0
2727
> y = {{alias}}( NaN )
2828
NaN
2929
> y = {{alias}}( 1.2 )

lib/node_modules/@stdlib/stats/base/dists/rademacher/pmf/lib/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
* // returns 0.5
3434
*
3535
* y = pmf( 0.4 );
36-
* // returns 0
36+
* // returns 0.0
3737
*
3838
* y = pmf( NaN );
3939
* // returns NaN

lib/node_modules/@stdlib/stats/base/dists/rademacher/pmf/test/test.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,23 +38,23 @@ tape( 'main export is a function', function test( t ) {
3838

3939
tape( 'if provided `NaN`, the function returns `NaN`', function test( t ) {
4040
var y = pmf( NaN );
41-
t.equal( isnan( y ), true, 'returns NaN');
41+
t.equal( isnan( y ), true, 'returns NaN' );
4242
t.end();
4343
});
4444

4545
tape( 'if provided `+infinity` or `-infinity`, the function returns `NaN`', function test( t ) {
4646
var y = pmf( PINF );
47-
t.equal( isnan( y ), true, 'returns NaN');
47+
t.equal( isnan( y ), true, 'returns NaN' );
4848
y = pmf( NINF );
49-
t.equal( isnan( y ), true, 'returns NaN');
49+
t.equal( isnan( y ), true, 'returns NaN' );
5050
t.end();
5151
});
5252

5353
tape( 'if provided `-1` or `+1`, the function returns `0.5`', function test( t ) {
5454
var y = pmf( 1.0 );
55-
t.equal( y, 0.5, 'returns 0.5');
55+
t.equal( y, 0.5, 'returns 0.5' );
5656
y = pmf( -1.0 );
57-
t.equal( y, 0.5, 'returns 0.5');
57+
t.equal( y, 0.5, 'returns 0.5' );
5858
t.end();
5959
});
6060

@@ -66,7 +66,7 @@ tape( 'if provided a number between `-1` and `1`, the function returns `0.0`', f
6666
for ( i = 0; i < 1e3; i++ ) {
6767
x = ( randu()*2.0 ) - 1.0;
6868
y = pmf( x );
69-
t.equal( y, 0.0, 'returns 0.0');
69+
t.equal( y, 0.0, 'returns 0.0' );
7070
}
7171
t.end();
7272
});

0 commit comments

Comments
 (0)