Mastering-Python-for-Finance-source-codes icon indicating copy to clipboard operation
Mastering-Python-for-Finance-source-codes copied to clipboard

incorrect treatment of sigma??

Open vvaidy opened this issue 7 years ago • 1 comments

Hi,

I suspect in your CIR model you are forgetting to scale the brownian motion term. If I am reading your code correctly, instead of:

dr = K*(theta-rates[-1])*dt + sigma*np.sqrt(rates[-1])*np.random.normal()

I would have said:

dr = K*(theta-rates[-1])*dt + sigma*np.sqrt(rates[-1])*np.sqrt(dt)*np.random.normal()

What am I missing?

-VV

vvaidy avatar May 15 '18 21:05 vvaidy

you're right, please scale it.

jamesmawm avatar May 19 '18 05:05 jamesmawm