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 Oct 13, 2024
1 parent ba41c96 commit 538b4d0
Show file tree
Hide file tree
Showing 5 changed files with 145 additions and 7 deletions.
1 change: 0 additions & 1 deletion .github/.keepalive

This file was deleted.

73 changes: 71 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,78 @@
<section class="release" id="unreleased">

## Unreleased (2024-10-01)
## Unreleased (2024-10-13)

No changes reported for this release.
<section class="packages">

### Packages

<section class="package" id="stats-base-dists-cosine-unreleased">

#### [@stdlib/stats/base/dists/cosine](https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/stats/base/dists/cosine)

<details>

<section class="issues">

##### Closed Issues

This release closes the following issue:

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

</section>

<!-- /.issues -->

</details>

</section>

<!-- /.package -->

</section>

<!-- /.packages -->

<section class="issues">

### Closed Issues

This release closes the following issue:

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

</section>

<!-- /.issues -->

<section class="contributors">

### Contributors

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

- Kohantika Nath
- Philipp Burckhardt

</section>

<!-- /.contributors -->

<section class="commits">

### Commits

<details>

- [`e5b993a`](https://github.com/stdlib-js/stdlib/commit/e5b993a1b314d478be07dabc12a7b349872e4427) - **docs:** improve README examples of `stats/base/dists/cosine` namespace [(#2669)](https://github.com/stdlib-js/stdlib/pull/2669) _(by Kohantika Nath, Kohantika Nath, Philipp Burckhardt)_

</details>

</section>

<!-- /.commits -->

</section>

Expand Down
2 changes: 2 additions & 0 deletions CONTRIBUTORS
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ EuniceSim142 <77243938+EuniceSim142@users.noreply.github.com>
Frank Kovacs <fran70kk@gmail.com>
Golden Kumar <103646877+AuenKr@users.noreply.github.com>
Gunj Joshi <gunjjoshi8372@gmail.com>
Gururaj Gurram <143020143+gururaj1512@users.noreply.github.com>
HarshaNP <96897754+GittyHarsha@users.noreply.github.com>
Harshita Kalani <harshitakalani02@gmail.com>
Hridyanshu <124202756+HRIDYANSHU054@users.noreply.github.com>
Expand Down Expand Up @@ -94,6 +95,7 @@ Tudor Pagu <104032457+tudor-pagu@users.noreply.github.com>
Tufailahmed Bargir <142114244+Tufailahmed-Bargir@users.noreply.github.com>
Utkarsh <http://utkarsh11105@gmail.com>
Utkarsh Raj <rajutkarsh2505@gmail.com>
UtkershBasnet <119008923+UtkershBasnet@users.noreply.github.com>
Vaibhav Patel <98279986+noobCoderVP@users.noreply.github.com>
Varad Gupta <varadgupta21@gmail.com>
Xiaochuan Ye <tap91624@gmail.com>
Expand Down
38 changes: 36 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,10 +141,44 @@ var y = dist.cdf( 0.5 );
<!-- eslint no-undef: "error" -->

```javascript
var objectKeys = require( '@stdlib/utils-keys' );
var cosine = require( '@stdlib/stats-base-dists-cosine' );

console.log( objectKeys( cosine ) );
// Create a raised cosine distribution:
var mu = 2.0;
var s = 1.5;
var dist = new cosine.Cosine( mu, s );

// Calculate various distribution properties:
console.log( 'Mean: %d', dist.mean );
// => 'Mean: 2'

console.log( 'Median: %d', dist.median );
// => 'Median: 2'

console.log( 'Mode: %d', dist.mode );
// => 'Mode: 2'

console.log( 'Standard Deviation: %d', dist.stdev );
// => 'Standard Deviation: 0.5422680827869919'

console.log( 'Variance: %d', dist.variance );
// => 'Variance: 0.29405467360947996'

// Evaluate the probability density function (PDF):
var x = 1.5;
console.log( 'PDF( %d ): %d', x, dist.pdf( x ) );
// => 'PDF( 1.5 ): 0.5'

// Evaluate the cumulative distribution function (CDF):
console.log( 'CDF( %d ): %d', x, dist.cdf( x ) );
// => 'CDF( 1.5 ): 0.19550110947788535'

// Calculate distribution moments:
console.log( 'Skewness: %d', cosine.skewness( mu, s ) );
// => 'Skewness: 0'

console.log( 'Excess Kurtosis: %d', cosine.kurtosis( mu, s ) );
// => 'Excess Kurtosis: -0.5937628755982807'
```

</section>
Expand Down
38 changes: 36 additions & 2 deletions examples/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,41 @@

'use strict';

var objectKeys = require( '@stdlib/utils-keys' );
var cosine = require( './../lib' );

console.log( objectKeys( cosine ) );
// Create a raised cosine distribution:
var mu = 2.0;
var s = 1.5;
var dist = new cosine.Cosine( mu, s );

// Calculate various distribution properties:
console.log( 'Mean: %d', dist.mean );
// => 'Mean: 2'

console.log( 'Median: %d', dist.median );
// => 'Median: 2'

console.log( 'Mode: %d', dist.mode );
// => 'Mode: 2'

console.log( 'Standard Deviation: %d', dist.stdev );
// => 'Standard Deviation: 0.5422680827869919'

console.log( 'Variance: %d', dist.variance );
// => 'Variance: 0.29405467360947996'

// Evaluate the probability density function (PDF):
var x = 1.5;
console.log( 'PDF( %d ): %d', x, dist.pdf( x ) );
// => 'PDF( 1.5 ): 0.5'

// Evaluate the cumulative distribution function (CDF):
console.log( 'CDF( %d ): %d', x, dist.cdf( x ) );
// => 'CDF( 1.5 ): 0.19550110947788535'

// Calculate distribution moments:
console.log( 'Skewness: %d', cosine.skewness( mu, s ) );
// => 'Skewness: 0'

console.log( 'Excess Kurtosis: %d', cosine.kurtosis( mu, s ) );
// => 'Excess Kurtosis: -0.5937628755982807'

0 comments on commit 538b4d0

Please sign in to comment.