@@ -0,0 +1,1514 @@
+/**%0A * Copyright (C) 2014 - present by OpenGamma Inc. and the OpenGamma group of companies%0A * %0A * Please see distribution for license.%0A */%0Apackage com.opengamma.analytics.financial.credit.isdastandardmodel;%0A%0Aimport com.opengamma.analytics.math.utilities.Epsilon;%0A%0A/**%0A */%0Apublic class AnnuityForSpreadApproxFunction extends AnnuityForSpreadFunction %7B%0A  private static final AnalyticCDSPricer PRICER = new AnalyticCDSPricer();%0A  private final CDSAnalytic _cds;%0A  private final ISDACompliantYieldCurve _yieldCurve;%0A  private final double _eta;%0A%0A  /**%0A  * For a given quoted spread (aka 'flat' spread), this function returns the risky annuity (aka risky PV01, RPV01 or risky duration).%0A  * This works by first calibrating a constant hazard rate that recovers the given spread, then computing the value of the annuity from this%0A  * constant hazard rate. The ISDA standard CDS model is used for these calculations. %0A   * @param cds analytic description of a CDS traded at a certain time %0A   * @param yieldCurve Calibrated yield curve %0A   */%0A  public AnnuityForSpreadApproxFunction(final CDSAnalytic cds, final ISDACompliantYieldCurve yieldCurve) %7B%0A    _cds = cds;%0A    _yieldCurve = yieldCurve;%0A    _eta = cds.getCoupon(0).getYFRatio();%0A  %7D%0A%0A  @Override%0A  public Double evaluate(final Double spread) %7B%0A    final double lambda = _eta * spread / _cds.getLGD();%0A    final ISDACompliantCreditCurve cc = new ISDACompliantCreditCurve(1.0, lambda);%0A    return PRICER.annuity(_cds, _yieldCurve, cc, PriceType.CLEAN);%0A  %7D%0A  %0A%0A%0A%7D%0A

add missing file