File tree Expand file tree Collapse file tree 4 files changed +5
-32
lines changed
lib/node_modules/@stdlib/stats/base/dists/erlang/entropy Expand file tree Collapse file tree 4 files changed +5
-32
lines changed Original file line number Diff line number Diff line change 22
33@license Apache-2.0
44
5- Copyright (c) 2024 The Stdlib Authors.
5+ Copyright (c) 2018 The Stdlib Authors.
66
77Licensed under the Apache License, Version 2.0 (the "License");
88you may not use this file except in compliance with the License.
@@ -182,8 +182,8 @@ double y = stdlib_base_dists_erlang_entropy( 1.0, 1.0 );
182182
183183The function accepts the following arguments:
184184
185- - ** k** : ` [in] double ` shape parameter
186- - ** lambda** : ` [in] double ` rate parameter
185+ - ** k** : ` [in] double ` shape parameter.
186+ - ** lambda** : ` [in] double ` rate parameter.
187187
188188``` c
189189double stdlib_base_dists_erlang_entropy ( const double k, const double lambda );
Original file line number Diff line number Diff line change @@ -110,7 +110,7 @@ static double benchmark( void ) {
110110
111111 t = tic ();
112112 for ( i = 0 ; i < ITERATIONS ; i ++ ) {
113- y = stdlib_base_dists_erlang_entropy ( k [ i % 100 ], lambda [ i % 100 ] );
113+ y = stdlib_base_dists_erlang_entropy ( k [ i % 100 ], lambda [ i % 100 ] );
114114 if ( y != y ) {
115115 printf ( "should not return NaN\n" );
116116 break ;
Original file line number Diff line number Diff line change @@ -28,6 +28,7 @@ var addon = require( './../src/addon.node' );
2828/**
2929* Returns the differential entropy of an Erlang distribution.
3030*
31+ * @private
3132* @param {PositiveInteger } k - shape parameter
3233* @param {PositiveNumber } lambda - rate parameter
3334* @returns {number } differential entropy
Original file line number Diff line number Diff line change 3434* @example
3535* double y = stdlib_base_dists_erlang_entropy( 1.0, 1.0 );
3636* // returns ~1.0
37- *
38- * @example
39- * double y = stdlib_base_dists_erlang_entropy( 4.0, 12.0 );
40- * // returns ~-0.462
41- *
42- * @example
43- * double y = stdlib_base_dists_erlang_entropy( 8.0, 2.0 );
44- * // returns ~1.723
45- *
46- * @example
47- * double y = stdlib_base_dists_erlang_entropy( 1.5, 2.0 );
48- * // returns NaN
49- *
50- * @example
51- * double y = stdlib_base_dists_erlang_entropy( 1.0, -0.1 );
52- * // returns NaN
53- *
54- * @example
55- * double y = stdlib_base_dists_erlang_entropy( -0.1, 1.0 );
56- * // returns NaN
57- *
58- * @example
59- * double y = stdlib_base_dists_erlang_entropy( 2.0, NaN );
60- * // returns NaN
61- *
62- * @example
63- * double y = stdlib_base_dists_erlang_entropy( NaN, 2.0 );
64- * // returns NaN
6537*/
6638double stdlib_base_dists_erlang_entropy ( const double k , const double lambda ) {
6739 if (
You can’t perform that action at this time.
0 commit comments