Example: The Inverse Cumulative Distribution Functions

Various inverse cumulative distribution functions are exercised. Their use in this example typifies the manner in which other functions in the InvCdf class would be used.

import com.imsl.stat.InvCdf;

public class InvCdfEx1 {

    public static void main(String args[]) {

        // Inverse Beta
        double x = .5;
        double pin = 12.;
        double qin = 12.;
        double result = InvCdf.beta(x, pin, qin);
        System.out.println("InvCdf.beta(.5, 12., 12.) is " + result);

        // Inverse Chi
        double prob = .99;
        int n = 2;
        result = InvCdf.chi(prob, n);
        System.out.println("InvCdf.chi(.99, 2) is " + result);
    }
}

Output

InvCdf.beta(.5, 12., 12.) is 0.4999999999999991
InvCdf.chi(.99, 2) is 9.210340371976173
Link to Java source.