Skip to content

Commit

Permalink
Simplified
Browse files Browse the repository at this point in the history
  • Loading branch information
jaehyukchoi committed Nov 1, 2018
1 parent ae8cea7 commit 65d95f9
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions HW3/option_models/basket.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,7 @@ def basket_price_mc(
'''
put the geometric brownian motion here
'''
vol_kk = cov_m.diagonal() #get the variance of each stock
vol_kk = np.tile(vol_kk,(n_samples,1)).transpose() #repeat
prices = forward[:,None]*np.exp(-0.5*texp*vol_kk+np.sqrt(texp) * chol_m @ znorm_m)
prices = forward[:,None]*np.exp(-0.5*texp*vol[:,None]**2 + np.sqrt(texp) * chol_m @ znorm_m)

else:
prices = forward[:,None] + np.sqrt(texp) * chol_m @ znorm_m
Expand Down

0 comments on commit 65d95f9

Please sign in to comment.