Package org.jquantlib.math.interpolations

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


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

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


            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

            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

                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

                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

                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

        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

                  +"\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

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.