European Options Examples - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Mozilla Firefox.

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Mathematics : Finance : Financial Instruments : European Options Examples

Pricing European Options Using the Finance Package

Simulation

> 

restart; withFinance:

 

We will consider a stochastic variable, which follows the standard Brownian motion with drift 0.055 and diffusion 0.3.

 

> 

Y:=BrownianMotion⁡0, 0.055,0.3

Y:=_X

(1.1)
> 

PathPlotYt,t=0..2,timesteps=50,replications=10, thickness =3, color = red..blue, axes = BOXED, gridlines = true, tickmarks = 10, 10

 

Here ae sample paths for ⅇY⁡t.

 

> 

PathPlot⁡ⅇY⁡t,t=0..2,timesteps=50,replications=10,thickness=3,color=red..blue,axes=BOXED,gridlines=true,tickmarks=10,10

 

You can compute the expected value of any expression involving Y.

 

> 

ExpectedValuemax⁡ⅇY⁡3−0.5,0,replications=105

value=0.5000000000,standarderror=0.

(1.2)

 

Consider another stochastic process.

 

> 

Z:=GeometricBrownianMotion⁡1,0.1,0.3

Z:=_X3

(1.3)
> 

Drift⁡Z⁡tZ⁡t=Drift⁡ⅇY⁡tⅇY⁡t

0.1=0.1000000000

(1.4)
> 

DiffusionZtZt=DiffusionexpYtexpYt

0.3=0.3

(1.5)

 

So eYt and Zt define the same stochastic process.

 

> 

ExpectedValuemaxZ⁡3−1,0,replications=105

value=0.4506814169,standarderror=0.002083752433

(1.6)

 

Note that the previous value is the expected payoff of a European call option with strike price 1 maturing in 3 years. In order to compute the current option price you have to discount this expected value at the risk-free rate (which is the drift parameter of Zt).

 

> 

DiscountFactor⁡3,0.1⁢ExpectedValue⁡max⁡Z⁡3−1,0,replications=105,output=value

0.3354146746

(1.7)

 

Compare this with the analytic price obtained using the Black-Scholes formula.

 

> 

BlackScholesPrice1,1,3,0.3, 0.1

0.3360448376

(1.8)

 

Try to compute some market sensitivities of the option price.

 

> 

W:=t→ln⁡Z⁡t−0.055⁢t0.3

W:=t→ln⁡Z⁡t+−1⋅0.055⁢t0.3

(1.9)
> 

Drift⁡W⁡t;

0.

(1.10)
> 

Diffusion⁡W⁡t;

0.9999999999

(1.11)

 

So Wt is the standard Wiener process. Using tools from the Malliavin Calculus you can show that for any payoff function  ft

 

Δ = ∂∂ S0 Ee−r⋅T⋅fST=e−r⋅T⋅EfST⋅WTS0⋅σ⋅T

 

> 

ⅇ−0.1⋅3⁢ExpectedValue⁡max⁡Z⁡3−1,0⁢W⁡30.3⋅3,replications=106,output=value

0.8034185612

(1.12)
> 

BlackScholesDelta1,1,3,0.3,0.1;

0.7987480882

(1.13)

 

Here are multiple stocks.

 

> 

W1:=WienerProcess⁡

W1:=_W

(1.14)
> 

S1:=t→100⁢ⅇ0.055⁢t+0.3⁢W1⁡t

S1:=t→100⁢ⅇ0.055⁢t+0.3⁢W1⁡t

(1.15)
> 

W2:=WienerProcess⁡

W2:=_W0

(1.16)
> 

S2:=t→100⁢ⅇ0.055⁢t+0.3⁢W2⁡t

S2:=t→100⁢ⅇ0.055⁢t+0.3⁢W2⁡t

(1.17)
> 

ⅇ−0.1⋅1⁢ExpectedValue⁡max⁡S1⁡1−S2⁡1,0,timesteps=100,replications=104,output=value

16.87358420

(1.18)
> 

ⅇ−0.1⋅1⁢ExpectedValue⁡max⁡S2⁡1−S1⁡1,0,timesteps=100,replications=104,output=value

16.94221984

(1.19)

 

This is the correlation structure.

 

> 

W3:=WienerProcess⁡

W3:=_W1

(1.20)
> 

S1:=t→100⁢ⅇ0.055⁢t+0.3⁢0.00001⁢W1⁡t+W3⁡t

S1:=t→100⁢ⅇ0.055⁢t+0.3⁢0.00001⁢W1⁡t+W3⁡t

(1.21)
> 

S2:=t→100⁢ⅇ0.055⁢t+0.3⁢0.000001⁢W2⁡t+W3⁡t

S2:=t→100⁢ⅇ0.055⁢t+0.3⁢0.000001⁢W2⁡t+W3⁡t

(1.22)
> 

ⅇ−0.1⋅1⁢ExpectedValue⁡max⁡S2⁡1−S1⁡1,0,timesteps=100,replications=104,output=value

0.0001198987355

(1.23)