%% Simulation de monte carlo d'un actif de rpix Spot 100, de volatilit�
% sigma, et de drift InterestRate.
% Vincent Leclercq, The MathWorks, 2007. vincent.leclercq@mathworks.fr
clear all;
close all;
%% Starting parameters
tic;
nActifs = 2;
CorrelationMatrix = [1 0.9;0.9 1];
Vols = [0.5 0.9];
DivYelds = [0 0];
StartValues = [100 100];
ExpCovariance = corr2cov(Vols, CorrelationMatrix);
CholFactor = chol(ExpCovariance);
InterestRate = 0.03;
TimeToMaturity = 0.5; % in years
NSimulation = 10000;
nSteps = 20;
%% Time Step
Dt = TimeToMaturity/nSteps;
%% Generate Random numbers
UniforRandom = rand (nSteps , NSimulation, nActifs );
CorrelatedRandomNumbers = zeros (nSteps , NSimul