-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
feat: initial implementation of stats/base/dists/halfnormal/cdf
#9429
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Changes from 1 commit
655c367
8e805b1
d3112d0
c4a724e
0d418b9
001de23
256ea76
c69c0ee
18617d9
288ee68
39b5057
e653b86
3d4ee5b
3effeb4
13a7c82
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,162 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <!-- | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| @license Apache-2.0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Copyright (c) 2025 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. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| --> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Cumulative Distribution Function | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| > [Half-normal][half-normal-distribution] distribution [cumulative distribution function][cdf]. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <section class="intro"> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| The [cumulative distribution function][cdf] for a [half-normal][half-normal-distribution] random variable is | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ```math | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| F(x;\mu,\sigma) = \mathop{\mathrm{erf}}\left( \frac{x-\mu}{\sigma\sqrt{2}} \right) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ``` | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| where `µ` is the location parameter and `σ` is the scale parameter. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </section> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <!-- /.intro --> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <section class="usage"> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ## Usage | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ```javascript | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| var cdf = require( '@stdlib/stats/base/dists/halfnormal/cdf' ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ``` | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| #### cdf( x, mu, sigma ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Evaluates the [cumulative distribution function][cdf] (CDF) for a [half-normal][half-normal-distribution] distribution with parameters `mu` (location) and `sigma` (scale). | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ```javascript | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| var y = cdf( 2.0, 0.0, 1.0 ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // returns 0.9544997361036416 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| y = cdf( -1.0, 0.0, 1.0 ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // returns 0.0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| y = cdf( -1.0, 2.0, 2.0 ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // returns 0.0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ``` | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| If provided `NaN` as any argument, the function returns `NaN`. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ```javascript | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| var y = cdf( NaN, 0.0, 1.0 ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // returns NaN | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| y = cdf( 0.0, NaN, 1.0 ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // returns NaN | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| y = cdf( 0.0, 0.0, NaN ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // returns NaN | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ``` | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| If provided `sigma < 0`, the function returns `NaN`. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ```javascript | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| var y = cdf( 2.0, 0.0, -1.0 ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // returns NaN | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ``` | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| If provided `sigma = 0`, the function evaluates the [CDF][cdf] of a [degenerate distribution][degenerate-distribution] centered at `mu`. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ```javascript | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| var y = cdf( 2.0, 8.0, 0.0 ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // returns 0.0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| y = cdf( 8.0, 8.0, 0.0 ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // returns 1.0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| y = cdf( 10.0, 8.0, 0.0 ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // returns 1.0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ``` | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| #### cdf.factory( mu, sigma ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Returns a function for evaluating the [cumulative distribution function][cdf] of a [half-normal][half-normal-distribution] distribution with parameters `mu` and `sigma`. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ```javascript | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| var mycdf = cdf.factory( 0.0, 1.0 ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| var y = mycdf( 2.0 ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // returns 0.9544997361036416 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| y = mycdf( -1.0 ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // returns 0.0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ``` | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </section> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <!-- /.usage --> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <section class="examples"> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ## Examples | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <!-- eslint no-undef: "error" --> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ```javascript | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| var randu = require( '@stdlib/random/base/randu' ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| var cdf = require( '@stdlib/stats/base/dists/halfnormal/cdf' ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| var sigma; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| var mu; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| var x; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| var y; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| var i; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| for ( i = 0; i < 10; i++ ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| x = randu() * 10.0; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| mu = (randu() * 10.0) - 5.0; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| sigma = randu() * 20.0; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| y = cdf( x, mu, sigma ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| console.log( 'x: %d, µ: %d, σ: %d, F(x;µ,σ): %d', x, mu, sigma, y ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The Examples section uses the older
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ``` | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </section> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <!-- /.examples --> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <!-- Section for related `stdlib` packages. Do not manually edit this section, as it is automatically populated. --> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <section class="related"> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </section> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <!-- /.related --> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <!-- Section for all links. Make sure to keep an empty line after the `section` element and another before the `/section` close. --> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <section class="links"> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| [cdf]: https://en.wikipedia.org/wiki/Cumulative_distribution_function | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| [half-normal-distribution]: https://en.wikipedia.org/wiki/Half-normal_distribution | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| [degenerate-distribution]: https://en.wikipedia.org/wiki/Degenerate_distribution | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </section> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <!-- /.links --> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,87 @@ | ||||||
| /** | ||||||
| * @license Apache-2.0 | ||||||
| * | ||||||
| * Copyright (c) 2025 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 bench = require( '@stdlib/bench' ); | ||||||
| var uniform = require( '@stdlib/random/array/uniform' ); | ||||||
| var isnan = require( '@stdlib/math/base/assert/is-nan' ); | ||||||
| var EPS = require( '@stdlib/constants/float64/eps' ); | ||||||
| var pkg = require( './../package.json' ).name; | ||||||
| var cdf = require( './../lib' ); | ||||||
|
|
||||||
|
|
||||||
| // MAIN // | ||||||
|
|
||||||
| bench( pkg, function benchmark( b ) { | ||||||
| var sigma; | ||||||
| var len; | ||||||
| var mu; | ||||||
| var x; | ||||||
| var y; | ||||||
| var i; | ||||||
|
|
||||||
| len = 100; | ||||||
| x = uniform( len, 0.0, 100.0 ); | ||||||
| mu = uniform( len, 0.0, 50.0 ); | ||||||
| sigma = uniform( len, EPS, 20.0 + EPS ); | ||||||
|
|
||||||
| b.tic(); | ||||||
| for ( i = 0; i < b.iterations; i++ ) { | ||||||
| y = cdf( x[ i % len ], mu[ i % len ], sigma[ i % len ]); | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missing space before closing parenthesis. stdlib style requires spaces inside function call parentheses:
Suggested change
|
||||||
| 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(); | ||||||
| }); | ||||||
|
|
||||||
| bench( pkg+':factory', function benchmark( b ) { | ||||||
| var mycdf; | ||||||
| var sigma; | ||||||
| var mu; | ||||||
| var x; | ||||||
| var y; | ||||||
| var i; | ||||||
|
|
||||||
| mu = 0.0; | ||||||
| sigma = 1.5; | ||||||
| mycdf = cdf.factory( mu, sigma ); | ||||||
| x = uniform( 100, 0.0, 10.0 ); | ||||||
|
|
||||||
| b.tic(); | ||||||
| for ( i = 0; i < b.iterations; i++ ) { | ||||||
| y = mycdf( x[ i % x.length ] ); | ||||||
| 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(); | ||||||
| }); | ||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,79 @@ | ||
|
|
||
| {{alias}}( x, μ, σ ) | ||
| Evaluates the cumulative distribution function (CDF) for a half-normal | ||
| distribution with location `μ` and scale `σ` at a value `x`. | ||
|
|
||
| If provided `NaN` as any argument, the function returns `NaN`. | ||
|
|
||
| If provided `σ < 0`, the function returns `NaN`. | ||
|
|
||
| Parameters | ||
| ---------- | ||
| x: number | ||
| Input value. | ||
|
|
||
| μ: number | ||
| Location parameter. | ||
|
|
||
| σ: number | ||
| Scale parameter. | ||
|
|
||
| Returns | ||
| ------- | ||
| out: number | ||
| Evaluated CDF. | ||
|
|
||
| Examples | ||
| -------- | ||
| > var y = {{alias}}( 2.0, 0.0, 1.0 ) | ||
| 0.9544997361036416 | ||
| > y = {{alias}}( -1.0, 0.0, 1.0 ) | ||
| 0.0 | ||
| > y = {{alias}}( -1.0, 2.0, 2.0 ) | ||
| 0.0 | ||
| > y = {{alias}}( NaN, 0.0, 1.0 ) | ||
| NaN | ||
| > y = {{alias}}( 0.0, NaN, 1.0 ) | ||
| NaN | ||
| > y = {{alias}}( 0.0, 0.0, NaN ) | ||
| NaN | ||
|
|
||
| // Negative scale parameter: | ||
| > y = {{alias}}( 2.0, 0.0, -1.0 ) | ||
| NaN | ||
|
|
||
| // Degenerate distribution centered at `μ` when `σ = 0.0`: | ||
| > y = {{alias}}( 2.0, 8.0, 0.0 ) | ||
| 0.0 | ||
| > y = {{alias}}( 8.0, 8.0, 0.0 ) | ||
| 1.0 | ||
| > y = {{alias}}( 10.0, 8.0, 0.0 ) | ||
| 1.0 | ||
|
|
||
|
|
||
| {{alias}}.factory( μ, σ ) | ||
| Returns a function for evaluating the cumulative distribution function (CDF) | ||
| of a half-normal distribution with location `μ` and scale `σ`. | ||
|
|
||
| Parameters | ||
| ---------- | ||
| μ: number | ||
| Location parameter. | ||
|
|
||
| σ: number | ||
| Scale parameter. | ||
|
|
||
| Returns | ||
| ------- | ||
| cdf: Function | ||
| Cumulative distribution function (CDF). | ||
|
|
||
| Examples | ||
| -------- | ||
| > var myCDF = {{alias}}.factory( 0.0, 1.0 ); | ||
| > var y = myCDF( 2.0 ) | ||
| 0.9544997361036416 | ||
|
|
||
| See Also | ||
| -------- | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.