Skip to content

Commit

Permalink
Auto-generated commit
Browse files Browse the repository at this point in the history
  • Loading branch information
stdlib-bot committed Dec 14, 2024
1 parent 9f8c437 commit e985a62
Show file tree
Hide file tree
Showing 20 changed files with 1,422 additions and 14 deletions.
1 change: 0 additions & 1 deletion .github/.keepalive

This file was deleted.

57 changes: 57 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,63 @@

> Package changelog.
<section class="release" id="unreleased">

## Unreleased (2024-12-14)

<section class="features">

### Features

- [`0fc07d1`](https://github.com/stdlib-js/stdlib/commit/0fc07d1722a3da70464b37d4de5f6a762468f85e) - add C implementation for `stats/base/dists/betaprime/skewness` [(#3462)](https://github.com/stdlib-js/stdlib/pull/3462)

</section>

<!-- /.features -->

<section class="issues">

### Closed Issues

This release closes the following issue:

[#3445](https://github.com/stdlib-js/stdlib/issues/3445)

</section>

<!-- /.issues -->

<section class="commits">

### Commits

<details>

- [`0fc07d1`](https://github.com/stdlib-js/stdlib/commit/0fc07d1722a3da70464b37d4de5f6a762468f85e) - **feat:** add C implementation for `stats/base/dists/betaprime/skewness` [(#3462)](https://github.com/stdlib-js/stdlib/pull/3462) _(by Aayush Khanna, Philipp Burckhardt, stdlib-bot)_

</details>

</section>

<!-- /.commits -->

<section class="contributors">

### Contributors

A total of 2 people contributed to this release. Thank you to the following contributors:

- Aayush Khanna
- Philipp Burckhardt

</section>

<!-- /.contributors -->

</section>

<!-- /.release -->

<section class="release" id="v0.2.2">

## 0.2.2 (2024-07-27)
Expand Down
21 changes: 12 additions & 9 deletions CONTRIBUTORS
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ Aayush Khanna <aayushiitbhu23@gmail.com>
Abhijit Raut <abhijitmraut8010@gmail.com>
Adarsh Palaskar <adarshpalaskar99@gmail.com>
Aditya Sapra <adityaework@gmail.com>
AgPriyanshu18 <113460573+AgPriyanshu18@users.noreply.github.com>
Ahmed Atwa <Ahmedatwa866@yahoo.com>
Ahmed Kashkoush <ahmedkashkoush464@gmail.com>
Aleksandr <112382387+alextes90@users.noreply.github.com>
Ali Salesi <ali_sal1381@yahoo.com>
Aman Bhansali <bhansali.1@iitj.ac.in>
Expand Down Expand Up @@ -51,6 +52,7 @@ Krishnendu Das <86651039+itskdhere@users.noreply.github.com>
Kshitij-Dale <152467202+Kshitij-Dale@users.noreply.github.com>
Lovelin <100030865+lovelindhoni@users.noreply.github.com>
Manik Sharma <maniksharma.rke@gmail.com>
Manvith M <148960168+manvith2003@users.noreply.github.com>
Marcus Fantham <mfantham@users.noreply.github.com>
Matt Cochrane <matthew.cochrane.eng@gmail.com>
Mihir Pandit <129577900+MSP20086@users.noreply.github.com>
Expand All @@ -60,32 +62,34 @@ Momtchil Momtchev <momtchil@momtchev.com>
Muhammad Haris <harriskhan047@outlook.com>
Naresh Jagadeesan <naresh.naresh000@gmail.com>
Neeraj Pathak <neerajrpathak710@gmail.com>
NightKnight <Ahmedatwa866@yahoo.com>
Nishant Shinde <97207366+nishant-s7@users.noreply.github.com>
Nithin Katta <88046362+nithinkatta@users.noreply.github.com>
Nourhan Hasan <109472010+TheNourhan@users.noreply.github.com>
Ognjen Jevremović <ognjenjevremovic@users.noreply.github.com>
Oneday12323 <107678750+Oneday12323@users.noreply.github.com>
Ori Miles <97595296+orimiles5@users.noreply.github.com>
Philipp Burckhardt <pburckhardt@outlook.com>
Prajwal Kulkarni <prajwalkulkarni76@gmail.com>
Pranav Goswami <goswami.4@iitj.ac.in>
Praneki <97080887+PraneGIT@users.noreply.github.com>
Pratik <97464067+Pratik772846@users.noreply.github.com>
Pratyush Kumar Chouhan <pratyushkumar0308@gmail.com>
Priyansh <88396544+itsspriyansh@users.noreply.github.com>
Priyanshu Agarwal <113460573+AgPriyanshu18@users.noreply.github.com>
Pushpendra Chandravanshi <pushpendrachandravanshi4@gmail.com>
RISHAV <115060907+rishav2404@users.noreply.github.com>
Raunak Kumar Gupta <raunakmodanwal321@gmail.com>
Rejoan Sardar <119718513+Rejoan-Sardar@users.noreply.github.com>
Ricky Reusser <rsreusser@gmail.com>
Ridam Garg <67867319+RidamGarg@users.noreply.github.com>
Rishav <115060907+rishav2404@users.noreply.github.com>
Robert Gislason <gztown2216@yahoo.com>
Roman Stetsyk <25715951+romanstetsyk@users.noreply.github.com>
Rutam <138517416+performant23@users.noreply.github.com>
Rutam Kathale <138517416+performant23@users.noreply.github.com>
Ruthwik Chikoti <145591715+ruthwikchikoti@users.noreply.github.com>
Ryan Seal <splrk@users.noreply.github.com>
Rylan Yang <137365285+rylany27@users.noreply.github.com>
Sai Srikar Dumpeti <80447788+the-r3aper7@users.noreply.github.com>
SarthakPaandey <145528240+SarthakPaandey@users.noreply.github.com>
Sarthak Paandey <145528240+SarthakPaandey@users.noreply.github.com>
Saurabh Singh <saurabhsraghuvanshi@gmail.com>
Seyyed Parsa Neshaei <spneshaei@users.noreply.github.com>
Shashank Shekhar Singh <shashankshekharsingh1205@gmail.com>
Expand All @@ -98,7 +102,7 @@ Snehil Shah <snehilshah.989@gmail.com>
Soumajit Chatterjee <121816890+soumajit23@users.noreply.github.com>
Spandan Barve <contact@marsian.dev>
Stephannie Jiménez Gacha <steff456@hotmail.com>
Suraj kumar <125961509+kumarsuraj212003@users.noreply.github.com>
Suraj Kumar <125961509+kumarsuraj212003@users.noreply.github.com>
Tirtadwipa Manunggal <tirtadwipa.manunggal@gmail.com>
Tudor Pagu <104032457+tudor-pagu@users.noreply.github.com>
Tufailahmed Bargir <142114244+Tufailahmed-Bargir@users.noreply.github.com>
Expand All @@ -108,12 +112,11 @@ UtkershBasnet <119008923+UtkershBasnet@users.noreply.github.com>
Vaibhav Patel <98279986+noobCoderVP@users.noreply.github.com>
Varad Gupta <varadgupta21@gmail.com>
Vinit Pandit <106718914+MeastroZI@users.noreply.github.com>
Vivek maurya <155618190+vivekmaurya001@users.noreply.github.com>
Xiaochuan Ye <tap91624@gmail.com>
Yaswanth Kosuru <116426380+yaswanthkosuru@users.noreply.github.com>
Yernar Yergaziyev <yernar.yergaziyev@erg.kz>
naveen <stupiddint@gmail.com>
nishant-s7 <97207366+nishant-s7@users.noreply.github.com>
olenkabilonizhka <62379231+olenkabilonizhka@users.noreply.github.com>
orimiles5 <97595296+orimiles5@users.noreply.github.com>
rainn <88160429+AmCodesLame@users.noreply.github.com>
rei2hu <reimu@reimu.ws>
yaswanth <116426380+yaswanthkosuru@users.noreply.github.com>
95 changes: 95 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,101 @@ for ( i = 0; i < 10; i++ ) {

<!-- /.examples -->

<!-- C interface documentation. -->

* * *

<section class="c">

## C APIs

<!-- Section to include introductory text. Make sure to keep an empty line after the intro `section` element and another before the `/section` close. -->

<section class="intro">

</section>

<!-- /.intro -->

<!-- C usage documentation. -->

<section class="usage">

### Usage

```c
#include "stdlib/stats/base/dists/betaprime/skewness.h"
```

#### stdlib_base_dists_betaprime_skewness( alpha, beta )

Returns the skewness of a beta prime distribution.

```c
double out = stdlib_base_dists_betaprime_skewness( 2.0, 4.0 );
// returns ~6.261
```

The function accepts the following arguments:

- **alpha**: `[in] double` first shape parameter.
- **beta**: `[in] double` second shape parameter.

```c
double stdlib_base_dists_betaprime_skewness( const double alpha, const double beta );
```
</section>
<!-- /.usage -->
<!-- C API usage notes. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
<section class="notes">
</section>
<!-- /.notes -->
<!-- C API usage examples. -->
<section class="examples">
### Examples
```c
#include "stdlib/stats/base/dists/betaprime/skewness.h"
#include <stdlib.h>
#include <stdio.h>
static double random_uniform( const double min, const double max ) {
double v = (double)rand() / ( (double)RAND_MAX + 1.0 );
return min + ( v * ( max - min ) );
}
int main( void ) {
double alpha;
double beta;
double y;
int i;
for ( i = 0; i < 25; i++ ) {
alpha = random_uniform( 0, 20 );
beta = random_uniform( 0, 20 ) + 3.0;
y = stdlib_base_dists_betaprime_skewness( alpha, beta );
printf( "α: %lf, β: %lf, skew(X;α,β): %lf\n", alpha, beta, y );
}
}
```

</section>

<!-- /.examples -->

</section>

<!-- /.c -->

<!-- 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. -->

<section class="references">
Expand Down
14 changes: 11 additions & 3 deletions benchmark/benchmark.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
// MODULES //

var bench = require( '@stdlib/bench-harness' );
var Float64Array = require( '@stdlib/array-float64' );
var randu = require( '@stdlib/random-base-randu' );
var isnan = require( '@stdlib/math-base-assert-is-nan' );
var EPS = require( '@stdlib/constants-float64-eps' );
Expand All @@ -33,14 +34,21 @@ var skewness = require( './../lib' );
bench( pkg, function benchmark( b ) {
var alpha;
var beta;
var len;
var y;
var i;

len = 100;
alpha = new Float64Array( len );
beta = new Float64Array( len );
for ( i = 0; i < len; i++ ) {
alpha[ i ] = ( randu() * 20.0 ) + EPS;
beta[ i ] = ( randu() * 20.0 ) + 3.0 + EPS;
}

b.tic();
for ( i = 0; i < b.iterations; i++ ) {
alpha = ( randu()*10.0 ) + EPS;
beta = ( randu()*10.0 ) + 3.0 + EPS;
y = skewness( alpha, beta );
y = skewness( alpha[ i % len ], beta[ i % len ] );
if ( isnan( y ) ) {
b.fail( 'should not return NaN' );
}
Expand Down
71 changes: 71 additions & 0 deletions benchmark/benchmark.native.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
/**
* @license Apache-2.0
*
* Copyright (c) 2024 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

'use strict';

// MODULES //

var resolve = require( 'path' ).resolve;
var bench = require( '@stdlib/bench-harness' );
var Float64Array = require( '@stdlib/array-float64' );
var tryRequire = require( '@stdlib/utils-try-require' );
var randu = require( '@stdlib/random-base-randu' );
var isnan = require( '@stdlib/math-base-assert-is-nan' );
var EPS = require( '@stdlib/constants-float64-eps' );
var pkg = require( './../package.json' ).name;


// VARIABLES //

var skewness = tryRequire( resolve( __dirname, './../lib/native.js' ) );
var opts = {
'skip': ( skewness instanceof Error )
};


// MAIN //

bench( pkg+'::native', opts, function benchmark( b ) {
var alpha;
var beta;
var len;
var y;
var i;

len = 100;
alpha = new Float64Array( len );
beta = new Float64Array( len );
for ( i = 0; i < len; i++ ) {
alpha[ i ] = ( randu() * 20.0 ) + EPS;
beta[ i ] = ( randu() * 20.0 ) + 3.0 + EPS;
}

b.tic();
for ( i = 0; i < b.iterations; i++ ) {
y = skewness( alpha[ i % len ], beta[ i % len ] );
if ( isnan( y ) ) {
b.fail( 'should not return NaN' );
}
}
b.toc();
if ( isnan( y ) ) {
b.fail( 'should not return NaN' );
}
b.pass( 'benchmark finished' );
b.end();
});
Loading

0 comments on commit e985a62

Please sign in to comment.