% Displays simulated paths randn('seed',0); S0 = 50; % spot price mu=0.1; % drift parameter sigma=0.3; % diffusion parameter T=1; % maturity NSteps=250; % number of time steps NRepl = 3; % number of generated trajectories paths=AssetPaths(S0,mu,sigma,T,NSteps,NRepl); %paths=AssetPaths(50,0.1,0.3,1,250,3); plot(1:length(paths),paths) % Find the price of a call option with So=50,K=52,T=5/12,r=0.1,sigma=0.4 % using Monte Carlo simulations (CI gives 95% confidence intervals) randn('seed',0); [Price,CI] = EuroMC(50,'MyCall',0.1,5/12,0.4,200000,[52 0 0]) % using explicit formula (Matlab function) (first component) [CPrice,PPrice] = blsprice(50,52,0.1,5/12,0.4) % Find the price of a put option with So=50,K=52,T=5/12,r=0.1,sigma=0.4 % Using Monte Carlo simulations randn('seed',0); [Price,CI] = EuroMC(50,'MyPut',0.1,5/12,0.4,200000,[52 0 0]) % using explicit formula (second component) [CPrice,PPrice] = blsprice(50,52,0.1,5/12,0.4);