Pricing Asian Options Using Maple - Maple Programming Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Applications and Example Worksheets : Finance : Finance/Examples/AsianOptions

Pricing Asian Options Using Maple

 

Overview

Solution using PDE

Monte Carlo Simulation

Overview

This example demonstrates the use of Maple for computing the price of an Asian option, a derivative security that has gained popularity in financial markets in recent years.

The payoff of an Asian option is based on the difference between an asset's average price over a given time period, and a fixed price called the strike price. Asian options are popular because they tend to have lower volatility than options whose payoffs are based purely on a single price point.  It is also harder for big traders to manipulate an average price over an extended period than a single price, so Asian options offer further protection against risk.

 

One disadvantage of Asian options is that their prices are very hard to compute using standard techniques.  Unlike European options, which can be priced using the classic Black-Scholes formula, there is no analytical formula for pricing an Asian option when the underlying asset is assumed to have a lognormal distribution, which is par for the course in financial modeling.

 

In this application, we use two different approaches for computing these prices numerically: (1) Solving a partial differential equation, and (2) Monte Carlo simulation.  We will see that the two numerical solutions that Maple derives are the same, providing strong validation for both the techniques and Maple's numerics.

 

Arithmetic average Asian options are securities whose payoff depends on the average of the underlying stock price over a certain period of time. To be more precise, the value of the continuous arithmetic Asian call option at time tT is given by

 

Ct,TK=ⅇrTtE1T0TSuⅆuK`+`

 

where St is the stock price at time t, T is the expiration date, and K is the strike price.

 

Since no general closed form solution for the price of the arithmetic average Asian option is known, a variety of numerical methods have been developed. These include formulation as a PDE, Monte Carlo simulation, and numeric inversion of the Laplace transform.

 

This worksheet demonstrates how these methods can be easily and quickly implemented in Maple.

 

Solution using PDE

restart

 

It was shown by Vecer ("A new PDE approach for pricing arithmetic average Asian options", Journal of Computational Finance, vol. 4, No. 4, 105-113) that the value of the Asian option at time 0 is given by

 

S0u0,S0KS0

 

where the function ut,z satisfies the following PDE

 

ut+r1tTzuz+11tTz2σ2uz,z2=0

 

with the boundary condition

uT,z=z`+`

 

First set up the equation:

 

q:=t→1tT

qt1tT

(2.1)

pde:=tut,z+r1tTzzut,z+11tTz2σ22z2ut,z2=0

pdetut,z+r1tTzzut,z+1tTz2σ22z2ut,z2=0

(2.2)

 

State the boundary conditions:

 

ibc1:=uT,z=maxz,0;

ibc1uT,z=max0,z

(2.3)

ibc2:=ut,1=0;

ibc2ut,−1=0

(2.4)

ibc3D2ut,1=1

ibc3D2ut,1=1

(2.5)

 

Assume a fixed time period of 1 year, a starting price of $100, a strike price of $100, and σ=0.2, r=0.15.

T:=1;

T1

(2.6)

S0100.;

S0100.

(2.7)

K:=100.;

K100.

(2.8)

σ:=0.2;

σ0.2

(2.9)

r:=0.15;

r0.15

(2.10)

 

Now solve the PDE numerically using Maple's built-in solver.

 

pds:=pdsolvepde,ibc1,ibc2,ibc3,numeric,spacestep=0.001,timestep=0.001;

pdsmodule...end module

(2.11)

val:=pds:-valuet=0,output=listprocedure:

v:=evalut,z,val:

 

Finally, evaluate S0u0,S0KS0 at Maple's numerical solution of uz,t.

 

S0 vS0KS0;

8.40878796725886

(2.12)

Monte Carlo Simulation

Alternatively, you can use Monte Carlo methods to price the option.

 

restart:

withFinance:

 

Use the same parameters as before.

 

T:=1;

T1

(3.1)

S0100.;

S0100.

(3.2)

K:=100.;

K100.

(3.3)

σ:=0.2;

σ0.2

(3.4)

r:=0.15;

r0.15

(3.5)

 

In the classical Black-Scholes setting the underlying process follows a geometric Brownian motion with drift r and volatility σ.

 

X:=GeometricBrownianMotionS0,r,σ:

 

Option payoff is given by the following formula:

 

P:=t→max1∫0tXuⅆutK,0

Ptmax0tXuⅆutK,0

(3.6)

 

You can compute the risk-neutral price of the option as expected payoff discounted using the risk-free rate.

 

DiscountFactorr,TExpectedValuePT,timesteps=100,replications=104,output=value

8.342020802

(3.7)

 

You can also compute the various statistics related to this simulation.

 

for t in ExpectedValuePT,'timesteps'=100,'replications'=104,'output'='all' do printf%20s = %a\n, opt end:

               value  =  9.569798629
       standarderror  =  .1022532908
   standarddeviation  =  10.22532908
            skewness  =  1.172246041
            kurtosis  =  1.209793258
             minimum  =  0.
             maximum  =  66.07060386
       standarderror  =  .1022532908

 

Alternatively, you can generate sample data for the option payoff and perform statistical analysis of this data.

 

A:=SampleValuesPT,'timesteps'=100,'replications'=104;

_rtable18446744074799623334

(3.8)

eval(NextAfter);

procoptionbuiltin=NextAfter;end proc

(3.9)

A:=StatisticsRemoveInRangeA, ..NextAfter0, ;

_rtable18446744074799664774

(3.10)

StatisticsHistogramA,bincount=20,averageshifted=4, axes = BOXED, gridlines = true;

 

You can consider a more complicated process for modeling the underlying asset. For example, you can incorporate jumps or regime switching into the model.

 

X1:=GeometricBrownianMotionS0,r,σ;

X1_X4

(3.11)

X2:=GeometricBrownianMotionS0,0.1,0.5;

X2_X5

(3.12)

P:=0.5,0.5|0.5,0.5;

0.50.50.50.5

(3.13)

X3:=RegimeSwitchingProcessP,X1,X2,1,12;

X3_X6

(3.14)

P:=X,t→max∫0tXuⅆutK,0;

PX,tmax0tXuⅆutK,0

(3.15)

DiscountFactorr,TExpectedValuePX1,T,timesteps=120,replications=104,output=value;

8.497423429

(3.16)

DiscountFactorr,TExpectedValuePX2,T,timesteps=120,replications=104,output=value;

12.45400511

(3.17)

DiscountFactorr,TExpectedValuePX3,T,timesteps=120,replications=104,output=value;

10.85502698

(3.18)

 

Here is another example. You can consider another asset, which also follows a geometric Brownian motion but with different parameters. Consider the following contract: if the average price of X is higher than the average price of Y, we get the difference, otherwise we get nothing.

 

Y:=GeometricBrownianMotionS0,0.1,0.5:

P:=t→max1∫0tXuⅆut1∫0tYuⅆut,0:

ExpectedValuePT,timesteps=100,replications=104;

value=14.85155399,standarderror=0.1795756877

(3.19)

 

Again, in order to get the price of the contract, you have to discount this expected value using the risk-free rate.

 

DiscountFactorr,TExpectedValuePT,timesteps=100,replications=104,output=value;

12.83559553

(3.20)