I originally posted this on Mathematics, but was told my question is better suited here.
I want to graph a yield curve with an extended version of the Nelson-Siegel-Svensson. I have the issue date, the due date, the periodicity, the coupon rate and the price of 37 bonds. I have assumed I must calculate the yield to maturity and graph it versus the maturity in months. To fit the curve with the data I have used R functions. My questions are
- Is it correct to use the YTM?
- Is it correct to graph it vs. the maturity in months?
- Assuming the answer is yes, I have some zero coupon bonds, for which the YTM function is relatively simple, but how do I properly get the YTM for couponed bonds? I've been using a very simple approximation but I want to be more formal. The information I have read has been very confusing on the matter.