From 87b43c1ca4e199fd7fcbc5be55162cf031c1edb2 Mon Sep 17 00:00:00 2001 From: Wahyu Date: Tue, 12 Mar 2024 23:48:47 +0700 Subject: [PATCH 1/2] update: update README.md @stdlib/stats/base/dists/signrank --- .../stats/base/dists/signrank/README.md | 103 +++++++++++++++++- 1 file changed, 101 insertions(+), 2 deletions(-) diff --git a/lib/node_modules/@stdlib/stats/base/dists/signrank/README.md b/lib/node_modules/@stdlib/stats/base/dists/signrank/README.md index 4889aee9fb5c..d235492a9a37 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/signrank/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/signrank/README.md @@ -30,10 +30,17 @@ limitations under the License. var signrank = require( '@stdlib/stats/base/dists/signrank' ); ``` -#### signrank +### Signrank Distribution of the Wilcoxon signed rank test statistic. +The Wilcoxon distribution is a discrete, bell-shaped, non-negative distribution, which describes the distribution of the U-statistic in the Mann-Whitney-Wilcoxon Rank-Sum test when comparing two unpaired samples drawn from the same arbitrary distribution. The rank-sum test is perhaps the most commonly used non-parametric significance test in statistics to detect when one distribution is stochastically greater (or not-equal) to another without making assumption that the underlying distributions are normally distributed. + +Reference:
+- [Wikipedia](https://en.wikipedia.org/wiki/Wilcoxon_signed-rank_test)
+- [Analytica](https://docs.analytica.com/index.php/Wilcoxon_Distribution) + + ```javascript var dist = signrank; // returns {...} @@ -63,8 +70,9 @@ The namespace contains the following distribution functions: - + +### Object Keys ```javascript var objectKeys = require( '@stdlib/utils/keys' ); var signrank = require( '@stdlib/stats/base/dists/signrank' ); @@ -72,6 +80,97 @@ var signrank = require( '@stdlib/stats/base/dists/signrank' ); console.log( objectKeys( signrank ) ); ``` +### Cumulative Distribution Function (CDF) +```javascript +var cdf = require( '@stdlib/stats/base/dists/signrank/cdf' ); +``` +#### cdf( x, n ) + +Evaluates the [cumulative distribution function][cdf] of the Wilcoxon signed rank test statistic with `n` observations. + +```javascript +var y = cdf( 7.0, 9 ); +// returns ~0.037 + +y = cdf( 7.0, 6 ); +// returns ~0.281 + +y = cdf( -1.0, 40 ); +// returns 0.0 +``` + +#### cdf.factory( n ) + +Returns a function for evaluating the [cumulative distribution function][cdf] of the Wilcoxon signed rank test statistic with `n` observations. + +```javascript +var mycdf = cdf.factory( 8 ); +var y = mycdf( 3.9 ); +// returns ~0.027 + +y = mycdf( 17.0 ); +// returns ~0.473 +``` + +### Probability Distribution Function (PDF) +```javascript +var pdf = require( '@stdlib/stats/base/dists/signrank/pdf' ); +``` +#### pdf( x, n ) +Evaluates the [probability density function][pdf] of the Wilcoxon signed rank test statistic with `n` observations. +```javascript +var y = pdf( 7.0, 9 ); +// returns ~0.0098 + +y = pdf( 7.0, 6 ); +// returns ~0.063 + +y = pdf( -1.0, 40 ); +// returns 0.0 +``` + +#### pdf.factory( n ) +Returns a function for evaluating the [probability density function][pdf] of the Wilcoxon signed rank test statistic with `n` observations. +```javascript +var mypdf = pdf.factory( 8 ); +var y = mypdf( 4.0 ); +// returns ~0.008 + +y = mypdf( 17.0 ); +// returns ~0.051 +``` + +### Quantile Function +```javascript +var quantile = require( '@stdlib/stats/base/dists/signrank/quantile' ); +``` +#### quantile( p, n ) + +Evaluates the [quantile function][quantile-function] for the Wilcoxon signed rank test statistic with `n` observations. + +```javascript +var y = quantile( 0.8, 5 ); +// returns 11 + +y = quantile( 0.5, 3 ); +// returns 3 +``` + +#### quantile.factory( n ) + +Returns a function for evaluating the [quantile function][quantile-function] of the Wilcoxon signed rank test statistic with `n` observations. + +```javascript +var myQuantile = quantile.factory( 8 ); + +var y = myQuantile( 0.4 ); +// returns 16 + +y = myQuantile( 1.0 ); +// returns 36 +``` + + From 97688791138c14e3c285c87b9bec3c28b3e7ba84 Mon Sep 17 00:00:00 2001 From: Wahyu Date: Tue, 12 Mar 2024 23:52:03 +0700 Subject: [PATCH 2/2] update: revert the #### signrank line --- lib/node_modules/@stdlib/stats/base/dists/signrank/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/stats/base/dists/signrank/README.md b/lib/node_modules/@stdlib/stats/base/dists/signrank/README.md index d235492a9a37..995719d2df80 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/signrank/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/signrank/README.md @@ -30,7 +30,7 @@ limitations under the License. var signrank = require( '@stdlib/stats/base/dists/signrank' ); ``` -### Signrank +#### signrank Distribution of the Wilcoxon signed rank test statistic.