Kurtosis

Hypergeometric distribution excess kurtosis.

Imagine a scenario with a population of size N, of which a subpopulation of size K can be considered successes. We draw n observations from the total population. Defining the random variable X as the number of successes in the n draws, X is said to follow a hypergeometric distribution. The excess kurtosis for a hypergeometric random variable is

Usage

var kurtosis = require( '@stdlib/math/base/dists/hypergeometric/kurtosis' );

kurtosis( N, K, n )

Returns the excess kurtosis of a hypergeometric distribution with parameters N (population size), K (subpopulation size), and n (number of draws).

var v = kurtosis( 16, 11, 4 );
// returns ~-0.326

v = kurtosis( 4, 2, 2 );
// returns 0.0

If provided NaN as any argument, the function returns NaN.

var v = kurtosis( NaN, 10, 4 );
// returns NaN

v = kurtosis( 20, NaN, 4 );
// returns NaN

v = kurtosis( 20, 10, NaN );
// returns NaN

If provided a population size N, subpopulation size K, or draws n which is not a nonnegative integer, the function returns NaN.

var v = kurtosis( 10.5, 5, 2 );
// returns NaN

v = kurtosis( 10, 1.5, 2 );
// returns NaN

v = kurtosis( 10, 5, -2.0 );
// returns NaN

If the number of draws n or the subpopulation size K exceed population size N, the function returns NaN.

var v = kurtosis( 10, 5, 12 );
// returns NaN

v = kurtosis( 10, 12, 5 );
// returns NaN

Examples

var randu = require( '@stdlib/random/base/randu' );
var round = require( '@stdlib/math/base/special/round' );
var kurtosis = require( '@stdlib/math/base/dists/hypergeometric/kurtosis' );

var v;
var i;
var N;
var K;
var n;

for ( i = 0; i < 10; i++ ) {
N = round( randu() * 20 );
K = round( randu() * N );
n = round( randu() * K );
v = kurtosis( N, K, n );
console.log( 'N: %d, K: %d, n: %d, Kurt(X;N,K,n): %d', N, K, n, v.toFixed( 4 ) );
}
{"ft_lang_label":"__label__en","ft_lang_prob":0.53317034,"math_prob":0.99779147,"size":1843,"snap":"2019-43-2019-47","text_gpt3_token_len":607,"char_repetition_ratio":0.20663404,"word_repetition_ratio":0.1382353,"special_character_ratio":0.34129137,"punctuation_ratio":0.22055137,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9996438,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2019-10-22T21:16:53Z\",\"WARC-Record-ID\":\"<urn:uuid:345ff3b8-04c9-4c61-95fb-6f55ab56fd5a>\",\"Content-Length\":\"567750\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:a5d5f08b-caad-4fb6-8f88-c92e60467cc0>\",\"WARC-Concurrent-To\":\"<urn:uuid:4fe3b637-4972-440b-bb3e-176728035877>\",\"WARC-IP-Address\":\"45.79.190.132\",\"WARC-Target-URI\":\"https://stdlib.io/develop/docs/api/@stdlib/math/base/dists/hypergeometric/kurtosis/\",\"WARC-Payload-Digest\":\"sha1:B2SSTALLAO7MURRWDKO3Z3SHRVSSPAKF\",\"WARC-Block-Digest\":\"sha1:D6WAVVWONF33FX73WEST3ONPZAMDJ5SZ\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2019/CC-MAIN-2019-43/CC-MAIN-2019-43_segments_1570987824701.89_warc_CC-MAIN-20191022205851-20191022233351-00027.warc.gz\"}"}