Package org.jquantlib.math.integrals

Examples of org.jquantlib.math.integrals.TabulatedGaussLegendre.evaluate()


        if (Math.abs(correlation) < 0.925) {
            if (Math.abs(correlation) > 0) {
                final double asr = Math.asin(correlation);
                final Eqn3 f = new Eqn3(h, k, asr);
                bvn = gaussLegendreQuad.evaluate(f);
                bvn *= asr * (0.25 / Math.PI);
            }
            bvn += cumnorm.op(-h) * cumnorm.op(-k);
        } else {
            if (correlation < 0) {
View Full Code Here


                    bvn -= Math.exp(-hk / 2) * Constants.M_SQRT2PI * cumnorm.op(-B / a) * B
                    * (1 - c * bs * (1 - d * bs / 5) / 3);
                }
                a /= 2;
                final Eqn6 f = new Eqn6(a, c, d, bs, hk);
                bvn += gaussLegendreQuad.evaluate(f);
                bvn /= (-2.0 * Math.PI);
            }

            if (correlation > 0) {
                bvn += cumnorm.op(-Math.max(h, k));
View Full Code Here

        if (Math.abs(correlation) < 0.925) {
            if (Math.abs(correlation) > 0) {
                final double asr = Math.asin(correlation);
                final Eqn3 f = new Eqn3(h, k, asr);
                bvn = gaussLegendreQuad.evaluate(f);
                bvn *= asr * (0.25 / Math.PI);
            }
            bvn += cumnorm.op(-h) * cumnorm.op(-k);
        } else {
            if (correlation < 0) {
View Full Code Here

                    bvn -= Math.exp(-hk / 2) * Constants.M_SQRT2PI * cumnorm.op(-B / a) * B
                    * (1 - c * bs * (1 - d * bs / 5) / 3);
                }
                a /= 2;
                final Eqn6 f = new Eqn6(a, c, d, bs, hk);
                bvn += gaussLegendreQuad.evaluate(f);
                bvn /= (-2.0 * Math.PI);
            }

            if (correlation > 0) {
                bvn += cumnorm.op(-Math.max(h, k));
View Full Code Here

  public void checkSingleTabulated(final Ops.DoubleOp f, final String tag, final double expected, final double tolerance) {
      final int order[] = { 6, 7, 12, 20 };
      final TabulatedGaussLegendre quad = new TabulatedGaussLegendre();
      for (final int element : order) {
          quad.setOrder(element);
          final double realised = quad.evaluate(f);
          if (Math.abs(realised-expected) > tolerance)
            fail(" integrating " + tag + "\n"
                        + "    order " + element + "\n"
                        + "    realised: " + realised + "\n"
                        + "    expected: " + expected);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.