-
-
Notifications
You must be signed in to change notification settings - Fork 823
docs: improve README examples for stats/base/dists/t
namespace
#1728
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docs: improve README examples for stats/base/dists/t
namespace
#1728
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👋 Hi there! 👋
And thank you for opening your first pull request! We will review it shortly. 🏃 💨
console.log( objectKeys( t ) ); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
console.log( objectKeys( t ) ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should remove the utils/keys
import.
console.log( objectKeys( t ) ); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
console.log( objectKeys( t ) ); |
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 ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 ); | |
var dof = 3; | |
var x = 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 cumulative distribution function (CDF) at a specific value: | |
res = t.cdf( x, dof ); | |
console.log( 'CDF at x = ' + x + ': ' + res ); | |
// 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 ); |
Follow project conventions in preferring shorter variable names.
stats/base/dists/t
namespacestats/base/dists/t
namespace
@kgryte Thank you for your feedback! I have addressed all the issues you mentioned in your review. Please take a look at the changes, and let me know if everything looks good now. If you have any further suggestions or concerns, feel free to share them. Thanks again! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks alright; let's land this change. Thanks!
PR-URL: stdlib-js#1728 Closes: stdlib-js#1645 Reviewed-by: Athan Reines <[email protected]> Reviewed-by: Philipp Burckhardt <[email protected]>
PR-URL: stdlib-js#1728 Closes: stdlib-js#1645 Reviewed-by: Athan Reines <[email protected]> Reviewed-by: Philipp Burckhardt <[email protected]>
Resolves #1645
Description
This pull request:
Improve README examples of
stats/base/dists/t
namespaceRelated Issues
This pull request:
stats/base/dists/t
namespace #1645Questions
No.
Other
No.
Checklist
@stdlib-js/reviewers