Package com.opengamma.analytics.math.interpolation

Examples of com.opengamma.analytics.math.interpolation.FlatExtrapolator1D


  @Override
  public void init(final FunctionCompilationContext context) {
    _definition = _helper.init(context, this);
    final ComputationTargetSpecification targetSpec = ComputationTargetSpecification.of(_definition.getCurrency());
    final ValueProperties properties = createValueProperties().with(ValuePropertyNames.CURVE, _curveName).get();
    _interpolator = new CombinedInterpolatorExtrapolator(Interpolator1DFactory.getInterpolator(_definition.getInterpolatorName()), new FlatExtrapolator1D());
    final String curveReqName = _isYieldCurve ? ValueRequirementNames.YIELD_CURVE : ValueRequirementNames.DISCOUNT_CURVE;
    _result = new ValueSpecification(curveReqName, targetSpec, properties);
    _specResult = new ValueSpecification(ValueRequirementNames.YIELD_CURVE_SPEC, targetSpec, properties);
    _results = Sets.newHashSet(_result, _specResult);
  }
View Full Code Here


      return new CombinedInterpolatorExtrapolator(interpolator, leftExtrapolator, rightExtrapolator);
    }

    private Interpolator1D getExtrapolator(final String extrapolatorName, final Interpolator1D interpolator) {
      if (extrapolatorName.equals(Interpolator1DFactory.FLAT_EXTRAPOLATOR)) {
        return new FlatExtrapolator1D();
      }
      if (extrapolatorName.equals(Interpolator1DFactory.LINEAR_EXTRAPOLATOR)) {
        return new LinearExtrapolator1D(interpolator);
      }
      return Interpolator1DFactory.getInterpolator(extrapolatorName);
View Full Code Here

    List<Function1D<Double, Double>> basisFuncs = generator.generateSet(0, 12, 100, 3);
    List<Function1D<Double, Double>> basisFuncsLog = generator.generateSet(-5, 3, 100, 3);

    final GeneralizedLeastSquare gls = new GeneralizedLeastSquare();

    final Interpolator1D interpolator = new CombinedInterpolatorExtrapolator(new DoubleQuadraticInterpolator1D(), new FlatExtrapolator1D());

    //  final double[] xData = new double[] {0.4, 0.9, 1.0, 1.8, 2.8, 5 };
    //  final double[] yData = new double[] {0.8, 4., 4.1, 5.6, 7., 8.1 };

    final double[] xData = new double[] {7. / 365, 14 / 365., 21 / 365., 1 / 12., 3 / 12., 0.5, 0.75, 1, 5, 10 };
View Full Code Here

TOP

Related Classes of com.opengamma.analytics.math.interpolation.FlatExtrapolator1D

Copyright © 2018 www.massapicom. 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.