Examples of multipliedBy()


Examples of com.opengamma.analytics.financial.provider.sensitivity.multicurve.MulticurveSensitivity.multipliedBy()

    final Map<String, List<DoublesPair>> resultMap = new HashMap<>();
    resultMap.put(multicurves.getName(ccy), list);
    MulticurveSensitivity result = MulticurveSensitivity.ofYieldDiscounting(resultMap);
    result = result.plus(forwardDr.multipliedBy(discountFactorSettle * (pvbpDf * bsAdjoint[0] + pvbp * (bsAdjoint[1] + bsAdjoint[2] * volatilityAdjoint[1]))));
    if (!swaption.isLong()) {
      result = result.multipliedBy(-1);
    }
    return MultipleCurrencyMulticurveSensitivity.of(ccy, result);
  }

  /**
 
View Full Code Here

Examples of com.opengamma.analytics.financial.provider.sensitivity.multicurve.MulticurveSensitivity.multipliedBy()

    final SABRExtrapolationRightFunction sabrExtrapolation = new SABRExtrapolationRightFunction(forwardModified, sabrParam, _cutOffStrike, swaption.getTimeToExpiry(), _mu);
    MulticurveSensitivity result = pvbpModifiedDr.multipliedBy(sabrExtrapolation.price(option));
    final double priceDF = sabrExtrapolation.priceDerivativeForward(option);
    result = result.plus(forwardModifiedDr.multipliedBy(pvbpModified * priceDF));
    if (!swaption.isLong()) {
      result = result.multipliedBy(-1);
    }
    return MultipleCurrencyMulticurveSensitivity.of(ccy, result);
  }

  /**
 
View Full Code Here

Examples of com.opengamma.analytics.financial.provider.sensitivity.multicurve.MulticurveSensitivity.multipliedBy()

    final BlackFunctionData dataBlack = new BlackFunctionData(forwardModified, 1.0, volatilityAdjoint[0]);
    final double[] bsAdjoint = blackFunction.getPriceAdjoint(option, dataBlack);
    MulticurveSensitivity result = pvbpModifiedDr.multipliedBy(bsAdjoint[0]);
    result = result.plus(forwardModifiedDr.multipliedBy(pvbpModified * (bsAdjoint[1] + bsAdjoint[2] * volatilityAdjoint[1])));
    if (!swaption.isLong()) {
      result = result.multipliedBy(-1);
    }
    return MultipleCurrencyMulticurveSensitivity.of(swaption.getCurrency(), result);
  }

  /**
 
View Full Code Here

Examples of com.opengamma.analytics.financial.provider.sensitivity.multicurve.MulticurveSensitivity.multipliedBy()

    final double rho = sabrData.getSABRParameter().getRho(expiryMaturity);
    final double nu = sabrData.getSABRParameter().getNu(expiryMaturity);
    final SABRFormulaData sabrParam = new SABRFormulaData(alpha, beta, rho, nu);
    final SABRExtrapolationRightFunction sabrExtrapolation = new SABRExtrapolationRightFunction(forward, sabrParam, _cutOffStrike, swaption.getTimeToExpiry(), _mu);
    final double price = sabrExtrapolation.price(swaption);
    result = result.multipliedBy(pvbp * price);
    result = result.plus(forwardDr.multipliedBy(discountFactorSettle * (pvbpDf * price + pvbp * sabrExtrapolation.priceDerivativeForward(swaption))));
    if (!swaption.isLong()) {
      result = result.multipliedBy(-1);
    }
    return MultipleCurrencyMulticurveSensitivity.of(ccy, result);
View Full Code Here

Examples of com.opengamma.analytics.financial.provider.sensitivity.multicurve.MulticurveSensitivity.multipliedBy()

    final SABRExtrapolationRightFunction sabrExtrapolation = new SABRExtrapolationRightFunction(forward, sabrParam, _cutOffStrike, swaption.getTimeToExpiry(), _mu);
    final double price = sabrExtrapolation.price(swaption);
    result = result.multipliedBy(pvbp * price);
    result = result.plus(forwardDr.multipliedBy(discountFactorSettle * (pvbpDf * price + pvbp * sabrExtrapolation.priceDerivativeForward(swaption))));
    if (!swaption.isLong()) {
      result = result.multipliedBy(-1);
    }
    return MultipleCurrencyMulticurveSensitivity.of(ccy, result);
  }

  /**
 
View Full Code Here

Examples of com.opengamma.analytics.financial.provider.sensitivity.multicurve.MulticurveSensitivity.multipliedBy()

        priceMin = priceFromBond[loopbasket];
        indexCTD = loopbasket;
      }
    }
    MulticurveSensitivity result = BOND_METHOD.dirtyPriceCurveSensitivity(future.getDeliveryBasket()[indexCTD], issuerMulticurves);
    return result.multipliedBy(1.0 / future.getConversionFactor()[indexCTD]);
  }

  /**
   * Compute the present value sensitivity to rates of a bond future by discounting.
   * @param future The future.
View Full Code Here

Examples of com.opengamma.analytics.financial.provider.sensitivity.multicurve.MulticurveSensitivity.multipliedBy()

   * @return The present value rate sensitivity.
   */
  public MultipleCurrencyMulticurveSensitivity presentValueCurveSensitivity(final BondFuture future, final IssuerProviderInterface issuerMulticurves) {
    Currency ccy = future.getCurrency();
    final MulticurveSensitivity priceSensitivity = priceCurveSensitivity(future, issuerMulticurves);
    final MultipleCurrencyMulticurveSensitivity transactionSensitivity = MultipleCurrencyMulticurveSensitivity.of(ccy, priceSensitivity.multipliedBy(future.getNotional()));
    return transactionSensitivity;
  }

  /**
   * Computes the gross basis of the bonds in the underlying basket from their clean prices.
View Full Code Here

Examples of com.opengamma.analytics.financial.provider.sensitivity.multicurve.MulticurveSensitivity.multipliedBy()

    MulticurveSensitivity sensitivity = MulticurveSensitivity.ofYieldDiscounting(pvsDF);
    final Map<Double, MulticurveSensitivity> cfeCurveSensi = futures.getUnderlyingSwap().accept(CFECSC, multicurves);
    for (int loopcf = 0; loopcf < cfe.getNumberOfPayments(); loopcf++) {
      final MulticurveSensitivity sensiCfe = cfeCurveSensi.get(cfe.getNthPayment(loopcf).getPaymentTime());
      if (!(sensiCfe == null)) { // There is some sensitivity to that cfe.
        sensitivity = sensitivity.plus(sensiCfe.multipliedBy(cfeAmountBar[loopcf]));
      }
    }
    return sensitivity;
  }
View Full Code Here

Examples of com.opengamma.analytics.financial.provider.sensitivity.multicurve.MulticurveSensitivity.multipliedBy()

    ArgumentChecker.notNull(transaction, "transaction");
    ArgumentChecker.notNull(blackPrice, "Black parameters");
    final MultipleCurrencyMulticurveSensitivity premiumSensitivity = METHOD_PAY_FIXED.presentValueCurveSensitivity(transaction.getPremium(), blackPrice.getMulticurveProvider());
    final MulticurveSensitivity securitySensitivity = METHOD_SECURITY.priceCurveSensitivity(transaction.getUnderlyingOption(), blackPrice);
    return premiumSensitivity.plus(MultipleCurrencyMulticurveSensitivity.of(transaction.getCurrency(),
        securitySensitivity.multipliedBy(transaction.getQuantity() * transaction.getUnderlyingOption().getUnderlyingFuture().getNotional())));
  }

  /**
   * Computes the present value curve sensitivity of a transaction. The bond futures price is computed from the curves.
   * @param transaction The option transaction.
View Full Code Here

Examples of com.opengamma.analytics.financial.provider.sensitivity.multicurve.MulticurveSensitivity.multipliedBy()

        priceMin = priceFromBond[loopbasket];
        indexCTD = loopbasket;
      }
    }
    MulticurveSensitivity result = BOND_METHOD.dirtyPriceCurveSensitivity(futures.getDeliveryBasket()[indexCTD], issuerMulticurves);
    return result.multipliedBy(1.0 / futures.getConversionFactor()[indexCTD]);
  }

  /**
   * Computes the gross basis of the bonds in the underlying basket from their clean prices.
   * @param futures The future security.
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.