Examples of op()


Examples of org.jquantlib.math.integrals.SegmentIntegral.op()

        final SegmentIntegral integrator = new SegmentIntegral(5000);

        final double infinity = 10.0*Math.sqrt(variance);
        r.value =
            process.riskFreeRate().currentLink().discount(a.exercise.lastDate()) /
            Math.sqrt(2.0*Math.PI*variance) * integrator.op(f, drift-infinity, drift+infinity);
    }


    //
    // private inner classes
View Full Code Here

Examples of org.jquantlib.math.integrals.SimpsonIntegral.op()

                    CubicInterpolation.DerivativeApprox.Spline, false,
                    CubicInterpolation.BoundaryCondition.NotAKnot, Constants.NULL_REAL,
                    CubicInterpolation.BoundaryCondition.NotAKnot, Constants.NULL_REAL);
          f.update();

          result = Math.sqrt(integral.op(makeErrorFunction(f), -1.7, 1.9));
          result /= scaleFactor;
            assertFalse("Not-a-knot spline interpolation "
                    +"\n    sample points:      "+n
                    +"\n    norm of difference: "+result
                    +"\n    it should be:       "+tabulatedErrors[i],
View Full Code Here

Examples of org.jquantlib.math.integrals.SimpsonIntegral.op()

                    CubicInterpolation.DerivativeApprox.Spline, true,
                    CubicInterpolation.BoundaryCondition.NotAKnot, Constants.NULL_REAL,
                    CubicInterpolation.BoundaryCondition.NotAKnot, Constants.NULL_REAL);
          f.update();

            result = Math.sqrt(integral.op(makeErrorFunction(f), -1.7, 1.9));
          result /= scaleFactor;
            assertFalse ("MC Not-a-knot spline interpolation "
                    + "\n    sample points:      "
                    + "\n    norm of difference: " + result
                    + "\n    it should be:       " + tabulatedErrors[i],
View Full Code Here

Examples of org.jquantlib.math.interpolations.BackwardFlatInterpolation.op()

        final double tolerance = 1.0e-12;

        // at original points
        for (int i=0; i<N; i++) {
            final double p = x.get(i);
            final double calculated = f.op(p);
            final double expected = y.get(i);
            assertFalse("failed to reproduce expected datum"
                    +"\n    expected value:   "+expected
                    +"\n    calculated value: "+calculated
                    +"\n    error:              "+Math.abs(calculated-expected),
View Full Code Here

Examples of org.jquantlib.math.interpolations.BackwardFlatInterpolation.op()

        }

        // at middle points
        for (int i=0; i<N-1; i++) {
            final double p = (x.get(i)+x.get(i+1))/2;
            final double calculated = f.op(p);
            final double expected = y.get(i+1);
            assertFalse("failed to reproduce expected datum"
                    +"\n    expected value:   "+expected
                    +"\n    calculated value: "+calculated
                    +"\n    error:              "+Math.abs(calculated-expected),
View Full Code Here

Examples of org.jquantlib.math.interpolations.BackwardFlatInterpolation.op()

        f.enableExtrapolation();

        {
            // this is just a block
            double p = x.get(0) - 0.5;
            double calculated = f.op(p);
            double expected = y.get(0);
            assertFalse("failed to reproduce expected datum"
                    +"\n    expected value:   "+expected
                    +"\n    calculated value: "+calculated
                    +"\n    error:              "+Math.abs(calculated-expected),
View Full Code Here

Examples of org.jquantlib.math.interpolations.BackwardFlatInterpolation.op()

                    +"\n    calculated value: "+calculated
                    +"\n    error:              "+Math.abs(calculated-expected),
                    Math.abs(calculated - expected) > tolerance);

            p = x.get(N-1) + 0.5;
            calculated = f.op(p);
            expected = y.get(N-1);
            assertFalse("failed to reproduce expected datum"
                    +"\n    expected value:   "+expected
                    +"\n    calculated value: "+calculated
                    +"\n    error:              "+Math.abs(calculated-expected),
View Full Code Here

Examples of org.jquantlib.math.interpolations.CubicInterpolation.op()

                  +"\n interpolated value: "+interpolated
                  +"\n expected value:     "+generic_natural_y2.get(i)
                  +"\n error:              "+error,
                  abs(error) > 3e-16);
        }
        x35[1] = f.op(3.5);


        // Clamped spline
        final double y1a = 0.0;
        final double y1b = 0.0;
View Full Code Here

Examples of org.jquantlib.math.interpolations.CubicInterpolation.op()

        f.update();

        checkValues("Clamped spline", f, generic_x, generic_y);
        check1stDerivativeValue("Clamped spline", f, generic_x.first(), 0.0);
        check1stDerivativeValue("Clamped spline", f, generic_x.last()0.0);
        x35[0] = f.op(3.5);


        // Not-a-knot spline
        f = new CubicInterpolation(
                generic_x, generic_y,
View Full Code Here

Examples of org.jquantlib.math.interpolations.CubicInterpolation.op()

                CubicInterpolation.BoundaryCondition.NotAKnot, Constants.NULL_REAL);
        f.update();

        checkValues("Not-a-knot spline", f, generic_x, generic_y);
        checkNotAKnotCondition("Not-a-knot spline", f);
        x35[2] = f.op(3.5);

        assertFalse("Spline interpolation failure"
            +"\n at x = "+3.5
            +"\n clamped spline    "+x35[0]
            +"\n natural spline    "+x35[1]
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.