Package com.opengamma.analytics.financial.greeks

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


public class TaylorExpansionMultiplierCalculator {

  public static double getMultiplier(final Underlying underlying) {
    Validate.notNull(underlying, "underlying");
    if (underlying instanceof NthOrderUnderlying) {
      final NthOrderUnderlying nthOrder = (NthOrderUnderlying) underlying;
      final int n = nthOrder.getOrder();
      if (n == 0) {
        return 1;
      }
      return 1. / MathUtils.factorial(n);
    } else if (underlying instanceof MixedOrderUnderlying) {
View Full Code Here


    Validate.notNull(underlyingData, "underlying data");
    Validate.notEmpty(underlyingData, "underlying data");
    Validate.noNullElements(underlyingData.keySet(), "underlying data keys");
    Validate.noNullElements(underlyingData.values(), "underlying data values");
    if (underlying instanceof NthOrderUnderlying) {
      final NthOrderUnderlying nthOrder = (NthOrderUnderlying) underlying;
      final int n = nthOrder.getOrder();
      if (n == 0) {
        return 1;
      }
      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;
View Full Code Here

    Validate.notNull(underlyingData, "underlying data");
    Validate.notEmpty(underlyingData, "underlying data");
    Validate.noNullElements(underlyingData.keySet(), "underlying data keys");
    Validate.noNullElements(underlyingData.values(), "underlying data values");
    if (underlying instanceof NthOrderUnderlying) {
      final NthOrderUnderlying nthOrder = (NthOrderUnderlying) underlying;
      final int n = nthOrder.getOrder();
      if (n == 0) {
        throw new UnsupportedOperationException();
      }
      final UnderlyingType type = nthOrder.getUnderlying();
      Validate.isTrue(underlyingData.containsKey(type));
      DoubleTimeSeries<?> ts = underlyingData.get(type);
      ts = ts.power(n);
      return ts.multiply(getMultiplier(underlying));
    } else if (underlying instanceof MixedOrderUnderlying) {
View Full Code Here

TOP

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

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.