Skip to content

Commit 4d7f36c

Browse files
authored
chore: apply suggestions from code review
Signed-off-by: Philipp Burckhardt <[email protected]>
1 parent e615052 commit 4d7f36c

File tree

3 files changed

+9
-10
lines changed

3 files changed

+9
-10
lines changed

lib/node_modules/@stdlib/stats/base/dists/gamma/logpdf/benchmark/benchmark.native.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ var resolve = require( 'path' ).resolve;
2424
var bench = require( '@stdlib/bench' );
2525
var Float64Array = require( '@stdlib/array/float64' );
2626
var tryRequire = require( '@stdlib/utils/try-require' );
27-
var randu = require( '@stdlib/random/base/randu' );
27+
var uniform = require( '@stdlib/random/base/uniform' );
2828
var isnan = require( '@stdlib/math/base/assert/is-nan' );
2929
var EPS = require( '@stdlib/constants/float64/eps' );
3030
var pkg = require( './../package.json' ).name;
@@ -53,9 +53,9 @@ bench( pkg+'::native', opts, function benchmark( b ) {
5353
alpha = new Float64Array( len );
5454
beta = new Float64Array( len );
5555
for ( i = 0; i < len; i++ ) {
56-
x[ i ] = ( randu()*100.0 ) + EPS;
57-
alpha[ i ] = ( randu()*100.0 ) + EPS;
58-
beta[ i ] = ( randu()*100.0 ) + EPS;
56+
x[ i ] = uniform( EPS, 100.0 );
57+
alpha[ i ] = uniform( EPS, 100.0 );
58+
beta[ i ] = uniform( EPS, 100.0 );
5959
}
6060

6161
b.tic();

lib/node_modules/@stdlib/stats/base/dists/gamma/logpdf/examples/c/example.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,6 @@ int main( void ) {
3737
alpha = random_uniform( 0.0, 20.0 );
3838
beta = random_uniform( 0.0, 20.0 );
3939
y = stdlib_base_dists_gamma_logpdf( x, alpha, beta );
40-
printf( "x: %lf, α: %lf, β: %lf, ln(f(x;α,β)):: %lf\n", x, alpha, beta, y );
40+
printf( "x: %lf, α: %lf, β: %lf, ln(f(x;α,β)): %lf\n", x, alpha, beta, y );
4141
}
4242
}

lib/node_modules/@stdlib/stats/base/dists/gamma/logpdf/src/main.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,9 @@
4444
/**
4545
* Computes `(z^a)*(e^-z) / gamma(a)`.
4646
*
47-
* @private
4847
* @param a input value
4948
* @param z input value
50-
* @returns function value
49+
* @return function value
5150
*/
5251
static double regularised_gamma_prefix( const double a, const double z ) {
5352
double prefix;
@@ -127,10 +126,9 @@ static double regularised_gamma_prefix( const double a, const double z ) {
127126
/**
128127
* Calculates the partial derivative with respect to x of the incomplete gamma function.
129128
*
130-
* @private
131129
* @param a function parameter
132130
* @param x function parameter
133-
* @returns function value
131+
* @return function value
134132
*/
135133
static double gamma_p_derivative( const double a, const double x ) {
136134
double f1;
@@ -165,11 +163,12 @@ static double gamma_p_derivative( const double a, const double x ) {
165163
// MAIN //
166164

167165
/**
166+
* Evaluates the logarithm of the probability density function (PDF) for a gamma distribution with shape parameter `alpha` and rate parameter `beta` at a value `x`.
168167
*
169168
* @param x input value
170169
* @param alpha shape parameter
171170
* @param beta rate parameter
172-
* @returns evaluated logPDF
171+
* @return evaluated logPDF
173172
*
174173
* @example
175174
* double y = stdlib_base_dists_gamma_logpdf( 2.0, 0.5, 1.0 );

0 commit comments

Comments
 (0)