README.md (3982B)
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 # Kurtosis 22 23 > [Student's t][t-distribution] distribution [excess kurtosis][kurtosis]. 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 [excess kurtosis][kurtosis] for a [Student's t][t-distribution] random variable with degrees of freedom `ν` is 30 31 <!-- <equation class="equation" label="eq:t_kurtosis" align="center" raw="\operatorname{Kurt}\left( X \right) = \begin{cases} \frac{6}{\nu-4} & \text{ for } \nu > 2 \\ \infty & \text{ for } 2 < \nu \le 4 \end{cases}" alt="Excess kurtosis for a Student's t distribution."> --> 32 33 <div class="equation" align="center" data-raw-text="\operatorname{Kurt}\left( X \right) = \begin{cases} \frac{6}{\nu-4} & \text{ for } \nu > 2 \\ \infty & \text{ for } 2 < \nu \le 4 \end{cases}" data-equation="eq:t_kurtosis"> 34 <img src="https://cdn.jsdelivr.net/gh/stdlib-js/stdlib@51534079fef45e990850102147e8945fb023d1d0/lib/node_modules/@stdlib/stats/base/dists/t/kurtosis/docs/img/equation_t_kurtosis.svg" alt="Excess kurtosis for a Student's t distribution."> 35 <br> 36 </div> 37 38 <!-- </equation> --> 39 40 For `ν` smaller than two, the kurtosis is not defined. 41 42 </section> 43 44 <!-- /.intro --> 45 46 <!-- Package usage documentation. --> 47 48 <section class="usage"> 49 50 ## Usage 51 52 ```javascript 53 var kurtosis = require( '@stdlib/stats/base/dists/t/kurtosis' ); 54 ``` 55 56 #### kurtosis( v ) 57 58 Returns the [excess kurtosis][kurtosis] of a [Student's t][t-distribution] distribution with degrees of freedom `v`. 59 60 ```javascript 61 var y = kurtosis( 9.0 ); 62 // returns 1.2 63 64 y = kurtosis( 4.5 ); 65 // returns 12.0 66 ``` 67 68 If provided `2 < v <= 4`, the function returns `infinity`. 69 70 ```javascript 71 var y = kurtosis( 3.5 ); 72 // returns Infinity 73 74 y = kurtosis( 2.9 ); 75 // returns Infinity 76 77 y = kurtosis( 4.0 ); 78 // returns Infinity 79 ``` 80 81 If provided `v <= 2`, the function returns `NaN`. 82 83 ```javascript 84 var y = kurtosis( -1.0 ); 85 // returns NaN 86 87 y = kurtosis( 0.8 ); 88 // returns NaN 89 90 y = kurtosis( 2.0 ); 91 // returns NaN 92 ``` 93 94 </section> 95 96 <!-- /.usage --> 97 98 <!-- Package usage notes. Make sure to keep an empty line after the `section` element and another before the `/section` close. --> 99 100 <section class="notes"> 101 102 </section> 103 104 <!-- /.notes --> 105 106 <!-- Package usage examples. --> 107 108 <section class="examples"> 109 110 ## Examples 111 112 <!-- eslint no-undef: "error" --> 113 114 ```javascript 115 var randu = require( '@stdlib/random/base/randu' ); 116 var round = require( '@stdlib/math/base/special/round' ); 117 var kurtosis = require( '@stdlib/stats/base/dists/t/kurtosis' ); 118 119 var v; 120 var y; 121 var i; 122 123 for ( i = 0; i < 10; i++ ) { 124 v = randu() * 20.0; 125 y = kurtosis( v ); 126 console.log( 'v: %d, Kurt(X,v): %d', v.toFixed( 4 ), y.toFixed( 4 ) ); 127 } 128 ``` 129 130 </section> 131 132 <!-- /.examples --> 133 134 <!-- 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. --> 135 136 <section class="references"> 137 138 </section> 139 140 <!-- /.references --> 141 142 <!-- Section for all links. Make sure to keep an empty line after the `section` element and another before the `/section` close. --> 143 144 <section class="links"> 145 146 [t-distribution]: https://en.wikipedia.org/wiki/Student%27s_t-distribution 147 148 [kurtosis]: https://en.wikipedia.org/wiki/Kurtosis 149 150 </section> 151 152 <!-- /.links -->