Option Pricing
Essay by babysaur • March 21, 2016 • Coursework • 1,180 Words (5 Pages) • 943 Views
IEOR4007 Homework #5
1. Option pricing in incomplete markets
Matlab codes:
close all
clear all
clc
%% Data
% number of assets
n = 10;
% number of states
m = 20;
% price today
p = [92 24 68 60 81 81 49 2 84 34]';
% strikes
strike = [100 98 101];
% S matrix
S = [117 151 176 141 34 78 178 175 78 170 11 68 155 2 27 39 38 115 52 38
1 35 21 43 22 20 39 25 10 31 39 1 32 18 39 24 33 20 15 9
24 83 37 66 19 85 46 105 104 72 61 109 100 79 99 80 42 36 42 65
71 31 82 56 36 69 54 44 68 61 78 93 51 86 17 96 27 25 85 72
25 3 160 36 54 118 51 84 12 176 104 76 92 60 78 41 104 136 95 115
32 58 120 104 71 87 121 9 92 8 64 47 133 3 117 148 151 120 67 76
20 59 30 88 67 38 68 25 41 85 63 20 77 58 13 19 56 58 34 53
2 1 1 2 1 2 3 1 1 3 3 1 1 1 3 1 2 3 3 3
14 75 73 58 26 111 115 120 79 91 20 74 118 147 45 42 142 39 132 149
21 22 5 7 58 17 76 16 16 89 40 31 28 33 35 53 11 4 41 78]';
%% compute a strictly positive state price deflator
f = zeros(1,m);
pi = linprog(f,[],[],S',p,zeros(1,m))
%% check if the call is attainable
K = 100;
payoff = max(S(:,1)-K,0);
equation = [S payoff];
rank_coefficient = rank(S)
rank_augmented = rank(equation)
if (rank_coefficient == rank_augmented)
fprintf('security attainable\n\n')
else
fprintf('security not attainable\n\n')
end
%% upper/lower bound and sensitivity analysis
% upper bound
[theta,~,~,~,u] = linprog(p,-S,-payoff);
upper_bnd = theta'*p
tol = 1e-6;
index = find(abs(u.ineqlin) > tol);
b99 = max(S(:,1)-99,0);
theta99 = S(index,:)\b99(index);
checksens_upper = (min(S*theta99 - b99)>=-tol)
new_upper_bnd = upper_bnd + (b99-payoff)'*u.ineqlin
% lower bound
[theta,~,~,~,u] = linprog(-p,S,payoff);
lower_bnd = theta'*p
index = find(abs(u.ineqlin) > tol);
theta99 = S(index,:)\b99(index);
checksens_lower = (max(S*theta99 - b99)<=tol)
new_lower_bnd = lower_bnd + (b99-payoff)'*u.ineqlin
Output:
Optimization terminated.
pi =
0.1443
0.0454
0.0256
0.0318
0.1796
0.0658
0.0121
0.1108
0.0301
0.0001
0.0261
0.0433
0.0296
0.0586
0.0935
0.0066
0.0715
0.0530
0.0646
0.0318
rank_coefficient =
10
rank_augmented =
11
security not attainable
Optimization terminated.
upper_bnd =
28.2009
checksens_upper =
1
new_upper_bnd =
28.6513
Optimization terminated.
lower_bnd =
13.4915
checksens_lower =
1
new_lower_bnd =
13.8390
2. Pricing a gas supply contract
...
...