Package org.jquantlib.math.interpolations

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


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

          result = Math.sqrt(integral.op(makeErrorFunction(f), -1.7, 1.9));
          result /= scaleFactor;
            assertFalse("Not-a-knot spline interpolation "
                    +"\n    sample points:      "+n
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();

            result = Math.sqrt(integral.op(makeErrorFunction(f), -1.7, 1.9));
          result /= scaleFactor;
            assertFalse ("MC Not-a-knot spline interpolation "
                    + "\n    sample points:      "
View Full Code Here

      CubicInterpolation f = new CubicInterpolation(
                                RPN15A_x, RPN15A_y,
                                CubicInterpolation.DerivativeApprox.Spline, false,
                                CubicInterpolation.BoundaryCondition.SecondDerivative, 0.0,
                                CubicInterpolation.BoundaryCondition.SecondDerivative, 0.0);
      f.update();

      checkValues("Natural spline", f, RPN15A_x, RPN15A_y);
      check2ndDerivativeValue("Natural spline", f, RPN15A_x.first(), 0.0);
      check2ndDerivativeValue("Natural spline", f, RPN15A_x.last()0.0);
View Full Code Here

      f = new CubicInterpolation(
                RPN15A_x, RPN15A_y,
                CubicInterpolation.DerivativeApprox.Spline, false,
                CubicInterpolation.BoundaryCondition.FirstDerivative, 0.0,
                CubicInterpolation.BoundaryCondition.FirstDerivative, 0.0);
      f.update();

      checkValues("Clamped spline", f, RPN15A_x, RPN15A_y);
      check1stDerivativeValue("Clamped spline", f, RPN15A_x.first(), 0.0);
      check1stDerivativeValue("Clamped spline", f, RPN15A_x.last()0.0);
View Full Code Here

        f = new CubicInterpolation(
                RPN15A_x, RPN15A_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, RPN15A_x, RPN15A_y);
      checkNotAKnotCondition("Not-a-knot spline", f);

      // poor performance
View Full Code Here

        f = new CubicInterpolation(
                RPN15A_x, RPN15A_y,
                CubicInterpolation.DerivativeApprox.Spline, true,
                CubicInterpolation.BoundaryCondition.SecondDerivative, 0.0,
                CubicInterpolation.BoundaryCondition.SecondDerivative, 0.0);
      f.update();

      checkValues("MC natural spline", f, RPN15A_x, RPN15A_y);

      // good performance
      interpolated = f.op(x_bad);
View Full Code Here

        f = new CubicInterpolation(
                RPN15A_x, RPN15A_y,
                CubicInterpolation.DerivativeApprox.Spline, true,
                CubicInterpolation.BoundaryCondition.FirstDerivative, 0.0,
                CubicInterpolation.BoundaryCondition.FirstDerivative, 0.0);
      f.update();

      checkValues("MC clamped spline", f, RPN15A_x, RPN15A_y);
      check1stDerivativeValue("MC clamped spline", f, RPN15A_x.first(), 0.0);
      check1stDerivativeValue("MC clamped spline", f, RPN15A_x.last()0.0);
View Full Code Here

        f = new CubicInterpolation(
                RPN15A_x, RPN15A_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, RPN15A_x, RPN15A_y);

      // good performance
      interpolated = f.op(x_bad);
View Full Code Here

            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

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.