//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @ImmutableConstructor private SabrParameters(com.opengamma.strata.market.curve.Curve alphaCurve, com.opengamma.strata.market.curve.Curve betaCurve, com.opengamma.strata.market.curve.Curve rhoCurve, com.opengamma.strata.market.curve.Curve nuCurve, com.opengamma.strata.market.curve.Curve shiftCurve, SabrVolatilityFormula sabrFormula) private SabrParameters(Curve alphaCurve, Curve betaCurve, Curve rhoCurve, Curve nuCurve, Curve shiftCurve, SabrVolatilityFormula sabrFormula) { validate(alphaCurve, "alphaCurve", ValueType.SABR_ALPHA); validate(betaCurve, "betaCurve", ValueType.SABR_BETA); validate(rhoCurve, "rhoCurve", ValueType.SABR_RHO); validate(nuCurve, "nuCurve", ValueType.SABR_NU); ArgChecker.notNull(shiftCurve, "shiftCurve"); ArgChecker.notNull(sabrFormula, "sabrFormula"); DayCount dayCount = alphaCurve.Metadata.findInfo(CurveInfoType.DAY_COUNT).orElseThrow(() => new System.ArgumentException("Incorrect curve metadata, missing DayCount")); validate(betaCurve, dayCount); validate(rhoCurve, dayCount); validate(nuCurve, dayCount); validate(shiftCurve, dayCount); this.alphaCurve = alphaCurve; this.betaCurve = betaCurve; this.rhoCurve = rhoCurve; this.nuCurve = nuCurve; this.shiftCurve = shiftCurve; this.sabrVolatilityFormula = sabrFormula; this.dayCount = dayCount; this.paramCombiner = ParameterizedDataCombiner.of(alphaCurve, betaCurve, rhoCurve, nuCurve, shiftCurve); }
//------------------------------------------------------------------------- /// <summary> /// Constructs SABR model fitter from forward, strikes, time to expiry, implied volatilities and error values. /// <para> /// {@code strikes}, {@code impliedVols} and {@code error} should be the same length and ordered coherently. /// /// </para> /// </summary> /// <param name="forward"> the forward value of the underlying </param> /// <param name="strikes"> the ordered values of strikes </param> /// <param name="timeToExpiry"> the time-to-expiry </param> /// <param name="impliedVols"> the market implied volatilities </param> /// <param name="error"> the 'measurement' error to apply to the market volatility of a particular option </param> /// <param name="sabrVolatilityFormula"> the volatility formula </param> //JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @SuppressWarnings("unchecked") public SabrModelFitter(double forward, com.opengamma.strata.collect.array.DoubleArray strikes, double timeToExpiry, com.opengamma.strata.collect.array.DoubleArray impliedVols, com.opengamma.strata.collect.array.DoubleArray error, com.opengamma.strata.pricer.model.SabrVolatilityFormula sabrVolatilityFormula) public SabrModelFitter(double forward, DoubleArray strikes, double timeToExpiry, DoubleArray impliedVols, DoubleArray error, SabrVolatilityFormula sabrVolatilityFormula) : base(forward, strikes, timeToExpiry, impliedVols, error, (VolatilityFunctionProvider <SabrFormulaData>)sabrVolatilityFormula) { }
/// <summary> /// Obtains an instance with shift from nodal curves and volatility function provider. /// <para> /// Each curve is specified by an instance of <seealso cref="Curve"/>, such as <seealso cref="InterpolatedNodalCurve"/>. /// The curves must contain the correct metadata: /// <ul> /// <li>The x-value type must be <seealso cref="ValueType#YEAR_FRACTION"/> /// <li>The y-value type must be <seealso cref="ValueType#YEAR_FRACTION"/> /// <li>The z-value type must be <seealso cref="ValueType#SABR_ALPHA"/>, <seealso cref="ValueType#SABR_BETA"/>, /// <seealso cref="ValueType#SABR_RHO"/> or <seealso cref="ValueType#SABR_NU"/> as appropriate /// <li>The day count must be set in the additional information of the alpha curve using /// <seealso cref="CurveInfoType#DAY_COUNT"/>, if present on other curves it must match that on the alpha /// </ul> /// The shift curve does not have to contain any metadata. /// If it does, the day count and convention must match that on the alpha curve. /// </para> /// <para> /// Suitable curve metadata can be created using /// <seealso cref="Curves#sabrParameterByExpiry(String, DayCount, ValueType)"/>. /// /// </para> /// </summary> /// <param name="alphaCurve"> the alpha curve </param> /// <param name="betaCurve"> the beta curve </param> /// <param name="rhoCurve"> the rho curve </param> /// <param name="nuCurve"> the nu curve </param> /// <param name="shiftCurve"> the shift curve </param> /// <param name="sabrFormula"> the SABR formula </param> /// <returns> {@code SabrParameters} </returns> public static SabrParameters of(Curve alphaCurve, Curve betaCurve, Curve rhoCurve, Curve nuCurve, Curve shiftCurve, SabrVolatilityFormula sabrFormula) { return(new SabrParameters(alphaCurve, betaCurve, rhoCurve, nuCurve, shiftCurve, sabrFormula)); }
/// <summary> /// Obtains an instance with shift from nodal surfaces and volatility function provider. /// <para> /// Each surface is specified by an instance of <seealso cref="Surface"/>, such as <seealso cref="InterpolatedNodalSurface"/>. /// The surfaces must contain the correct metadata: /// <ul> /// <li>The x-value type must be <seealso cref="ValueType#YEAR_FRACTION"/> /// <li>The y-value type must be <seealso cref="ValueType#YEAR_FRACTION"/> /// <li>The z-value type must be <seealso cref="ValueType#SABR_ALPHA"/>, <seealso cref="ValueType#SABR_BETA"/>, /// <seealso cref="ValueType#SABR_RHO"/> or <seealso cref="ValueType#SABR_NU"/> as appropriate /// <li>The day count must be set in the additional information of the alpha surface using /// <seealso cref="SurfaceInfoType#DAY_COUNT"/>, if present on other surfaces it must match that on the alpha /// </ul> /// The shift surface does not have to contain any metadata. /// If it does, the day count and convention must match that on the alpha surface. /// </para> /// <para> /// Suitable surface metadata can be created using /// <seealso cref="Surfaces#sabrParameterByExpiryTenor(String, DayCount, ValueType)"/>. /// /// </para> /// </summary> /// <param name="alphaSurface"> the alpha surface </param> /// <param name="betaSurface"> the beta surface </param> /// <param name="rhoSurface"> the rho surface </param> /// <param name="nuSurface"> the nu surface </param> /// <param name="shiftSurface"> the shift surface </param> /// <param name="sabrFormula"> the SABR formula </param> /// <returns> {@code SabrInterestRateParameters} </returns> public static SabrInterestRateParameters of(Surface alphaSurface, Surface betaSurface, Surface rhoSurface, Surface nuSurface, Surface shiftSurface, SabrVolatilityFormula sabrFormula) { return(new SabrInterestRateParameters(alphaSurface, betaSurface, rhoSurface, nuSurface, shiftSurface, sabrFormula)); }