Skip to content

Commit e845abb

Browse files
authored
update README.md
Signed-off-by: Harsh <[email protected]>
1 parent 7aee0da commit e845abb

File tree

1 file changed

+4
-31
lines changed
  • lib/node_modules/@stdlib/stats/incr/nanmape

1 file changed

+4
-31
lines changed

lib/node_modules/@stdlib/stats/incr/nanmape/README.md

Lines changed: 4 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,8 @@ m = accumulator();
111111
<!-- eslint no-undef: "error" -->
112112

113113
```javascript
114-
var randu = require( '@stdlib/random/base/randu' );
114+
var bernoulli = require( '@stdlib/random/base/bernoulli' );
115+
var uniform = require( '@stdlib/random/base/uniform' );
115116
var incrnanmape = require( '@stdlib/stats/incr/nanmape' );
116117

117118
var accumulator;
@@ -124,13 +125,8 @@ accumulator = incrnanmape();
124125

125126
// For each simulated datum, update the mean absolute percentage error...
126127
for ( i = 0; i < 100; i++ ) {
127-
if ( randu() < 0.2 ) {
128-
v1 = NaN;
129-
v2 = NaN;
130-
} else {
131-
v1 = ( randu()*100.0 ) + 50.0;
132-
v2 = ( randu()*100.0 ) + 50.0;
133-
}
128+
v1 = ( bernoulli( 0.8 ) < 1 ) ? NaN : uniform( -50.0, 50.0 );
129+
v2 = ( bernoulli( 0.8 ) < 1 ) ? NaN : uniform( -50.0, 50.0 );
134130
accumulator( v1, v2 );
135131
}
136132
console.log( accumulator() );
@@ -144,15 +140,6 @@ console.log( accumulator() );
144140

145141
<section class="related">
146142

147-
* * *
148-
149-
## See Also
150-
151-
- <span class="package-name">[`@stdlib/stats/incr/maape`][@stdlib/stats/incr/maape]</span><span class="delimiter">: </span><span class="description">compute the mean arctangent absolute percentage error (MAAPE) incrementally.</span>
152-
- <span class="package-name">[`@stdlib/stats/incr/mae`][@stdlib/stats/incr/mae]</span><span class="delimiter">: </span><span class="description">compute the mean absolute error (MAE) incrementally.</span>
153-
- <span class="package-name">[`@stdlib/stats/incr/mean`][@stdlib/stats/incr/mean]</span><span class="delimiter">: </span><span class="description">compute an arithmetic mean incrementally.</span>
154-
- <span class="package-name">[`@stdlib/stats/incr/mmape`][@stdlib/stats/incr/mmape]</span><span class="delimiter">: </span><span class="description">compute a moving mean absolute percentage error (MAPE) incrementally.</span>
155-
156143
</section>
157144

158145
<!-- /.related -->
@@ -161,20 +148,6 @@ console.log( accumulator() );
161148

162149
<section class="links">
163150

164-
[mean-absolute-percentage-error]: https://en.wikipedia.org/wiki/Mean_absolute_percentage_error
165-
166-
<!-- <related-links> -->
167-
168-
[@stdlib/stats/incr/maape]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/stats/incr/maape
169-
170-
[@stdlib/stats/incr/mae]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/stats/incr/mae
171-
172-
[@stdlib/stats/incr/mean]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/stats/incr/mean
173-
174-
[@stdlib/stats/incr/mmape]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/stats/incr/mmape
175-
176-
<!-- </related-links> -->
177-
178151
</section>
179152

180153
<!-- /.links -->

0 commit comments

Comments
 (0)