README.md (3419B)
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 # Standard Deviation 22 23 > [Degenerate][degenerate-distribution] distribution [standard deviation][standard-deviation]. 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 [variance][standard-deviation] for a [degenerate][degenerate-distribution] random variable is 30 31 <!-- <equation class="equation" label="eq:degenerate_stdev" align="center" raw="\operatorname{SD}\left( X \right) = 0" alt="Standard deviation for a degenerate distribution."> --> 32 33 <div class="equation" align="center" data-raw-text="\operatorname{SD}\left( X \right) = 0" data-equation="eq:degenerate_stdev"> 34 <img src="https://cdn.jsdelivr.net/gh/stdlib-js/stdlib@e1fbdee688c5409e4cc6b0cd06d90b1cd2abd67c/lib/node_modules/@stdlib/stats/base/dists/degenerate/stdev/docs/img/equation_degenerate_stdev.svg" alt="Standard deviation 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 stdev = require( '@stdlib/stats/base/dists/degenerate/stdev' ); 54 ``` 55 56 #### stdev( mu ) 57 58 Returns the [standard deviation][standard-deviation] of a [degenerate][degenerate-distribution] distribution with constant value `mu`. 59 60 ```javascript 61 var v = stdev( 10.0 ); 62 // returns 0.0 63 64 v = stdev( -0.5 ); 65 // returns 0.0 66 67 v = stdev( NaN ); 68 // returns NaN 69 ``` 70 71 </section> 72 73 <!-- /.usage --> 74 75 <!-- Package usage notes. Make sure to keep an empty line after the `section` element and another before the `/section` close. --> 76 77 <section class="notes"> 78 79 </section> 80 81 <!-- /.notes --> 82 83 <!-- Package usage examples. --> 84 85 <section class="examples"> 86 87 ## Examples 88 89 <!-- eslint no-undef: "error" --> 90 91 ```javascript 92 var randu = require( '@stdlib/random/base/randu' ); 93 var stdev = require( '@stdlib/stats/base/dists/degenerate/stdev' ); 94 95 var mu; 96 var v; 97 var i; 98 99 for ( i = 0; i < 10; i++ ) { 100 mu = randu(); 101 v = stdev( mu ); 102 console.log( 'µ: %d, SD(X;µ): %d', mu.toFixed( 4 ), v.toFixed( 4 ) ); 103 } 104 ``` 105 106 </section> 107 108 <!-- /.examples --> 109 110 <!-- 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. --> 111 112 <section class="references"> 113 114 </section> 115 116 <!-- /.references --> 117 118 <!-- Section for all links. Make sure to keep an empty line after the `section` element and another before the `/section` close. --> 119 120 <section class="links"> 121 122 [degenerate-distribution]: https://en.wikipedia.org/wiki/Degenerate_distribution 123 124 [standard-deviation]: https://en.wikipedia.org/wiki/Standard_deviation 125 126 </section> 127 128 <!-- /.links -->