Examples of op()


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

            interpolation.update();

            checkValues("MC not-a-knot spline", interpolation, x, y);

            // bad performance
            interpolated  = interpolation.op(x1_bad);
            interpolated2 = interpolation.op(x2_bad);
            if (interpolated>0.0 && interpolated2>0.0 ) {
                assertFalse("Not-a-knot spline interpolation "
                            + "bad performance unverified"
                            + "\nat x = " + x1_bad
View Full Code Here

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

            checkValues("MC not-a-knot spline", interpolation, x, y);

            // bad performance
            interpolated  = interpolation.op(x1_bad);
            interpolated2 = interpolation.op(x2_bad);
            if (interpolated>0.0 && interpolated2>0.0 ) {
                assertFalse("Not-a-knot spline interpolation "
                            + "bad performance unverified"
                            + "\nat x = " + x1_bad
                            + " interpolated value: " + interpolated
View Full Code Here

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

                x, y,
                CubicInterpolation.DerivativeApprox.Spline, true,
                CubicInterpolation.BoundaryCondition.NotAKnot, 0.0,
                CubicInterpolation.BoundaryCondition.NotAKnot, 0.0);

        interpolated = f.op(zero);
        assertFalse("MC not-a-knot spline interpolation failed at x = "+zero
                    +"\n    interpolated value: "+interpolated
                    +"\n    expected value:     "+expected
                    +"\n    error:              "+abs(interpolated-expected),
                    abs(interpolated-expected) > 1e-15);
View Full Code Here

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

                x, y,
                CubicInterpolation.DerivativeApprox.Spline, true,
                CubicInterpolation.BoundaryCondition.FirstDerivative,  4.0,
                CubicInterpolation.BoundaryCondition.FirstDerivative, -4.0);

        interpolated =  f.op(zero);
        assertFalse("MC clamped spline interpolation failed at x = "+zero
                +"\n    interpolated value: "+interpolated
                +"\n    expected value:     "+expected
                +"\n    error:              "+abs(interpolated-expected),
                abs(interpolated-expected) > 1e-15);
View Full Code Here

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

                x, y,
                CubicInterpolation.DerivativeApprox.Spline, true,
                CubicInterpolation.BoundaryCondition.SecondDerivative, -2.0,
                CubicInterpolation.BoundaryCondition.SecondDerivative, -2.0);

        interpolated =  f.op(zero);
        assertFalse("MC SecondDerivative spline interpolation failed at x = "+zero
                +"\n    interpolated value: "+interpolated
                +"\n    expected value:     "+expected
                +"\n    error:              "+abs(interpolated-expected),
                abs(interpolated-expected) > 1e-15);
View Full Code Here

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

        final CubicInterpolation priceSpline = new NaturalCubicInterpolation(transformed, values);

        priceSpline.update();
        for (int i=0; i<newValues.size(); i++) {
            newValues.set(i, priceSpline.op(newValues.get(i), true) );
        }

        this.grid.swap(newGrid);
        this.values.swap(newValues);
    }
View Full Code Here

Examples of org.jquantlib.math.interpolations.ForwardFlatInterpolation.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.ForwardFlatInterpolation.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);
            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.ForwardFlatInterpolation.op()

        // outside the original range
        f.enableExtrapolation();

        {
            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.ForwardFlatInterpolation.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
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.