Package org.jquantlib.math.distributions

Examples of org.jquantlib.math.distributions.BinomialDistribution


        };

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

        final BinomialDistribution binomdist = new BinomialDistribution(p,n);

        for(int i=0;i<n;i++){
            final int z = i;
            final double expected = testvalues[i];
            final double computed = binomdist.op(z);

            // double tolerance = (z<6 ) ? 1.0e-15: 1.0e-10;
            final double tolerance = 1.0e-15; // try to to get 1.0e-15 accuracy whenever possible

            //assertEquals(expected, computed, tolerance);
View Full Code Here


         return pn.get(n);
     }


     public static double  evaluateBinomialDistributionValue(double probability, int k) {
         BinomialDistribution bs  = new BinomialDistribution(probability, 0);
         return bs.op(k);

     }
View Full Code Here

TOP

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

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.