Package org.jquantlib.math.interpolations

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


            final CubicInterpolation interpolation = new CubicInterpolation(
                    x, y,
                    CubicInterpolation.DerivativeApprox.Spline, true,
                    CubicInterpolation.BoundaryCondition.NotAKnot, 0.0,
                    CubicInterpolation.BoundaryCondition.NotAKnot, 0.0);
            interpolation.update();

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

            // bad performance
            interpolated  = interpolation.op(x1_bad);
View Full Code Here


            newValues = newGrid.clone().transform(f);
        }

        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);
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

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.