luphord / nelson_siegel_svensson

Implementation of the Nelson-Siegel-Svensson interest rate curve model.
MIT License
110 stars 41 forks source link

Is the input yield zero-coupon yield? #15

Open flcong opened 2 years ago

flcong commented 2 years ago

A question that is not clear in the documentation but very important is whether the input yield is zero-coupon yield or yield of coupon-bearing bonds when calibrating the NS model.

elivolunteer commented 2 years ago

Correct me if I'm wrong, but this is up to the user right? This library just fits the NS/NSS curve to whatever data you give it. If you give it zero-coupon yield bonds as inputs, then the result will be a fitted NSS curve for zero-coupon yield curve. If you use coupon-bearing bonds, then it'll be a coupon-bearing yield curve.

flcong commented 2 years ago

Yeah. I agree, but I guess it would be better to be more explicit in the documentation since "fitting the NS model" could mean either directly fitting the functional form of NS model using whatever tenors and rates that are given, or a more complicated process: obtaining the zero yield curve (assuming NS model) from bond yields (or prices) such as QuantLib's FittedBondDiscountCurve class.