Skip to content

Commit 6efb60b

Browse files
committed
chore: apply suggestions from review
--- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: passed - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed ---
1 parent 6f952de commit 6efb60b

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

lib/node_modules/@stdlib/stats/base/dists/bradford/pdf/lib/factory.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,14 @@ var log1p = require( '@stdlib/math/base/special/log1p' );
4242
* // returns ~0.465
4343
*/
4444
function factory( c ) {
45+
var k;
4546
if (
4647
isnan( c ) ||
4748
c <= 0.0
4849
) {
4950
return constantFunction( NaN );
5051
}
52+
k = log1p( c );
5153
return pdf;
5254

5355
/**
@@ -62,7 +64,6 @@ function factory( c ) {
6264
* // returns <number>
6365
*/
6466
function pdf( x ) {
65-
var k;
6667
if (
6768
isnan( x )
6869
) {
@@ -72,8 +73,7 @@ function factory( c ) {
7273
// Support of the Bradford distribution: [0,1]
7374
return 0.0;
7475
}
75-
k = log1p( c );
76-
return c / ( ( 1.0 + ( c * x ) ) * k );
76+
return c / ( ( 1.0 + ( c*x ) ) * k );
7777
}
7878
}
7979

lib/node_modules/@stdlib/stats/base/dists/bradford/pdf/lib/main.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ var log1p = require( '@stdlib/math/base/special/log1p' );
2727
// MAIN //
2828

2929
/**
30-
* Returns the probability density function (PDF) for a Bradford distribution with shape parameter `c` at a value `x`.
30+
* Evaluates the probability density function (PDF) for a Bradford distribution with shape parameter `c` at a value `x`.
3131
*
3232
* @param {number} x - input value
3333
* @param {PositiveNumber} c - shape parameter
@@ -83,7 +83,7 @@ function pdf( x, c ) {
8383
return 0.0;
8484
}
8585
k = log1p( c );
86-
return c / ( ( 1.0 + ( c * x ) ) * k );
86+
return c / ( ( 1.0 + ( c*x ) ) * k );
8787
}
8888

8989

0 commit comments

Comments
 (0)