README.md (3519B)
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 # Skewness 22 23 > [Exponential][exponential-distribution] distribution [skewness][skewness]. 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 [skewness][skewness] for an [exponential][exponential-distribution] random variable with rate parameter `λ` is 30 31 <!-- <equation class="equation" label="eq:exponential_skewness" align="center" raw="\operatorname{skew}\left( X \right) = 2" alt="Skewness for an exponential distribution."> --> 32 33 <div class="equation" align="center" data-raw-text="\operatorname{skew}\left( X \right) = 2" data-equation="eq:exponential_skewness"> 34 <img src="https://cdn.jsdelivr.net/gh/stdlib-js/stdlib@51534079fef45e990850102147e8945fb023d1d0/lib/node_modules/@stdlib/stats/base/dists/exponential/skewness/docs/img/equation_exponential_skewness.svg" alt="Skewness for an exponential distribution."> 35 <br> 36 </div> 37 38 <!-- </equation> --> 39 40 </section> 41 42 <!-- /.intro --> 43 44 <!-- Package usage documentation. --> 45 46 <section class="usage"> 47 48 ## Usage 49 50 ```javascript 51 var skewness = require( '@stdlib/stats/base/dists/exponential/skewness' ); 52 ``` 53 54 #### skewness( lambda ) 55 56 Returns the [skewness][skewness] of an [exponential][exponential-distribution] distribution with rate parameter `lambda`. 57 58 ```javascript 59 var v = skewness( 9.0 ); 60 // returns 2.0 61 62 v = skewness( 0.5 ); 63 // returns 2.0 64 ``` 65 66 If provided `lambda < 0`, the function returns `NaN`. 67 68 ```javascript 69 var v = skewness( -1.0 ); 70 // returns NaN 71 ``` 72 73 </section> 74 75 <!-- /.usage --> 76 77 <!-- Package usage notes. Make sure to keep an empty line after the `section` element and another before the `/section` close. --> 78 79 <section class="notes"> 80 81 </section> 82 83 <!-- /.notes --> 84 85 <!-- Package usage examples. --> 86 87 <section class="examples"> 88 89 ## Examples 90 91 <!-- eslint no-undef: "error" --> 92 93 ```javascript 94 var randu = require( '@stdlib/random/base/randu' ); 95 var round = require( '@stdlib/math/base/special/round' ); 96 var skewness = require( '@stdlib/stats/base/dists/exponential/skewness' ); 97 98 var lambda; 99 var v; 100 var i; 101 102 for ( i = 0; i < 10; i++ ) { 103 lambda = randu() * 20.0; 104 v = skewness( lambda ); 105 console.log( 'λ: %d, skew(X;λ): %d', lambda.toFixed( 4 ), v.toFixed( 4 ) ); 106 } 107 ``` 108 109 </section> 110 111 <!-- /.examples --> 112 113 <!-- 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. --> 114 115 <section class="references"> 116 117 </section> 118 119 <!-- /.references --> 120 121 <!-- Section for all links. Make sure to keep an empty line after the `section` element and another before the `/section` close. --> 122 123 <section class="links"> 124 125 [exponential-distribution]: https://en.wikipedia.org/wiki/Exponential_distribution 126 127 [skewness]: https://en.wikipedia.org/wiki/Skewness 128 129 </section> 130 131 <!-- /.links -->