%
% Evaluate error for basket call option

clear all; close all

rng('default')

N = 10^5;

r     = 0.05;
sigma = 0.2;
rho   = 0.1;
T     = 1;
K     = 100;
S0    = 100;

Omega = eye(5) + rho*(ones(5)-eye(5));
L = chol(Omega,'lower');
W = sqrt(T)*L*randn(5,N);
S = S0.*exp((r-0.5*sigma^2)*T + sigma*W);

S = 0.2*sum(S,1);
F = exp(-r*T)*max(S-K,0);

val = sum(F)/N
sd  = sqrt( (sum(F.^2)/N - val.^2)/(N-1) )
