time-to-botec

Benchmark sampling in different programming languages
Log | Files | Refs | README

README.md (3258B)


      1 <!--
      2 
      3 @license Apache-2.0
      4 
      5 Copyright (c) 2018 The Stdlib Authors.
      6 
      7 Licensed under the Apache License, Version 2.0 (the "License");
      8 you may not use this file except in compliance with the License.
      9 You may obtain a copy of the License at
     10 
     11    http://www.apache.org/licenses/LICENSE-2.0
     12 
     13 Unless required by applicable law or agreed to in writing, software
     14 distributed under the License is distributed on an "AS IS" BASIS,
     15 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     16 See the License for the specific language governing permissions and
     17 limitations under the License.
     18 
     19 -->
     20 
     21 # Mode
     22 
     23 > [Degenerate][degenerate-distribution] distribution [mode][mode].
     24 
     25 <!-- Section to include introductory text. Make sure to keep an empty line after the intro `section` element and another before the `/section` close. -->
     26 
     27 <section class="intro">
     28 
     29 The [mode][mode] for a [degenerate][degenerate-distribution] random variable is
     30 
     31 <!-- <equation class="equation" label="eq:degenerate_mode" align="center" raw="\operatorname{Mode}\left( X \right) = \mu" alt="Mode for a degenerate distribution."> -->
     32 
     33 <div class="equation" align="center" data-raw-text="\operatorname{Mode}\left( X \right) = \mu" data-equation="eq:degenerate_mode">
     34     <img src="https://cdn.jsdelivr.net/gh/stdlib-js/stdlib@e1fbdee688c5409e4cc6b0cd06d90b1cd2abd67c/lib/node_modules/@stdlib/stats/base/dists/degenerate/mode/docs/img/equation_degenerate_mode.svg" alt="Mode for a degenerate distribution.">
     35     <br>
     36 </div>
     37 
     38 <!-- </equation> -->
     39 
     40 where `μ` is the constant value of the distribution.
     41 
     42 </section>
     43 
     44 <!-- /.intro -->
     45 
     46 <!-- Package usage documentation. -->
     47 
     48 <section class="usage">
     49 
     50 ## Usage
     51 
     52 ```javascript
     53 var mode = require( '@stdlib/stats/base/dists/degenerate/mode' );
     54 ```
     55 
     56 #### mode( mu )
     57 
     58 Returns the [mode][mode] of a [degenerate][degenerate-distribution] distribution with constant value `mu`.
     59 
     60 ```javascript
     61 var v = mode( 10.0 );
     62 // returns 10.0
     63 
     64 v = mode( -0.5 );
     65 // returns -0.5
     66 ```
     67 
     68 </section>
     69 
     70 <!-- /.usage -->
     71 
     72 <!-- Package usage notes. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
     73 
     74 <section class="notes">
     75 
     76 </section>
     77 
     78 <!-- /.notes -->
     79 
     80 <!-- Package usage examples. -->
     81 
     82 <section class="examples">
     83 
     84 ## Examples
     85 
     86 <!-- eslint no-undef: "error" -->
     87 
     88 ```javascript
     89 var randu = require( '@stdlib/random/base/randu' );
     90 var mode = require( '@stdlib/stats/base/dists/degenerate/mode' );
     91 
     92 var mu;
     93 var v;
     94 var i;
     95 
     96 for ( i = 0; i < 10; i++ ) {
     97     mu = randu();
     98     v = mode( mu );
     99     console.log( 'µ: %d, Mode(X;µ): %d', mu.toFixed( 4 ), v.toFixed( 4 ) );
    100 }
    101 ```
    102 
    103 </section>
    104 
    105 <!-- /.examples -->
    106 
    107 <!-- 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. -->
    108 
    109 <section class="references">
    110 
    111 </section>
    112 
    113 <!-- /.references -->
    114 
    115 <!-- Section for all links. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
    116 
    117 <section class="links">
    118 
    119 [degenerate-distribution]: https://en.wikipedia.org/wiki/Degenerate_distribution
    120 
    121 [mode]: https://en.wikipedia.org/wiki/Mode_%28statistics%29
    122 
    123 </section>
    124 
    125 <!-- /.links -->