<commit_before>Probability Density Function
===

> [Logistic][Logistic] distribution [probability density function (PDF)][pdf].

<!-- <intro> -->

The [probability density function][pdf] (PDF) for a [logistic][logistic] random variable is

<!-- <equation class="equation" label="eq:pdf_function" align="center" raw="f(x; \mu,s) = \frac{e^{-\frac{x-\mu}{s}}} {s\left(1+e^{-\frac{x-\mu}{s}}\right)^2}" alt="Probability density function (PDF) for a logistic distribution."> -->

<div class="equation" align="center" data-raw-text="f(x; \mu,s) = \frac{e^{-\frac{x-\mu}{s}}} {s\left(1+e^{-\frac{x-\mu}{s}}\right)^2}" data-equation="eq:pdf_function">
    <img src="" alt="Probability density function (PDF) for a logistic distribution.">
    <br>
</div>

<!-- </equation> -->

where `mu` is the location parameter and `s` is the scale parameter.

<!-- </intro> -->

<!-- <usage> -->

## Usage
``` javascript
var pdf = require( '@stdlib/math/base/base/dist/logistic/pdf' );
```

#### pdf( x, mu, s )

Evaluates the [probability density function][pdf] (PDF) for a [logistic][logistic] distribution with parameters `mu` (location parameter) and `s` (scale parameter).

``` javascript
var y = pdf( 2.0, 0.0, 1.0 );
// returns ~0.105

y = pdf( -1.0, 4.0, 4.0 );
// returns ~0.043
```

If provided `NaN` as any argument, the function returns `NaN`.

``` javascript
var y = pdf( NaN, 0.0, 1.0 );
// returns NaN

y = pdf( 0.0, NaN, 1.0 );
// returns NaN

y = pdf( 0.0, 0.0, NaN );
// returns NaN
```

If provided `s < 0`, the function returns `NaN`.

``` javascript
var y = pdf( 2.0, 0.0, -1.0 );
// returns NaN
```

If provided `s = 0`, the function evaluates the [PDF][pdf] of a [degenerate distribution][degenerate-distribution] centered at `mu`.

``` javascript
var y = pdf( 2.0, 8.0, 0.0 );
// returns 0.0

y = pdf( 8.0, 8.0, 0.0 );
// returns Number.POSITIVE_INFINITY
```

#### pdf.factory( mu, s )

Partially apply `mu` and `s` to create a reusable `function` for evaluating the PDF.

``` javascript
var mypdf = pdf.factory( 10.0, 2.0 );

var y = mypdf( 10.0 );
// returns 0.125

y = mypdf( 5.0 );
// returns ~0.035
```
<!-- </usage> -->

<!-- <examples> -->
## Examples

``` javascript
var randu = require( '@stdlib/math/base/random/randu' );
var pdf = require( '@stdlib/math/base/base/dist/logistic/pdf' );

var mu;
var s;
var x;
var y;
var i;

for ( i = 0; i < 10; i++ ) {
    x = randu() * 10.0;
    mu = randu() * 10.0;
    s = randu() * 10.0;
    y = pdf( x, mu, s );
    console.log( 'x: %d, µ: %d, s: %d, f(x;µ,s): %d', x, mu, s, y );
}
```
<!-- </examples> -->


<!-- <links> -->
[logistic]: https://en.wikipedia.org/wiki/Logistic_distribution
[pdf]: https://en.wikipedia.org/wiki/Probability_density_function
[degenerate-distribution]: https://en.wikipedia.org/wiki/Degenerate_distribution
<!-- </links> -->
<commit_msg>Add empty lines to conform to commonmark standard<commit_after>Probability Density Function
===

> [Logistic][Logistic] distribution [probability density function (PDF)][pdf].

<!-- <intro> -->

The [probability density function][pdf] (PDF) for a [logistic][logistic] random variable is

<!-- <equation class="equation" label="eq:pdf_function" align="center" raw="f(x; \mu,s) = \frac{e^{-\frac{x-\mu}{s}}} {s\left(1+e^{-\frac{x-\mu}{s}}\right)^2}" alt="Probability density function (PDF) for a logistic distribution."> -->

<div class="equation" align="center" data-raw-text="f(x; \mu,s) = \frac{e^{-\frac{x-\mu}{s}}} {s\left(1+e^{-\frac{x-\mu}{s}}\right)^2}" data-equation="eq:pdf_function">
    <img src="" alt="Probability density function (PDF) for a logistic distribution.">
    <br>
</div>

<!-- </equation> -->

where `mu` is the location parameter and `s` is the scale parameter.

<!-- </intro> -->

<!-- <usage> -->

## Usage
``` javascript
var pdf = require( '@stdlib/math/base/base/dist/logistic/pdf' );
```

#### pdf( x, mu, s )

Evaluates the [probability density function][pdf] (PDF) for a [logistic][logistic] distribution with parameters `mu` (location parameter) and `s` (scale parameter).

``` javascript
var y = pdf( 2.0, 0.0, 1.0 );
// returns ~0.105

y = pdf( -1.0, 4.0, 4.0 );
// returns ~0.043
```

If provided `NaN` as any argument, the function returns `NaN`.

``` javascript
var y = pdf( NaN, 0.0, 1.0 );
// returns NaN

y = pdf( 0.0, NaN, 1.0 );
// returns NaN

y = pdf( 0.0, 0.0, NaN );
// returns NaN
```

If provided `s < 0`, the function returns `NaN`.

``` javascript
var y = pdf( 2.0, 0.0, -1.0 );
// returns NaN
```

If provided `s = 0`, the function evaluates the [PDF][pdf] of a [degenerate distribution][degenerate-distribution] centered at `mu`.

``` javascript
var y = pdf( 2.0, 8.0, 0.0 );
// returns 0.0

y = pdf( 8.0, 8.0, 0.0 );
// returns Number.POSITIVE_INFINITY
```

#### pdf.factory( mu, s )

Partially apply `mu` and `s` to create a reusable `function` for evaluating the PDF.

``` javascript
var mypdf = pdf.factory( 10.0, 2.0 );

var y = mypdf( 10.0 );
// returns 0.125

y = mypdf( 5.0 );
// returns ~0.035
```

<!-- </usage> -->

<!-- <examples> -->

## Examples

``` javascript
var randu = require( '@stdlib/math/base/random/randu' );
var pdf = require( '@stdlib/math/base/base/dist/logistic/pdf' );

var mu;
var s;
var x;
var y;
var i;

for ( i = 0; i < 10; i++ ) {
    x = randu() * 10.0;
    mu = randu() * 10.0;
    s = randu() * 10.0;
    y = pdf( x, mu, s );
    console.log( 'x: %d, µ: %d, s: %d, f(x;µ,s): %d', x, mu, s, y );
}
```

<!-- </examples> -->


<!-- <links> -->

[logistic]: https://en.wikipedia.org/wiki/Logistic_distribution
[pdf]: https://en.wikipedia.org/wiki/Probability_density_function
[degenerate-distribution]: https://en.wikipedia.org/wiki/Degenerate_distribution

<!-- </links> -->

{'fraction_non_alphanumeric': 0.22015122208545806, 'fraction_numerical': 0.030947775628626693, 'mean_word_length': 3.4333593141075602, 'pattern_counts': {'":': 0, '<': 55, '<?xml version=': 0, '>': 53, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3954976', 'n_tokens_mistral': 2284, 'n_tokens_neox': 2065, 'n_words': 601}