Skip to content

Commit f0b1c07

Browse files
committed
Auto-generated commit
1 parent 6de6c7e commit f0b1c07

File tree

19 files changed

+1328
-10
lines changed

19 files changed

+1328
-10
lines changed

.github/.keepalive

Lines changed: 0 additions & 1 deletion
This file was deleted.

CHANGELOG.md

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,25 @@
44
55
<section class="release" id="unreleased">
66

7-
## Unreleased (2025-04-07)
7+
## Unreleased (2025-05-06)
8+
9+
<section class="features">
10+
11+
### Features
12+
13+
- [`736fe31`](https://github.com/stdlib-js/stdlib/commit/736fe3118504faef9a2b6ac064debe426c8f9a24) - add C implementation for `stats/base/dists/lognormal/skewness` [(#4166)](https://github.com/stdlib-js/stdlib/pull/4166)
14+
15+
</section>
16+
17+
<!-- /.features -->
818

919
<section class="issues">
1020

1121
### Closed Issues
1222

13-
This release closes the following issue:
23+
A total of 2 issues were closed in this release:
1424

15-
[#4979](https://github.com/stdlib-js/stdlib/issues/4979)
25+
[#3757](https://github.com/stdlib-js/stdlib/issues/3757), [#4979](https://github.com/stdlib-js/stdlib/issues/4979)
1626

1727
</section>
1828

@@ -24,6 +34,7 @@ This release closes the following issue:
2434

2535
<details>
2636

37+
- [`736fe31`](https://github.com/stdlib-js/stdlib/commit/736fe3118504faef9a2b6ac064debe426c8f9a24) - **feat:** add C implementation for `stats/base/dists/lognormal/skewness` [(#4166)](https://github.com/stdlib-js/stdlib/pull/4166) _(by Manvith M, Philipp Burckhardt, stdlib-bot)_
2738
- [`ae08a29`](https://github.com/stdlib-js/stdlib/commit/ae08a29eb928357ae97532f0c3f398b0fef58ebd) - **bench:** refactor random number generation in `stats/base/dists/lognormal` [(#5164)](https://github.com/stdlib-js/stdlib/pull/5164) _(by Saurabh Singh)_
2839
- [`4a70790`](https://github.com/stdlib-js/stdlib/commit/4a707903dfef7c2b56216000165706497d19a251) - **style:** add missing spaces _(by Philipp Burckhardt)_
2940

@@ -37,8 +48,9 @@ This release closes the following issue:
3748

3849
### Contributors
3950

40-
A total of 2 people contributed to this release. Thank you to the following contributors:
51+
A total of 3 people contributed to this release. Thank you to the following contributors:
4152

53+
- Manvith M
4254
- Philipp Burckhardt
4355
- Saurabh Singh
4456

CONTRIBUTORS

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,15 +51,18 @@ Dorrin Sotoudeh <dorrinsotoudeh123@gmail.com>
5151
EuniceSim142 <77243938+EuniceSim142@users.noreply.github.com>
5252
Frank Kovacs <fran70kk@gmail.com>
5353
GK Bishnoi <gkishan1kyt@gmail.com>
54+
GURU PRASAD SHARMA <168292003+GURUPRASADSHARMA@users.noreply.github.com>
5455
Gaurav <gaurav70380@gmail.com>
5556
Gautam sharma <gautamkrishnasharma1@gmail.com>
57+
Girish Garg <garggirish2020@gmail.com>
5658
Golden Kumar <103646877+AuenKr@users.noreply.github.com>
5759
Gunj Joshi <gunjjoshi8372@gmail.com>
5860
Gururaj Gurram <gururajgurram1512@gmail.com>
5961
Haroon Rasheed <51189276+haroon26@users.noreply.github.com>
60-
Harsh <149176984+hrshya@users.noreply.github.com>
62+
Harsh <harshyadav6078@gmail.com>
6163
HarshaNP <96897754+GittyHarsha@users.noreply.github.com>
6264
Harshita Kalani <harshitakalani02@gmail.com>
65+
Hemang Choudhary <coehemang@gmail.com>
6366
Hemant M Mehta <92446645+hemantmm@users.noreply.github.com>
6467
Hridyanshu <124202756+HRIDYANSHU054@users.noreply.github.com>
6568
Jaimin Godhani <112328542+Jai0401@users.noreply.github.com>
@@ -77,15 +80,18 @@ Joris Labie <joris.labie1@gmail.com>
7780
Justin Dennison <justin1dennison@gmail.com>
7881
Justyn Shelby <96994781+ShelbyJustyn@users.noreply.github.com>
7982
Karan Anand <anandkarancompsci@gmail.com>
83+
Karan Yadav <77043443+karanBRAVO@users.noreply.github.com>
8084
Karthik Prakash <116057817+skoriop@users.noreply.github.com>
8185
Kaushikgtm <162317291+Kaushikgtm@users.noreply.github.com>
8286
Kavyansh-Bagdi <153486713+Kavyansh-Bagdi@users.noreply.github.com>
8387
Kohantika Nath <145763549+kohantikanath@users.noreply.github.com>
8488
Krishnam Agarwal <83017176+888krishnam@users.noreply.github.com>
8589
Krishnendu Das <86651039+itskdhere@users.noreply.github.com>
8690
Kshitij-Dale <152467202+Kshitij-Dale@users.noreply.github.com>
91+
Lalit Narayan Yadav <162928571+LalitNarayanYadav@users.noreply.github.com>
8792
Lovelin Dhoni J B <100030865+lovelindhoni@users.noreply.github.com>
8893
MANI <77221000+Eternity0207@users.noreply.github.com>
94+
Mahfuza Humayra Mohona <mhmohona@gmail.com>
8995
Manik Sharma <maniksharma.rke@gmail.com>
9096
Manvith M <148960168+manvith2003@users.noreply.github.com>
9197
Marcus Fantham <mfantham@users.noreply.github.com>
@@ -103,6 +109,7 @@ Naveen Kumar <stupiddint@gmail.com>
103109
Neeraj Pathak <neerajrpathak710@gmail.com>
104110
NirvedMishra <139633597+NirvedMishra@users.noreply.github.com>
105111
Nishant Shinde <97207366+nishant-s7@users.noreply.github.com>
112+
Nishant singh <38534128+Nishantsingh11@users.noreply.github.com>
106113
Nishchay Rajput <121144841+NishchayRajput@users.noreply.github.com>
107114
Nithin Katta <88046362+nithinkatta@users.noreply.github.com>
108115
Nourhan Hasan <109472010+TheNourhan@users.noreply.github.com>
@@ -118,6 +125,7 @@ Prashant Kumar Yadav <144602492+0PrashantYadav0@users.noreply.github.com>
118125
PrathamBhamare <164445568+PrathamBhamare@users.noreply.github.com>
119126
Pratik Singh <97464067+Pratik772846@users.noreply.github.com>
120127
Pratyush Kumar Chouhan <pratyushkumar0308@gmail.com>
128+
Pravesh Kunwar <praveshkunwar04@gmail.com>
121129
Priyansh Prajapati <88396544+itsspriyansh@users.noreply.github.com>
122130
Priyanshu Agarwal <113460573+AgPriyanshu18@users.noreply.github.com>
123131
Pulkit Gupta <65711278+pulkitgupta2@users.noreply.github.com>
@@ -174,12 +182,15 @@ Yaswanth Kosuru <116426380+yaswanthkosuru@users.noreply.github.com>
174182
Yernar Yergaziyev <yernar.yergaziyev@erg.kz>
175183
Yugal Kaushik <yugalkaushik14@gmail.com>
176184
Yuvi Mittal <128018763+yuvi-mittal@users.noreply.github.com>
185+
devshree-bhati <147095250+devshree-bhati@users.noreply.github.com>
177186
ditsu <170345142+ditsus@users.noreply.github.com>
178187
ekambains <bainsinbusiness@gmail.com>
179188
fadiothman22 <48636283+fadiothman22@users.noreply.github.com>
189+
iraandrushko <71790513+iraandrushko@users.noreply.github.com>
180190
lohithganni <116790357+lohithganni@users.noreply.github.com>
181191
olenkabilonizhka <62379231+olenkabilonizhka@users.noreply.github.com>
182192
pranav-1720 <123018993+pranav-1720@users.noreply.github.com>
183193
rahulrangers <127782777+rahulrangers@users.noreply.github.com>
184194
rainn <88160429+AmCodesLame@users.noreply.github.com>
185195
rei2hu <reimu@reimu.ws>
196+
zhanggy <geodaoyu@foxmail.com>

README.md

Lines changed: 90 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -167,13 +167,100 @@ for ( i = 0; i < 10; i++ ) {
167167

168168
<!-- /.examples -->
169169

170-
<!-- Section to include cited references. If references are included, add a horizontal rule *before* the section. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
170+
<!-- C interface documentation. -->
171171

172-
<section class="references">
172+
* * *
173+
174+
<section class="c">
175+
176+
## C APIs
177+
178+
<!-- Section to include introductory text. Make sure to keep an empty line after the intro `section` element and another before the `/section` close. -->
179+
180+
<section class="intro">
181+
182+
</section>
183+
184+
<!-- /.intro -->
185+
186+
<!-- C usage documentation. -->
187+
188+
<section class="usage">
189+
190+
### Usage
191+
192+
```c
193+
#include "stdlib/stats/base/dists/lognormal/skewness.h"
194+
```
195+
196+
#### stdlib_base_dists_lognormal_skewness( mu, sigma )
197+
198+
Returns the skewness for a lognormal distribution with location `mu` and scale `sigma`.
199+
200+
```c
201+
double out = stdlib_base_dists_lognormal_skewness( 0.0, 1.0 );
202+
// returns ~6.185
203+
```
204+
205+
The function accepts the following arguments:
206+
207+
- **mu**: `[in] double` location parameter.
208+
- **sigma**: `[in] double` scale parameter.
209+
210+
```c
211+
double stdlib_base_dists_lognormal_skewness( const double mu, const double sigma );
212+
```
213+
214+
</section>
215+
216+
<!-- /.usage -->
217+
218+
<!-- C API usage notes. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
219+
220+
<section class="notes">
221+
222+
</section>
223+
224+
<!-- /.notes -->
225+
226+
<!-- C API usage examples. -->
227+
228+
<section class="examples">
229+
230+
### Examples
231+
232+
```c
233+
#include "stdlib/stats/base/dists/lognormal/skewness.h"
234+
#include <stdlib.h>
235+
#include <stdio.h>
236+
237+
static double random_uniform( const double min, const double max ) {
238+
double v = (double)rand() / ( (double)RAND_MAX + 1.0 );
239+
return min + ( v*(max-min) );
240+
}
241+
242+
int main( void ) {
243+
double sigma;
244+
double mu;
245+
double y;
246+
int i;
247+
248+
for ( i = 0; i < 10; i++ ) {
249+
mu = random_uniform( -5.0, 5.0 );
250+
sigma = random_uniform( 0.1, 20.0 );
251+
y = stdlib_base_dists_lognormal_skewness( mu, sigma );
252+
printf("µ: %.4f, σ: %.4f, skew(X;µ,σ): %.4f\n", mu, sigma, y);
253+
}
254+
}
255+
```
256+
257+
</section>
258+
259+
<!-- /.examples -->
173260

174261
</section>
175262

176-
<!-- /.references -->
263+
<!-- /.c -->
177264

178265
<!-- Section for related `stdlib` packages. Do not manually edit this section, as it is automatically populated. -->
179266

benchmark/benchmark.native.js

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
/**
2+
* @license Apache-2.0
3+
*
4+
* Copyright (c) 2025 The Stdlib Authors.
5+
*
6+
* Licensed under the Apache License, Version 2.0 (the "License");
7+
* you may not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
18+
19+
'use strict';
20+
21+
// MODULES //
22+
23+
var resolve = require( 'path' ).resolve;
24+
var bench = require( '@stdlib/bench-harness' );
25+
var Float64Array = require( '@stdlib/array-float64' );
26+
var uniform = require( '@stdlib/random-base-uniform' );
27+
var isnan = require( '@stdlib/math-base-assert-is-nan' );
28+
var tryRequire = require( '@stdlib/utils-try-require' );
29+
var EPS = require( '@stdlib/constants-float64-eps' );
30+
var pkg = require( './../package.json' ).name;
31+
32+
33+
// VARIABLES //
34+
35+
var skewness = tryRequire( resolve( __dirname, './../lib/native.js' ) );
36+
var opts = {
37+
'skip': ( skewness instanceof Error )
38+
};
39+
40+
41+
// MAIN //
42+
43+
bench( pkg+'::native', opts, function benchmark( b ) {
44+
var sigma;
45+
var len;
46+
var mu;
47+
var y;
48+
var i;
49+
50+
len = 100;
51+
mu = new Float64Array( len );
52+
sigma = new Float64Array( len );
53+
for ( i = 0; i < len; i++ ) {
54+
mu[ i ] = uniform( -50.0, 50.0 );
55+
sigma[ i ] = uniform( EPS, 20.0 );
56+
}
57+
b.tic();
58+
for ( i = 0; i < b.iterations; i++ ) {
59+
y = skewness( mu[ i % len ], sigma[ i % len ] );
60+
if ( isnan( y ) ) {
61+
b.fail( 'should not return NaN' );
62+
}
63+
}
64+
b.toc();
65+
if ( isnan( y ) ) {
66+
b.fail( 'should not return NaN' );
67+
}
68+
b.pass( 'benchmark finished' );
69+
b.end();
70+
});

0 commit comments

Comments
 (0)