Beispiel #1
0
 public double GetCompoundedRate(double t)
 {
     if (t.IsAlmostZero() || t < 0.0)
     {
         return(1.0);
     }
     if (Trait == YieldCurveTrait.ForwardCurve)
     {
         return(Math.Exp(_curveXInYears.GetIntegral(t)));
     }
     if (Trait == YieldCurveTrait.DiscountCurve)
     {
         return(1.0 / _curveXInYears.GetValue(t));
     }
     return(Compound.CalcCompoundRate(t, GetSpotRate(t)));
 }