Call Option Pricing – Matlab Code

In this Matlab code, we use antithetic variates to price European call options through Monte Carlo simulation. The antithetic variates is a popular variance reduction technique that leads to a faster convergence.

%inputs
N = 1000; % number of simulations
rf = 0.02; % risk-free rate
sigma = 0.2; % volatility
T = 1; % time to maturity
S0 = 10; % initial price
X = 10; % strike price

% initiate variables
E = zeros(N,1); En = zeros(N,1);
S = zeros(N,1); Sn = zeros(N,1);
V = zeros(N,1); Vn = zeros(N,1);

% simulate stock prices; use antithetic variates
for i = 1 : N
E(i) = normrnd(0,1);
En(i) = - normrnd(0,1);
S(i) = S0 * exp((rf - 0.5 * sigma^2) * T + sigma * sqrt(T) * E(i));
Sn(i) = S0 * exp((rf - 0.5 * sigma^2) * T + sigma * sqrt(T) * En(i));
V(i) = (exp(-rf * T)) * max(S(i) - X, 0);
Vn(i) = (exp(-rf * T)) * max(Sn(i) - X, 0);
end

% calculate call option price
mean(V)
mean((V + Vn) / 2)

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s