Package org.jquantlib.math.interpolations

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


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

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

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


            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

        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

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.