File tree Expand file tree Collapse file tree
lib/node_modules/@stdlib/math/base/dist/lognormal/pdf Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22
33// MODULES //
44
5+ var constantFunction = require ( '@stdlib/utils/constant-function' ) ;
56var isnan = require ( '@stdlib/math/base/assert/is-nan' ) ;
67var sqrt = require ( '@stdlib/math/base/special/sqrt' ) ;
78var exp = require ( '@stdlib/math/base/special/exp' ) ;
89var pow = require ( '@stdlib/math/base/special/pow' ) ;
910var ln = require ( '@stdlib/math/base/special/ln' ) ;
1011var PI = require ( '@stdlib/math/constants/float64-pi' ) ;
11- var nan = require ( './nan.js' ) ;
1212
1313
1414// MAIN //
@@ -37,7 +37,7 @@ function factory( mu, sigma ) {
3737 isnan ( sigma ) ||
3838 sigma <= 0.0
3939 ) {
40- return nan ;
40+ return constantFunction ( NaN ) ;
4141 }
4242 s2 = pow ( sigma , 2.0 ) ;
4343 A = 1.0 / ( sqrt ( 2.0 * s2 * PI ) ) ;
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -23,24 +23,31 @@ var PI = require( '@stdlib/math/constants/float64-pi' );
2323* @example
2424* var y = pdf( 2.0, 0.0, 1.0 );
2525* // returns ~0.157
26+ *
2627* @example
2728* var y = pdf( 1.0, 0.0, 1.0 );
2829* // returns ~0.399
30+ *
2931* @example
3032* var y = pdf( 1.0, 3.0, 1.0 );
3133* // returns ~0.004
34+ *
3235* @example
3336* var y = pdf( -1.0, 4.0, 2.0 );
3437* // returns 0.0
38+ *
3539* @example
3640* var y = pdf( NaN, 0.0, 1.0 );
3741* // returns NaN
42+ *
3843* @example
3944* var y = pdf( 0.0, NaN, 1.0 );
4045* // returns NaN
46+ *
4147* @example
4248* var y = pdf( 0.0, 0.0, NaN );
4349* // returns NaN
50+ *
4451* @example
4552* // Negative scale parameter:
4653* var y = pdf( 2.0, 0.0, -1.0 );
Original file line number Diff line number Diff line change 3030 " gaussian" ,
3131 " pdf" ,
3232 " density function" ,
33- " density"
33+ " density" ,
34+ " normal" ,
35+ " lognormal" ,
36+ " log" ,
37+ " logarithm" ,
38+ " ln" ,
39+ " natural"
3440 ],
3541 "bugs" : {
3642 "url" : " https://github.com/stdlib-js/stdlib/issues"
You can’t perform that action at this time.
0 commit comments