Financial-Models-Numerical-Methods icon indicating copy to clipboard operation
Financial-Models-Numerical-Methods copied to clipboard

NoteBook 1.4

Open ArjunWhabi opened this issue 2 years ago • 1 comments

Hello

Firstly thanks so much for all your notebooks they are really helpful and insightful. Credit to you for all the effort.

However I noticed something in notebook 1.4

When you are generating rice paths using Hestons Model you use the following equation :

for t in range(0,N-1):
    v = np.exp(Y[:,t])    # variance 
    v_sq = np.sqrt(v)     # square root of variance 
    
    Y[:,t+1] = Y[:,t] + (1/v)*( kappa*(theta - v) - 0.5*sigma**2 )*dt + sigma * (1/v_sq) * dt_sq * W_v[:,t]   

    X[:,t+1] = X[:,t] + (mu - 0.5*v)*dt + v_sq * dt_sq * W_S[:,t]

However, According to Euler Method shoulndt it be as follows: for i in range(1,N+1): S[i] = S[i-1] * np.exp( (mu- 0.5*v[i-1])*dt + np.sqrt(v[i-1] * dt) * Z[i-1,:,0] ) v[i] = np.maximum(v[i-1] + kappa*(theta-v[i-1])*dt + sigma*np.sqrt(v[i-1]*dt)*Z[i-1,:,1],0) I could be wrong but just thought id check

ArjunWhabi avatar Sep 09 '22 16:09 ArjunWhabi

Hi @ArjunWhabi , both approaches are correct. I used Euler Maruyama (EU) discretization on the system of two SDEs, you instead used the EU method only on the variance SDE. You used the analytical solution for the price.

cantaro86 avatar Sep 11 '22 19:09 cantaro86