Package org.jquantlib.math.interpolations

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


        CubicInterpolation f = new CubicInterpolation(
                generic_x, generic_y,
                CubicInterpolation.DerivativeApprox.Spline, false,
                CubicInterpolation.BoundaryCondition.SecondDerivative, generic_natural_y2.first(),
                CubicInterpolation.BoundaryCondition.SecondDerivative, generic_natural_y2.last());
        f.update();

        checkValues("Natural spline", f, generic_x, generic_y);
        // cached second derivative
        for (int i=0; i<n; i++) {
            interpolated = f.secondDerivative(generic_x.get(i));
View Full Code Here


        f = new CubicInterpolation(
                generic_x, generic_y,
                CubicInterpolation.DerivativeApprox.Spline, false,
                CubicInterpolation.BoundaryCondition.FirstDerivative, y1a,
                CubicInterpolation.BoundaryCondition.FirstDerivative, y1b);
        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);
View Full Code Here

        f = new CubicInterpolation(
                generic_x, generic_y,
                CubicInterpolation.DerivativeApprox.Spline, false,
                CubicInterpolation.BoundaryCondition.NotAKnot, Constants.NULL_REAL,
                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);
View Full Code Here

        CubicInterpolation f = new CubicInterpolation(
                x, y,
                CubicInterpolation.DerivativeApprox.Spline, false,
                CubicInterpolation.BoundaryCondition.NotAKnot, Constants.NULL_REAL,
                CubicInterpolation.BoundaryCondition.NotAKnot, Constants.NULL_REAL);
        f.update();

        checkValues("Not-a-knot spline", f, x, y);
        checkNotAKnotCondition("Not-a-knot spline", f);
        checkSymmetry("Not-a-knot spline", f, x.first());
View Full Code Here

        f = new CubicInterpolation(
                x, y,
                CubicInterpolation.DerivativeApprox.Spline, true,
                CubicInterpolation.BoundaryCondition.NotAKnot, Constants.NULL_REAL,
                CubicInterpolation.BoundaryCondition.NotAKnot, Constants.NULL_REAL);
        f.update();

        checkValues("MC not-a-knot spline", f, x, y);
        checkSymmetry("MC not-a-knot spline", f, x.first());
    }
View Full Code Here

        CubicInterpolation f = new CubicInterpolation(
                x, y,
                CubicInterpolation.DerivativeApprox.Spline, false,
                CubicInterpolation.BoundaryCondition.NotAKnot, Constants.NULL_REAL,
                CubicInterpolation.BoundaryCondition.NotAKnot, Constants.NULL_REAL);
        f.update();
        checkValues("Not-a-knot spline", f, x, y);
        check1stDerivativeValue("Not-a-knot spline", f, x.get(0), 4.0);
        check1stDerivativeValue("Not-a-knot spline", f, x.get(n-1), -4.0);
        check2ndDerivativeValue("Not-a-knot spline", f, x.get(0), -2.0);
        check2ndDerivativeValue("Not-a-knot spline", f, x.get(n-1), -2.0);
View Full Code Here

        f = new CubicInterpolation(
                x, y,
                CubicInterpolation.DerivativeApprox.Spline, false,
                CubicInterpolation.BoundaryCondition.FirstDerivative,  4.0,
                CubicInterpolation.BoundaryCondition.FirstDerivative, -4.0);
        f.update();
        checkValues("Clamped spline", f, x, y);
        check1stDerivativeValue("Clamped spline", f, x.get(0), 4.0);
        check1stDerivativeValue("Clamped spline", f, x.get(n-1), -4.0);
        check2ndDerivativeValue("Clamped spline", f, x.get(0), -2.0);
        check2ndDerivativeValue("Clamped spline", f, x.get(n-1), -2.0);
View Full Code Here

        f = new CubicInterpolation(
                x, y,
                CubicInterpolation.DerivativeApprox.Spline, false,
                CubicInterpolation.BoundaryCondition.SecondDerivative, -2.0,
                CubicInterpolation.BoundaryCondition.SecondDerivative, -2.0);
        f.update();
        checkValues("SecondDerivative spline", f, x, y);
        check1stDerivativeValue("SecondDerivative spline", f, x.get(0), 4.0);
        check1stDerivativeValue("SecondDerivative spline", f, x.get(n-1), -4.0);
        check2ndDerivativeValue("SecondDerivative spline", f, x.get(0), -2.0);
        check2ndDerivativeValue("SecondDerivative spline", f, x.get(n-1), -2.0);
View Full Code Here

        f = new CubicInterpolation(
                x, y,
                CubicInterpolation.DerivativeApprox.Spline, true,
                CubicInterpolation.BoundaryCondition.NotAKnot, Constants.NULL_REAL,
                CubicInterpolation.BoundaryCondition.NotAKnot, Constants.NULL_REAL);
        f.update();
        checkValues("MC Not-a-knot spline", f, x, y);
        check1stDerivativeValue("MC Not-a-knot spline", f, x.get(0), 4.0);
        check1stDerivativeValue("MC Not-a-knot spline", f, x.get(n-1), -4.0);
        check2ndDerivativeValue("MC Not-a-knot spline", f, x.get(0), -2.0);
        check2ndDerivativeValue("MC Not-a-knot spline", f, x.get(n-1), -2.0);
View Full Code Here

        f = new CubicInterpolation(
                x, y,
                CubicInterpolation.DerivativeApprox.Spline, true,
                CubicInterpolation.BoundaryCondition.FirstDerivative,  4.0,
                CubicInterpolation.BoundaryCondition.FirstDerivative, -4.0);
        f.update();
        checkValues("MC Clamped spline", f, x, y);
        check1stDerivativeValue("MC Clamped spline", f, x.get(0), 4.0);
        check1stDerivativeValue("MC Clamped spline", f, x.get(n-1), -4.0);
        check2ndDerivativeValue("MC Clamped spline", f, x.get(0), -2.0);
        check2ndDerivativeValue("MC Clamped spline", f, x.get(n-1), -2.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.