Gaurav, some time ago I asked a very similar question. I got some very helpful answers and some lines of code. Perhaps you want to read this (after consulting Hull and the others): https://stat.ethz.ch/pipermail/r-sig-finance/2006q1/000682.html If you want to see some of my "present" code, just let me know. Yours, Thomas