Fitting Nelson-Siegel to Bond Prices

Define the Nelson-Siegel function returnint the spot (continously compounded) and the discount curve, given the vector of model parameters and a vector of time to maturities.

Define a function that returns the bond price according to the NS model, given the model parameters, the bond cash flows, payment dates and the number of coupons to be paid.

Calibrate the NS to US Bond Prices. The Excel file containing the data set is available here