Examples of multiplyBy()


Examples of aima.core.probability.CategoricalDistribution.multiplyBy()

    // <b>P</b>(e<sub>t+1</sub> | X<sub>t+1</sub>)
    CategoricalDistribution s2 = sensorModel.posteriorDistribution(ProbUtil
        .constructConjunction(e_tp1.toArray(new Proposition[e_tp1
            .size()])), Xtp1);

    return s2.multiplyBy(s1).normalize();
  }

  @Override
  public CategoricalDistribution backward(CategoricalDistribution b_kp2t,
      List<AssignmentProposition> e_kp1) {
View Full Code Here

Examples of cc.mallet.grmm.types.FactorGraph.multiplyBy()

    Variable[] vars2 = new Variable[]{ vars[1], vars[2] };
    double[] vals2 = new double[] { 0.2, 0.2, 0.8, 0.7, 0, 0.7, 0.3, 0, 0.5 };
    Factor tbl2 = new TableFactor (vars2, vals2);

    FactorGraph fg = new FactorGraph ();
    fg.multiplyBy (tbl1);
    fg.multiplyBy (tbl2);
    System.out.println (fg.dumpToString ());

    GibbsSampler gs = new GibbsSampler (new Randoms (324123), 10);
    gs.sample (fg, 10)// assert no exception
View Full Code Here

Examples of cc.mallet.grmm.types.FactorGraph.multiplyBy()

    double[] vals2 = new double[] { 0.2, 0.2, 0.8, 0.7, 0, 0.7, 0.3, 0, 0.5 };
    Factor tbl2 = new TableFactor (vars2, vals2);

    FactorGraph fg = new FactorGraph ();
    fg.multiplyBy (tbl1);
    fg.multiplyBy (tbl2);
    System.out.println (fg.dumpToString ());

    GibbsSampler gs = new GibbsSampler (new Randoms (324123), 10);
    gs.sample (fg, 10)// assert no exception
  }
View Full Code Here

Examples of cc.mallet.grmm.types.LogTableFactor.multiplyBy()

    for (Iterator it = edge.neighboringParents.iterator (); it.hasNext ();) {
      RegionEdge otherEdge = (RegionEdge) it.next ();
      Factor otherMsg = oldMessages.getMessage (otherEdge.from, otherEdge.to);

      product.multiplyBy (otherMsg);
    }

    for (Iterator it = edge.loopingMessages.iterator (); it.hasNext ();) {
      RegionEdge otherEdge = (RegionEdge) it.next ();
      Factor otherMsg = newMessages.getMessage (otherEdge.from, otherEdge.to);
View Full Code Here

Examples of com.opengamma.analytics.financial.interestrate.PresentValueSABRSensitivityDataBundle.multiplyBy()

   * @return The present value curve sensitivity.
   */
  public PresentValueSABRSensitivityDataBundle presentValueSABRSensitivity(final InterestRateFutureOptionMarginTransaction transaction, final SABRInterestRateDataBundle sabrData) {
    PresentValueSABRSensitivityDataBundle securitySensitivity = ((InterestRateFutureOptionMarginSecuritySABRMethod) getSecurityMethod()).priceSABRSensitivity(transaction.getUnderlyingOption(),
        sabrData);
    securitySensitivity = securitySensitivity.multiplyBy(transaction.getQuantity() * transaction.getUnderlyingOption().getUnderlyingFuture().getNotional()
        * transaction.getUnderlyingOption().getUnderlyingFuture().getPaymentAccrualFactor());
    return securitySensitivity;
  }

}
View Full Code Here

Examples of com.opengamma.analytics.financial.interestrate.PresentValueSABRSensitivityDataBundle.multiplyBy()

   * @param sabrData The SABR and multi-curves provider.
   * @return The present value curve sensitivity.
   */
  public PresentValueSABRSensitivityDataBundle presentValueSABRSensitivity(final InterestRateFutureOptionMarginTransaction transaction, final SABRSTIRFuturesProviderInterface sabrData) {
    PresentValueSABRSensitivityDataBundle securitySensitivity = getSecurityMethod().priceSABRSensitivity(transaction.getUnderlyingOption(), sabrData);
    securitySensitivity = securitySensitivity.multiplyBy(transaction.getQuantity() * transaction.getUnderlyingOption().getUnderlyingFuture().getNotional()
        * transaction.getUnderlyingOption().getUnderlyingFuture().getPaymentAccrualFactor());
    return securitySensitivity;
  }

}
View Full Code Here

Examples of com.opengamma.analytics.financial.interestrate.PresentValueSABRSensitivityDataBundle.multiplyBy()

    PresentValueSABRSensitivityDataBundle cmsCap1SABRSensitivity = _methodCmsCap.presentValueSABRSensitivity(cmsCap1, sabrData);
    PresentValueSABRSensitivityDataBundle cmsCap2SABRSensitivity = _methodCmsCap.presentValueSABRSensitivity(cmsCap2, sabrData);
    cmsCoupon1SABRSensitivity = cmsCoupon1SABRSensitivity.multiplyBy(cmsCoupon1PriceBar);
    cmsCoupon2SABRSensitivity = cmsCoupon2SABRSensitivity.multiplyBy(cmsCoupon2PriceBar);
    cmsCap1SABRSensitivity = cmsCap1SABRSensitivity.multiplyBy(cmsCap1PriceBar);
    cmsCap2SABRSensitivity = cmsCap2SABRSensitivity.multiplyBy(cmsCap2PriceBar);
    PresentValueSABRSensitivityDataBundle result = cmsCoupon1SABRSensitivity;
    result = result.plus(cmsCoupon2SABRSensitivity);
    result = result.plus(cmsCap1SABRSensitivity);
    result = result.plus(cmsCap2SABRSensitivity);
    return result;
View Full Code Here

Examples of com.opengamma.analytics.financial.interestrate.PresentValueSABRSensitivityDataBundle.multiplyBy()

  public void presentValueSABRSensitivity() {
    // Swaption sensitivity
    final PresentValueSABRSensitivityDataBundle pvsLongPayer = METHOD_SWPT_SABR.presentValueSABRSensitivity(SWAPTION_LONG_PAYER, SABR_MULTICURVES);
    PresentValueSABRSensitivityDataBundle pvsShortPayer = METHOD_SWPT_SABR.presentValueSABRSensitivity(SWAPTION_SHORT_PAYER, SABR_MULTICURVES);
    // Long/short parity
    pvsShortPayer = pvsShortPayer.multiplyBy(-1.0);
    assertEquals("SwaptionPhysicalFixedIborSABRMethod: presentValueSABRSensitivity", pvsLongPayer.getAlpha(), pvsShortPayer.getAlpha());
    // SABR sensitivity vs finite difference
    final double pvLongPayer = METHOD_SWPT_SABR.presentValue(SWAPTION_LONG_PAYER, SABR_MULTICURVES).getAmount(EUR);
    final double shift = 1.0E-8;
    final DoublesPair expectedExpiryTenor = new DoublesPair(SWAPTION_LONG_PAYER.getTimeToExpiry(), ANNUITY_TENOR_YEAR);
View Full Code Here

Examples of com.opengamma.analytics.financial.interestrate.PresentValueSABRSensitivityDataBundle.multiplyBy()

        IS_CAP, FUNDING_CURVE_NAME);
    final SABRInterestRateCorrelationParameters sabrCorrelation = SABRInterestRateCorrelationParameters.from(SABR_PARAMETERS, CORRELATION_FUNCTION);
    final SABRInterestRateDataBundle sabrBundleCor = new SABRInterestRateDataBundle(sabrCorrelation, CURVES);
    final PresentValueSABRSensitivityDataBundle pvssLong = METHOD_CMS_SPREAD.presentValueSABRSensitivity(CMS_CAP_SPREAD, sabrBundleCor);
    PresentValueSABRSensitivityDataBundle pvssShort = METHOD_CMS_SPREAD.presentValueSABRSensitivity(cmsSpreadShort, sabrBundleCor);
    pvssShort = pvssShort.multiplyBy(-1);
    assertEquals("CMS spread: Long/Short parity", pvssLong, pvssShort);
  }

  @Test(enabled = false)
  /**
 
View Full Code Here

Examples of com.opengamma.analytics.financial.interestrate.PresentValueSABRSensitivityDataBundle.multiplyBy()

  public void presentValueSABRSensitivity() {
    // Swaption sensitivity
    final PresentValueSABRSensitivityDataBundle pvsLongPayer = METHOD_EXTRAPOLATION.presentValueSABRSensitivity(SWAPTION_LONG_PAYER_HIGH, SABR_MULTICURVES);
    PresentValueSABRSensitivityDataBundle pvsShortPayer = METHOD_EXTRAPOLATION.presentValueSABRSensitivity(SWAPTION_SHORT_PAYER_HIGH, SABR_MULTICURVES);
    // Long/short parity
    pvsShortPayer = pvsShortPayer.multiplyBy(-1.0);
    assertEquals(pvsLongPayer.getAlpha(), pvsShortPayer.getAlpha());
    // SABR sensitivity vs finite difference
    final double pvLongPayer = METHOD_EXTRAPOLATION.presentValue(SWAPTION_LONG_PAYER_HIGH, SABR_MULTICURVES).getAmount(EUR);
    final DoublesPair expectedExpiryTenor = new DoublesPair(SWAPTION_LONG_PAYER_HIGH.getTimeToExpiry(), ANNUITY_TENOR_YEAR);
    final double shift = 0.000005;
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.