Package org.jquantlib.math.distributions

Examples of org.jquantlib.math.distributions.CumulativeBinomialDistribution


                0.99998474121094 };

        final double p = 0.5;           // probability that an event occurs
        final int n = testvalues.length;      // number of trials

        final CumulativeBinomialDistribution cumbinomdist = new CumulativeBinomialDistribution(p,n);
        for (int i=0;i<testvalues.length;i++) {
            final double expected = testvalues[i];
            final double realised = cumbinomdist.op(i); // i = number of successful events
            final double tolerance = 1.0e-11;
            if (Math.abs(expected-realised)>tolerance) {
                fail("x: " + i + " expected: " + expected + " realised: " + realised);
            }
        }
View Full Code Here

TOP

Related Classes of org.jquantlib.math.distributions.CumulativeBinomialDistribution

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.