wilsonfreitas / R-fixedincome

Fixed income tools for R
http://wilsonfreitas.github.io/R-fixedincome/
Other
50 stars 25 forks source link

interpolation doesn't accept different units #22

Open wilsonfreitas opened 2 years ago

wilsonfreitas commented 2 years ago

The terms in a term structure usually have the same units. So, once you have a term structure defined with terms in days you can only interpolate it using terms in days. The [[ operator could be adapted to handled that and accept terms in any units.

wilsonfreitas commented 2 years ago

With this commit ea6263d2518bb794d4f0c9d1ade66f5a996b2684 the SpotRateCurve works with terms in days, by default. It accepts terms in any units in its constructor, but internally the terms are converted to days units.

With that in mind, the operator [[ should receive the term and convert it to days.