Skip to content

Commit c69eda1

Browse files
committed
Auto-generated commit
1 parent 76e574a commit c69eda1

File tree

32 files changed

+250
-349
lines changed

32 files changed

+250
-349
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3524,6 +3524,9 @@ A total of 558 issues were closed in this release:
35243524

35253525
<details>
35263526

3527+
- [`6fe0761`](https://github.com/stdlib-js/stdlib/commit/6fe0761c9b399fae0e81992d5dda665cebaee019) - **docs:** replace manual `for` loop in examples [(#9055)](https://github.com/stdlib-js/stdlib/pull/9055) _(by Harsh Yadav)_
3528+
- [`d57045f`](https://github.com/stdlib-js/stdlib/commit/d57045fec3f0dab1790f3926fd31604724c81540) - **chore:** minor clean-up _(by Philipp Burckhardt)_
3529+
- [`d61ac9c`](https://github.com/stdlib-js/stdlib/commit/d61ac9c7ba00677bfde2c2fbc039db20ef9b2ce2) - **docs:** fix README sections _(by Athan Reines)_
35273530
- [`8e9cdba`](https://github.com/stdlib-js/stdlib/commit/8e9cdba2577c9ef6b349c091450ef90f96e70a77) - **docs:** update examples [(#9270)](https://github.com/stdlib-js/stdlib/pull/9270) _(by stdlib-bot)_
35283531
- [`975697c`](https://github.com/stdlib-js/stdlib/commit/975697c99f123dbf8ca5943c877dd6d99740af02) - **docs:** update return annotations to use ndarray instance notation for `stats/range` [(#9246)](https://github.com/stdlib-js/stdlib/pull/9246) _(by Samarth Kolarkar)_
35293532
- [`ea2e468`](https://github.com/stdlib-js/stdlib/commit/ea2e468ba5638502b1b59cf5d946ba065fae9f7e) - **docs:** update examples [(#9239)](https://github.com/stdlib-js/stdlib/pull/9239) _(by stdlib-bot)_

base/dists/arcsine/logpdf/README.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -247,12 +247,6 @@ int main( void ) {
247247

248248
</section>
249249

250-
<!-- Section for related `stdlib` packages. Do not manually edit this section, as it is automatically populated. -->
251-
252-
<section class="related">
253-
254-
</section>
255-
256250
<!-- /.related -->
257251

258252
<!-- Section for all links. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->

base/dists/geometric/cdf/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,14 +222,14 @@ int main( void ) {
222222

223223
<!-- /.c -->
224224

225-
<!-- /.references -->
226-
227225
<!-- Section to include cited references. If references are included, add a horizontal rule *before* the section. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
228226

229227
<section class="references">
230228

231229
</section>
232230

231+
<!-- /.references -->
232+
233233
<!-- Section for related `stdlib` packages. Do not manually edit this section, as it is automatically populated. -->
234234

235235
<section class="related">

base/dists/normal/cdf/README.md

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -126,22 +126,18 @@ y = mycdf( 8.0 );
126126
<!-- eslint no-undef: "error" -->
127127

128128
```javascript
129-
var randu = require( '@stdlib/random/base/randu' );
129+
var uniform = require( '@stdlib/random/array/uniform' );
130+
var logEachMap = require( '@stdlib/console/log-each-map' );
130131
var cdf = require( '@stdlib/stats/base/dists/normal/cdf' );
131132

132-
var sigma;
133-
var mu;
134-
var x;
135-
var y;
136-
var i;
137-
138-
for ( i = 0; i < 10; i++ ) {
139-
x = randu() * 10.0;
140-
mu = (randu() * 10.0) - 5.0;
141-
sigma = randu() * 20.0;
142-
y = cdf( x, mu, sigma );
143-
console.log( 'x: %d, µ: %d, σ: %d, F(x;µ,σ): %d', x, mu, sigma, y );
144-
}
133+
var opts = {
134+
'dtype': 'float64'
135+
};
136+
var sigma = uniform( 10, 0.0, 20.0, opts );
137+
var mu = uniform( 10, -5.0, 5.0, opts );
138+
var x = uniform( 10, 0.0, 10.0, opts );
139+
140+
logEachMap( 'x: %0.4f, µ: %0.4f, σ: %0.4f, F(x;µ,σ): %0.4f', x, mu, sigma, cdf );
145141
```
146142

147143
</section>

base/dists/normal/cdf/examples/index.js

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,15 @@
1818

1919
'use strict';
2020

21-
var randu = require( '@stdlib/random/base/randu' );
21+
var uniform = require( '@stdlib/random/array/uniform' );
22+
var logEachMap = require( '@stdlib/console/log-each-map' );
2223
var cdf = require( './../lib' );
2324

24-
var sigma;
25-
var mu;
26-
var x;
27-
var y;
28-
var i;
25+
var opts = {
26+
'dtype': 'float64'
27+
};
28+
var sigma = uniform( 10, 0.0, 20.0, opts );
29+
var mu = uniform( 10, -5.0, 5.0, opts );
30+
var x = uniform( 10, 0.0, 10.0, opts );
2931

30-
for ( i = 0; i < 10; i++ ) {
31-
x = randu() * 10.0;
32-
mu = (randu() * 10.0) - 5.0;
33-
sigma = randu() * 20.0;
34-
y = cdf( x, mu, sigma );
35-
console.log( 'x: %d, µ: %d, σ: %d, F(x;µ,σ): %d', x, mu, sigma, y );
36-
}
32+
logEachMap( 'x: %0.4f, µ: %0.4f, σ: %0.4f, F(x;µ,σ): %0.4f', x, mu, sigma, cdf );

base/dists/normal/entropy/README.md

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -108,20 +108,17 @@ y = entropy( 0.0, -1.0 );
108108
<!-- eslint no-undef: "error" -->
109109

110110
```javascript
111-
var randu = require( '@stdlib/random/base/randu' );
111+
var uniform = require( '@stdlib/random/array/uniform' );
112+
var logEachMap = require( '@stdlib/console/log-each-map' );
112113
var entropy = require( '@stdlib/stats/base/dists/normal/entropy' );
113114

114-
var sigma;
115-
var mu;
116-
var y;
117-
var i;
115+
var opts = {
116+
'dtype': 'float64'
117+
};
118+
var sigma = uniform( 10, 0.0, 20.0, opts );
119+
var mu = uniform( 10, -5.0, 5.0, opts );
118120

119-
for ( i = 0; i < 10; i++ ) {
120-
mu = ( randu()*10.0 ) - 5.0;
121-
sigma = randu() * 20.0;
122-
y = entropy( mu, sigma );
123-
console.log( 'µ: %d, σ: %d, h(X;µ,σ): %d', mu.toFixed( 4 ), sigma.toFixed( 4 ), y.toFixed( 4 ) );
124-
}
121+
logEachMap( 'µ: %0.4f, σ: %0.4f, h(X;µ,σ): %0.4f', mu, sigma, entropy );
125122
```
126123

127124
</section>

base/dists/normal/entropy/examples/index.js

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,14 @@
1818

1919
'use strict';
2020

21-
var randu = require( '@stdlib/random/base/randu' );
21+
var uniform = require( '@stdlib/random/array/uniform' );
22+
var logEachMap = require( '@stdlib/console/log-each-map' );
2223
var entropy = require( './../lib' );
2324

24-
var sigma;
25-
var mu;
26-
var y;
27-
var i;
25+
var opts = {
26+
'dtype': 'float64'
27+
};
28+
var sigma = uniform( 10, 0.0, 20.0, opts );
29+
var mu = uniform( 10, -5.0, 5.0, opts );
2830

29-
for ( i = 0; i < 10; i++ ) {
30-
mu = ( randu()*10.0 ) - 5.0;
31-
sigma = randu() * 20.0;
32-
y = entropy( mu, sigma );
33-
console.log( 'µ: %d, σ: %d, h(X;µ,σ): %d', mu.toFixed( 4 ), sigma.toFixed( 4 ), y.toFixed( 4 ) );
34-
}
31+
logEachMap( 'µ: %0.4f, σ: %0.4f, h(X;µ,σ): %0.4f', mu, sigma, entropy );

base/dists/normal/kurtosis/README.md

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -108,20 +108,17 @@ y = kurtosis( 0.0, -1.0 );
108108
<!-- eslint no-undef: "error" -->
109109

110110
```javascript
111-
var randu = require( '@stdlib/random/base/randu' );
111+
var uniform = require( '@stdlib/random/array/uniform' );
112+
var logEachMap = require( '@stdlib/console/log-each-map' );
112113
var kurtosis = require( '@stdlib/stats/base/dists/normal/kurtosis' );
113114

114-
var sigma;
115-
var mu;
116-
var y;
117-
var i;
115+
var opts = {
116+
'dtype': 'float64'
117+
};
118+
var sigma = uniform( 10, 0.0, 20.0, opts );
119+
var mu = uniform( 10, -5.0, 5.0, opts );
118120

119-
for ( i = 0; i < 10; i++ ) {
120-
mu = ( randu()*10.0 ) - 5.0;
121-
sigma = randu() * 20.0;
122-
y = kurtosis( mu, sigma );
123-
console.log( 'µ: %d, σ: %d, Kurt(X;µ,σ): %d', mu.toFixed( 4 ), sigma.toFixed( 4 ), y.toFixed( 4 ) );
124-
}
121+
logEachMap( 'µ: %0.4f, σ: %0.4f, Kurt(X;µ,σ): %0.4f', mu, sigma, kurtosis );
125122
```
126123

127124
</section>

base/dists/normal/kurtosis/examples/index.js

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,14 @@
1818

1919
'use strict';
2020

21-
var randu = require( '@stdlib/random/base/randu' );
21+
var uniform = require( '@stdlib/random/array/uniform' );
22+
var logEachMap = require( '@stdlib/console/log-each-map' );
2223
var kurtosis = require( './../lib' );
2324

24-
var sigma;
25-
var mu;
26-
var y;
27-
var i;
25+
var opts = {
26+
'dtype': 'float64'
27+
};
28+
var sigma = uniform( 10, 0.0, 20.0, opts );
29+
var mu = uniform( 10, -5.0, 5.0, opts );
2830

29-
for ( i = 0; i < 10; i++ ) {
30-
mu = ( randu()*10.0 ) - 5.0;
31-
sigma = randu() * 20.0;
32-
y = kurtosis( mu, sigma );
33-
console.log( 'µ: %d, σ: %d, Kurt(X;µ,σ): %d', mu.toFixed( 4 ), sigma.toFixed( 4 ), y.toFixed( 4 ) );
34-
}
31+
logEachMap( 'µ: %0.4f, σ: %0.4f, Kurt(X;µ,σ): %0.4f', mu, sigma, kurtosis );

base/dists/normal/logcdf/README.md

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -106,22 +106,18 @@ y = mylogcdf( 5.0 );
106106
<!-- eslint no-undef: "error" -->
107107

108108
```javascript
109-
var randu = require( '@stdlib/random/base/randu' );
109+
var uniform = require( '@stdlib/random/array/uniform' );
110+
var logEachMap = require( '@stdlib/console/log-each-map' );
110111
var logcdf = require( '@stdlib/stats/base/dists/normal/logcdf' );
111112

112-
var sigma;
113-
var mu;
114-
var x;
115-
var y;
116-
var i;
117-
118-
for ( i = 0; i < 10; i++ ) {
119-
x = randu() * 10.0;
120-
mu = (randu() * 10.0) - 5.0;
121-
sigma = randu() * 20.0;
122-
y = logcdf( x, mu, sigma );
123-
console.log( 'x: %d, µ: %d, σ: %d, ln(F(x;µ,σ)): %d', x, mu, sigma, y );
124-
}
113+
var opts = {
114+
'dtype': 'float64'
115+
};
116+
var sigma = uniform( 10, 0.0, 20.0, opts );
117+
var mu = uniform( 10, -5.0, 5.0, opts );
118+
var x = uniform( 10, 0.0, 10.0, opts );
119+
120+
logEachMap( 'x: %0.4f, µ: %0.4f, σ: %0.4f, ln(F(x;µ,σ)): %0.4f', x, mu, sigma, logcdf );
125121
```
126122

127123
</section>

0 commit comments

Comments
 (0)