From 34e672081abd2d7ddb9c053633fb8e3b985eba65 Mon Sep 17 00:00:00 2001 From: Jaimin Godhani <21cs3025@rgipt.ac.in> Date: Wed, 6 Mar 2024 11:07:55 +0530 Subject: [PATCH 1/3] docs:improve README examples of namespace --- .../@stdlib/stats/base/dists/t/README.md | 19 ++++++++++++++++++- .../stats/base/dists/t/examples/index.js | 17 +++++++++++++++++ 2 files changed, 35 insertions(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/stats/base/dists/t/README.md b/lib/node_modules/@stdlib/stats/base/dists/t/README.md index 760e8c4838a4..3ba17d4fd406 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/t/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/t/README.md @@ -109,9 +109,26 @@ var y = dist.cdf( 0.5 ); ```javascript var objectKeys = require( '@stdlib/utils/keys' ); -var t = require( '@stdlib/stats/base/dists/t' ); +var t = require( './../lib' ); console.log( objectKeys( t ) ); + +// Example usage of specific functions from the t namespace +var degreesOfFreedom = 3; +var xValue = 1.5; + +// Evaluate the probability density function (PDF) at a specific value +var pdfResult = t.pdf( xValue, degreesOfFreedom ); +console.log( 'PDF at x = ' + xValue + ': ' + pdfResult ); + +// Evaluate the cumulative distribution function (CDF) at a specific value +var cdfResult = t.cdf( xValue, degreesOfFreedom ); +console.log( 'CDF at x = ' + xValue + ': ' + cdfResult ); + +// Get the mean and variance of the t distribution +var meanValue = t.mean( degreesOfFreedom ); +var varianceValue = t.variance( degreesOfFreedom ); +console.log( 'Mean: ' + meanValue + ', Variance: ' + varianceValue ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/t/examples/index.js b/lib/node_modules/@stdlib/stats/base/dists/t/examples/index.js index d530c58876e7..8e756c1ae4e7 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/t/examples/index.js +++ b/lib/node_modules/@stdlib/stats/base/dists/t/examples/index.js @@ -22,3 +22,20 @@ var objectKeys = require( '@stdlib/utils/keys' ); var t = require( './../lib' ); console.log( objectKeys( t ) ); + +// Example usage of specific functions from the t namespace +var degreesOfFreedom = 3; +var xValue = 1.5; + +// Evaluate the probability density function (PDF) at a specific value +var pdfResult = t.pdf( xValue, degreesOfFreedom ); +console.log( 'PDF at x = ' + xValue + ': ' + pdfResult ); + +// Evaluate the cumulative distribution function (CDF) at a specific value +var cdfResult = t.cdf( xValue, degreesOfFreedom ); +console.log( 'CDF at x = ' + xValue + ': ' + cdfResult ); + +// Get the mean and variance of the t distribution +var meanValue = t.mean( degreesOfFreedom ); +var varianceValue = t.variance( degreesOfFreedom ); +console.log( 'Mean: ' + meanValue + ', Variance: ' + varianceValue ); From 1965b3dca21e80ca366aa975830aa9e68341b845 Mon Sep 17 00:00:00 2001 From: Jaimin Godhani <21cs3025@rgipt.ac.in> Date: Wed, 6 Mar 2024 11:12:16 +0530 Subject: [PATCH 2/3] docs:improve README examples of t namespace --- lib/node_modules/@stdlib/stats/base/dists/t/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/stats/base/dists/t/README.md b/lib/node_modules/@stdlib/stats/base/dists/t/README.md index 3ba17d4fd406..266012fe8d26 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/t/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/t/README.md @@ -109,7 +109,7 @@ var y = dist.cdf( 0.5 ); ```javascript var objectKeys = require( '@stdlib/utils/keys' ); -var t = require( './../lib' ); +var t = require( '@stdlib/stats/base/dists/t' ); console.log( objectKeys( t ) ); From 2fd5d3f4b044180f8f4b041d374f38321ac46d48 Mon Sep 17 00:00:00 2001 From: Jaimin Godhani <21cs3025@rgipt.ac.in> Date: Wed, 6 Mar 2024 17:43:10 +0530 Subject: [PATCH 3/3] chore: done-required-changes-for-improving-readme-examples-in-t-namespace --- .../@stdlib/stats/base/dists/t/README.md | 28 ++++++++----------- .../stats/base/dists/t/examples/index.js | 28 ++++++++----------- 2 files changed, 24 insertions(+), 32 deletions(-) diff --git a/lib/node_modules/@stdlib/stats/base/dists/t/README.md b/lib/node_modules/@stdlib/stats/base/dists/t/README.md index 266012fe8d26..6296626ef11f 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/t/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/t/README.md @@ -108,27 +108,23 @@ var y = dist.cdf( 0.5 ); ```javascript -var objectKeys = require( '@stdlib/utils/keys' ); var t = require( '@stdlib/stats/base/dists/t' ); -console.log( objectKeys( t ) ); +var dof = 3; +var x = 1.5; -// Example usage of specific functions from the t namespace -var degreesOfFreedom = 3; -var xValue = 1.5; +// Evaluate the probability density function (PDF) at a specific value: +var res = t.pdf( x, dof ); +console.log( 'PDF at x = ' + x + ': ' + res ); -// Evaluate the probability density function (PDF) at a specific value -var pdfResult = t.pdf( xValue, degreesOfFreedom ); -console.log( 'PDF at x = ' + xValue + ': ' + pdfResult ); +// Evaluate the cumulative distribution function (CDF) at a specific value: +res = t.cdf( x, dof ); +console.log( 'CDF at x = ' + x + ': ' + res ); -// Evaluate the cumulative distribution function (CDF) at a specific value -var cdfResult = t.cdf( xValue, degreesOfFreedom ); -console.log( 'CDF at x = ' + xValue + ': ' + cdfResult ); - -// Get the mean and variance of the t distribution -var meanValue = t.mean( degreesOfFreedom ); -var varianceValue = t.variance( degreesOfFreedom ); -console.log( 'Mean: ' + meanValue + ', Variance: ' + varianceValue ); +// Get the mean and variance of the t distribution: +var mu = t.mean( dof ); +var v = t.variance( dof ); +console.log( 'Mean: ' + mu + ', Variance: ' + v ); ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/t/examples/index.js b/lib/node_modules/@stdlib/stats/base/dists/t/examples/index.js index 8e756c1ae4e7..1f3c9d477aee 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/t/examples/index.js +++ b/lib/node_modules/@stdlib/stats/base/dists/t/examples/index.js @@ -18,24 +18,20 @@ 'use strict'; -var objectKeys = require( '@stdlib/utils/keys' ); var t = require( './../lib' ); -console.log( objectKeys( t ) ); +var dof = 3; +var x = 1.5; -// Example usage of specific functions from the t namespace -var degreesOfFreedom = 3; -var xValue = 1.5; +// Evaluate the probability density function (PDF) at a specific value: +var res = t.pdf( x, dof ); +console.log( 'PDF at x = ' + x + ': ' + res ); -// Evaluate the probability density function (PDF) at a specific value -var pdfResult = t.pdf( xValue, degreesOfFreedom ); -console.log( 'PDF at x = ' + xValue + ': ' + pdfResult ); +// Evaluate the cumulative distribution function (CDF) at a specific value: +res = t.cdf( x, dof ); +console.log( 'CDF at x = ' + x + ': ' + res ); -// Evaluate the cumulative distribution function (CDF) at a specific value -var cdfResult = t.cdf( xValue, degreesOfFreedom ); -console.log( 'CDF at x = ' + xValue + ': ' + cdfResult ); - -// Get the mean and variance of the t distribution -var meanValue = t.mean( degreesOfFreedom ); -var varianceValue = t.variance( degreesOfFreedom ); -console.log( 'Mean: ' + meanValue + ', Variance: ' + varianceValue ); +// Get the mean and variance of the t distribution: +var mu = t.mean( dof ); +var v = t.variance( dof ); +console.log( 'Mean: ' + mu + ', Variance: ' + v );