[Finance] Arbitrage Free Initial Price of a European Option

written by jjycjn   2014. 10. 13. 07:26

아래 코드는 주어진 시장이 Binomial Model라 가정할 때, call option의 arbitrage free initial price을 구하는 과정을 프로그램화 한 것이다. 이때 입력값 S0는 stock의 initial price, u와 d는 각각 stock의 가격 상승률과 하락율, T와 K는 각각 option의 exercise time과 strike price, 마지막으로 r은 bond의 이자율을 나타낸다. 출력값인 V0는 contingent claim의 arbitrage free initial price를 나타낸다.

function [V0] = price2(S0,u,d,T,K,r)
% Compute the arbitrage free initial price of the European call option
% by using V0 = E^{p*}[X*]

p = (1+r-d)/(u-d);
V0 = 0;
for k = 0:T 
    V0 = V0 + nchoosek(T,k)*p^k*(1-p)^(T-k)*max(S0*u^k*d^(T-k)-K,0);
end
V0 = V0/(1+r)^T; % Arbitrage free initial price
end


만약 주어진 contingent claim이 put option이라면, 간단히 위 코드의 8번째 줄을

    V0 = V0 + nchoosek(T,k)*p^k*(1-p)^(T-k)*max(K-S0*u^k*d^(T-k),0);

로 바꾸어 주기만 하면 된다.


하지만 contingent claim의 exercise time T 때의 가격이 임의로 주어졌다면, (예를 들면, X = max{S0,S2,..., ST} 등) 위의 공식으로는 계산이 어렵다. 따라서 아래와 같이 직접 정의에 따라 단계적으로 initial price를 구해야 한다. 특히, 아래 코드를 이용하면 주어진 contingent claim에 대한 replicating strategy와 이를 통해 얻을 수 있는 value process까지 한꺼번에 구할 수 있기 때문에 그 활용도가 더욱 높다. 이때 코드의 입력값과 출력값은 위와 같고, 출력값 V는 value process, AB는 replicating strategy를 나타낸다.

function [V0,V,AB] = price(S0,u,d,T,K,r)
% Compute the arbitrage free initial price of the European call option
% by using the definition

% Make the binomial tree with S_0, S_1, S_2, ..., S_T
S = zeros(2^T, T+1);
S(1,1) = S0;
for t = 2:T+1
    for j = 1:2^(t-2)
        S(2^(T-t+1)*(2*(j-1))+1,t) = S(2^(T-t+1)*(2*(j-1))+1,t-1)*u;
        S(2^(T-t+1)*(2*j-1)+1,t) = S(2^(T-t+1)*(2*(j-1))+1,t-1)*d;
    end
end

% Compute the value of contingent claim X at time T
X = zeros(2^T,1);
for j = 1:2^T
    X(j,1) = max(0, S(j,T+1)-K);
end

% Calculate the risk neutral probability p*
p = (1+r-d)/(u-d);

% Compute the arbitrage free initial price V0 of the claim X
% and the hedging strategy (a_t,b_t) where t=1,2,...,T
V = zeros(2^T, T+1);
AB = zeros(2^(T-1), T, 2);
V(:,T+1) = X;
for t = 1:T
    for j = 1:2^(T-t)
        % Compute the value of the portfolio V_t
        V(2^(t-1)*(2*(j-1))+1,T-t+1)...
            = (p*V(2^(t-1)*(2*(j-1))+1,T-t+2)...
              + (1-p)*V(2^(t-1)*(2*j-1)+1,T-t+2))/(1+r);
        % Compute the number of shares of stock a_t
        AB(2^(t-1)*(j-1)+1,T-t+1,1)...
            = (V(2^(t-1)*(2*(j-1))+1,T-t+2)...
              - V(2^(t-1)*(2*j-1)+1,T-t+2))/...
              ((u-d)*S(2^(t-1)*(2*(j-1))+1,T-t+1));
        % Compute the number of unit of bond b_t
        AB(2^(t-1)*(j-1)+1,T-t+1,2)...
            = 1/(1+r)^(T-t+1) * (u*V(2^(t-1)*(2*j-1)+1,T-t+2)...
              - d*V(2^(t-1)*(2*(j-1))+1,T-t+2))/(u-d);
    end
end

% Find the arbitrage free initial price of the claim X
V0 = V(1,1); % Arbitrage free initial price
end


이제 실제로 위의 두가지 코드를 이용하여 initial price를 구해보자. 초기값은 S0=100, u=2, d=0.5, T=4, K=80, r=0.1로 두었다. 아래 결과를 보면 알 수 있듯이, 어떠한 코드를 쓰든지 initial price V0는 약 64.8699가 됨을 알 수 있다.

>> S0=100; u=2; d=0.5; T=4; K=80; r=0.1;
>> [V0] = price2(S0,u,d,T,K,r)

V0 =
   64.8699

>> [V0,V,AB] = price(S0,u,d,T,K,r)

V0 =
   64.8699

V =
   1.0e+03 *
    0.0649    0.1488    0.3339    0.7273    1.5200
         0         0         0         0    0.3200
         0         0         0    0.1273    0.3200
         0         0         0         0    0.0200
         0         0    0.0502    0.1273    0.3200
         0         0         0         0    0.0200
         0         0         0    0.0073    0.0200
         0         0         0         0         0
         0    0.0197    0.0502    0.1273    0.3200
         0         0         0         0    0.0200
         0         0         0    0.0073    0.0200
         0         0         0         0         0
         0         0    0.0026    0.0073    0.0200
         0         0         0         0         0
         0         0         0         0         0
         0         0         0         0         0

AB(:,:,1) =
    0.8607    0.9455    1.0000    1.0000
         0         0         0    1.0000
         0         0    0.8000    1.0000
         0         0         0    0.2667
         0    0.6347    0.8000    1.0000
         0         0         0    0.2667
         0         0    0.1939    0.2667
         0         0         0         0

AB(:,:,2) =
  -21.2007  -36.6095  -54.6411  -54.6411
         0         0         0  -54.6411
         0         0  -24.5885  -54.6411
         0         0         0   -4.5534
         0  -10.9282  -24.5885  -54.6411
         0         0         0   -4.5534
         0         0   -1.8214   -4.5534
         0         0         0         0


  ::  
  • 공유하기  ::