% Average Rate Options (ARO) % % Multiperiod binomial model to price an average rate option % % % M.V.Wickerhauser % 2019-10-17 % 2019-10-18 - fixed the FSPut and FSCall mistake. % Example 8.1, p.112 of the textbook % Given S0=100; % Initial stock price r=0.05; % risk-free interest rate over T sigma=0.20; % volatility T=1; % unit period N=4; % number of sub periods in the tree % Computed K=S0; % Strike price for at-the-money options dt=T/N; % sub period R=exp(r*dt); % risk-free return over dt u=exp(sigma*sqrt(dt)); % up factor d=1/u; % down factor pi_up= (R-d)/(u-d); % risk-neutral up probability pi_down= 1-pi_up; % risk-neutral down probability %%% Non recombining trees for the binomial pricing model % Asset prices S=0*(1:(2*2^N-1)); % non recombining tree of stock prices S(1)=S0; % spot price at time n=0, state j=0 for n=0:(N-1) % recursive current times up to N-1 for j=2^n:(2*2^n -1) % state indexes at the current time n S(2*j) = S(j)*d; % next down state at time n+1 S(2*j+1) = S(j)*u; % next up state at time n+1 end end % ...now S(1),...,S(2*2^N-1) contain the non recombining asset tree % Path-dependent averages % ...compute these recursively as on p.111 A=0*(1:(2*2^N-1)); % non recombining tree of averages % Compute partial sums recursively along each path: A(1)=S(1); % initial summand at time n=0, state j=0 for n=0:(N-1) % recursive current times up to N-1 for j=2^n:(2*2^n -1) % state indexes at the current time n A(2*j) = A(j)+S(2*j); % next partial sum at time n+1 A(2*j+1) = A(j)+S(2*j+1); % next partial sum at time n+1 end end % Divide the partial sums by the number n+1 of summands to get averages: for n=1:N % recursive current times up to N for j=2^n:(2*2^n -1) % state indexes at the current time n A(j) = A(j)/(n+1); % n+1 summands for these indexes end end % ...now A(1),...,A(2*2^N-1) contain the non recombining averages tree % Path-dependent maximums and minimums % ...compute these recursively as on p.113 MaxS=0*(1:(2*2^N-1)); % non recombining tree of maximums MinS=0*(1:(2*2^N-1)); % non recombining tree of minimums % Compute maximums and minimums recursively along each path: MaxS(1)=S(1); % initial maximum at time n=0, state j=0 MinS(1)=S(1); % initial minimum at time n=0, state j=0 for n=0:(N-1) % recursive current times up to N-1 for j=2^n:(2*2^n -1) % state indexes at the current time n MaxS(2*j) = max(MaxS(j),S(2*j)); % next maximums at time n+1 MaxS(2*j+1) = max(MaxS(j),S(2*j+1)); MinS(2*j) = min(MinS(j),S(2*j)); % next minimums at time n+1 MinS(2*j+1) = min(MinS(j),S(2*j+1)); end end % ...now MaxS() and MinS() contain the non recombining max and min tree %%% Various path-dependent options % Asian options = average rate options. Compute these by backwardization AsianCall=0*(1:(2*2^N-1)); % non recombining tree of option prices AsianPut =0*(1:(2*2^N-1)); % non recombining tree of option prices % Initialize with the payoffs at expiry: for j=2^N:(2*2^N -1) % state indexes at expiry n=N AsianCall(j) = max(0,A(j)-K); % call payoff AsianPut(j) = max(0,K-A(j)); % put payoff end % Backward induction for n=(N-1):-1:0 % recursive previous times down to 0 for j=2^n:(2*2^n -1) % state indexes at the previous time n AsianCall(j) = (pi_up*AsianCall(2*j+1) + pi_down*AsianCall(2*j))/R; AsianPut(j) = (pi_up*AsianPut(2*j+1) + pi_down*AsianPut(2*j))/R; end end % ...now AsianCall(1) and AsianPut(1) contain the option prices at n=0. AsianCall(1) AsianPut(1) % Floating strike options. Compute these by backwardization FSCall=0*(1:(2*2^N-1)); % non recombining tree of option prices FSPut =0*(1:(2*2^N-1)); % non recombining tree of option prices % Initialize with the payoffs at expiry: for j=2^N:(2*2^N -1) % state indexes at expiry n=N FSCall(j) = max(0,S(j)-A(j)); % call payoff FSPut(j) = max(0,A(j)-S(j)); % put payoff end % Backward induction for n=(N-1):-1:0 % recursive previous times down to 0 for j=2^n:(2*2^n -1) % state indexes at the previous time n FSCall(j) = (pi_up*FSCall(2*j+1) + pi_down*FSCall(2*j))/R; FSPut(j) = (pi_up*FSPut(2*j+1) + pi_down*FSPut(2*j))/R; end end % ...now FSCall(1) and FSPut(1) contain the option prices at n=0. FSCall(1) FSPut(1) % Lookback options LBCall=0*(1:(2*2^N-1)); % non recombining tree of option prices LBPut =0*(1:(2*2^N-1)); % non recombining tree of option prices % Initialize with the payoffs at expiry: for j=2^N:(2*2^N -1) % state indexes at expiry n=N LBCall(j) = S(j)-MinS(j); % call payoff LBPut(j) = MaxS(j)-S(j); % put payoff end % Backward induction for n=(N-1):-1:0 % recursive previous times down to 0 for j=2^n:(2*2^n -1) % state indexes at the previous time n LBCall(j) = (pi_up*LBCall(2*j+1) + pi_down*LBCall(2*j))/R; LBPut(j) = (pi_up*LBPut(2*j+1) + pi_down*LBPut(2*j))/R; end end % ...now LBCall(1) and LBPut(1) contain the option prices at n=0. LBCall(1) LBPut(1)