Exemplo n.º 1
0
 private HullWhiteOneFactorPiecewiseConstantParametersProvider(HullWhiteOneFactorPiecewiseConstantParameters parameters, DayCount dayCount, ZonedDateTime valuationDateTime)
 {
     JodaBeanUtils.notNull(parameters, "parameters");
     JodaBeanUtils.notNull(dayCount, "dayCount");
     JodaBeanUtils.notNull(valuationDateTime, "valuationDateTime");
     this.parameters = parameters;
     this.dayCount = dayCount;
     this.valuationDateTime = valuationDateTime;
 }
Exemplo n.º 2
0
        //-------------------------------------------------------------------------
        public virtual void coverage()
        {
            HullWhiteOneFactorPiecewiseConstantParametersProvider test1 = HullWhiteOneFactorPiecewiseConstantParametersProvider.of(PARAMETERS, ACT_360, DATE_TIME);

            coverImmutableBean(test1);
            HullWhiteOneFactorPiecewiseConstantParameters         @params = HullWhiteOneFactorPiecewiseConstantParameters.of(0.02, DoubleArray.of(0.01, 0.011, 0.014), DoubleArray.of(0.5, 5.0));
            HullWhiteOneFactorPiecewiseConstantParametersProvider test2   = HullWhiteOneFactorPiecewiseConstantParametersProvider.of(@params, ACT_ACT_ISDA, DATE_TIME.plusDays(1));

            coverBeanEquals(test1, test2);
        }
Exemplo n.º 3
0
 //-----------------------------------------------------------------------
 public override bool Equals(object obj)
 {
     if (obj == this)
     {
         return(true);
     }
     if (obj != null && obj.GetType() == this.GetType())
     {
         HullWhiteOneFactorPiecewiseConstantParameters other = (HullWhiteOneFactorPiecewiseConstantParameters)obj;
         return(JodaBeanUtils.equal(meanReversion, other.meanReversion) && JodaBeanUtils.equal(volatility, other.volatility) && JodaBeanUtils.equal(volatilityTime, other.volatilityTime));
     }
     return(false);
 }
Exemplo n.º 4
0
 public override Builder set(string propertyName, object newValue)
 {
     switch (propertyName.GetHashCode())
       {
     case 458736106: // parameters
       this.parameters = (HullWhiteOneFactorPiecewiseConstantParameters) newValue;
       break;
     case 1905311443: // dayCount
       this.dayCount = (DayCount) newValue;
       break;
     case -949589828: // valuationDateTime
       this.valuationDateTime = (ZonedDateTime) newValue;
       break;
     default:
       throw new NoSuchElementException("Unknown property: " + propertyName);
       }
       return this;
 }
Exemplo n.º 5
0
 /// <summary>
 /// Obtains an instance from Hull-White model parameters and the date, time and zone for which it is valid.
 /// </summary>
 /// <param name="parameters">  the Hull-White model parameters </param>
 /// <param name="dayCount">  the day count applicable to the model </param>
 /// <param name="valuationDate">  the valuation date </param>
 /// <param name="valuationTime">  the valuation time </param>
 /// <param name="valuationZone">  the valuation time zone </param>
 /// <returns> the provider </returns>
 public static HullWhiteOneFactorPiecewiseConstantParametersProvider of(HullWhiteOneFactorPiecewiseConstantParameters parameters, DayCount dayCount, LocalDate valuationDate, LocalTime valuationTime, ZoneId valuationZone)
 {
     return of(parameters, dayCount, valuationDate.atTime(valuationTime).atZone(valuationZone));
 }
Exemplo n.º 6
0
 //-------------------------------------------------------------------------
 /// <summary>
 /// Obtains an instance from Hull-White model parameters and the date-time for which it is valid.
 /// </summary>
 /// <param name="parameters">  the Hull-White model parameters </param>
 /// <param name="dayCount">  the day count applicable to the model </param>
 /// <param name="valuationDateTime">  the valuation date-time </param>
 /// <returns> the provider </returns>
 public static HullWhiteOneFactorPiecewiseConstantParametersProvider of(HullWhiteOneFactorPiecewiseConstantParameters parameters, DayCount dayCount, ZonedDateTime valuationDateTime)
 {
     return new HullWhiteOneFactorPiecewiseConstantParametersProvider(parameters, dayCount, valuationDateTime);
 }