Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fréchet distribution kurtosis.

License

NotificationsYou must be signed in to change notification settings

stdlib-js/stats-base-dists-frechet-kurtosis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

61 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
About stdlib...

We believe in a future in which the web is a preferred environment for numerical computation. To help realize this future, we've built stdlib. stdlib is a standard library, with an emphasis on numerical and scientific computation, written in JavaScript (and C) for execution in browsers and in Node.js.

The library is fully decomposable, being architected in such a way that you can swap out and mix and match APIs and functionality to cater to your exact preferences and use cases.

When you use stdlib, you can be absolutely certain that you are using the most thorough, rigorous, well-written, studied, documented, tested, measured, and high-quality code out there.

To join us in bringing numerical computing to the web, get started by checking us out onGitHub, and please considerfinancially supporting stdlib. We greatly appreciate your continued support!

Kurtosis

NPM versionBuild StatusCoverage Status

Fréchet distributionkurtosis.

Theexcess kurtosis for aFréchet random variable shapeα > 0, scales > 0, and location parameterm is

$$\mathop{\mathrm{Kurt}} = \begin{cases} -6+{\frac{\Gamma \left(1-{\frac{4}{\alpha }}\right)-4\Gamma \left(1-{\frac{3}{\alpha }}\right)\Gamma \left(1-{\frac{1}{\alpha }}\right)+3\Gamma^{2}\left(1-{\frac{2}{\alpha }}\right)}{\left[\Gamma \left(1-{\frac{2}{\alpha }}\right)-\Gamma^{2}\left(1-{\frac{1}{\alpha }}\right)\right]^{2}}} & {\text{ for }}\alpha >4\\\ \infty & \text{ otherwise }\end{cases}$$

whereΓ is thegamma function.

Installation

npm install @stdlib/stats-base-dists-frechet-kurtosis

Alternatively,

  • To load the package in a website via ascript tag without installation and bundlers, use theES Module available on theesm branch (seeREADME).
  • If you are using Deno, visit thedeno branch (seeREADME for usage intructions).
  • For use in Observable, or in browser/node environments, use theUniversal Module Definition (UMD) build available on theumd branch (seeREADME).

Thebranches.md file summarizes the available branches and displays a diagram illustrating their relationships.

To view installation and usage instructions specific to each branch build, be sure to explicitly navigate to the respective README files on each branch, as linked to above.

Usage

varkurtosis=require('@stdlib/stats-base-dists-frechet-kurtosis');

kurtosis( alpha, s, m )

Returns theexcess kurtosis for aFréchet distribution with shapealpha > 0, scales > 0, and location parameterm.

vary=kurtosis(5.0,1.0,1.0);// returns ~45.092y=kurtosis(5.0,10.0,1.0);// returns ~45.092y=kurtosis(5.0,1.0,2.0);// returns ~45.092

If0 < alpha <= 4, the function returns+Infinity.

vary=kurtosis(2.5,1.0,1.0);// returns Infinity

If providedNaN as any argument, the function returnsNaN.

vary=kurtosis(NaN,1.0,-2.0);// returns NaNy=kurtosis(1.0,NaN,-2.0);// returns NaNy=kurtosis(1.0,1.0,NaN);// returns NaN

If providedalpha <= 0, the function returnsNaN.

vary=kurtosis(0.0,3.0,2.0);// returns NaNy=kurtosis(0.0,-1.0,2.0);// returns NaN

If provideds <= 0, the function returnsNaN.

vary=kurtosis(1.0,0.0,2.0);// returns NaNy=kurtosis(1.0,-1.0,2.0);// returns NaN

Examples

varrandu=require('@stdlib/random-base-randu');varEPS=require('@stdlib/constants-float64-eps');varkurtosis=require('@stdlib/stats-base-dists-frechet-kurtosis');varalpha;varm;vars;vary;vari;for(i=0;i<10;i++){alpha=(randu()*20.0)+EPS;s=(randu()*20.0)+EPS;m=(randu()*40.0)-20.0;y=kurtosis(alpha,s,m);console.log('α: %d, s: %d, m: %d, Kurt(X;α,s,m): %d',alpha.toFixed(4),s.toFixed(4),m.toFixed(4),y.toFixed(4));}

C APIs

Usage

#include"stdlib/stats/base/dists/frechet/kurtosis.h"

stdlib_base_dists_frechet_kurtosis( alpha, s, m )

Returns the excess kurtosis for a Fréchet distribution with shapealpha, scales, and locationm.

doubley=stdlib_base_dists_frechet_kurtosis(5.0,2.0,0.0 );// returns ~45.092

The function accepts the following arguments:

  • alpha:[in] double shape parameter.
  • s:[in] double scale parameter.
  • m:[in] double location parameter.
doublestdlib_base_dists_frechet_kurtosis(constdoublealpha,constdoubles,constdoublem );

Examples

#include"stdlib/stats/base/dists/frechet/kurtosis.h"#include"stdlib/constants/float64/eps.h"#include<stdlib.h>#include<stdio.h>staticdoublerandom_uniform(constdoublemin,constdoublemax ) {doublev= (double)rand() / ( (double)RAND_MAX+1.0 );returnmin+ (v*(max-min) );}intmain(void ) {doublealpha;doubles;doublem;doubley;inti;for (i=0;i<10;i++ ) {alpha=random_uniform(STDLIB_CONSTANT_FLOAT64_EPS,20.0 );s=random_uniform(STDLIB_CONSTANT_FLOAT64_EPS,20.0 );m=random_uniform(-40.0,-20.0 );y=stdlib_base_dists_frechet_kurtosis(alpha,s,m );printf("α: %.4lf, s: %.4lf, m: %.4lf, Kurt(X;α,s,m): %.4lf\n",alpha,s,m,y );    }}

Notice

This package is part ofstdlib, a standard library for JavaScript and Node.js, with an emphasis on numerical and scientific computing. The library provides a collection of robust, high performance libraries for mathematics, statistics, streams, utilities, and more.

For more information on the project, filing bug reports and feature requests, and guidance on how to developstdlib, see the main projectrepository.

Community

Chat


License

SeeLICENSE.

Copyright

Copyright © 2016-2025. The StdlibAuthors.

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp