Code covered by the BSD License  

Highlights from
Monte Carlo simulations using MATLAB

image thumbnail

Monte Carlo simulations using MATLAB

by

 

11 Dec 2007 (Updated )

Demonstrations of Monte Carlo simulations in MATLAB

BlsHalton(S0,X,r,T,sigma,NPoints)
% BlsHalton.m
function [Price , CI]= BlsHalton(S0,X,r,T,sigma,NPoints)
nuT = (r - 0.5*sigma^2)*T;
siT = sigma * sqrt(T);


H = haltonset(1);
HaltonRandomNumbers = net(H,NPoints);

Norm = norminv(HaltonRandomNumbers);
DiscPayoff = exp(-r*T) * max( 0 , S0*exp(nuT+siT*Norm) - X);
[Price, VarPrice, CI] = normfit(DiscPayoff);

Contact us