Examples of evaluate()


Examples of com.opengamma.analytics.financial.timeseries.analysis.AutocovarianceFunctionCalculator.evaluate()

    for (int i = 0; i < 200; i++) {
      assertEquals(Math.abs(rhoARMAP0[i] - rhoAR[i]), 0., eps);
      assertEquals(Math.abs(rhoARMA0Q[i] - rhoMA[i]), 0., eps);
    }
    final double[] rhoARMA11 = autocorrelation.evaluate(ARMA11);
    final double[] gammaARMA11 = autocovariance.evaluate(ARMA11);
    assertEquals(PHI[1] - THETA[1] * STD * STD / gammaARMA11[0], rhoARMA11[1], eps);
  }
}

Examples of com.opengamma.analytics.financial.timeseries.returns.TimeSeriesReturnCalculator.evaluate()

    final LocalDateDoubleTimeSeries sampledTS = samplingFunction.getSampledTimeSeries(timeSeries.getTimeSeries(), schedule);
    for (final UnderlyingType underlyingType : valueGreek.getUnderlyingGreek().getUnderlying().getUnderlyings()) {
      if (underlyingType != UnderlyingType.SPOT_PRICE) {
        throw new OpenGammaRuntimeException("Have hard-coded to only use delta; should not have anything with " + underlyingType + " as the underlying type");
      }
      tsReturns.put(underlyingType, returnCalculator.evaluate(sampledTS));
    }
    dataBundleArray[0] = new SensitivityAndReturnDataBundle(sensitivity, value, tsReturns);
    final DoubleTimeSeries<?> result = PNL_CALCULATOR.evaluate(dataBundleArray);
    // Please see http://jira.opengamma.com/browse/PLAT-2330 for information about the PROPERTY_PNL_CONTRIBUTIONS constant
    final ValueProperties properties = createValueProperties()

Examples of com.opengamma.analytics.financial.timeseries.util.TimeSeriesWeightedVolatilityOperator.evaluate()

  @Override
  protected DateDoubleTimeSeries<?> calculatePnlSeries(LocalDateDoubleTimeSeries priceSeries, FunctionExecutionContext executionContext, ValueRequirement desiredValue) {
    double lambda = Double.parseDouble(desiredValue.getConstraint(VolatilityWeightingFunctionUtils.VOLATILITY_WEIGHTING_LAMBDA_PROPERTY));
    TimeSeriesWeightedVolatilityOperator weightedVolatilityOperator = new TimeSeriesWeightedVolatilityOperator(lambda);
    DateDoubleTimeSeries<?> weightedVolatilitySeries = weightedVolatilityOperator.evaluate(priceSeries);
    LocalDateDoubleTimeSeries weightedPnlSeries = (LocalDateDoubleTimeSeries) RELATIVE_WEIGHTED_DIFFERENCE.evaluate(priceSeries, weightedVolatilitySeries);
    LocalDate pnlSeriesStart = DateConstraint.evaluate(executionContext, desiredValue.getConstraint(HistoricalTimeSeriesFunctionUtils.START_DATE_PROPERTY));
    if (pnlSeriesStart.isAfter(weightedPnlSeries.getEarliestTime())) {
      weightedPnlSeries = weightedPnlSeries.subSeries(pnlSeriesStart, true, weightedPnlSeries.getLatestTime(), true);
    }

Examples of com.opengamma.analytics.math.curve.InterpolatedCurveShiftFunction.evaluate()

  @Test
  public void testParallel() {
    final InterpolatedCurveShiftFunction f = new InterpolatedCurveShiftFunction();
    final VolatilityCurve vol = new VolatilityCurve(CURVE);
    VolatilityCurve shifted1 = vol.withParallelShift(3);
    InterpolatedDoublesCurve shifted2 = f.evaluate(CURVE, 3.);
    assertArrayEquals(shifted1.getCurve().getXData(), shifted2.getXData());
    assertArrayEquals(shifted1.getCurve().getYData(), shifted2.getYData());
    shifted1 = vol.withSingleShift(1, 3);
    shifted2 = f.evaluate(CURVE, 1, 3.);
    assertArrayEquals(shifted1.getCurve().getXData(), shifted2.getXData());

Examples of com.opengamma.analytics.math.function.DoubleFunction1D.evaluate()

    final DoubleFunction1D derivative = pair.getSecond();
    for (int i = 0; i < mid; i++) {
      final double root = ROOT_FINDER.getRoot(function, derivative, getInitialRootGuess(i, n));
      x[i] = -root;
      x[n - i - 1] = root;
      final double dp = derivative.evaluate(root);
      w[i] = 2 / ((1 - root * root) * dp * dp);
      w[n - i - 1] = w[i];
    }
    return new GaussianQuadratureData(x, w);
  }

Examples of com.opengamma.analytics.math.function.PiecewisePolynomialFunction1D.evaluate()

    PiecewisePolynomialResult resultPos = interpPos.interpolate(xValues, yValues);

    final int nKeys = 101;
    for (int i = 0; i < nKeys; ++i) {
      final double key = 1. + 4. / (nKeys - 1) * i;
      System.out.println(key + "\t" + function.evaluate(result, key).getData()[0] + "\t" + function.evaluate(resultPos, key).getData()[0]);
    }
  }

  /**
   *
 

Examples of com.opengamma.analytics.math.function.PiecewisePolynomialFunction2D.evaluate()

    //    for (int i = 0; i < n1Keys; ++i) {
    //      x1Keys[i] = -1. + 5. * i / (n1Keys - 1);
    //    }

    PiecewisePolynomialFunction2D func = new PiecewisePolynomialFunction2D();
    final double[][] values = func.evaluate(result2D, x0Keys, x1Keys).getData();

    for (int i = 0; i < n0Keys; ++i) {
      System.out.print("\t" + x0Keys[i]);
    }
    System.out.print("\n");

Examples of com.opengamma.analytics.math.function.RealPolynomialFunction1D.evaluate()

  }

  public static void polyDerivativeDemo(PrintStream out) {
    RealPolynomialFunction1D f = getFunction();

    assert f.evaluate(5.0) == 0.0;

    RealPolynomialFunction1D d = f.derivative();
    double[] coefficients = d.getCoefficients();
    out.println(Arrays.toString(coefficients));
  }

Examples of com.opengamma.analytics.math.linearalgebra.CholeskyDecompositionCommons.evaluate()

      for (int loopjump2 = 0; loopjump2 < nbJump - nbZero; loopjump2++) {
        cov2[loopjump][loopjump2] = cov[loopjump + nbZero][loopjump2 + nbZero];
      }
    }
    final CholeskyDecompositionCommons cd = new CholeskyDecompositionCommons();
    final CholeskyDecompositionResult cdr2 = cd.evaluate(new DoubleMatrix2D(cov2));
    final double[][] covCD2 = cdr2.getL().toArray();
    final double[][] covCD = new double[nbJump][nbJump];
    for (int loopjump = 0; loopjump < nbJump - nbZero; loopjump++) {
      for (int loopjump2 = 0; loopjump2 < nbJump - nbZero; loopjump2++) {
        covCD[loopjump + nbZero][loopjump2 + nbZero] = covCD2[loopjump][loopjump2];

Examples of com.opengamma.analytics.math.linearalgebra.InverseTridiagonalMatrixCalculator.evaluate()

      a[n - 1] = deltaX[n - 2] / 3.0;
      c[n - 2] = deltaX[n - 2] / 6.0;
    }

    final TridiagonalMatrix tridiagonal = new TridiagonalMatrix(a, b, c);
    return invertor.evaluate(tridiagonal);
  }

  @Override
  public void setYValueAtIndex(final int index, final double y) {
    ArgumentChecker.notNegative(index, "index");
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.