Rank: 107448 based on 0 downloads (last 30 days) and 0 file submitted
photo

Wes Devauld

E-mail

Personal Profile:
Professional Interests:

 

Watch this Author's files

 

Comments and Ratings by Wes View all
Updated File Comments Rating
23 Nov 2011 RANDRAW Efficient Random Variates Generator (from over 50 distributions). Author: Alex Bar-Guy

30 Aug 2011 MCSpreadOption.m Monte Carlo Simulation Spread Options Author: Espen Haug

The For loop can be replaced with:

---Code Start
Epsilon1 = normrnd(zeros(nSimulations,1),1);
Epsilon2 = rho * Epsilon1 + normrnd(zeros(nSimulations,1),1) ...
.* sqrt(ones(nSimulations,1) - rho ^ 2);
St1 = S1 * exp(Drift1 + v1Sqrdt * Epsilon1);
St2 = S2 * exp(Drift2 + v2Sqrdt * Epsilon2);
price = exp(-r * T) * (sum(max(z * (St1 - St2 - X), 0)) / nSimulations);
---Code End

Contact us