Evaluates the inverse of the Beta CDF.

View versions (2)

Interface

#include <codecogs/statistics/distributions/continuous/beta/cdf_inv.h>

using namespace Statistics::Distributions::Continuous::Beta;

The inverse CDF of the Beta distribution is identical to the inverse regularized beta function.

\graph alpha=0.5 beta=0.5 y=0:1

Given y, this function finds x such that

CDF( x, alpha, beta ) = y

The routine performs interval halving or Newton iterations to find the root of betaCDF(x,a,b) - y = 0

References

Cephes Math Library Release 2.8: June, 2000

Example 1

#include <codecogs/statistics/distributions/continuous/beta/cdf_inv.h>
#include <iostream>
#include <iomanip>
     
#define PRECISION 17
     
int main()
{
  std::cout << "The values of the Beta CDF inverse with alpha = beta = 0.5";
  std::cout << std::endl;
  std::cout << "x = {0, 0.1, 0.2, ... , 0.7, 0.8} are" << std::endl;
  std::cout << std::endl;
  for (double x = 0; x < 0.81; x += 0.1)
  {
    std::cout << std::setprecision(1);
    std::cout << "x = " << std::setw(3) << x << " : ";
    std::cout << std::setprecision(PRECISION);
    std::cout << Stats::Dists::Continuous::Beta::CDF_inv(x, 0.5, 0.5);
    std::cout << std::endl;
   }
   return 0;
}

Output

The values of the Beta CDF inverse with alpha = beta = 0.5
x = {0, 0.1, 0.2, ... , 0.7, 0.8} are

x =   0 : 0
x = 0.1 : 0.024471741852423217
x = 0.2 : 0.095491502812526302
x = 0.3 : 0.20610737385376349
x = 0.4 : 0.34549150281252633
x = 0.5 : 0.5
x = 0.6 : 0.65450849718747373
x = 0.7 : 0.79389262614623646
x = 0.8 : 0.90450849718747361

Parameters

y
solution we&#039;re seeking for betaCDF
alpha
first attribute
beta
second attribute

Returns

the inverse CDF of the Beta distribution
GPL Licence — free for non commercial use. See Licence details.

Interactive Calculator

y
alpha
beta
Result