Package com.opengamma.analytics.financial.greeks

Examples of com.opengamma.analytics.financial.greeks.MixedOrderUnderlying


      if (n == 0) {
        return 1;
      }
      return 1. / MathUtils.factorial(n);
    } else if (underlying instanceof MixedOrderUnderlying) {
      final MixedOrderUnderlying mixedOrder = (MixedOrderUnderlying) underlying;
      double result = 1;
      for (final NthOrderUnderlying underlyingOrder : mixedOrder.getUnderlyingOrders()) {
        result *= getMultiplier(underlyingOrder);
      }
      return result;
    }
    throw new IllegalArgumentException("Order was neither NthOrderUnderlying nor MixedOrderUnderlying: have " + underlying.getClass());
View Full Code Here


      final UnderlyingType type = nthOrder.getUnderlying();
      Validate.isTrue(underlyingData.containsKey(type));
      final double value = Math.pow(underlyingData.get(type), n);
      return value * getMultiplier(underlying);
    } else if (underlying instanceof MixedOrderUnderlying) {
      final MixedOrderUnderlying mixedOrder = (MixedOrderUnderlying) underlying;
      Double result = null;
      double multiplier;
      for (final NthOrderUnderlying underlyingOrder : mixedOrder.getUnderlyingOrders()) {
        if (result == null) {
          result = getValue(underlyingData, underlyingOrder);
        } else {
          multiplier = getValue(underlyingData, underlyingOrder);
          result = result * multiplier;
 
View Full Code Here

      Validate.isTrue(underlyingData.containsKey(type));
      DoubleTimeSeries<?> ts = underlyingData.get(type);
      ts = ts.power(n);
      return ts.multiply(getMultiplier(underlying));
    } else if (underlying instanceof MixedOrderUnderlying) {
      final MixedOrderUnderlying mixedOrder = (MixedOrderUnderlying) underlying;
      DoubleTimeSeries<?> result = null;
      DoubleTimeSeries<?> multiplier = null;
      int size = 0;
      for (final NthOrderUnderlying underlyingOrder : mixedOrder.getUnderlyingOrders()) {
        if (result == null) {
          result = getTimeSeries(underlyingData, underlyingOrder);
          size = result.size();
        } else {
          multiplier = getTimeSeries(underlyingData, underlyingOrder);
View Full Code Here

TOP

Related Classes of com.opengamma.analytics.financial.greeks.MixedOrderUnderlying

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.