You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: lib/node_modules/@stdlib/math/base/special/betaincinv/README.md
+34-92
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,7 @@
1
1
<!--
2
-
3
2
@license Apache-2.0
4
3
5
-
Copyright (c) 2018 The Stdlib Authors.
4
+
Copyright (c) 2024 The Stdlib Authors.
6
5
7
6
Licensed under the Apache License, Version 2.0 (the "License");
8
7
you may not use this file except in compliance with the License.
@@ -15,15 +14,16 @@ distributed under the License is distributed on an "AS IS" BASIS,
15
14
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
15
See the License for the specific language governing permissions and
17
16
limitations under the License.
18
-
19
17
-->
20
18
21
19
# betaincinv
22
20
23
-
> Inverse of the [incomplete beta function][incomplete-beta-function].
21
+
> Inverse incomplete beta function.
24
22
25
23
<sectionclass="intro">
26
24
25
+
The [inverse incomplete beta function][inverse-incomplete-beta] is the inverse of the [incomplete beta function][incomplete-beta]. It is used in various statistical applications, including hypothesis testing and confidence interval calculations.
26
+
27
27
</section>
28
28
29
29
<!-- /.intro -->
@@ -36,69 +36,35 @@ limitations under the License.
36
36
var betaincinv =require( '@stdlib/math/base/special/betaincinv' );
37
37
```
38
38
39
-
#### betaincinv( p, a, b\[, upper] )
39
+
#### betaincinv( p, a, b )
40
40
41
-
Inverts the regularized [incomplete beta function][incomplete-beta-function]. Contrary to the more commonly used definition, in this implementation the first parameter is the probability `p` and the second and third parameter are `a` and `b`. By default, the function inverts the _lower_ regularized [incomplete beta function][incomplete-beta-function]. To invert the _upper_ function instead, set the `upper` argument to `true`.
41
+
Evaluates the inverse of the incomplete beta function:
42
42
43
43
```javascript
44
-
var y =betaincinv( 0.2, 3.0, 3.0 );
44
+
var y =betaincinv( 0.5, 1.0, 1.0 );
45
+
// returns 0.5
46
+
47
+
y =betaincinv( 0.2, 3.0, 3.0 );
45
48
// returns ~0.327
46
49
47
50
y =betaincinv( 0.4, 3.0, 3.0 );
48
51
// returns ~0.446
49
52
50
-
y =betaincinv( 0.4, 3.0, 3.0, true );
51
-
// returns ~0.554
52
-
53
53
y =betaincinv( 0.4, 1.0, 6.0 );
54
54
// returns ~0.082
55
-
56
-
y =betaincinv( 0.8, 1.0, 6.0 );
57
-
// returns ~0.235
58
55
```
59
56
60
-
If provided `NaN` as any argument, the function returns `NaN`.
61
-
62
-
```javascript
63
-
var y =betaincinv( NaN, 1.0, 1.0 );
64
-
// returns NaN
65
-
66
-
y =betaincinv( 0.5, NaN, 1.0 );
67
-
// returns NaN
68
-
69
-
y =betaincinv( 0.5, 1.0, NaN );
70
-
// returns NaN
71
-
```
72
-
73
-
If provided a value outside `[0,1]` for `p`, the function returns `NaN`.
74
-
75
-
```javascript
76
-
var y =betaincinv( 1.2, 1.0, 1.0 );
77
-
// returns NaN
78
-
79
-
y =betaincinv( -0.5, 1.0, 1.0 );
80
-
// returns NaN
81
-
```
82
-
83
-
If provided a nonpositive `a`, the function returns `NaN`.
84
-
85
-
```javascript
86
-
var y =betaincinv( 0.5, -2.0, 2.0 );
87
-
// returns NaN
88
-
89
-
y =betaincinv( 0.5, 0.0, 2.0 );
90
-
// returns NaN
91
-
```
57
+
The function accepts the following parameters:
92
58
93
-
If provided a nonpositive `b`, the function returns `NaN`.
59
+
-**p**: probability value (input value for the incomplete beta function).
60
+
-**a**: first shape parameter (must be positive).
61
+
-**b**: second shape parameter (must be positive).
94
62
95
-
```javascript
96
-
var y =betaincinv( 0.5, 2.0, -2.0 );
97
-
// returns NaN
63
+
The function returns `NaN` if any of the following conditions are met:
- <spanclass="package-name">[`@stdlib/math/base/special/betaln`][@stdlib/math/base/special/betaln]</span><spanclass="delimiter">: </span><spanclass="description">natural logarithm of the beta function.</span>
92
+
y =betaincinv( 0.4, 1.0, 6.0 );
93
+
console.log( y );
94
+
// => ~0.082
95
+
```
143
96
144
97
</section>
145
98
146
-
<!-- /.related -->
147
-
148
-
<!-- Section for all links. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
0 commit comments