I would like to test different methods for fitting a yield curve, like the Nelson-Siegel, cubic splines etc.

I would like to generate random yield to maturity data, that somehow reflects the common observed yields in the markets. I am using R but I appreciate any idea.

Thanks in advance!

  • 10
    $\begingroup$ Just take historical data! $\endgroup$
    – dm63
    Apr 20, 2016 at 10:02
  • $\begingroup$ You can simulate Vasicek or CIR models using the "sde" package in R. $\endgroup$
    – Egodym
    Jun 19, 2016 at 20:28

1 Answer 1


Challenge with completely randomized yields is that it's hard to ensure the data is arbitrage-free. What you can do is either using the data from another market (say take the UK yield and pretend they are in USD) or use randomized resampling of SETS of data.

  • $\begingroup$ How would you do the resampling? I believe in addition to arbitrage there are non-trivial issues due to correlations/dependence. $\endgroup$
    – g g
    Aug 22, 2016 at 10:03
  • 1
    $\begingroup$ My understanding is that this is actually why most of the literature on yield curves translates the curves into forward curves. If you simulate random forward yields and then build a yield curve from that, then there shouldn't be arbitrage opportunities. $\endgroup$
    – John
    Feb 14, 2017 at 22:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.