Black-ScholesPricingandHedging - NTU · to the Black-Scholes PDE (6.2) in order to price a claim...

39
Chapter 6 Black-Scholes Pricing and Hedging The Black and Scholes (1973) PDE is a Partial Differential Equation which is used for the pricing of vanilla options under absence of arbitrage and self- financing portfolio assumptions. In this chapter we derive the Black-Scholes PDE and present its solution by the the heat kernel method, with application to the pricing and hedging of European call and put options. 6.1 The Black-Scholes PDE ........................ 201 6.2 European Call Options ......................... 206 6.3 European Put Options ......................... 214 6.4 Market Terms and Data ........................ 218 6.5 The Heat Equation ............................. 222 6.6 Solution of the Black-Scholes PDE .............. 227 Exercises ........................................... 230 6.1 The Black-Scholes PDE In this chapter we work in a market based on a riskless asset with price (A t ) tR+ given by A t+dt - A t A t = rdt, dA t A t = rdt, dA t dt = rA t , t R + ,. with A t = A 0 e rt , t R + , and a risky asset with price (S t ) tR+ modeled using a geometric Brownian motion defined from the equation dS t S t = μdt + σdB t , t R + , (6.1) with solution " 201 This version: September 6, 2020 https://www.ntu.edu.sg/home/nprivault/indext.html

Transcript of Black-ScholesPricingandHedging - NTU · to the Black-Scholes PDE (6.2) in order to price a claim...

Page 1: Black-ScholesPricingandHedging - NTU · to the Black-Scholes PDE (6.2) in order to price a claim payoff Cof the formC= h(S T).Asinthediscrete-timecase,thearbitragepriceπt(C) at

Chapter 6Black-Scholes Pricing and Hedging

The Black and Scholes (1973) PDE is a Partial Differential Equation whichis used for the pricing of vanilla options under absence of arbitrage and self-financing portfolio assumptions In this chapter we derive the Black-ScholesPDE and present its solution by the the heat kernel method with applicationto the pricing and hedging of European call and put options

61 The Black-Scholes PDE 20162 European Call Options 20663 European Put Options 21464 Market Terms and Data 21865 The Heat Equation 22266 Solution of the Black-Scholes PDE 227Exercises 230

61 The Black-Scholes PDE

In this chapter we work in a market based on a riskless asset with price(At)tisinR+ given by

At+dt minusAtAt

= rdt dAtAt

= rdt dAtdt

= rAt t isin R+

withAt = A0 ert t isin R+

and a risky asset with price (St)tisinR+ modeled using a geometric Brownianmotion defined from the equation

dStSt

= microdt+ σdBt t isin R+ (61)

with solution

201

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

St = S0 exp(σBt +

(microminus 1

2σ2)t

) t isin R+

cf Proposition 516

installpackages(quantmod)2 library(quantmod)

getSymbols(0005HKfrom=2016-02-15to=SysDate()src=yahoo)4 getSymbols(0005HKfrom=2016-02-15to=2017-05-11src=yahoo)

stock=Ad(`0005HK`)6 write(stock file = data_exp sep=n)

myTheme lt- chart_theme()myTheme$col$linecol lt- blue8 chart_Series(stock theme = myTheme)

add_TA(stock on=1 col=blue legend=NULLlwd=16)

The adjusted close price Ad() is the closing price after adjustments for ap-plicable splits and dividend distributions

The next Figure 61 presents a graph of underlying asset price market datawhich is compared to the geometric Brownian motion simulations of Fig-ures 55 and 56

Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec Jan Feb Mar Apr May

Feb 152016

Apr 012016

May 032016

Jun 012016

Jul 042016

Aug 012016

Sep 012016

Oct 032016

Nov 012016

Dec 012016

Jan 032017

Feb 012017

Mar 012017

Apr 032017

May 022017

stock 2016minus02minus15 2017minus05minus10

38

40

42

44

46

48

50

52

54

56

38

40

42

44

46

48

50

52

54

56

40

45

50

55

60

65

70

Feb 16 May 16 Jul 16 Sep 16 Nov 16 Jan 17 Mar 17 May 17

St

0005HKemicrot

Fig 61 Graph of underlying market prices

1

15

2

25

3

35

4

0 01 02 03 04 05 06 07 08 09 10

S0=

St

t

St

1

15

2

25

3

35

4

0 01 02 03 04 05 06 07 08 09 10

S0=

St

t

Stert

Fig 62 Graph of simulated geometric Brownian motion

202

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

In the sequel we start by deriving the Black and Scholes (1973) Partial Dif-ferential Equation (PDE) for the value of a self-financing portfolio Note thatthe drift parameter micro in (61) is absent in the PDE (62) and it does notappear as well in the Black and Scholes (1973) formula (610)Proposition 61 Let (ηt ξt)tisinR+ be a portfolio strategy such that

(i) the porfolio strategy (ηt ξt)tisinR+ is self-financing

(ii) the portfolio value Vt = ηtAt + ξtSt takes the form

Vt = g(tSt) t isin R+

for some function g isin C12(R+ timesR+) of t and StThen the function g(tx) satisfies the Black and Scholes (1973) PDE

rg(tx) = partg

partt(tx) + rx

partg

partx(tx) + 1

2σ2x2 part

2g

partx2 (tx) x gt 0 (62)

and ξt = ξt(St) is given by the partial derivative

ξt = ξt(St) =partg

partx(tSt) t isin R+ (63)

Proof (i) First we note that the self-financing condition (58) in Proposi-tion 59 implies

dVt = ηtdAt + ξtdSt

= rηtAtdt+ microξtStdt+ σξtStdBt (64)= rVtdt+ (microminus r)ξtStdt+ σξtStdBt

= rg(tSt)dt+ (microminus r)ξtStdt+ σξtStdBt

t isin R+ We now rewrite (518) under the form of an Itocirc process

St = S0 +w t

0vsds+

w t0usdBs t isin R+

as in (422) by taking

ut = σSt and vt = microSt t isin R+

(ii) By (424) the application of Itocircrsquos formula Theorem 423 to Vt = g(tSt)leads to

dVt = dg(tSt)

=partg

partt(tSt)dt+

partg

partx(tSt)dSt +

12 (dSt)

2 part2g

partx2 (tSt) 203

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

=partg

partt(tSt)dt+ vt

partg

partx(tSt)dt+ ut

partg

partx(tSt)dBt +

12 |ut|

2 part2g

partx2 (tSt)dt

=partg

partt(tSt)dt+ microSt

partg

partx(tSt)dt+

12σ

2S2tpart2g

partx2 (tSt)dt+ σStpartg

partx(tSt)dBt

(65)

By respective identification of the terms in dBt and dt in (64) and (65) wegetrg(tSt)dt+ (microminus r)ξtStdt =

partg

partt(tSt)dt+ microSt

partg

partx(tSt)dt+

12σ

2S2tpart2g

partx2 (tSt)dt

ξtStσdBt = Stσpartg

partx(tSt)dBt

hence rg(tSt) =

partg

partt(tSt) + rSt

partg

partx(tSt) +

12σ

2S2tpart2g

partx2 (tSt)

ξt =partg

partx(tSt) 0 6 t 6 T

(66)

which yields (62) after substituting St with x gt 0

The derivative giving ξt in (63) is called the Delta of the option price seeProposition 64 below The amount invested on the riskless asset is

ηtAt = Vt minus ξtSt = g(tSt)minus Stpartg

partx(tSt)

and ηt is given by

ηt =Vt minus ξtSt

At

=1At

(g(tSt)minus St

partg

partx(tSt)

)=

1A0 ert

(g(tSt)minus St

partg

partx(tSt)

)

In the next Proposition 62 we add a terminal condition g(T x) = f(x)to the Black-Scholes PDE (62) in order to price a claim payoff C of theform C = h(ST ) As in the discrete-time case the arbitrage price πt(C) attime t isin [0T ] of the claim payoff C is defined to be the value Vt of theself-financing portfolio hedging C

Proposition 62 The arbitrage price πt(C) at time t isin [0T ] of the (vanilla)option with payoff C = h(ST ) is given by πt(C) = g(tSt) and the hedging

204

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

allocation ξt is given by the partial derivative (63) where the function g(tx)is solution of the following Black-Scholes PDE

rg(tx) = partg

partt(tx) + rx

partg

partx(tx) + 1

2σ2x2 part

2g

partx2 (tx)

g(T x) = h(x) x gt 0(67)

Proof Proposition 61 shows that the solution g(tx) of (62) g isin C12(R+timesR+) represents the value Vt = ηtAt + ξtSt = g(tSt) t isin R+ of a self-financing portfolio strategy (ηt ξt)tisinR+ By Definition 31 πt(C) = Vt =g(tSt) is the arbitrage price at time t isin [0T ] of the vanilla option withpayoff C = h(ST )

The absence of the drift parameter micro from the PDE (67) can be understoodin the next forward contract example in which the claim payoff can be hedgedby leveraging on the value St of the underlying asset independently of thetrend parameter micro

Example - forward contracts

When C = ST minusK is the (linear) payoff function of a long forward contractie h(x) = xminusK the Black-Scholes PDE (67) admits the easy solution

g(tx) = xminusK eminus(Tminust)r x gt 0 0 6 t 6 T (68)

showing that the price at time t of the forward contract with payoff C =ST minusK is

St minusK eminus(Tminust)r x gt 0 0 6 t 6 T

In addition the Delta of the option price is given by

ξt =partg

partx(tSt) = 1 0 6 t 6 T

which leads to a static ldquohedge and forgetrdquo strategy cf Exercise 67 Theforward contract can be realized by the option issuer as followsa) At time t receive the option premium Vt = St minus eminus(Tminust)rK from the

option buyerb) Borrow eminus(Tminust)rK from the bank to be refunded at maturityc) Buy the risky asset using the amount Stminus eminus(Tminust)rK + eminus(Tminust)rK = Std) Hold the risky asset until maturity (do nothing constant portfolio strat-

egy)e) At maturity T hand in the asset to the option holder who will pay the

amount K in return 205

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

f) Use the amountK = e(Tminust)r eminus(Tminust)rK to refund the lender of eminus(Tminust)rKborrowed at time t

Another way to compute the option premium Vt is to state that the amountVtminusSt has to be borrowed at time t in order to purchase the asset and thatthe asset price K received at maturity T should be used to refund the loanwhich yields

(Vt minus St) eminus(Tminust)r = K 0 6 t 6 T

Forward contracts can be used for physical delivery eg for live cattle In thecase of European options the basic ldquohedge and forgetrdquo constant strategy

ξt = 1 ηt = η0 0 6 t 6 T

will hedge the option only if

ST + η0AT gt (ST minusK)+

ie if minusη0AT 6 K 6 ST

Future contracts

For a future contract expiring at time T we take K = S0 erT and the contractis usually quoted at time t in terms of the forward price

e(Tminust)r(St minusK eminus(Tminust)r

)= e(Tminust)rSt minusK = e(Tminust)rSt minus S0 erT

discounted at time T or simply using e(Tminust)rSt Future contracts are non-deliverable forward contracts which are ldquomarked to marketrdquo at each timestep via a cash flow exchange between the two parties ensuring that theabsolute difference | e(Tminust)rSt minusK| is being credited to the buyerrsquos accountif e(Tminust)rSt gt K or to the sellerrsquos account if e(Tminust)rSt lt K

62 European Call Options

Recall that in the case of the European call option with strike price K thepayoff function is given by h(x) = (xminusK)+ and the Black-Scholes PDE (67)reads

rgc(tx) =partgcpartt

(tx) + rxpartgcpartx

(tx) + 12σ

2x2 part2gcpartx2 (tx)

gc(T x) = (xminusK)+(69)

The next proposition will be proved in Sections 65 and 66 see Proposi-tion 611

206

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

Proposition 63 The solution of the PDE (69) is given by the Black-Scholes formula for call options

gc(tx) = Bl(Kxσ rT minus t) = xΦ(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)

(610)with

d+(T minus t) =log(xK) + (r+ σ22)(T minus t)

|σ|radicT minus t

(611)

dminus(T minus t) =log(xK) + (rminus σ22)(T minus t)

|σ|radicT minus t

0 6 t lt T (612)

We note the relation

d+(T minus t) = dminus(T minus t) + |σ|radicT minus t 0 6 t lt T (613)

Here ldquologrdquo denotes the natural logarithm ldquolnrdquo and

Φ(x) = P(X 6 x) =1radic2π

w xminusinfin

eminusy22dy x isin R

denotes the standard Gaussian Cumulative Distribution Function (CDF) ofa standard normal random variable X N (0 1) with the relation

Φ(minusx) = 1minusΦ(x) x isin R (614)

0

02

04

06

08

1

12

-4 -3 -2 -1 0 1 2 3 4

Φ(x)

x

1Gaussian CDF Φ(x)

Fig 63 Graph of the Gaussian CDF

In other words the European call option with strike price K and maturityT is priced at time t isin [0T ] as

gc(tSt) = Bl(KStσ rT minus t)= StΦ

(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

) 0 6 t 6 T

207

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

The following R script is an implementation of the Black-Scholes formula forEuropean call options in Rlowast

1 BSCall lt- function(S K r T sigma)d1 lt- (log(SK)+(r+sigma^22)T)(sigmasqrt(T))

3 d2 lt- d1 - sigma sqrt(T)BSCall = Spnorm(d1) - Kexp(-rT)pnorm(d2)

5 BSCall

In comparison with the discrete-time Cox-Ross-Rubinstein (CRR) model ofSection 26 the interest in the formula (610) is to provide an analytical so-lution that can be evaluated in a single step which is computationally muchmore efficient

Fig 64 Graph of the Black-Scholes call price map with strike price K = 100dagger

Figure 64 presents an interactive graph of the Black-Scholes call price mapie the solution

(tx) 7minusrarr gc(tx) = xΦ(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)of the Black-Scholes PDE (67) for a call optionlowast Download the corresponding that can be run heredagger Right-click on the figure for interaction and ldquoFull Screen Multimediardquo view

208

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

(C) 2012--today Alexander Grahn 3Dmenujs version 20140923 3D JavaScript used by media9sty Extended functionality of the (right click) context menu of 3D annotations 1) Adds the following items to the 3D context menu `Generate Default View Finds good default camera settings returned as options for use with the includemedia command `Get Current View Determines camera cross section and part settings of the current view returned as `VIEW section that can be copied into a views file of additional views The views file is inserted using the `3Dviews option of includemedia `Cross Section Toggle switch to add or remove a cross section into or from the current view The cross section can be moved in the x y z directions using x y z and X Y Z keys on the keyboard be tilted against and spun around the upright Z axis using the UpDown and LeftRight arrow keys and caled using the s and S keys 2) Enables manipulation of position and orientation of indiviual parts and groups of parts in the 3D scene Parts which have been selected with the mouse can be scaled moved around and rotated like the cross section as described above To spin the parts around their local up-axis keep Control key pressed while using the UpDown and LeftRight arrow keys This work may be distributed andor modified under the conditions of the LaTeX Project Public License The latest version of this license is in httpmirrorsctanorgmacroslatexbaselppltxt This work has the LPPL maintenance status `maintained The Current Maintainer of this work is A Grahn The code borrows heavily from Bernd Gaertners `Miniball software originally written in C++ for computing the smallest enclosing ball of a set of points see httpwwwinfethzchpersonalgaertnerminiballhtmlhostconsoleshow()constructor for doubly linked listfunction List() thisfirst_node=null thislast_node=new Node(undefined)Listprototypepush_back=function(x) var new_node=new Node(x) if(thisfirst_node==null) thisfirst_node=new_node new_nodeprev=null else new_nodeprev=thislast_nodeprev new_nodeprevnext=new_node new_nodenext=thislast_node thislast_nodeprev=new_nodeListprototypemove_to_front=function(it) var node=itget() if(nodenext=null ampamp nodeprev=null) nodenextprev=nodeprev nodeprevnext=nodenext nodeprev=null nodenext=thisfirst_node thisfirst_nodeprev=node thisfirst_node=node Listprototypebegin=function() var i=new Iterator() itarget=thisfirst_node return(i)Listprototypeend=function() var i=new Iterator() itarget=thislast_node return(i)function Iterator(it) if( it=undefined ) thistarget=ittarget else thistarget=null Iteratorprototypeset=function(it)thistarget=ittargetIteratorprototypeget=function()return(thistarget)Iteratorprototypederef=function()return(thistargetdata)Iteratorprototypeincr=function() if(thistargetnext=null) thistarget=thistargetnextconstructor for node objects that populate the linked listfunction Node(x) thisprev=null thisnext=null thisdata=xfunction sqr(r)return(rr)helper functionMiniball algorithm by B Gaertnerfunction Basis() thism=0 thisq0=new Array(3) thisz=new Array(4) thisf=new Array(4) thisv=new Array(new Array(3) new Array(3) new Array(3) new Array(3)) thisa=new Array(new Array(3) new Array(3) new Array(3) new Array(3)) thisc=new Array(new Array(3) new Array(3) new Array(3) new Array(3)) thissqr_r=new Array(4) thiscurrent_c=thisc[0] thiscurrent_sqr_r=0 thisreset()Basisprototypecenter=function()return(thiscurrent_c)Basisprototypesize=function()return(thism)Basisprototypepop=function()--thismBasisprototypeexcess=function(p) var e=-thiscurrent_sqr_r for(var k=0klt3++k) e+=sqr(p[k]-thiscurrent_c[k]) return(e)Basisprototypereset=function() thism=0 for(var j=0jlt3++j) thisc[0][j]=0 thiscurrent_c=thisc[0] thiscurrent_sqr_r=-1Basisprototypepush=function(p) var i j var eps=1e-32 if(thism==0) for(i=0ilt3++i) thisq0[i]=p[i] for(i=0ilt3++i) thisc[0][i]=thisq0[i] thissqr_r[0]=0 else for(i=0ilt3++i) thisv[thism][i]=p[i]-thisq0[i] for(i=1iltthism++i) thisa[thism][i]=0 for(j=0jlt3++j) thisa[thism][i]+=thisv[i][j]thisv[thism][j] thisa[thism][i]=(2thisz[i]) for(i=1iltthism++i) for(j=0jlt3++j) thisv[thism][j]-=thisa[thism][i]thisv[i][j] thisz[thism]=0 for(j=0jlt3++j) thisz[thism]+=sqr(thisv[thism][j]) thisz[thism]=2 if(thisz[thism]ltepsthiscurrent_sqr_r) return(false) var e=-thissqr_r[thism-1] for(i=0ilt3++i) e+=sqr(p[i]-thisc[thism-1][i]) thisf[thism]=ethisz[thism] for(i=0ilt3++i) thisc[thism][i]=thisc[thism-1][i]+thisf[thism]thisv[thism][i] thissqr_r[thism]=thissqr_r[thism-1]+ethisf[thism]2 thiscurrent_c=thisc[thism] thiscurrent_sqr_r=thissqr_r[thism] ++thism return(true)function Miniball() thisL=new List() thisB=new Basis() thissupport_end=new Iterator()Miniballprototypemtf_mb=function(it) var i=new Iterator(it) thissupport_endset(thisLbegin()) if((thisBsize())==4) return for(var k=new Iterator(thisLbegin())kget()=iget()) var j=new Iterator(k) kincr() if(thisBexcess(jderef()) gt 0) if(thisBpush(jderef())) thismtf_mb(j) thisBpop() if(thissupport_endget()==jget()) thissupport_endincr() thisLmove_to_front(j) Miniballprototypecheck_in=function(b) thisLpush_back(b)Miniballprototypebuild=function() thisBreset() thissupport_endset(thisLbegin()) thismtf_mb(thisLend())Miniballprototypecenter=function() return(thisBcenter())Miniballprototyperadius=function() return(Mathsqrt(thisBcurrent_sqr_r))functions called by menu itemsfunction calc3Dopts () create Miniball object var mb=new Miniball() auxiliary vector var corner=new Vector3() iterate over all visible mesh nodes in the scene for(i=0iltscenemeshescounti++) var mesh=scenemeshesgetByIndex(i) if(meshvisible) continue local to parent transformation matrix var trans=meshtransform build local to world transformation matrix by recursively multiplying the parents transf matrix on the right var parent=meshparent while(parenttransform) trans=transmultiply(parenttransform) parent=parentparent get the bbox of the mesh (local coordinates) var bbox=meshcomputeBoundingBox() transform the local bounding box corner coordinates to world coordinates for bounding sphere determination BBoxmin cornerset(bboxmin) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) BBoxmax cornerset(bboxmax) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) remaining six BBox corners cornerset(bboxminx bboxmaxy bboxmaxz) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) cornerset(bboxminx bboxminy bboxmaxz) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) cornerset(bboxminx bboxmaxy bboxminz) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) cornerset(bboxmaxx bboxminy bboxminz) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) cornerset(bboxmaxx bboxminy bboxmaxz) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) cornerset(bboxmaxx bboxmaxy bboxminz) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) compute the smallest enclosing bounding sphere mbbuild() current camera settings var camera=scenecamerasgetByIndex(0) var res= initialize result string aperture angle of the virtual camera (perspective projection) or orthographic scale (orthographic projection) if(cameraprojectionType==cameraTYPE_PERSPECTIVE) var aac=camerafov180MathPI if(hostutilprintf(4f aac)=30) res+=hostutilprintf(n3Daac=s aac) else cameraviewPlaneSize=2mbradius() res+=hostutilprintf(n3Dortho=s 1cameraviewPlaneSize) camera roll var roll = cameraroll180MathPI if(hostutilprintf(4f roll)=0) res+=hostutilprintf(n3Droll=sroll) target to camera vector var c2c=new Vector3() c2cset(cameraposition) c2csubtractInPlace(cameratargetPosition) c2cnormalize() if((c2cx==0 ampamp c2cy==-1 ampamp c2cz==0)) res+=hostutilprintf(n3Dc2c=s s s c2cx c2cy c2cz) new camera settings bounding sphere centre --gt new camera target var coo=new Vector3() cooset((mbcenter())[0] (mbcenter())[1] (mbcenter())[2]) if(coolength) res+=hostutilprintf(n3Dcoo=s s s coox cooy cooz) radius of orbit if(cameraprojectionType==cameraTYPE_PERSPECTIVE) var roo=mbradius() Mathsin(aac MathPI 360) else orthographic projection var roo=mbradius() res+=hostutilprintf(n3Droo=s roo) update camera settings in the viewer var currol=cameraroll cameratargetPositionset(coo) camerapositionset(cooadd(c2cscale(roo))) cameraroll=currol determine background colour rgb=scenebackgroundgetColor() if((rgbr==1 ampamp rgbg==1 ampamp rgbb==1)) res+=hostutilprintf(n3Dbg=s s s rgbr rgbg rgbb) determine lighting scheme switch(scenelightScheme) case sceneLIGHT_MODE_FILE curlights=Artworkbreak case sceneLIGHT_MODE_NONE curlights=Nonebreak case sceneLIGHT_MODE_WHITE curlights=Whitebreak case sceneLIGHT_MODE_DAY curlights=Daybreak case sceneLIGHT_MODE_NIGHT curlights=Nightbreak case sceneLIGHT_MODE_BRIGHT curlights=Hardbreak case sceneLIGHT_MODE_RGB curlights=Primarybreak case sceneLIGHT_MODE_BLUE curlights=Bluebreak case sceneLIGHT_MODE_RED curlights=Redbreak case sceneLIGHT_MODE_CUBE curlights=Cubebreak case sceneLIGHT_MODE_CAD curlights=CADbreak case sceneLIGHT_MODE_HEADLAMP curlights=Headlampbreak if(curlights=Artwork) res+=hostutilprintf(n3Dlights=s curlights) determine global render mode switch(scenerenderMode) case sceneRENDER_MODE_BOUNDING_BOX currender=BoundingBoxbreak case sceneRENDER_MODE_TRANSPARENT_BOUNDING_BOX currender=TransparentBoundingBoxbreak case sceneRENDER_MODE_TRANSPARENT_BOUNDING_BOX_OUTLINE currender=TransparentBoundingBoxOutlinebreak case sceneRENDER_MODE_VERTICES currender=Verticesbreak case sceneRENDER_MODE_SHADED_VERTICES currender=ShadedVerticesbreak case sceneRENDER_MODE_WIREFRAME currender=Wireframebreak case sceneRENDER_MODE_SHADED_WIREFRAME currender=ShadedWireframebreak case sceneRENDER_MODE_SOLID currender=Solidbreak case sceneRENDER_MODE_TRANSPARENT currender=Transparentbreak case sceneRENDER_MODE_SOLID_WIREFRAME currender=SolidWireframebreak case sceneRENDER_MODE_TRANSPARENT_WIREFRAME currender=TransparentWireframebreak case sceneRENDER_MODE_ILLUSTRATION currender=Illustrationbreak case sceneRENDER_MODE_SOLID_OUTLINE currender=SolidOutlinebreak case sceneRENDER_MODE_SHADED_ILLUSTRATION currender=ShadedIllustrationbreak case sceneRENDER_MODE_HIDDEN_WIREFRAME currender=HiddenWireframebreak if(currender=Solid) res+=hostutilprintf(n3Drender=s currender) write result string to the console hostconsoleshow() hostconsoleclear() hostconsoleprintln(n Copy and paste the following text to then+ option list of includemedian + res + n)function get3Dview () var camera=scenecamerasgetByIndex(0) var coo=cameratargetPosition var c2c=camerapositionsubtract(coo) var roo=c2clength c2cnormalize() var res=VIEW=insert optional name heren if((coox==0 ampamp cooy==0 ampamp cooz==0)) res+=hostutilprintf( COO=s s sn coox cooy cooz) if((c2cx==0 ampamp c2cy==-1 ampamp c2cz==0)) res+=hostutilprintf( C2C=s s sn c2cx c2cy c2cz) if(roo gt 1e-9) res+=hostutilprintf( ROO=sn roo) var roll = cameraroll180MathPI if(hostutilprintf(4f roll)=0) res+=hostutilprintf( ROLL=sn roll) if(cameraprojectionType==cameraTYPE_PERSPECTIVE) var aac=camerafov 180MathPI if(hostutilprintf(4f aac)=30) res+=hostutilprintf( AAC=sn aac) else if(hostutilprintf(4f cameraviewPlaneSize)=1) res+=hostutilprintf( ORTHO=sn 1cameraviewPlaneSize) rgb=scenebackgroundgetColor() if((rgbr==1 ampamp rgbg==1 ampamp rgbb==1)) res+=hostutilprintf( BGCOLOR=s s sn rgbr rgbg rgbb) switch(scenelightScheme) case sceneLIGHT_MODE_FILE curlights=Artworkbreak case sceneLIGHT_MODE_NONE curlights=Nonebreak case sceneLIGHT_MODE_WHITE curlights=Whitebreak case sceneLIGHT_MODE_DAY curlights=Daybreak case sceneLIGHT_MODE_NIGHT curlights=Nightbreak case sceneLIGHT_MODE_BRIGHT curlights=Hardbreak case sceneLIGHT_MODE_RGB curlights=Primarybreak case sceneLIGHT_MODE_BLUE curlights=Bluebreak case sceneLIGHT_MODE_RED curlights=Redbreak case sceneLIGHT_MODE_CUBE curlights=Cubebreak case sceneLIGHT_MODE_CAD curlights=CADbreak case sceneLIGHT_MODE_HEADLAMP curlights=Headlampbreak if(curlights=Artwork) res+= LIGHTS=+curlights+n switch(scenerenderMode) case sceneRENDER_MODE_BOUNDING_BOX defaultrender=BoundingBoxbreak case sceneRENDER_MODE_TRANSPARENT_BOUNDING_BOX defaultrender=TransparentBoundingBoxbreak case sceneRENDER_MODE_TRANSPARENT_BOUNDING_BOX_OUTLINE defaultrender=TransparentBoundingBoxOutlinebreak case sceneRENDER_MODE_VERTICES defaultrender=Verticesbreak case sceneRENDER_MODE_SHADED_VERTICES defaultrender=ShadedVerticesbreak case sceneRENDER_MODE_WIREFRAME defaultrender=Wireframebreak case sceneRENDER_MODE_SHADED_WIREFRAME defaultrender=ShadedWireframebreak case sceneRENDER_MODE_SOLID defaultrender=Solidbreak case sceneRENDER_MODE_TRANSPARENT defaultrender=Transparentbreak case sceneRENDER_MODE_SOLID_WIREFRAME defaultrender=SolidWireframebreak case sceneRENDER_MODE_TRANSPARENT_WIREFRAME defaultrender=TransparentWireframebreak case sceneRENDER_MODE_ILLUSTRATION defaultrender=Illustrationbreak case sceneRENDER_MODE_SOLID_OUTLINE defaultrender=SolidOutlinebreak case sceneRENDER_MODE_SHADED_ILLUSTRATION defaultrender=ShadedIllustrationbreak case sceneRENDER_MODE_HIDDEN_WIREFRAME defaultrender=HiddenWireframebreak if(defaultrender=Solid) res+= RENDERMODE=+defaultrender+n detect existing Clipping Plane (3D Cross Section) var clip=null if( clip=scenenodesgetByName($$$$$$)|| clip=scenenodesgetByName(Clipping Plane) ) for(var i=0iltscenenodescounti++) var nd=scenenodesgetByIndex(i) if(nd==clip||ndname==) continue var ndUTFName= for (var j=0 jltndnamelength j++) var theUnicode = ndnamecharCodeAt(j)toString(16) while (theUnicodelengthlt4) theUnicode = 0 + theUnicode ndUTFName += theUnicode var end=ndnamelastIndexOf() if(endgt0) var ndUserName=ndnamesubstr(0end) else var ndUserName=ndname respart= PART=+ndUserName+n respart+= UTF16NAME=+ndUTFName+n defaultvals=true if(ndvisible) respart+= VISIBLE=falsen defaultvals=false if(ndopacitylt10) respart+= OPACITY=+ndopacity+n defaultvals=false if(ndconstructorname==Mesh) currender=defaultrender switch(ndrenderMode) case sceneRENDER_MODE_BOUNDING_BOX currender=BoundingBoxbreak case sceneRENDER_MODE_TRANSPARENT_BOUNDING_BOX currender=TransparentBoundingBoxbreak case sceneRENDER_MODE_TRANSPARENT_BOUNDING_BOX_OUTLINE currender=TransparentBoundingBoxOutlinebreak case sceneRENDER_MODE_VERTICES currender=Verticesbreak case sceneRENDER_MODE_SHADED_VERTICES currender=ShadedVerticesbreak case sceneRENDER_MODE_WIREFRAME currender=Wireframebreak case sceneRENDER_MODE_SHADED_WIREFRAME currender=ShadedWireframebreak case sceneRENDER_MODE_SOLID currender=Solidbreak case sceneRENDER_MODE_TRANSPARENT currender=Transparentbreak case sceneRENDER_MODE_SOLID_WIREFRAME currender=SolidWireframebreak case sceneRENDER_MODE_TRANSPARENT_WIREFRAME currender=TransparentWireframebreak case sceneRENDER_MODE_ILLUSTRATION currender=Illustrationbreak case sceneRENDER_MODE_SOLID_OUTLINE currender=SolidOutlinebreak case sceneRENDER_MODE_SHADED_ILLUSTRATION currender=ShadedIllustrationbreak case sceneRENDER_MODE_HIDDEN_WIREFRAME currender=HiddenWireframebreak case sceneRENDER_MODE_DEFAULT currender=Defaultbreak if(currender=defaultrender) respart+= RENDERMODE=+currender+n defaultvals=false if(origtrans[ndname]ampampndtransformisEqual(origtrans[ndname])) var lvec=ndtransformtransformDirection(new Vector3(100)) var uvec=ndtransformtransformDirection(new Vector3(010)) var vvec=ndtransformtransformDirection(new Vector3(001)) respart+= TRANSFORM= +lvecx+ +lvecy+ +lvecz+ +uvecx+ +uvecy+ +uvecz+ +vvecx+ +vvecy+ +vvecz+ +ndtransformtranslationx+ +ndtransformtranslationy+ +ndtransformtranslationz+n defaultvals=false respart+= ENDn if(defaultvals) res+=respart if(clip) var centre=cliptransformtranslation var normal=cliptransformtransformDirection(new Vector3(001)) res+= CROSSSECTn if((centrex==0 ampamp centrey==0 ampamp centrez==0)) res+=hostutilprintf( CENTER=s s sn centrex centrey centrez) if((normalx==1 ampamp normaly==0 ampamp normalz==0)) res+=hostutilprintf( NORMAL=s s sn normalx normaly normalz) res+=hostutilprintf( VISIBLE=sn clipvisible) res+=hostutilprintf( PLANECOLOR=s s sn clipmaterialemissiveColorr clipmaterialemissiveColorg clipmaterialemissiveColorb) res+=hostutilprintf( OPACITY=sn clipopacity) res+=hostutilprintf( INTERSECTIONCOLOR=s s sn clipwireframeColorr clipwireframeColorg clipwireframeColorb) res+= ENDn for(var propt in clip) consoleprintln(propt++clip[propt]) res+=ENDn hostconsoleshow() hostconsoleclear() hostconsoleprintln(n Add the following VIEW section to a file ofn+ predefined views (See option 3Dviews)nn + The view may be given a name after VIEW=n + (Remove in front of =)n) hostconsoleprintln(res + n)add items to 3D context menuruntimeaddCustomMenuItem(dfltview Generate Default View default 0)runtimeaddCustomMenuItem(currview Get Current View default 0)runtimeaddCustomMenuItem(csection Cross Section checked 0)menu event handlersmenuEventHandler = new MenuEventHandler()menuEventHandleronEvent = function(e) switch(emenuItemName) case dfltview calc3Dopts() break case currview get3Dview() break case csection addremoveClipPlane(emenuItemChecked) break runtimeaddEventHandler(menuEventHandler)global variable taking reference to currently selected nodevar target=nullselectionEventHandler=new SelectionEventHandler()selectionEventHandleronEvent=function(e) if(eselectedampampenodename=) target=enode else target=null runtimeaddEventHandler(selectionEventHandler)cameraEventHandler=new CameraEventHandler()cameraEventHandleronEvent=function(e) var clip=null runtimeremoveCustomMenuItem(csection) runtimeaddCustomMenuItem(csection Cross Section checked 0) if(clip=scenenodesgetByName($$$$$$)|| predefined scenenodesgetByName(Clipping Plane)) added via context menu runtimeremoveCustomMenuItem(csection) runtimeaddCustomMenuItem(csection Cross Section checked 1) if(clip)plane in predefined views must be rotated by 90 deg around normal cliptransformrotateAboutLineInPlace( MathPI2cliptransformtranslation cliptransformtransformDirection(new Vector3(001)) ) for(var i=0 iltrot4x4length i++)rot4x4[i]setIdentity() target=nullruntimeaddEventHandler(cameraEventHandler)var rot4x4=new Array() keeps track of spin and tilt axes transformationskey event handler for scaling moving spinning and tilting objectskeyEventHandler=new KeyEventHandler()keyEventHandleronEvent=function(e) var backtrans=new Matrix4x4() var trgt=null if(target) trgt=target var backtrans=new Matrix4x4() var trans=trgttransform var parent=trgtparent while(parenttransform) build local to world transformation matrix transmultiplyInPlace(parenttransform) also build world to local back-transformation matrix backtransmultiplyInPlace(parenttransforminversetranspose) parent=parentparent backtranstransposeInPlace() else if( trgt=scenenodesgetByName($$$$$$)|| trgt=scenenodesgetByName(Clipping Plane) ) var trans=trgttransform if(trgt) return var tname=trgtname if(typeof(rot4x4[tname])==undefined) rot4x4[tname]=new Matrix4x4() if(target) var tiltAxis=rot4x4[tname]transformDirection(new Vector3(010)) else var tiltAxis=transtransformDirection(new Vector3(010)) var spinAxis=rot4x4[tname]transformDirection(new Vector3(001)) get the centre of the mesh if(targetampamptrgtconstructorname==Mesh) var centre=transtransformPosition(trgtcomputeBoundingBox()center) else part group (Node3 parent node clipping plane) var centre=new Vector3(transtranslation) switch(echaracterCode) case 30tilt up rot4x4[tname]rotateAboutLineInPlace( -MathPI900rot4x4[tname]translationtiltAxis) transrotateAboutLineInPlace(-MathPI900centretiltAxis) break case 31tilt down rot4x4[tname]rotateAboutLineInPlace( MathPI900rot4x4[tname]translationtiltAxis) transrotateAboutLineInPlace(MathPI900centretiltAxis) break case 28spin right if(ectrlKeyDownampamptarget) transrotateAboutLineInPlace(-MathPI900centrespinAxis) else rot4x4[tname]rotateAboutLineInPlace( -MathPI900rot4x4[tname]translationnew Vector3(001)) transrotateAboutLineInPlace(-MathPI900centrenew Vector3(001)) break case 29spin left if(ectrlKeyDownampamptarget) transrotateAboutLineInPlace(MathPI900centrespinAxis) else rot4x4[tname]rotateAboutLineInPlace( MathPI900rot4x4[tname]translationnew Vector3(001)) transrotateAboutLineInPlace(MathPI900centrenew Vector3(001)) break case 120 x translateTarget(trans new Vector3(100) e) break case 121 y translateTarget(trans new Vector3(010) e) break case 122 z translateTarget(trans new Vector3(001) e) break case 88 shift + x translateTarget(trans new Vector3(-100) e) break case 89 shift + y translateTarget(trans new Vector3(0-10) e) break case 90 shift + z translateTarget(trans new Vector3(00-1) e) break case 115 s transtranslateInPlace(centrescale(-1)) transscaleInPlace(101) transtranslateInPlace(centrescale(1)) break case 83 shift + s transtranslateInPlace(centrescale(-1)) transscaleInPlace(1101) transtranslateInPlace(centrescale(1)) break transmultiplyInPlace(backtrans)runtimeaddEventHandler(keyEventHandler)translates object by amount calculated from Canvas sizefunction translateTarget(t d e) var cam=scenecamerasgetByIndex(0) if(camprojectionType==camTYPE_PERSPECTIVE) var scale=Mathtan(camfov2) camtargetPositionsubtract(camposition)length Mathmin(ecanvasPixelWidthecanvasPixelHeight) else var scale=camviewPlaneSize2 Mathmin(ecanvasPixelWidthecanvasPixelHeight) ttranslateInPlace(dscale(scale))function addremoveClipPlane(chk) var curTrans=getCurTrans() var clip=scenecreateClippingPlane() if(chk) add Clipping Plane and place its center either into the camera target position or into the centre of the currently selected mesh node var centre=new Vector3() if(target) var trans=targettransform var parent=targetparent while(parenttransform) trans=transmultiply(parenttransform) parent=parentparent if(targetconstructorname==Mesh) var centre=transtransformPosition(targetcomputeBoundingBox()center) else var centre=new Vector3(transtranslation) target=null else centreset(scenecamerasgetByIndex(0)targetPosition) cliptransformsetView( new Vector3(000) new Vector3(100) new Vector3(010)) cliptransformtranslateInPlace(centre) else if( scenenodesgetByName($$$$$$)|| scenenodesgetByName(Clipping Plane) ) clipremove()clip=null restoreTrans(curTrans) return clipfunction to store current transformation matrix of all nodes in the scenefunction getCurTrans() var tA=new Array() for(var i=0 iltscenenodescount i++) var nd=scenenodesgetByIndex(i) if(ndname==) continue tA[ndname]=new Matrix4x4(ndtransform) return tAfunction to restore transformation matrices given as argfunction restoreTrans(tA) for(var i=0 iltscenenodescount i++) var nd=scenenodesgetByIndex(i) if(tA[ndname]) ndtransformset(tA[ndname]) store original transformation matrix of all mesh nodes in the scenevar origtrans=getCurTrans()set initial state of Cross Section menu entrycameraEventHandleronEvent(1)hostconsoleclear()

var ocgs=hostgetOCGs(hostpageNum)for(var i=0iltocgslengthi++)if(ocgs[i]name==MediaPlayButton1)ocgs[i]state=false

(C) 2012 Michail Vidiassov John C Bowman Alexander Grahn asylabelsjs version 20120912 3D JavaScript to be used with media9sty (option `add3Djscript) for Asymptote generated PRC files adds billboard behaviour to text labels in Asymptote PRC files so that they always face the camera under 3D rotation This work may be distributed andor modified under the conditions of the LaTeX Project Public License The latest version of this license is in httpmirrorsctanorgmacroslatexbaselppltxt This work has the LPPL maintenance status `maintained The Current Maintainer of this work is A Grahnvar bbnodes=new Array() billboard meshesvar bbtrans=new Array() billboard transformsfunction fulltransform(mesh) var t=new Matrix4x4(meshtransform) if(meshparentname = ) var parentTransform=fulltransform(meshparent) tmultiplyInPlace(parentTransform) return t else return t find all text labels in the scene and determine pivoting pointsvar nodes=scenenodesvar nodescount=nodescountvar third=1030for(var i=0 i lt nodescount i++) var node=nodesgetByIndex(i) var name=nodename var end=namelastIndexOf()-1 if(end gt 0) if(namecharAt(end) == 001) var start=namelastIndexOf(-)+1 if(end gt start) nodename=namesubstr(0start-1) var nodeMatrix=fulltransform(nodeparent) var c=nodeMatrixtranslation position var d=Mathpow(Mathabs(nodeMatrixdeterminant)third) scale bbnodespush(node) bbtranspush(Matrix4x4()scale(ddd)translate(c)multiply(nodeMatrixinverse)) var camera=scenecamerasgetByIndex(0) var zero=new Vector3(000)var bbcount=bbnodeslength event handler to maintain camera-facing text labelsbillboardHandler=new RenderEventHandler()billboardHandleronEvent=function(event) var T=new Matrix4x4() TsetView(zerocamerapositionsubtract(cameratargetPosition) cameraupsubtract(cameraposition)) for(var j=0 j lt bbcount j++) bbnodes[j]transformset(Tmultiply(bbtrans[j])) runtimerefresh() runtimeaddEventHandler(billboardHandler)runtimerefresh()

(C) 2012 Alexander Grahn 3Dspintooljs version 20120301 3D JavaScript to be used with media9sty (option `add3Djscript) enables the Spin tool (also accessible via 3D toolbar or context menu) upon activation of the 3D scene the scene then rotates around the upright axis while dragging with the mouse This work may be distributed andor modified under the conditions of the LaTeX Project Public License The latest version of this license is in httpmirrorsctanorgmacroslatexbaselppltxt This work has the LPPL maintenance status `maintained The Current Maintainer of this work is A GrahnruntimesetCurrentTool(runtimeTOOL_NAME_SPIN)

cells [ cell_type code execution_count null metadata outputs [] source [ from IPythoncoredisplay import display HTMLn display(HTML( )) ] cell_type code execution_count null metadata collapsed true outputs [] source [ import numpy as npn import scipystats as ssn import time n n Black and Scholesn def d1(S0 K r sigma T)n return (nplog(S0K) + (r + sigma2 2) T)(sigma npsqrt(T))n n def d2(S0 K r sigma T)n return (nplog(S0 K) + (r - sigma2 2) T) (sigma npsqrt(T))n n def BlackScholes(typeS0 K r sigma T)n if type==Cn return S0 ssnormcdf(d1(S0 K r sigma T)) - K npexp(-r T) ssnormcdf(d2(S0 K r sigma T))n elsen return K npexp(-r T) ssnormcdf(-d2(S0 K r sigma T)) - S0 ssnormcdf(-d1(S0 K r sigma T)) ] cell_type code execution_count null metadata outputs [] source [ BlackScholes(C100 120 002 02 10) ] ] metadata anaconda-cloud kernelspec display_name Python 3 language python name python3 language_info codemirror_mode name ipython version 3 file_extension py mimetype textx-python name python nbconvert_exporter python pygments_lexer ipython3 version 375rc1 nbformat 4 nbformat_minor 1

Black-Scholes Pricing and Hedging

Fig 65 Time-dependent solution of the Black-Scholes PDE (call option)lowast

The next proposition is proved by a direct differentiation of the Black-Scholesfunction and will be recovered later using a probabilistic argument in Propo-sition 714 below

Proposition 64 The Black-Scholes Delta of the European call option isgiven by

ξt = ξt(St) =partgcpartx

(tSt) = Φ(d+(T minus t)

)isin [0 1] (615)

where d+(T minus t) is given by (611)

Proof From Relation (613) we note that the standard normal probabilitydensity function

ϕ(x) = Φprime(x) =1radic2π

eminusx22 x isin R

satisfies

ϕ(d+(T minus t)) = ϕ

(log(xK) + (r+ σ22)(T minus t)

|σ|radicT minus t

)=

1radic2π

exp(minus1

2

(log(xK) + (r+ σ22)(T minus t)

|σ|radicT minus t

)2)

=1radic2π

exp(minus1

2

(log(xK) + (rminus σ22)(T minus t)

|σ|radicT minus t

+ |σ|radicT minus t

)2)

=1radic2π

exp(minus1

2 (dminus(T minus t))2 minus (T minus t)rminus log x

K

)=

K

xradic

2πeminus(Tminust)r exp

(minus1

2 (dminus(T minus t))2)

lowast The animation works in Acrobat Reader on the entire pdf file

209

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

=K

xeminus(Tminust)rϕ(dminus(T minus t))

hence by (610) we have

partgcpartx

(tx) = part

partx

(xΦ(

log(xK) + (r+ σ22)(T minus t)|σ|radicT minus t

))(616)

minusK eminus(Tminust)r partpartx

(Φ(

log(xK) + (rminus σ22)(T minus t)|σ|radicT minus t

))= Φ

(log(xK) + (r+ σ22)(T minus t)

|σ|radicT minus t

)+x

part

partxΦ(

log(xK) + (r+ σ22)(T minus t)|σ|radicT minus t

)minusK eminus(Tminust)r part

partxΦ(

log(xK) + (rminus σ22)(T minus t)|σ|radicT minus t

)= Φ

(log(xK) + (r+ σ22)(T minus t)

|σ|radicT minus t

)+

x

|σ|radicT minus t

ϕ

(log(xK) + (r+ σ22)(T minus t)

|σ|radicT minus t

)minusK eminus(Tminust)r

|σ|radicT minus t

ϕ

(log(xK) + (rminus σ22)(T minus t)

|σ|radicT minus t

)= Φ(d+(T minus t)) +

x

|σ|radicT minus t

ϕ(d+(T minus t))minusK eminus(Tminust)r

|σ|radicT minus t

ϕ(dminus(T minus t))

= Φ(d+(T minus t))

As a consequence of Proposition 64 the Black-Scholes call price splits into arisky component StΦ

(d+(T minus t)

)and a riskless componentminusK eminus(Tminust)rΦ

(dminus(T minus

t)) as follows

gc(tSt) = StΦ(d+(T minus t)

)︸ ︷︷ ︸risky investment (held)

minus K eminus(Tminust)rΦ(dminus(T minus t)

)︸ ︷︷ ︸

riskminusfree investment (borrowed)

0 6 t 6 T

See Exercise 64 for a computation of the boundary values of gc(tx) t isin[0T ) x gt 0 The following R script is an implementation of the Black-ScholesDelta for European call options in R

1 Delta lt- function(S K r T sigma)d1 lt- (log(SK)+(r+sigma^22)T)(sigmasqrt(T))

3 Delta = pnorm(d1)Delta

210

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

In Figure 66 we plot the Delta of the European call option as a function ofthe underlying asset price and of the time remaining until maturity

Payoff function (x-K)+

0

50

100

150

200

Underlying

0

5

10

15

Time to maturity T-t

0

025

05

075

1

Fig 66 Delta of a European call option with strike price K = 100 r = 3 σ = 10

The Gamma of the European call option is defined as the first derivative ofDelta or second derivative of the option price with respect to the underlyingasset price This gives

γt =1

St|σ|radicT minus t

Φprime(d+(T minus t)

)=

1St|σ|

radic2(T minus t)π

exp(minus1

2

(log(StK) + (r+ σ22)(T minus t)

|σ|radicT minus t

)2)gt 0

In particular a positive value of γt implies that the Delta ξt = ξt(St) shouldincrease when the underlying asset price St increases In other words the po-sition ξt in the underlying asset should be increased by additional purchasesif the underlying asset price St increases

In Figure 67 we plot the (truncated) value of the Gamma of a European calloption as a function of the underlying asset price and of time to maturity

211

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

Fig 67 Gamma of a European call option with strike price K = 100

As Gamma is always nonnegative the Black-Scholes hedging strategy is tokeep buying the risky underlying asset when its price increases and to sell itwhen its price decreases as can be checked from Figure 67

Numerical example - hedging of a call option

In Figure 68 we consider the historical stock price of HSBC Holdings(0005HK) over one year

Fig 68 Graph of the stock price of HSBC Holdings

Consider the call option issued by Societe Generale on 31 December 2008 withstrike price K=$63704 maturity T = October 05 2009 and an entitlementratio of 100 meaning that one option contract is divided into 100 warrants cfpage 9 The next graph gives the time evolution of the Black-Scholes portfoliovalue

t 7minusrarr gc(tSt)

driven by the market price t 7minusrarr St of the risky underlying asset as given inFigure 68 in which the number of days is counted from the origin and notfrom maturity

212

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

40 50 60 70 80 90 0 50 100 150 200

0

5

10

15

20

25

30

35

40

Underlying (HK$) Time in days

Fig 69 Path of the Black-Scholes price for a call option on HSBC

As a consequence of Proposition 64 in the Black-Scholes call option hedgingmodel the amount invested in the risky asset is

Stξt = StΦ(d+(T minus t)

)= StΦ

(log(StK) + (r+ σ22)(T minus t)

|σ|radicT minus t

)gt 0

which is always nonnegative ie there is no short selling and the amountinvested on the riskless asset is

ηtAt = minusK eminus(Tminust)rΦ(dminus(T minus t)

)= minusK eminus(Tminust)rΦ

(log(StK) + (rminus σ22)(T minus t)

|σ|radicT minus t

)6 0

which is always nonpositive ie we are constantly borrowing money on theriskless asset as noted in Figure 610

-60

-40

-20

0

20

40

60

80

100

0 50 100 150 200

K

HK$

Black-Scholes priceRisky investment ξtSt

Riskless investment ηtAtUnderlying asset price

Fig 610 Time evolution of a hedging portfolio for a call option on HSBC

213

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

A comparison of Figure 610 with market data can be found in Figures 911and 912 below

Cash settlement In the case of a cash settlement the option issuer will sat-isfy the option contract by selling ξT = 1 stock at the price ST = $83refund the K = $63 risk-free investment and hand in the remaining amountC = (ST minusK)+ = 83minus 63 = $20 to the option holder

Physical delivery In the case of physical delivery of the underlying asset theoption issuer will deliver ξT = 1 stock to the option holder in exchange forK = $63 which will be used together with the portfolio value to refund therisk-free loan

63 European Put Options

Similarly in the case of the European put option with strike price K thepayoff function is given by h(x) = (Kminusx)+ and the Black-Scholes PDE (67)reads

rgp(tx) =partgppartt

(tx) + rxpartgppartx

(tx) + 12σ

2x2 part2gppartx2 (tx)

gp(T x) = (K minus x)+(617)

The next proposition can be proved as in Sections 65 and 66 see Proposi-tion 611

Proposition 65 The solution of the PDE (617) is given by the Black-Scholes formula for put options

gp(tx) = K eminus(Tminust)rΦ(minus dminus(T minus t)

)minus xΦ

(minus d+(T minus t)

) (618)

withd+(T minus t) =

log(xK) + (r+ σ22)(T minus t)|σ|radicT minus t

(619)

dminus(T minus t) =log(xK) + (rminus σ22)(T minus t)

|σ|radicT minus t

(620)

as illustrated in Figure 611

214

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

Fig 611 Graph of the Black-Scholes put price function with strike price K = 100lowast

In other words the European put option with strike price K and maturityT is priced at time t isin [0T ] as

gp(tSt) = K eminus(Tminust)rΦ(minus dminus(T minus t)

)minus StΦ

(minus d+(T minus t)

) 0 6 t 6 T

Fig 612 Time-dependent solution of the Black-Scholes PDE (put option)dagger

The following R script is an implementation of the Black-Scholes formula forEuropean put options in R

1 BSPut lt- function(S K r T sigma)d1 = (log(SK)+(r+sigma^22)T)(sigmasqrt(T))

3 d2 = d1 - sigma sqrt(T)BSPut = Kexp(-rT) pnorm(-d2) - Spnorm(-d1)

5 BSPut

Call-put parity

lowast Right-click on the figure for interaction and ldquoFull Screen Multimediardquo viewdagger The animation works in Acrobat Reader on the entire pdf file

215

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

(C) 2012--today Alexander Grahn 3Dmenujs version 20140923 3D JavaScript used by media9sty Extended functionality of the (right click) context menu of 3D annotations 1) Adds the following items to the 3D context menu `Generate Default View Finds good default camera settings returned as options for use with the includemedia command `Get Current View Determines camera cross section and part settings of the current view returned as `VIEW section that can be copied into a views file of additional views The views file is inserted using the `3Dviews option of includemedia `Cross Section Toggle switch to add or remove a cross section into or from the current view The cross section can be moved in the x y z directions using x y z and X Y Z keys on the keyboard be tilted against and spun around the upright Z axis using the UpDown and LeftRight arrow keys and caled using the s and S keys 2) Enables manipulation of position and orientation of indiviual parts and groups of parts in the 3D scene Parts which have been selected with the mouse can be scaled moved around and rotated like the cross section as described above To spin the parts around their local up-axis keep Control key pressed while using the UpDown and LeftRight arrow keys This work may be distributed andor modified under the conditions of the LaTeX Project Public License The latest version of this license is in httpmirrorsctanorgmacroslatexbaselppltxt This work has the LPPL maintenance status `maintained The Current Maintainer of this work is A Grahn The code borrows heavily from Bernd Gaertners `Miniball software originally written in C++ for computing the smallest enclosing ball of a set of points see httpwwwinfethzchpersonalgaertnerminiballhtmlhostconsoleshow()constructor for doubly linked listfunction List() thisfirst_node=null thislast_node=new Node(undefined)Listprototypepush_back=function(x) var new_node=new Node(x) if(thisfirst_node==null) thisfirst_node=new_node new_nodeprev=null else new_nodeprev=thislast_nodeprev new_nodeprevnext=new_node new_nodenext=thislast_node thislast_nodeprev=new_nodeListprototypemove_to_front=function(it) var node=itget() if(nodenext=null ampamp nodeprev=null) nodenextprev=nodeprev nodeprevnext=nodenext nodeprev=null nodenext=thisfirst_node thisfirst_nodeprev=node thisfirst_node=node Listprototypebegin=function() var i=new Iterator() itarget=thisfirst_node return(i)Listprototypeend=function() var i=new Iterator() itarget=thislast_node return(i)function Iterator(it) if( it=undefined ) thistarget=ittarget else thistarget=null Iteratorprototypeset=function(it)thistarget=ittargetIteratorprototypeget=function()return(thistarget)Iteratorprototypederef=function()return(thistargetdata)Iteratorprototypeincr=function() if(thistargetnext=null) thistarget=thistargetnextconstructor for node objects that populate the linked listfunction Node(x) thisprev=null thisnext=null thisdata=xfunction sqr(r)return(rr)helper functionMiniball algorithm by B Gaertnerfunction Basis() thism=0 thisq0=new Array(3) thisz=new Array(4) thisf=new Array(4) thisv=new Array(new Array(3) new Array(3) new Array(3) new Array(3)) thisa=new Array(new Array(3) new Array(3) new Array(3) new Array(3)) thisc=new Array(new Array(3) new Array(3) new Array(3) new Array(3)) thissqr_r=new Array(4) thiscurrent_c=thisc[0] thiscurrent_sqr_r=0 thisreset()Basisprototypecenter=function()return(thiscurrent_c)Basisprototypesize=function()return(thism)Basisprototypepop=function()--thismBasisprototypeexcess=function(p) var e=-thiscurrent_sqr_r for(var k=0klt3++k) e+=sqr(p[k]-thiscurrent_c[k]) return(e)Basisprototypereset=function() thism=0 for(var j=0jlt3++j) thisc[0][j]=0 thiscurrent_c=thisc[0] thiscurrent_sqr_r=-1Basisprototypepush=function(p) var i j var eps=1e-32 if(thism==0) for(i=0ilt3++i) thisq0[i]=p[i] for(i=0ilt3++i) thisc[0][i]=thisq0[i] thissqr_r[0]=0 else for(i=0ilt3++i) thisv[thism][i]=p[i]-thisq0[i] for(i=1iltthism++i) thisa[thism][i]=0 for(j=0jlt3++j) thisa[thism][i]+=thisv[i][j]thisv[thism][j] thisa[thism][i]=(2thisz[i]) for(i=1iltthism++i) for(j=0jlt3++j) thisv[thism][j]-=thisa[thism][i]thisv[i][j] thisz[thism]=0 for(j=0jlt3++j) thisz[thism]+=sqr(thisv[thism][j]) thisz[thism]=2 if(thisz[thism]ltepsthiscurrent_sqr_r) return(false) var e=-thissqr_r[thism-1] for(i=0ilt3++i) e+=sqr(p[i]-thisc[thism-1][i]) thisf[thism]=ethisz[thism] for(i=0ilt3++i) thisc[thism][i]=thisc[thism-1][i]+thisf[thism]thisv[thism][i] thissqr_r[thism]=thissqr_r[thism-1]+ethisf[thism]2 thiscurrent_c=thisc[thism] thiscurrent_sqr_r=thissqr_r[thism] ++thism return(true)function Miniball() thisL=new List() thisB=new Basis() thissupport_end=new Iterator()Miniballprototypemtf_mb=function(it) var i=new Iterator(it) thissupport_endset(thisLbegin()) if((thisBsize())==4) return for(var k=new Iterator(thisLbegin())kget()=iget()) var j=new Iterator(k) kincr() if(thisBexcess(jderef()) gt 0) if(thisBpush(jderef())) thismtf_mb(j) thisBpop() if(thissupport_endget()==jget()) thissupport_endincr() thisLmove_to_front(j) Miniballprototypecheck_in=function(b) thisLpush_back(b)Miniballprototypebuild=function() thisBreset() thissupport_endset(thisLbegin()) thismtf_mb(thisLend())Miniballprototypecenter=function() return(thisBcenter())Miniballprototyperadius=function() return(Mathsqrt(thisBcurrent_sqr_r))functions called by menu itemsfunction calc3Dopts () create Miniball object var mb=new Miniball() auxiliary vector var corner=new Vector3() iterate over all visible mesh nodes in the scene for(i=0iltscenemeshescounti++) var mesh=scenemeshesgetByIndex(i) if(meshvisible) continue local to parent transformation matrix var trans=meshtransform build local to world transformation matrix by recursively multiplying the parents transf matrix on the right var parent=meshparent while(parenttransform) trans=transmultiply(parenttransform) parent=parentparent get the bbox of the mesh (local coordinates) var bbox=meshcomputeBoundingBox() transform the local bounding box corner coordinates to world coordinates for bounding sphere determination BBoxmin cornerset(bboxmin) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) BBoxmax cornerset(bboxmax) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) remaining six BBox corners cornerset(bboxminx bboxmaxy bboxmaxz) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) cornerset(bboxminx bboxminy bboxmaxz) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) cornerset(bboxminx bboxmaxy bboxminz) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) cornerset(bboxmaxx bboxminy bboxminz) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) cornerset(bboxmaxx bboxminy bboxmaxz) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) cornerset(bboxmaxx bboxmaxy bboxminz) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) compute the smallest enclosing bounding sphere mbbuild() current camera settings var camera=scenecamerasgetByIndex(0) var res= initialize result string aperture angle of the virtual camera (perspective projection) or orthographic scale (orthographic projection) if(cameraprojectionType==cameraTYPE_PERSPECTIVE) var aac=camerafov180MathPI if(hostutilprintf(4f aac)=30) res+=hostutilprintf(n3Daac=s aac) else cameraviewPlaneSize=2mbradius() res+=hostutilprintf(n3Dortho=s 1cameraviewPlaneSize) camera roll var roll = cameraroll180MathPI if(hostutilprintf(4f roll)=0) res+=hostutilprintf(n3Droll=sroll) target to camera vector var c2c=new Vector3() c2cset(cameraposition) c2csubtractInPlace(cameratargetPosition) c2cnormalize() if((c2cx==0 ampamp c2cy==-1 ampamp c2cz==0)) res+=hostutilprintf(n3Dc2c=s s s c2cx c2cy c2cz) new camera settings bounding sphere centre --gt new camera target var coo=new Vector3() cooset((mbcenter())[0] (mbcenter())[1] (mbcenter())[2]) if(coolength) res+=hostutilprintf(n3Dcoo=s s s coox cooy cooz) radius of orbit if(cameraprojectionType==cameraTYPE_PERSPECTIVE) var roo=mbradius() Mathsin(aac MathPI 360) else orthographic projection var roo=mbradius() res+=hostutilprintf(n3Droo=s roo) update camera settings in the viewer var currol=cameraroll cameratargetPositionset(coo) camerapositionset(cooadd(c2cscale(roo))) cameraroll=currol determine background colour rgb=scenebackgroundgetColor() if((rgbr==1 ampamp rgbg==1 ampamp rgbb==1)) res+=hostutilprintf(n3Dbg=s s s rgbr rgbg rgbb) determine lighting scheme switch(scenelightScheme) case sceneLIGHT_MODE_FILE curlights=Artworkbreak case sceneLIGHT_MODE_NONE curlights=Nonebreak case sceneLIGHT_MODE_WHITE curlights=Whitebreak case sceneLIGHT_MODE_DAY curlights=Daybreak case sceneLIGHT_MODE_NIGHT curlights=Nightbreak case sceneLIGHT_MODE_BRIGHT curlights=Hardbreak case sceneLIGHT_MODE_RGB curlights=Primarybreak case sceneLIGHT_MODE_BLUE curlights=Bluebreak case sceneLIGHT_MODE_RED curlights=Redbreak case sceneLIGHT_MODE_CUBE curlights=Cubebreak case sceneLIGHT_MODE_CAD curlights=CADbreak case sceneLIGHT_MODE_HEADLAMP curlights=Headlampbreak if(curlights=Artwork) res+=hostutilprintf(n3Dlights=s curlights) determine global render mode switch(scenerenderMode) case sceneRENDER_MODE_BOUNDING_BOX currender=BoundingBoxbreak case sceneRENDER_MODE_TRANSPARENT_BOUNDING_BOX currender=TransparentBoundingBoxbreak case sceneRENDER_MODE_TRANSPARENT_BOUNDING_BOX_OUTLINE currender=TransparentBoundingBoxOutlinebreak case sceneRENDER_MODE_VERTICES currender=Verticesbreak case sceneRENDER_MODE_SHADED_VERTICES currender=ShadedVerticesbreak case sceneRENDER_MODE_WIREFRAME currender=Wireframebreak case sceneRENDER_MODE_SHADED_WIREFRAME currender=ShadedWireframebreak case sceneRENDER_MODE_SOLID currender=Solidbreak case sceneRENDER_MODE_TRANSPARENT currender=Transparentbreak case sceneRENDER_MODE_SOLID_WIREFRAME currender=SolidWireframebreak case sceneRENDER_MODE_TRANSPARENT_WIREFRAME currender=TransparentWireframebreak case sceneRENDER_MODE_ILLUSTRATION currender=Illustrationbreak case sceneRENDER_MODE_SOLID_OUTLINE currender=SolidOutlinebreak case sceneRENDER_MODE_SHADED_ILLUSTRATION currender=ShadedIllustrationbreak case sceneRENDER_MODE_HIDDEN_WIREFRAME currender=HiddenWireframebreak if(currender=Solid) res+=hostutilprintf(n3Drender=s currender) write result string to the console hostconsoleshow() hostconsoleclear() hostconsoleprintln(n Copy and paste the following text to then+ option list of includemedian + res + n)function get3Dview () var camera=scenecamerasgetByIndex(0) var coo=cameratargetPosition var c2c=camerapositionsubtract(coo) var roo=c2clength c2cnormalize() var res=VIEW=insert optional name heren if((coox==0 ampamp cooy==0 ampamp cooz==0)) res+=hostutilprintf( COO=s s sn coox cooy cooz) if((c2cx==0 ampamp c2cy==-1 ampamp c2cz==0)) res+=hostutilprintf( C2C=s s sn c2cx c2cy c2cz) if(roo gt 1e-9) res+=hostutilprintf( ROO=sn roo) var roll = cameraroll180MathPI if(hostutilprintf(4f roll)=0) res+=hostutilprintf( ROLL=sn roll) if(cameraprojectionType==cameraTYPE_PERSPECTIVE) var aac=camerafov 180MathPI if(hostutilprintf(4f aac)=30) res+=hostutilprintf( AAC=sn aac) else if(hostutilprintf(4f cameraviewPlaneSize)=1) res+=hostutilprintf( ORTHO=sn 1cameraviewPlaneSize) rgb=scenebackgroundgetColor() if((rgbr==1 ampamp rgbg==1 ampamp rgbb==1)) res+=hostutilprintf( BGCOLOR=s s sn rgbr rgbg rgbb) switch(scenelightScheme) case sceneLIGHT_MODE_FILE curlights=Artworkbreak case sceneLIGHT_MODE_NONE curlights=Nonebreak case sceneLIGHT_MODE_WHITE curlights=Whitebreak case sceneLIGHT_MODE_DAY curlights=Daybreak case sceneLIGHT_MODE_NIGHT curlights=Nightbreak case sceneLIGHT_MODE_BRIGHT curlights=Hardbreak case sceneLIGHT_MODE_RGB curlights=Primarybreak case sceneLIGHT_MODE_BLUE curlights=Bluebreak case sceneLIGHT_MODE_RED curlights=Redbreak case sceneLIGHT_MODE_CUBE curlights=Cubebreak case sceneLIGHT_MODE_CAD curlights=CADbreak case sceneLIGHT_MODE_HEADLAMP curlights=Headlampbreak if(curlights=Artwork) res+= LIGHTS=+curlights+n switch(scenerenderMode) case sceneRENDER_MODE_BOUNDING_BOX defaultrender=BoundingBoxbreak case sceneRENDER_MODE_TRANSPARENT_BOUNDING_BOX defaultrender=TransparentBoundingBoxbreak case sceneRENDER_MODE_TRANSPARENT_BOUNDING_BOX_OUTLINE defaultrender=TransparentBoundingBoxOutlinebreak case sceneRENDER_MODE_VERTICES defaultrender=Verticesbreak case sceneRENDER_MODE_SHADED_VERTICES defaultrender=ShadedVerticesbreak case sceneRENDER_MODE_WIREFRAME defaultrender=Wireframebreak case sceneRENDER_MODE_SHADED_WIREFRAME defaultrender=ShadedWireframebreak case sceneRENDER_MODE_SOLID defaultrender=Solidbreak case sceneRENDER_MODE_TRANSPARENT defaultrender=Transparentbreak case sceneRENDER_MODE_SOLID_WIREFRAME defaultrender=SolidWireframebreak case sceneRENDER_MODE_TRANSPARENT_WIREFRAME defaultrender=TransparentWireframebreak case sceneRENDER_MODE_ILLUSTRATION defaultrender=Illustrationbreak case sceneRENDER_MODE_SOLID_OUTLINE defaultrender=SolidOutlinebreak case sceneRENDER_MODE_SHADED_ILLUSTRATION defaultrender=ShadedIllustrationbreak case sceneRENDER_MODE_HIDDEN_WIREFRAME defaultrender=HiddenWireframebreak if(defaultrender=Solid) res+= RENDERMODE=+defaultrender+n detect existing Clipping Plane (3D Cross Section) var clip=null if( clip=scenenodesgetByName($$$$$$)|| clip=scenenodesgetByName(Clipping Plane) ) for(var i=0iltscenenodescounti++) var nd=scenenodesgetByIndex(i) if(nd==clip||ndname==) continue var ndUTFName= for (var j=0 jltndnamelength j++) var theUnicode = ndnamecharCodeAt(j)toString(16) while (theUnicodelengthlt4) theUnicode = 0 + theUnicode ndUTFName += theUnicode var end=ndnamelastIndexOf() if(endgt0) var ndUserName=ndnamesubstr(0end) else var ndUserName=ndname respart= PART=+ndUserName+n respart+= UTF16NAME=+ndUTFName+n defaultvals=true if(ndvisible) respart+= VISIBLE=falsen defaultvals=false if(ndopacitylt10) respart+= OPACITY=+ndopacity+n defaultvals=false if(ndconstructorname==Mesh) currender=defaultrender switch(ndrenderMode) case sceneRENDER_MODE_BOUNDING_BOX currender=BoundingBoxbreak case sceneRENDER_MODE_TRANSPARENT_BOUNDING_BOX currender=TransparentBoundingBoxbreak case sceneRENDER_MODE_TRANSPARENT_BOUNDING_BOX_OUTLINE currender=TransparentBoundingBoxOutlinebreak case sceneRENDER_MODE_VERTICES currender=Verticesbreak case sceneRENDER_MODE_SHADED_VERTICES currender=ShadedVerticesbreak case sceneRENDER_MODE_WIREFRAME currender=Wireframebreak case sceneRENDER_MODE_SHADED_WIREFRAME currender=ShadedWireframebreak case sceneRENDER_MODE_SOLID currender=Solidbreak case sceneRENDER_MODE_TRANSPARENT currender=Transparentbreak case sceneRENDER_MODE_SOLID_WIREFRAME currender=SolidWireframebreak case sceneRENDER_MODE_TRANSPARENT_WIREFRAME currender=TransparentWireframebreak case sceneRENDER_MODE_ILLUSTRATION currender=Illustrationbreak case sceneRENDER_MODE_SOLID_OUTLINE currender=SolidOutlinebreak case sceneRENDER_MODE_SHADED_ILLUSTRATION currender=ShadedIllustrationbreak case sceneRENDER_MODE_HIDDEN_WIREFRAME currender=HiddenWireframebreak case sceneRENDER_MODE_DEFAULT currender=Defaultbreak if(currender=defaultrender) respart+= RENDERMODE=+currender+n defaultvals=false if(origtrans[ndname]ampampndtransformisEqual(origtrans[ndname])) var lvec=ndtransformtransformDirection(new Vector3(100)) var uvec=ndtransformtransformDirection(new Vector3(010)) var vvec=ndtransformtransformDirection(new Vector3(001)) respart+= TRANSFORM= +lvecx+ +lvecy+ +lvecz+ +uvecx+ +uvecy+ +uvecz+ +vvecx+ +vvecy+ +vvecz+ +ndtransformtranslationx+ +ndtransformtranslationy+ +ndtransformtranslationz+n defaultvals=false respart+= ENDn if(defaultvals) res+=respart if(clip) var centre=cliptransformtranslation var normal=cliptransformtransformDirection(new Vector3(001)) res+= CROSSSECTn if((centrex==0 ampamp centrey==0 ampamp centrez==0)) res+=hostutilprintf( CENTER=s s sn centrex centrey centrez) if((normalx==1 ampamp normaly==0 ampamp normalz==0)) res+=hostutilprintf( NORMAL=s s sn normalx normaly normalz) res+=hostutilprintf( VISIBLE=sn clipvisible) res+=hostutilprintf( PLANECOLOR=s s sn clipmaterialemissiveColorr clipmaterialemissiveColorg clipmaterialemissiveColorb) res+=hostutilprintf( OPACITY=sn clipopacity) res+=hostutilprintf( INTERSECTIONCOLOR=s s sn clipwireframeColorr clipwireframeColorg clipwireframeColorb) res+= ENDn for(var propt in clip) consoleprintln(propt++clip[propt]) res+=ENDn hostconsoleshow() hostconsoleclear() hostconsoleprintln(n Add the following VIEW section to a file ofn+ predefined views (See option 3Dviews)nn + The view may be given a name after VIEW=n + (Remove in front of =)n) hostconsoleprintln(res + n)add items to 3D context menuruntimeaddCustomMenuItem(dfltview Generate Default View default 0)runtimeaddCustomMenuItem(currview Get Current View default 0)runtimeaddCustomMenuItem(csection Cross Section checked 0)menu event handlersmenuEventHandler = new MenuEventHandler()menuEventHandleronEvent = function(e) switch(emenuItemName) case dfltview calc3Dopts() break case currview get3Dview() break case csection addremoveClipPlane(emenuItemChecked) break runtimeaddEventHandler(menuEventHandler)global variable taking reference to currently selected nodevar target=nullselectionEventHandler=new SelectionEventHandler()selectionEventHandleronEvent=function(e) if(eselectedampampenodename=) target=enode else target=null runtimeaddEventHandler(selectionEventHandler)cameraEventHandler=new CameraEventHandler()cameraEventHandleronEvent=function(e) var clip=null runtimeremoveCustomMenuItem(csection) runtimeaddCustomMenuItem(csection Cross Section checked 0) if(clip=scenenodesgetByName($$$$$$)|| predefined scenenodesgetByName(Clipping Plane)) added via context menu runtimeremoveCustomMenuItem(csection) runtimeaddCustomMenuItem(csection Cross Section checked 1) if(clip)plane in predefined views must be rotated by 90 deg around normal cliptransformrotateAboutLineInPlace( MathPI2cliptransformtranslation cliptransformtransformDirection(new Vector3(001)) ) for(var i=0 iltrot4x4length i++)rot4x4[i]setIdentity() target=nullruntimeaddEventHandler(cameraEventHandler)var rot4x4=new Array() keeps track of spin and tilt axes transformationskey event handler for scaling moving spinning and tilting objectskeyEventHandler=new KeyEventHandler()keyEventHandleronEvent=function(e) var backtrans=new Matrix4x4() var trgt=null if(target) trgt=target var backtrans=new Matrix4x4() var trans=trgttransform var parent=trgtparent while(parenttransform) build local to world transformation matrix transmultiplyInPlace(parenttransform) also build world to local back-transformation matrix backtransmultiplyInPlace(parenttransforminversetranspose) parent=parentparent backtranstransposeInPlace() else if( trgt=scenenodesgetByName($$$$$$)|| trgt=scenenodesgetByName(Clipping Plane) ) var trans=trgttransform if(trgt) return var tname=trgtname if(typeof(rot4x4[tname])==undefined) rot4x4[tname]=new Matrix4x4() if(target) var tiltAxis=rot4x4[tname]transformDirection(new Vector3(010)) else var tiltAxis=transtransformDirection(new Vector3(010)) var spinAxis=rot4x4[tname]transformDirection(new Vector3(001)) get the centre of the mesh if(targetampamptrgtconstructorname==Mesh) var centre=transtransformPosition(trgtcomputeBoundingBox()center) else part group (Node3 parent node clipping plane) var centre=new Vector3(transtranslation) switch(echaracterCode) case 30tilt up rot4x4[tname]rotateAboutLineInPlace( -MathPI900rot4x4[tname]translationtiltAxis) transrotateAboutLineInPlace(-MathPI900centretiltAxis) break case 31tilt down rot4x4[tname]rotateAboutLineInPlace( MathPI900rot4x4[tname]translationtiltAxis) transrotateAboutLineInPlace(MathPI900centretiltAxis) break case 28spin right if(ectrlKeyDownampamptarget) transrotateAboutLineInPlace(-MathPI900centrespinAxis) else rot4x4[tname]rotateAboutLineInPlace( -MathPI900rot4x4[tname]translationnew Vector3(001)) transrotateAboutLineInPlace(-MathPI900centrenew Vector3(001)) break case 29spin left if(ectrlKeyDownampamptarget) transrotateAboutLineInPlace(MathPI900centrespinAxis) else rot4x4[tname]rotateAboutLineInPlace( MathPI900rot4x4[tname]translationnew Vector3(001)) transrotateAboutLineInPlace(MathPI900centrenew Vector3(001)) break case 120 x translateTarget(trans new Vector3(100) e) break case 121 y translateTarget(trans new Vector3(010) e) break case 122 z translateTarget(trans new Vector3(001) e) break case 88 shift + x translateTarget(trans new Vector3(-100) e) break case 89 shift + y translateTarget(trans new Vector3(0-10) e) break case 90 shift + z translateTarget(trans new Vector3(00-1) e) break case 115 s transtranslateInPlace(centrescale(-1)) transscaleInPlace(101) transtranslateInPlace(centrescale(1)) break case 83 shift + s transtranslateInPlace(centrescale(-1)) transscaleInPlace(1101) transtranslateInPlace(centrescale(1)) break transmultiplyInPlace(backtrans)runtimeaddEventHandler(keyEventHandler)translates object by amount calculated from Canvas sizefunction translateTarget(t d e) var cam=scenecamerasgetByIndex(0) if(camprojectionType==camTYPE_PERSPECTIVE) var scale=Mathtan(camfov2) camtargetPositionsubtract(camposition)length Mathmin(ecanvasPixelWidthecanvasPixelHeight) else var scale=camviewPlaneSize2 Mathmin(ecanvasPixelWidthecanvasPixelHeight) ttranslateInPlace(dscale(scale))function addremoveClipPlane(chk) var curTrans=getCurTrans() var clip=scenecreateClippingPlane() if(chk) add Clipping Plane and place its center either into the camera target position or into the centre of the currently selected mesh node var centre=new Vector3() if(target) var trans=targettransform var parent=targetparent while(parenttransform) trans=transmultiply(parenttransform) parent=parentparent if(targetconstructorname==Mesh) var centre=transtransformPosition(targetcomputeBoundingBox()center) else var centre=new Vector3(transtranslation) target=null else centreset(scenecamerasgetByIndex(0)targetPosition) cliptransformsetView( new Vector3(000) new Vector3(100) new Vector3(010)) cliptransformtranslateInPlace(centre) else if( scenenodesgetByName($$$$$$)|| scenenodesgetByName(Clipping Plane) ) clipremove()clip=null restoreTrans(curTrans) return clipfunction to store current transformation matrix of all nodes in the scenefunction getCurTrans() var tA=new Array() for(var i=0 iltscenenodescount i++) var nd=scenenodesgetByIndex(i) if(ndname==) continue tA[ndname]=new Matrix4x4(ndtransform) return tAfunction to restore transformation matrices given as argfunction restoreTrans(tA) for(var i=0 iltscenenodescount i++) var nd=scenenodesgetByIndex(i) if(tA[ndname]) ndtransformset(tA[ndname]) store original transformation matrix of all mesh nodes in the scenevar origtrans=getCurTrans()set initial state of Cross Section menu entrycameraEventHandleronEvent(1)hostconsoleclear()

var ocgs=hostgetOCGs(hostpageNum)for(var i=0iltocgslengthi++)if(ocgs[i]name==MediaPlayButton2)ocgs[i]state=false

(C) 2012 Michail Vidiassov John C Bowman Alexander Grahn asylabelsjs version 20120912 3D JavaScript to be used with media9sty (option `add3Djscript) for Asymptote generated PRC files adds billboard behaviour to text labels in Asymptote PRC files so that they always face the camera under 3D rotation This work may be distributed andor modified under the conditions of the LaTeX Project Public License The latest version of this license is in httpmirrorsctanorgmacroslatexbaselppltxt This work has the LPPL maintenance status `maintained The Current Maintainer of this work is A Grahnvar bbnodes=new Array() billboard meshesvar bbtrans=new Array() billboard transformsfunction fulltransform(mesh) var t=new Matrix4x4(meshtransform) if(meshparentname = ) var parentTransform=fulltransform(meshparent) tmultiplyInPlace(parentTransform) return t else return t find all text labels in the scene and determine pivoting pointsvar nodes=scenenodesvar nodescount=nodescountvar third=1030for(var i=0 i lt nodescount i++) var node=nodesgetByIndex(i) var name=nodename var end=namelastIndexOf()-1 if(end gt 0) if(namecharAt(end) == 001) var start=namelastIndexOf(-)+1 if(end gt start) nodename=namesubstr(0start-1) var nodeMatrix=fulltransform(nodeparent) var c=nodeMatrixtranslation position var d=Mathpow(Mathabs(nodeMatrixdeterminant)third) scale bbnodespush(node) bbtranspush(Matrix4x4()scale(ddd)translate(c)multiply(nodeMatrixinverse)) var camera=scenecamerasgetByIndex(0) var zero=new Vector3(000)var bbcount=bbnodeslength event handler to maintain camera-facing text labelsbillboardHandler=new RenderEventHandler()billboardHandleronEvent=function(event) var T=new Matrix4x4() TsetView(zerocamerapositionsubtract(cameratargetPosition) cameraupsubtract(cameraposition)) for(var j=0 j lt bbcount j++) bbnodes[j]transformset(Tmultiply(bbtrans[j])) runtimerefresh() runtimeaddEventHandler(billboardHandler)runtimerefresh()

(C) 2012 Alexander Grahn 3Dspintooljs version 20120301 3D JavaScript to be used with media9sty (option `add3Djscript) enables the Spin tool (also accessible via 3D toolbar or context menu) upon activation of the 3D scene the scene then rotates around the upright axis while dragging with the mouse This work may be distributed andor modified under the conditions of the LaTeX Project Public License The latest version of this license is in httpmirrorsctanorgmacroslatexbaselppltxt This work has the LPPL maintenance status `maintained The Current Maintainer of this work is A GrahnruntimesetCurrentTool(runtimeTOOL_NAME_SPIN)

N Privault

Proposition 66 Call-put parity We have the call-put parity relation

gc(tSt)minus gp(tSt) = St minusK eminus(Tminust)r 0 6 t 6 T (621)

between the Black-Scholes prices of call and put options in terms of theforward contract price St minusK eminus(Tminust)r

Proof The call-put parity (621) is a consequence of the relation

xminusK = (xminusK)+ minus (K minus x)+

satisfied by the terminal call and put payoff functions in the Black-ScholesPDE (67) It can also be verified directly from (610) and (618) as

gc(tx)minus gp(tx) = xΦ(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)minus(K eminus(Tminust)rΦ

(minus dminus(T minus t)

)minus xΦ

(minus d+(T minus t)

))= xΦ

(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)minusK eminus(Tminust)r

(1minusΦ

(dminus(T minus t)

))+ x

(1minusΦ

(d+(T minus t)

))= xminusK

The Delta of the Black-Scholes put option can be obtained by differentiationof the call-put parity relation (621) and Proposition 64

Proposition 67 The Delta of the Black-Scholes put option is given by

ξt = minus(1minusΦ(d+(T minus t)

)) = minusΦ

(minus d+(T minus t)

)isin [minus1 0] 0 6 t 6 T

Proof By the call-put parity relation (621) and Proposition 64 we have

partgppartx

(tSt) =partgcpartx

(tSt)minus 1

= Φ(d+(T minus t))minus 1= minusΦ(minusd+(T minus t)) 0 6 t 6 T

where we applied (614)

As a consequence of Proposition 67 the Black-Scholes put price splitsinto a risky component minusStΦ

(minus d+(T minus t)

)and a riskless component

K eminus(Tminust)rΦ(minus dminus(T minus t)

) as follows

gp(tSt) = K eminus(Tminust)rΦ(minus dminus(T minus t)

)︸ ︷︷ ︸riskminusfree investment (savings)

minus StΦ(minus d+(T minus t)

)︸ ︷︷ ︸

risky investment (short)

0 6 t 6 T

216

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

In Figure 613 we plot the Delta of the European put option as a function ofthe underlying asset price and of the time remaining until maturity

Payoff function (x-K)+

0

50

100

150

200

Underlying

0

5

10

15 Time to maturity T-t

-1

-075

-05

-025

0

Fig 613 Delta of a European put option with strike price K = 100 r = 3 σ = 10

Numerical example - hedging of a put option

For one more example we consider a put option issued by BNP Paribas on04 November 2008 with strike price K=$77667 maturity T = October 052009 and entitlement ratio 92593 cf page 9 In the next Figure 614 thenumber of days is counted from the origin not from maturity

40 50 60 70 80 90 100

0 50 100 150 200

0 5

10 15 20 25 30 35 40 45

Underlying (HK$)Time in days

Fig 614 Path of the Black-Scholes price for a put option on HSBC

As a consequence of Proposition 67 the amount invested on the risky assetfor the hedging of a put option is

minusStΦ(minus d+(T minus t)

)= minusStΦ

(minus log(StK) + (r+ σ22)(T minus t)

|σ|radicT minus t

)6 0

217

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

ie there is always short selling and the amount invested on the riskless assetpriced At = ert t isin [0T ] is

ηtAt = K eminus(Tminust)rΦ(minus dminus(T minus t)

)= K eminus(Tminust)rΦ

(minus log(StK) + (rminus σ22)(T minus t)

|σ|radicT minus t

)gt 0

which is always nonnegative ie we are constantly saving money on theriskless asset as noted in Figure 615

-60

-40

-20

0

20

40

60

80

100

0 50 100 150 200

K

HK$

Black-Scholes priceRisky investment ξtSt

Riskless investment ηtAtUnderlying asset price

Fig 615 Time evolution of the hedging portfolio for a put option on HSBC

In the above example the put option finished out of the money (OTM) so thatno cash settlement or physical delivery occurs A comparison of Figure 610with market data can be found in Figures 913 and 914 below

64 Market Terms and Data

The following Table 61 provides a summary of formulas for the computationof Black-Scholes sensitivities also called Greekslowast

lowast ldquoEvery class feels like attending a Greek lessonrdquo (AY2018-2019 student feedback)

218

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

Call option Put option

Option price g(tSt) StΦ(d+(T minus t))minusK eminus(Tminust)rΦ(dminus(T minus t)) K eminus(Tminust)rΦ(minusdminus(T minus t))minus StΦ(minusd+(T minus t))

Delta (∆) partg

partx(tSt) Φ(d+(T minus t)) gt 0 minusΦ(minusd+(T minus t)) 6 0

Gamma (Γ) part2g

partx2 (tSt)Φprime(d+(T minus t))St|σ|

radicT minus t

gt 0

Vega partg

partσ(tSt) St

radicT minus tΦprime(d+(T minus t)) gt 0

Theta (Θ) partg

partt(tSt) minusSt|σ|Φ

prime(d+(T minus t))2radicT minus t

minus rK eminus(Tminust)rΦ(dminus(T minus t)) 6 0 minusSt|σ|Φprime(d+(T minus t))

2radicT minus t

+ rK eminus(Tminust)rΦ(minusdminus(T minus t))

Rho (ρ) partg

partr(tSt) K(T minus t) eminus(Tminust)rΦ(dminus(T minus t)) minusK(T minus t) eminus(Tminust)rΦ(minusdminus(T minus t))

Table 61 Black-Scholes Greeks (Wikipedia)

From Table 61 we can conclude that call option prices are increasing func-tions of the underlying asset price St of the interest rate r and of the volatil-ity parameter σ Similarly put option prices are decreasing functions of theunderlying asset price St of the interest rate r and increasing functions ofthe volatility parameter σ

Parameter Variation of call option prices Variation of put option prices

Underlying St increasing decreasing

Volatility σ increasing increasing

Time t decreasing depends on the underlying price level

Interest rate r increasing decreasing

Table 62 Variations of Black-Scholes prices

The change of sign of the sensitivity Theta (Θ) with respect to time t can beverified in the following Figure 616

219

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

(a) Black-Scholes call price maps (b) Black-Scholes put price maps

Fig 616 Time-dependent solutions of the Black-Scholes PDElowast

Intrinsic value The intrinsic value at time t isin [0T ] of the option withpayoff C = h

(S(1)T

)is given by the immediate exercise payoff h

(S(1)t

) The

extrinsic value at time t isin [0T ] of the option is the remaining differenceπt(C) minus h

(S(1)t

)between the option price πt(C) and the immediate ex-

ercise payoff h(S(1)t

) In general the option price πt(C) decomposes as

πt(C) = h(S(1)t

)︸ ︷︷ ︸intrinsic value

+ πt(C)minus h(S(1)t

)︸ ︷︷ ︸

extrinsic value

0 6 t 6 T ]

Gearing The gearing at time t isin [0T ] of the option with payoff C = h(ST )is defined as the ratio

Gt =St

πt(C)=

Stg(tSt)

0 6 t 6 T

Effective gearing The effective gearing at time t isin [0T ] of the option withpayoff C = h(ST ) is defined as the ratio

Get = Gtξt

=ξtStπt(C)

=St

πt(C)

partg

partx(tSt)

=St

g(tSt)partg

partx(tSt)

= Stpart

partxlog g(tSt) 0 6 t 6 T

lowast The animation works in Acrobat Reader on the entire pdf file

220

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

The effective gearingGet =

ξtStπt(C)

can be interpreted as the hedge ratio ie the percentage of the portfoliowhich is invested on the risky asset When written as

∆g(tSt)g(tSt)

= Get times

∆StSt

the effective gearing gives the relative variation or percentage change∆g(tSt)g(tSt) of the option price g(tSt) from the relative variation∆StSt in the underlying asset price

The ratio Get = Stpart log g(tSt)partx can also be interpreted as an elasticity

coefficient

Break-even price The break-even price BEPt of the underlying asset is thevalue of S for which the intrinsic option value h(S) equals the option priceπt(C) at time t isin [0T ] For European call options it is given by

BEPt = K + πt(C) = K + g(tSt) t = 0 1 N

whereas for European put options it is given by

BEPt = K minus πt(C) = K minus g(tSt) 0 6 t 6 T

Premium The option premium OPt can be defined as the variation requiredfrom the underlying asset price in order to reach the break-even price iewe have

OPt =BEPt minus St

St=K + g(tSt)minus St

St 0 6 t 6 T

for European call options and

OPt =St minusBEPt

St=St + g(tSt)minusK

St 0 6 t 6 T

for European put options see Figure 617 below The term ldquopremiumrdquo issometimes also used to denote the arbitrage price g(tSt) of the option

221

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

f (tx σ)100

=

x =

K =

xpart log f

partx=

σ =

partf

partt(tx σ)=

T=

=(xminusK)x

∆ = = partf

partx(tx σ)

= partf

partσ(tx σ)

=K+f (txσ)minusx

x

=K+f (tx σ)

rf=

partf

partt+rxpartf

partx+

σ2 2x2part2f

partx2

Fig 617 Warrant terms and data

The R package bizdays (requires to install QuantLib) can be used to computecalendar time vs business time to maturity1 installpackages(bizdays)

library(bizdays)3 load_quantlib_calendars(HongKong from=2018-01-01 to=2018-12-31)

load_quantlib_calendars(Singapore from=2018-01-01 to=2018-12-31)5 bizdays(2018-03-10 2018-04-03 QuantLibHongKong)

bizdays(2018-03-10 2018-04-03 QuantLibSingapore)

65 The Heat Equation

In the next proposition we notice that the solution f(tx) of the Black-Scholes PDE (67) can be transformed into a solution g(t y) of the simplerheat equation by a change of variable and a time inversion t 7minusrarr T minus t onthe interval [0T ] so that the terminal condition at time T in the Black-Scholes equation (622) becomes an initial condition at time t = 0 in theheat equation (625) See also here for a related discussion on changes ofvariables for the Black-Scholes PDE

222

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

Proposition 68 Assume that f(tx) solves the Black-Scholes PDErf(tx) = partf

partt(tx) + rx

partf

partx(tx) + 1

2σ2x2 part

2f

partx2 (tx)

f(T x) = (xminusK)+(622)

with terminal condition h(x) = (xminusK)+ x gt 0 Then the function g(t y)defined by

g(t y) = ertf(T minus t e|σ|y+(σ22minusr)t) (623)

solves the heat equation (625) with initial condition

ψ(y) = h(

e|σ|y) y isin R (624)

ie we have partg

partt(t y) = 1

2part2g

party2 (t y)

g(0 y) = h(

e|σ|y)

(625)

Proposition 68 will be proved in Section 66 It will allow us to solve theBlack-Scholes PDE (622) based on the solution of the heat equation (625)with initial condition ψ(y) = h

(e|σ|y

) y isin R by inversion of Relation (623)

with s = T minus t x = e|σ|y+(σ22minusr)t ie

f(sx) = eminus(Tminuss)rg(T minus s minus(σ

22minus r)(T minus s) + log x|σ|

)

Next we focus on the heat equation

partϕ

partt(t y) = 1

2part2ϕ

party2 (t y) (626)

which is used to model the diffusion of heat over time through solids Herethe data of g(x t) represents the temperature measured at time t and pointx We refer the reader to Widder (1975) for a complete treatment of thistopic

223

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

Fig 618 Time-dependent solution of the heat equationlowast

Proposition 69 The fundamental solution of the heat equation (626) isgiven by the Gaussian probability density function

ϕ(t y) =1radic2πt

eminusy2(2t) y isin R

with variance t gt 0

Proof The proof is done by a direct calculation as follows

partϕ

partt(t y) = part

partt

(eminusy2(2t)radic

2πt

)

= minus eminusy2(2t)

2t32radic

2π+

y2

2t2eminusy2(2t)radic

2πt

=

(minus 1

2t +y2

2t2

)ϕ(t y)

and

12part2ϕ

party2 (t y) = minus12part

party

(y

t

eminusy2(2t)radic

2πt

)

= minus eminusy2(2t)

2tradic

2πt+

y2

2t2eminusy2(2t)radic

2πt

=

(minus 1

2t +y2

2t2

)ϕ(t y) t gt 0 y isin R

lowast The animation works in Acrobat Reader on the entire pdf file

224

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

In Section 66 the heat equation (626) will be shown to be equivalent to theBlack-Scholes PDE after a change of variables In particular this will lead tothe explicit solution of the Black-Scholes PDE

Proposition 610 The heat equationpartg

partt(t y) = 1

2part2g

party2 (t y)

g(0 y) = ψ(y)

(627)

with continuous initial condition

g(0 y) = ψ(y)

has the solution

g(t y) =winfinminusinfin

ψ(z) eminus(yminusz)2(2t) dzradic2πt

y isin R t gt 0 (628)

Proof We have

partg

partt(t y) = part

partt

winfinminusinfin

ψ(z) eminus(yminusz)2(2t) dzradic2πt

=winfinminusinfin

ψ(z)part

partt

(eminus(yminusz)2(2t)radic

2πt

)dz

=12winfinminusinfin

ψ(z)

((yminus z)2

t2minus 1t

)eminus(yminusz)2(2t) dzradic

2πt

=12winfinminusinfin

ψ(z)part2

partz2 eminus(yminusz)2(2t) dzradic2πt

=12winfinminusinfin

ψ(z)part2

party2 eminus(yminusz)2(2t) dzradic2πt

=12part2

party2

winfinminusinfin

ψ(z) eminus(yminusz)2(2t) dzradic2πt

=12part2g

party2 (t y)

On the other hand it can be checked that at time t = 0 we have

limtrarr0

winfinminusinfin

ψ(z) eminus(yminusz)2(2t) dzradic2πt

= limtrarr0

winfinminusinfin

ψ(y+ z) eminusz2(2t) dzradic2πt

= ψ(y) y isin R

225

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

The next Figure 619 shows the evolution of g(tx) with initial conditionbased on the European call payoff function h(x) = (xminusK)+ ie

g(0 y) = ψ(y) = h(

e|σ|y)=(

e|σ|y minusK)+ y isin R

Fig 619 Time-dependent solution of the heat equationlowast

Let us provide a second proof of Proposition 610 this time using Brownianmotion and stochastic calculus

Proof of Proposition 610 First note that under the change of variable x =z minus y we have

g(t y) =winfinminusinfin

ψ(z) eminus(yminusz)2(2t) dzradic2πt

=winfinminusinfin

ψ(y+ x) eminusx2(2t) dxradic2πt

= IE[ψ(y+Bt)]

= IE[ψ(yminusBt)]

where (Bt)tisinR+ is a standard Brownian motion and Bt N (0 t) t isin R+Applying Itocircrsquos formula and using the fact that the expectation of the stochas-tic integral with respect to Brownian motion is zero see Relation (417) inProposition 420 we find

g(t y) = IE[ψ(yminusBt)]

= ψ(y)minus IE[w t

0ψprime(yminusBs)dBs

]+

12 IE

[w t0ψprimeprime(yminusBs)ds

]= ψ(y) +

12w t

0IE[ψprimeprime(yminusBs)

]ds

lowast The animation works in Acrobat Reader on the entire pdf file

226

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

= ψ(y) +12w t

0part2

party2 IE [ψ(yminusBs)] ds

= ψ(y) +12w t

0part2g

party2 (s y)ds

Hence we have

partg

partt(t y) = part

parttIE[ψ(yminusBt)]

=12part2

party2 IE [ψ(yminusBt)]

=12part2g

party2 (t y)

Regarding the initial condition we check that

g(0 y) = IE[ψ(yminusB0)] = IE[ψ(y)] = ψ(y)

The expression g(t y) = IE[ψ(yminusBt)] provides a probabilistic interpreta-tion of the heat diffusion phenomenon based on Brownian motion Namelywhen ψε(y) = 1[minusεε](y) we find that

gε(t y) = IE[ψε(yminusBt)]= IE[1[minusεε](yminusBt)]= P

(yminusBt isin [minusε ε]

)= P

(yminus ε 6 Bt 6 y+ ε

)represents the probability of finding Bt within a neighborhood [y minus ε y + ε]of the point y isin R

66 Solution of the Black-Scholes PDE

In this section we solve the Black-Scholes PDE by the kernel method of Sec-tion 65 and a change of variables This solution method uses the change ofvariables (623) of Proposition 68 and a time inversion from which the ter-minal condition at time T in the Black-Scholes equation becomes an initialcondition at time t = 0 in the heat equation

Next we state the proof Proposition 68

Proof Letting s = T minus t and x = e|σ|y+(σ22minusr)t and using Relation (623)ie

g(t y) = ertf(T minus t e|σ|y+(σ22minusr)t)

227

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

we have

partg

partt(t y) = r ertf

(T minus t e|σ|y+(σ22minusr)t)minus ert partf

parts

(T minus t e|σ|y+(σ22minusr)t)

+

(σ2

2 minus r)

ert e|σ|y+(σ22minusr)t partf

partx

(T minus t e|σ|y+(σ22minusr)t)

= r ertf(T minus tx)minus ert partfparts

(T minus tx) +(σ2

2 minus r)

ertxpartfpartx

(T minus tx)

=12 ertx2σ2 part

2f

partx2 (T minus tx) +σ2

2 ertxpartfpartx

(T minus tx) (629)

where on the last step we used the Black-Scholes PDE On the other handwe have

partg

party(t y) = |σ| ert e|σ|y+(σ22minusr)t partf

partx

(T minus t e|σ|y+(σ22minusr)t)

and

12partg2

party2 (t y) =σ2

2 ert e|σ|y+(σ22minusr)t partf

partx

(T minus t e|σ|y+(σ22minusr)t)

+σ2

2 ert e2|σ|y+2(σ22minusr)t part2f

partx2(T minus t e|σ|y+(σ22minusr)t)

=σ2

2 ertxpartfpartx

(T minus tx) + σ2

2 ertx2 part2f

partx2 (T minus tx) (630)

We conclude by comparing (629) with (630) which shows that g(tx) solvesthe heat equation (627) with initial condition

g(0 y) = f(T e|σ|y

)= h

(e|σ|y

)

In the next proposition we derive the Black-Scholes formula (610) by solv-ing the PDE (622) The Black-Scholes formula will also be recovered by aprobabilistic argument via the computation of an expected value in Proposi-tion 77

Proposition 611 When h(x) = (x minusK)+ the solution of the Black-Scholes PDE (622) is given by

f(tx) = xΦ(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

) x gt 0

whereΦ(x) =

1radic2π

w xminusinfin

eminusy22dy x isin R

and

228

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

d+(T minus t) =

log(xK) + (r+ σ22)(T minus t)|σ|radicT minus t

dminus(T minus t) =log(xK) + (rminus σ22)(T minus t)

|σ|radicT minus t

x gt 0 t isin [0T )

Proof By inversion of Relation (623) with s = T minus t and x = e|σ|y+(σ22minusr)twe get

f(sx) = eminus(Tminuss)rg(T minus s minus(σ

22minus r)(T minus s) + log x|σ|

)and

h(x) = ψ

(log x|σ|

) x gt 0 or ψ(y) = h

(e|σ|y

) y isin R

Hence using the solution (628) and Relation (624) we get

f(tx) = eminus(Tminust)rg(T minus t minus(σ

22minus r)(T minus t) + log x|σ|

)= eminus(Tminust)r

winfinminusinfin

ψ

(minus(σ22minus r)(T minus t) + log x

|σ|+ z

)eminusz2(2(Tminust)) dzradic

2(T minus t)π

= eminus(Tminust)rwinfinminusinfin

h(x e|σ|zminus(σ22minusr)(Tminust)) eminusz2(2(Tminust)) dzradic

2(T minus t)π

= eminus(Tminust)rwinfinminusinfin

(x e|σ|zminus(σ22minusr)(Tminust) minusK

)+ eminusz2(2(Tminust)) dzradic2(T minus t)π

= eminus(Tminust)r

timeswinfin

(minusr+σ22)(Tminust)+log(Kx)|σ|

(x e|σ|zminus(σ22minusr)(Tminust) minusK

)eminusz2(2(Tminust)) dzradic

2(T minus t)π

= x eminus(Tminust)rwinfinminusdminus(Tminust)

radicTminust

e|σ|zminus(σ22minusr)(Tminust) eminusz2(2(Tminust)) dzradic2(T minus t)π

minusK eminus(Tminust)rwinfinminusdminus(Tminust)

radicTminust

eminusz2(2(Tminust)) dzradic2(T minus t)π

= xwinfinminusdminus(Tminust)

radicTminust

e|σ|zminus(Tminust)σ22minusz2(2(Tminust)) dzradic2(T minus t)π

minusK eminus(Tminust)rwinfinminusdminus(Tminust)

radicTminust

eminusz2(2(Tminust)) dzradic2(T minus t)π

= xwinfinminusdminus(Tminust)

radicTminust

eminus(zminus(Tminust)|σ|)2(2(Tminust)) dzradic2(T minus t)π

229

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

minusK eminus(Tminust)rwinfinminusdminus(Tminust)

radicTminust

eminusz2(2(Tminust)) dzradic2(T minus t)π

= xwinfinminusdminus(Tminust)

radicTminustminus(Tminust)|σ|

eminusz2(2(Tminust)) dzradic2(T minus t)π

minusK eminus(Tminust)rwinfinminusdminus(Tminust)

radicTminust

eminusz2(2(Tminust)) dzradic2(T minus t)π

= xwinfinminusdminus(Tminust)minus|σ|

radicTminust

eminusz22 dzradic2πminusK eminus(Tminust)r

winfinminusdminus(Tminust)

eminusz22 dzradic2π

= x(1minusΦ

(minus d+(T minus t)

))minusK eminus(Tminust)r

(1minusΦ

(minus dminus(T minus t)

))= xΦ

(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)

where we used the relation (614) ie

1minusΦ(a) = Φ(minusa) a isin R

Exercises

Exercise 61 Bachelier (1900) model Consider a market made of a risklessasset valued At = A0 with zero interest rate t isin R+ and a risky asset whoseprice St is modeled by a standard Brownian motion as St = Bt t isin R+

a) Show that the price g(tBt) of the option with payoff C = B2T satisfies

the heat equationpartϕ

partt(t y) = minus1

2part2ϕ

party2 (t y)

with terminal condition g(T x) = x2b) Find the function g(tx) by solving the PDE of Question (a)

Hint Try a solution of the form g(tx) = x2 + f(t)

See Exercises 611 713 and 714 for extensions to nonzero interest rates

Exercise 62 Consider a risky asset price (St)tisinR modeled in the Cox et al(1985) (CIR) model as

dSt = β(αminus St)dt+ σradicStdBt αβσ gt 0 (631)

and let (ηt ξt)tisinR+ be a portfolio strategy whose value Vt = ηtAt + ξtSttakes the form Vt = g(tSt) t isin R+ Figure 620 presents a random simula-tion of the solution to (631) with α = 0025 β = 1 and σ = 13230

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

0

1

2

3

4

5

6

7

8

0 01 02 03 04 05 06 07 08 09 1

St

t

Fig 620 Graph of the CIR short rate t 7rarr rt with α = 25 β = 1 and σ = 13

N=10000 t lt- 0(N-1) dt lt- 10Na=0025 b=2 sigma=0052 X lt- rnorm(Nmean=0sd=sqrt(dt))R lt- rep(0N)R[1]=001

for (j in 2N)R[j]=max(0R[j-1]+(a-bR[j-1])dt+sigmasqrt(R[j-1])X[j])4 plot(t R xlab = t ylab = type = l ylim = c(0002) col = blue)

Based on the self-financing condition written as

dVt = rVtdtminus rξtStdt+ ξtdSt

= rVtdtminus rξtStdt+ β(αminus St)ξtdt+ σξtradicStdBt t isin R+ (632)

derive the PDE satisfied by the function g(tx) using the Itocirc formula

Exercise 63 Black-Scholes PDE with dividends Consider a riskless as-set with price At = A0 ert t isin R+ and an underlying asset price process(St)tisinR+ modeled as

dSt = (microminus δ)Stdt+ σStdBt

where (Bt)tisinR+ is a standard Brownian motion and δ gt 0 is a continuous-time dividend rate By absence of arbitrage the payment of a dividend entailsa drop in the stock price by the same amount occuring generally on the ex-dividend date on which the purchase of the security no longer entitles theinvestor to the dividend amount The list of investors entitled to dividendpayment is consolidated on the date of record and payment is made on thepayable date

library(quantmod)2 getSymbols(0005HKfrom=2010-01-01to=SysDate()src=yahoo)

getDividends(0005HKfrom=2010-01-01to=SysDate()src=yahoo)

a) Assuming that the portfolio with value Vt = ξtSt + ηtAt at time t is self-financing and that dividends are continuously reinvested write down theportfolio variation dVt

231

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

b) Assuming that the portfolio value Vt takes the form Vt = g(tSt) at timet derive the Black-Scholes PDE for the function g(tx) with its terminalcondition

c) Compute the price at time t isin [0T ] of the European call option withstrike price K by solving the corresponding Black-Scholes PDE

d) Compute the Delta of the option

Exercise 64

a) Check that the Black-Scholes formula (610) for European call options

gc(tx) = xΦ(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)

satisfies the following boundary conditions

i) at x = 0 gc(t 0) = 0ii) at maturity t = T

gc(T x) = (xminusK)+ =

xminusK x gt K

0 x 6 K

iii) as time to maturity tends to infinity

limTrarrinfin

Bl(Kxσ rT minus t) = x t isin R+

b) Check that the Black-Scholes formula (618) for European put options

gp(tx) = K eminus(Tminust)rΦ(minus dminus(T minus t)

)minus xΦ

(minus d+(T minus t)

)satisfies the following boundary conditions

i) at x = 0 gp(t 0) = K eminus(Tminust)rii) as x tends to infinity gp(tinfin) = 0 for all t isin [0T )iii) at maturity t = T

gp(T x) = (K minus x)+ =

0 x gt K

K minus x x 6 K

iv) as time to maturity tends to infinity

limTrarrinfin

Blp(KStσ rT minus t) = 0 t isin R+

Exercise 65 Power option (Exercise 314 continued)

232

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

a) Solve the Black-Scholes PDE

rg(x t) = partg

partt(x t) + rx

partg

partx(x t) + σ2

2 x2 part2g

partx2 (x t) (633)

with terminal condition g(xT ) = x2 x gt 0 t isin [0T ]

Hint Try a solution of the form g(x t) = x2f(t) and find f(t)b) Find the respective quantities ξt and ηt of the risky asset St and riskless

asset At = ert in the portfolio with value

Vt = g(St t) = ξtSt + ηtAt 0 6 t 6 T

hedging the contract with payoff S2T at maturity

Exercise 66 On December 18 2007 a call warrant has been issued byFortis Bank on the stock price S of the MTR Corporation with maturityT = 23122008 strike price K = HK$ 3608 and entitlement ratio=10Recall that in the Black-Scholes model the price at time t of the Europeanclaim on the underlying asset priced St with strike price K maturity T interest rate r and volatility σ gt 0 is given by the Black-Scholes formula as

f(tSt) = StΦ(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)

wheredminus(T minus t) =

(rminus σ22)(T minus t) + log(StK)

|σ|radicT minus t

d+(T minus t) = dminus(T minus t) + |σ|radicT minus t = (r+ σ22)(T minus t) + log(StK)

|σ|radicT minus t

Recall that by Proposition 64 we have

partf

partx(tSt) = Φ

(d+(T minus t)

) 0 6 t 6 T

a) Using the values of the Gaussian cumulative distribution function com-pute the Black-Scholes price of the corresponding call option at timet =November 07 2008 with St = HK$ 17200 assuming a volatility σ =90 = 090 and an annual risk-free interest rate r = 4377 = 004377

b) Still using the Gaussian cumulative distribution function compute thequantity of the risky asset required in your portfolio at time t =November07 2008 in order to hedge one such option at maturity T = 23122008

c) Figure 1 represents the Black-Scholes price of the call option as a functionof σ isin [05 15] = [50 150]

233

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

0

01

02

03

04

05

06

05 06 07 08 09 1 11 12 13 14 15σimp

Optio

n pr

ice

σ

Market price

Fig 621 Option price as a function of the volatility σ gt 0

1 BSCall lt- function(S K r T sigma)d1 lt- (log(SK)+(r+sigma^22)T)(sigmasqrt(T))d2 lt- d1 - sigma sqrt(T)

3 BSCall = Spnorm(d1) - Kexp(-rT)pnorm(d2)BSCallsigma lt- seq(0515 length=100)

5 plot(sigmaBSCall(172360800437746365sigma) type=llty=1 xlab=Sigmaylab=Black-Scholes Call Price ylim = c(006)col=bluelwd=3)grid()

abline(h=023col=redlwd=3)

Knowing that the closing price of the warrant on November 07 2008 wasHK$ 0023 which value can you infer for the implied volatility σ at thisdatelowast

Exercise 67 Forward contracts Recall that the price πt(C) of a claimpayoff C = h(ST ) of maturity T can be written as πt(C) = g(tSt) wherethe function g(tx) satisfies the Black-Scholes PDE

rg(tx) = partg

partt(tx) + rx

partg

partx(tx) + 1

2σ2x2 part

2g

partx2 (tx)

g(T x) = h(x) (1)

with terminal condition g(T x) = h(x) x gt 0

a) Assume that C is a forward contract with payoff

C = ST minusK

at time T Find the function h(x) in (1)b) Find the solution g(tx) of the above PDE and compute the price πt(C)

at time t isin [0T ]Hint search for a solution of the form g(tx) = xminus α(t) where α(t) is afunction of t to be determined

lowast Download the corresponding or the that can be runhere

234

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

BS lt- function(S K T r sig)d1 lt- (log(SK) + (r + sig^22)T) (sigsqrt(T))d2 lt- d1 - sigsqrt(T)return(Spnorm(d1) - Kexp(-rT)pnorm(d2))impliedvol lt- function(S K T r market)sig lt- 020sigup lt- 1sigdown lt- 0001count lt- 0err lt- BS(S K T r sig) - marketwhile(abs(err) gt 000001 ampamp countlt1000)if(err lt 0)sigdown lt- sigsig lt- (sigup + sig)2elsesigup lt- sigsig lt- (sigdown + sig)2err lt- BS(S K T r sig) - marketcount lt- count + 1if(count==2000)return(NA)elsereturn(sig)market = 083K = 628T = 7 365S = 634r = 002impliedvol(S K T r market)

cells [ cell_type code execution_count null metadata outputs [] source [ from IPythoncoredisplay import display HTMLn display(HTML( )) ] cell_type code execution_count null metadata collapsed true outputs [] source [ import numpy as npn import scipystats as ssn import time n n Black and Scholesn def d1(S0 K r sigma T)n return (nplog(S0K) + (r + sigma2 2) T)(sigma npsqrt(T))n n def d2(S0 K r sigma T)n return (nplog(S0 K) + (r - sigma2 2) T) (sigma npsqrt(T))n n def BlackScholes(typeS0 K r sigma T)n if type==Cn return S0 ssnormcdf(d1(S0 K r sigma T)) - K npexp(-r T) ssnormcdf(d2(S0 K r sigma T))n elsen return K npexp(-r T) ssnormcdf(-d2(S0 K r sigma T)) - S0 ssnormcdf(-d1(S0 K r sigma T)) ] cell_type code execution_count null metadata outputs [] source [ BlackScholes(C1000 1200 002 015 10) ] cell_type code execution_count null metadata outputs [] source [ def difference(x p S K r t)n return BlackScholes(CS K r x t) - p ] cell_type code execution_count null metadata outputs [] source [ from scipyoptimize import bisectn bisect(difference00011args=(11541763731112766 1000 1200 002 10)) ] ] metadata anaconda-cloud kernelspec display_name Python 3 language python name python3 language_info codemirror_mode name ipython version 3 file_extension py mimetype textx-python name python nbconvert_exporter python pygments_lexer ipython3 version 375rc1 nbformat 4 nbformat_minor 1

Black-Scholes Pricing and Hedging

c) Compute the quantityξt =

partg

partx(tSt)

of risky assets in a self-financing portfolio hedging Cd) Repeat the above questions with the terminal condition g(T x) = x

Exercise 68a) Solve the Black-Scholes PDE

rg(tx) = partg

partt(tx) + rx

partg

partx(tx) + σ2

2 x2 part2g

partx2 (tx) (634)

with terminal condition g(T x) = 1 x gt 0

Hint Try a solution of the form g(tx) = f(t) and find f(t)

b) Find the respective quantities ξt and ηt of the risky asset St and risklessasset At = ert in the portfolio with value

Vt = g(tSt) = ξtSt + ηtAt

hedging the contract with payoff $1 at maturity

Exercise 69 Log-contracts see also Exercise 84a) Solve the PDE

0 =partg

partt(x t) + rx

partg

partx(x t) + σ2

2 x2 part2g

partx2 (x t)

with the terminal condition g(xT ) = log x x gt 0

Hint Try a solution of the form g(x t) = f(t) + log x and find f(t)b) Solve the Black-Scholes PDE

rh(x t) = parth

partt(x t) + rx

parth

partx(x t) + σ2

2 x2 part2h

partx2 (x t) (635)

with the terminal condition h(xT ) = log x x gt 0

Hint Try a solution of the form h(x t) = u(t)g(x t) and find u(t)c) Find the respective quantities ξt and ηt of the risky asset St and riskless

asset At = ert in the portfolio with value

Vt = g(St t) = ξtSt + ηtAt

hedging a log-contract with payoff logST at maturity 235

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

Exercise 610 Binary options Consider a price process (St)tisinR+ given by

dStSt

= rdt+ σdBt S0 = 1

under the risk-neutral probability measure Plowast The binary (or digital) calloption is a contract with maturity T strike price K and payoff

Cd = 1[Kinfin)(ST ) =

$1 if ST gt K

0 if ST lt K

a) Derive the Black-Schole PDE satisfied by the pricing function Cd(tSt) ofthe binary call option together with its terminal condition

b) Show that the solution Cd(tx) of the Black-Scholes PDE of Question (a)is given by

Cd(tx) = eminus(Tminust)rΦ((rminus σ22)(T minus t) + log(xK)

|σ|radicT minus t

)= eminus(Tminust)rΦ

(dminus(T minus t)

)

where

dminus(T minus t) =(rminus σ22)(T minus t) + log(StK)

|σ|radicT minus t

0 6 t lt T

Exercise 611

a) Bachelier (1900) model Solve the stochastic differential equation

dSt = αStdt+ σdBt (636)

in terms of ασ isin R and the initial condition S0b) Write down the Bachelier PDE satisfied by the function C(tx) where

C(tSt) is the price at time t isin [0T ] of the contingent claim with payoffφ(ST ) = exp(ST ) and identify the process Delta (ξt)tisin[0T ] that hedgesthis claim

c) Solve the Black-Scholes PDE of Question (b) with the terminal conditionφ(x) = ex x isin R

Hint Search for a solution of the form

C(tx) = exp(minus(T minus t)r+ xh(t) +

σ2

4r (h2(t)minus 1)

) (637)

where h(t) is a function to be determined with h(T ) = 1

236

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

d) Compute the portfolio strategy (ξt ηt)tisin[0T ] that hedges the contingentclaim with payoff exp(ST )

Exercise 612

a) Show that for every fixed value of S the function

d 7minusrarr h(S d) = SΦ(d+ |σ|

radicT)minusK eminusrTΦ(d)

reaches its maximum at dlowast(S) =log(SK) + (rminus σ22)T

|σ|radicT

b) By the differentiation rule

d

dSh(S dlowast(S)) =

parth

partS(S dlowast(S)) + dprimelowast(S)

parth

partd(S dlowast(S))

recover the value of the Black-Scholes Delta

Exercise 613 Compute the Black-Scholes Vega by differentiation of theBlack-Scholes function

gc(tx) = Bl(Kxσ rT minus t) = xΦ(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)

with respect to the volatility parameter σ knowing that

minus12(dminus(T minus t)

)2= minus1

2

(log(xK) + (rminus σ22)(T minus t)

|σ|radicT minus t

)2

= minus12(d+(T minus t)

)2+ (T minus t)r+ log x

K (638)

Exercise 614 Consider the backward induction relation (313) ie

v(tx) = (1minus plowastN )v (t+ 1x(1 + aN )) + plowastN v (t+ 1x(1 + bN ))

using the renormalizations rN = rTN and

aN = (1 + rN )(1minus |σ|radicTN)minus 1 bN = (1 + rN )(1 + |σ|

radicTN)minus 1

of Section 36 N gt 1 with

plowastN =rN minus aNbN minus aN

and plowastN =bN minus rNbN minus aN

a) Show that the Black-Scholes PDE (62) of Proposition 61 can be recoveredfrom the induction relation (313) when the number N of time steps tendsto infinity

237

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

b) Show that the expression of the Delta ξt =partgcpartx

(tSt) can be similarlyrecovered from the finite difference relation (319) ie

ξ(1)t (Stminus1) =

v (t (1 + bN )Stminus1)minus v (t (1 + aN )Stminus1)

Stminus1(bN minus aN )

as N tends to infinity

Problem 615 (Leung and Sircar (2015)) ProShares Ultra SampP500 andProShares UltraShort SampP500 are leveraged investment funds that seek dailyinvestment results before fees and expenses that correspond to β times (βx)the daily performance of the SampP500reg with respectively β = 2 for ProSharesUltra and β = minus2 for ProShares UltraShort Here leveraging with a factorβ 1 aims at multiplying the potential return of an investment by a factorβ The following 10 questions are interdependent and should be treated insequence

a) Consider a risky asset priced S0 = $4 at time t = 0 and taking twopossible values S1 = $5 and S1 = $2 at time t = 1 Compute the twopossible returns (in ) achieved when investing $4 in one share of the assetS and the expected return under the risk-neutral probability measureassuming that the risk-free interest rate is zero

b) Leveraging Still based on an initial $4 investment we decide to leverageby a factor β = 3 by borrowing another (β minus 1) times $4 = 2times $4 at ratezero to purchase a total of β = 3 shares of the asset S Compute thetwo returns (in ) possibly achieved in this case and the expected returnunder the risk-neutral probability measure assuming that the risk-freeinterest rate is zero

c) Denoting by Ft the ProShares value at time t how much should the fundinvest in the underlying asset priced St and how much $ should it borrowor save on the risk-free market at any time t in order to leverage with afactor β 1

d) Find the portfolio allocation (ξt ηt) for the fund value

Ft = ξtSt + ηtAt t isin R+

according to Question (c) where At = A0 ert is the riskless money marketaccount

e) We choose to model the SampP500 index St as the geometric Brownianmotion

dSt = rStdt+ σStdBt t isin R+

under the risk-neutral probability measure Plowast Find the stochastic dif-ferential equation satisfied by (Ft)tisinR+ under the self-financing conditiondFt = ξtdSt + ηtdAt

238

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

f) Is the discounted fund value ( eminusrtFt)tisinR+ a martingale under the risk-neutral probability measure Plowast

g) Find the relation between the fund value Ft and the index St by solvingthe stochastic differential equation obtained for Ft in Question (e) Forsimplicity we normalize F0 = Sβ0

h) Write the price at time t = 0 of the call option with payoff (FT minusK)+ onthe ProShares index using the Black-Scholes formula

i) Show that when β gt 0 the Delta at time t isin [0T ) of the call optionwith payoff (FT minusK)+ on ProShares Ultra is equal to the Delta of thecall option with payoff (ST minusKβ(t))

+ on the SampP500 for a certain strikeprice Kβ(t) to be determined explicitly

j) When β lt 0 find the relation between the Delta at time t isin [0T ) ofthe call option with payoff (FT minusK)+ on ProShares UltraShort and theDelta of the put option with payoff (Kβ(t)minus ST )+ on the SampP500

239

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

  1. pbsARFix223
  2. pbsARFix224
  3. pbsARFix225
  4. pbsARFix226
  5. pbsARFix227
  6. pbsARFix228
  7. pbsARFix229
  8. pbsARFix230
  9. fdrm1
  10. pbsARFix231
  11. 100
  12. 101
  13. 102
  14. 103
  15. 104
  16. 105
  17. 106
  18. 107
  19. 108
  20. 109
  21. 1010
  22. 1011
  23. 1012
  24. 1013
  25. 1014
  26. 1015
  27. 1016
  28. 1017
  29. 1018
  30. 1019
  31. anm10
  32. 10EndLeft
  33. 10StepLeft
  34. 10PauseLeft
  35. 10PlayLeft
  36. 10PlayPauseLeft
  37. 10PauseRight
  38. 10PlayRight
  39. 10PlayPauseRight
  40. 10StepRight
  41. 10EndRight
  42. 10Minus
  43. 10Reset
  44. 10Plus
  45. pbsARFix232
  46. pbsARFix233
  47. pbsARFix234
  48. pbsARFix235
  49. pbsARFix236
  50. pbsARFix237
  51. fdrm2
  52. 110
  53. 111
  54. 112
  55. 113
  56. 114
  57. 115
  58. 116
  59. 117
  60. 118
  61. 119
  62. 1110
  63. 1111
  64. 1112
  65. 1113
  66. 1114
  67. 1115
  68. 1116
  69. 1117
  70. 1118
  71. 1119
  72. anm11
  73. 11EndLeft
  74. 11StepLeft
  75. 11PauseLeft
  76. 11PlayLeft
  77. 11PlayPauseLeft
  78. 11PauseRight
  79. 11PlayRight
  80. 11PlayPauseRight
  81. 11StepRight
  82. 11EndRight
  83. 11Minus
  84. 11Reset
  85. 11Plus
  86. pbsARFix238
  87. pbsARFix239
  88. pbsARFix240
  89. pbsARFix241
  90. pbsARFix242
  91. 120
  92. 121
  93. 122
  94. 123
  95. 124
  96. 125
  97. 126
  98. 127
  99. 128
  100. 129
  101. 1210
  102. anm12
  103. 12EndLeft
  104. 12StepLeft
  105. 12PauseLeft
  106. 12PlayLeft
  107. 12PlayPauseLeft
  108. 12PauseRight
  109. 12PlayRight
  110. 12PlayPauseRight
  111. 12StepRight
  112. 12EndRight
  113. 12Minus
  114. 12Reset
  115. 12Plus
  116. 130
  117. 131
  118. 132
  119. 133
  120. 134
  121. 135
  122. 136
  123. 137
  124. 138
  125. 139
  126. 1310
  127. anm13
  128. 13EndLeft
  129. 13StepLeft
  130. 13PauseLeft
  131. 13PlayLeft
  132. 13PlayPauseLeft
  133. 13PauseRight
  134. 13PlayRight
  135. 13PlayPauseRight
  136. 13StepRight
  137. 13EndRight
  138. 13Minus
  139. 13Reset
  140. 13Plus
  141. pbsARFix243
  142. pbsARFix244
  143. pbsARFix245
  144. pbsARFix246
  145. 140
  146. 141
  147. 142
  148. 143
  149. 144
  150. 145
  151. 146
  152. 147
  153. 148
  154. 149
  155. 1410
  156. 1411
  157. 1412
  158. 1413
  159. 1414
  160. 1415
  161. 1416
  162. 1417
  163. 1418
  164. 1419
  165. 1420
  166. 1421
  167. 1422
  168. 1423
  169. 1424
  170. 1425
  171. 1426
  172. 1427
  173. 1428
  174. 1429
  175. 1430
  176. 1431
  177. 1432
  178. 1433
  179. 1434
  180. 1435
  181. 1436
  182. 1437
  183. 1438
  184. 1439
  185. 1440
  186. 1441
  187. 1442
  188. 1443
  189. 1444
  190. 1445
  191. 1446
  192. 1447
  193. 1448
  194. 1449
  195. 1450
  196. 1451
  197. 1452
  198. 1453
  199. 1454
  200. 1455
  201. 1456
  202. 1457
  203. 1458
  204. 1459
  205. 1460
  206. 1461
  207. 1462
  208. 1463
  209. 1464
  210. 1465
  211. 1466
  212. 1467
  213. 1468
  214. 1469
  215. 1470
  216. 1471
  217. 1472
  218. 1473
  219. 1474
  220. 1475
  221. 1476
  222. 1477
  223. 1478
  224. 1479
  225. 1480
  226. 1481
  227. 1482
  228. 1483
  229. 1484
  230. 1485
  231. 1486
  232. 1487
  233. 1488
  234. 1489
  235. 1490
  236. 1491
  237. 1492
  238. 1493
  239. 1494
  240. 1495
  241. 1496
  242. 1497
  243. 1498
  244. 1499
  245. 14100
  246. 14101
  247. 14102
  248. 14103
  249. 14104
  250. 14105
  251. 14106
  252. 14107
  253. 14108
  254. 14109
  255. 14110
  256. 14111
  257. 14112
  258. 14113
  259. 14114
  260. 14115
  261. 14116
  262. 14117
  263. 14118
  264. 14119
  265. 14120
  266. 14121
  267. 14122
  268. 14123
  269. 14124
  270. 14125
  271. 14126
  272. 14127
  273. 14128
  274. 14129
  275. 14130
  276. 14131
  277. 14132
  278. 14133
  279. 14134
  280. 14135
  281. 14136
  282. 14137
  283. 14138
  284. 14139
  285. 14140
  286. 14141
  287. 14142
  288. 14143
  289. 14144
  290. 14145
  291. 14146
  292. 14147
  293. 14148
  294. 14149
  295. 14150
  296. 14151
  297. 14152
  298. 14153
  299. 14154
  300. 14155
  301. 14156
  302. 14157
  303. 14158
  304. 14159
  305. 14160
  306. 14161
  307. 14162
  308. 14163
  309. 14164
  310. 14165
  311. 14166
  312. 14167
  313. 14168
  314. 14169
  315. 14170
  316. 14171
  317. 14172
  318. 14173
  319. 14174
  320. 14175
  321. 14176
  322. 14177
  323. 14178
  324. 14179
  325. 14180
  326. 14181
  327. 14182
  328. 14183
  329. 14184
  330. 14185
  331. 14186
  332. 14187
  333. 14188
  334. 14189
  335. 14190
  336. 14191
  337. 14192
  338. 14193
  339. 14194
  340. 14195
  341. 14196
  342. 14197
  343. anm14
  344. 14EndLeft
  345. 14StepLeft
  346. 14PauseLeft
  347. 14PlayLeft
  348. 14PlayPauseLeft
  349. 14PauseRight
  350. 14PlayRight
  351. 14PlayPauseRight
  352. 14StepRight
  353. 14EndRight
  354. 14Minus
  355. 14Reset
  356. 14Plus
  357. pbsARFix247
  358. pbsARFix248
  359. 150
  360. 151
  361. 152
  362. 153
  363. 154
  364. 155
  365. 156
  366. 157
  367. 158
  368. 159
  369. 1510
  370. 1511
  371. 1512
  372. 1513
  373. 1514
  374. 1515
  375. 1516
  376. 1517
  377. 1518
  378. 1519
  379. anm15
  380. 15EndLeft
  381. 15StepLeft
  382. 15PauseLeft
  383. 15PlayLeft
  384. 15PlayPauseLeft
  385. 15PauseRight
  386. 15PlayRight
  387. 15PlayPauseRight
  388. 15StepRight
  389. 15EndRight
  390. 15Minus
  391. 15Reset
  392. 15Plus
  393. pbsARFix249
  394. pbsARFix250
  395. pbsARFix251
  396. pbsARFix252
  397. pbsARFix253
  398. pbsARFix254
  399. pbsARFix255
  400. pbsARFix256
  401. pbsARFix257
  402. pbsARFix258
  403. pbsARFix259
  404. pbsARFix260
  405. pbsARFix261
Page 2: Black-ScholesPricingandHedging - NTU · to the Black-Scholes PDE (6.2) in order to price a claim payoff Cof the formC= h(S T).Asinthediscrete-timecase,thearbitragepriceπt(C) at

N Privault

St = S0 exp(σBt +

(microminus 1

2σ2)t

) t isin R+

cf Proposition 516

installpackages(quantmod)2 library(quantmod)

getSymbols(0005HKfrom=2016-02-15to=SysDate()src=yahoo)4 getSymbols(0005HKfrom=2016-02-15to=2017-05-11src=yahoo)

stock=Ad(`0005HK`)6 write(stock file = data_exp sep=n)

myTheme lt- chart_theme()myTheme$col$linecol lt- blue8 chart_Series(stock theme = myTheme)

add_TA(stock on=1 col=blue legend=NULLlwd=16)

The adjusted close price Ad() is the closing price after adjustments for ap-plicable splits and dividend distributions

The next Figure 61 presents a graph of underlying asset price market datawhich is compared to the geometric Brownian motion simulations of Fig-ures 55 and 56

Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec Jan Feb Mar Apr May

Feb 152016

Apr 012016

May 032016

Jun 012016

Jul 042016

Aug 012016

Sep 012016

Oct 032016

Nov 012016

Dec 012016

Jan 032017

Feb 012017

Mar 012017

Apr 032017

May 022017

stock 2016minus02minus15 2017minus05minus10

38

40

42

44

46

48

50

52

54

56

38

40

42

44

46

48

50

52

54

56

40

45

50

55

60

65

70

Feb 16 May 16 Jul 16 Sep 16 Nov 16 Jan 17 Mar 17 May 17

St

0005HKemicrot

Fig 61 Graph of underlying market prices

1

15

2

25

3

35

4

0 01 02 03 04 05 06 07 08 09 10

S0=

St

t

St

1

15

2

25

3

35

4

0 01 02 03 04 05 06 07 08 09 10

S0=

St

t

Stert

Fig 62 Graph of simulated geometric Brownian motion

202

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

In the sequel we start by deriving the Black and Scholes (1973) Partial Dif-ferential Equation (PDE) for the value of a self-financing portfolio Note thatthe drift parameter micro in (61) is absent in the PDE (62) and it does notappear as well in the Black and Scholes (1973) formula (610)Proposition 61 Let (ηt ξt)tisinR+ be a portfolio strategy such that

(i) the porfolio strategy (ηt ξt)tisinR+ is self-financing

(ii) the portfolio value Vt = ηtAt + ξtSt takes the form

Vt = g(tSt) t isin R+

for some function g isin C12(R+ timesR+) of t and StThen the function g(tx) satisfies the Black and Scholes (1973) PDE

rg(tx) = partg

partt(tx) + rx

partg

partx(tx) + 1

2σ2x2 part

2g

partx2 (tx) x gt 0 (62)

and ξt = ξt(St) is given by the partial derivative

ξt = ξt(St) =partg

partx(tSt) t isin R+ (63)

Proof (i) First we note that the self-financing condition (58) in Proposi-tion 59 implies

dVt = ηtdAt + ξtdSt

= rηtAtdt+ microξtStdt+ σξtStdBt (64)= rVtdt+ (microminus r)ξtStdt+ σξtStdBt

= rg(tSt)dt+ (microminus r)ξtStdt+ σξtStdBt

t isin R+ We now rewrite (518) under the form of an Itocirc process

St = S0 +w t

0vsds+

w t0usdBs t isin R+

as in (422) by taking

ut = σSt and vt = microSt t isin R+

(ii) By (424) the application of Itocircrsquos formula Theorem 423 to Vt = g(tSt)leads to

dVt = dg(tSt)

=partg

partt(tSt)dt+

partg

partx(tSt)dSt +

12 (dSt)

2 part2g

partx2 (tSt) 203

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

=partg

partt(tSt)dt+ vt

partg

partx(tSt)dt+ ut

partg

partx(tSt)dBt +

12 |ut|

2 part2g

partx2 (tSt)dt

=partg

partt(tSt)dt+ microSt

partg

partx(tSt)dt+

12σ

2S2tpart2g

partx2 (tSt)dt+ σStpartg

partx(tSt)dBt

(65)

By respective identification of the terms in dBt and dt in (64) and (65) wegetrg(tSt)dt+ (microminus r)ξtStdt =

partg

partt(tSt)dt+ microSt

partg

partx(tSt)dt+

12σ

2S2tpart2g

partx2 (tSt)dt

ξtStσdBt = Stσpartg

partx(tSt)dBt

hence rg(tSt) =

partg

partt(tSt) + rSt

partg

partx(tSt) +

12σ

2S2tpart2g

partx2 (tSt)

ξt =partg

partx(tSt) 0 6 t 6 T

(66)

which yields (62) after substituting St with x gt 0

The derivative giving ξt in (63) is called the Delta of the option price seeProposition 64 below The amount invested on the riskless asset is

ηtAt = Vt minus ξtSt = g(tSt)minus Stpartg

partx(tSt)

and ηt is given by

ηt =Vt minus ξtSt

At

=1At

(g(tSt)minus St

partg

partx(tSt)

)=

1A0 ert

(g(tSt)minus St

partg

partx(tSt)

)

In the next Proposition 62 we add a terminal condition g(T x) = f(x)to the Black-Scholes PDE (62) in order to price a claim payoff C of theform C = h(ST ) As in the discrete-time case the arbitrage price πt(C) attime t isin [0T ] of the claim payoff C is defined to be the value Vt of theself-financing portfolio hedging C

Proposition 62 The arbitrage price πt(C) at time t isin [0T ] of the (vanilla)option with payoff C = h(ST ) is given by πt(C) = g(tSt) and the hedging

204

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

allocation ξt is given by the partial derivative (63) where the function g(tx)is solution of the following Black-Scholes PDE

rg(tx) = partg

partt(tx) + rx

partg

partx(tx) + 1

2σ2x2 part

2g

partx2 (tx)

g(T x) = h(x) x gt 0(67)

Proof Proposition 61 shows that the solution g(tx) of (62) g isin C12(R+timesR+) represents the value Vt = ηtAt + ξtSt = g(tSt) t isin R+ of a self-financing portfolio strategy (ηt ξt)tisinR+ By Definition 31 πt(C) = Vt =g(tSt) is the arbitrage price at time t isin [0T ] of the vanilla option withpayoff C = h(ST )

The absence of the drift parameter micro from the PDE (67) can be understoodin the next forward contract example in which the claim payoff can be hedgedby leveraging on the value St of the underlying asset independently of thetrend parameter micro

Example - forward contracts

When C = ST minusK is the (linear) payoff function of a long forward contractie h(x) = xminusK the Black-Scholes PDE (67) admits the easy solution

g(tx) = xminusK eminus(Tminust)r x gt 0 0 6 t 6 T (68)

showing that the price at time t of the forward contract with payoff C =ST minusK is

St minusK eminus(Tminust)r x gt 0 0 6 t 6 T

In addition the Delta of the option price is given by

ξt =partg

partx(tSt) = 1 0 6 t 6 T

which leads to a static ldquohedge and forgetrdquo strategy cf Exercise 67 Theforward contract can be realized by the option issuer as followsa) At time t receive the option premium Vt = St minus eminus(Tminust)rK from the

option buyerb) Borrow eminus(Tminust)rK from the bank to be refunded at maturityc) Buy the risky asset using the amount Stminus eminus(Tminust)rK + eminus(Tminust)rK = Std) Hold the risky asset until maturity (do nothing constant portfolio strat-

egy)e) At maturity T hand in the asset to the option holder who will pay the

amount K in return 205

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

f) Use the amountK = e(Tminust)r eminus(Tminust)rK to refund the lender of eminus(Tminust)rKborrowed at time t

Another way to compute the option premium Vt is to state that the amountVtminusSt has to be borrowed at time t in order to purchase the asset and thatthe asset price K received at maturity T should be used to refund the loanwhich yields

(Vt minus St) eminus(Tminust)r = K 0 6 t 6 T

Forward contracts can be used for physical delivery eg for live cattle In thecase of European options the basic ldquohedge and forgetrdquo constant strategy

ξt = 1 ηt = η0 0 6 t 6 T

will hedge the option only if

ST + η0AT gt (ST minusK)+

ie if minusη0AT 6 K 6 ST

Future contracts

For a future contract expiring at time T we take K = S0 erT and the contractis usually quoted at time t in terms of the forward price

e(Tminust)r(St minusK eminus(Tminust)r

)= e(Tminust)rSt minusK = e(Tminust)rSt minus S0 erT

discounted at time T or simply using e(Tminust)rSt Future contracts are non-deliverable forward contracts which are ldquomarked to marketrdquo at each timestep via a cash flow exchange between the two parties ensuring that theabsolute difference | e(Tminust)rSt minusK| is being credited to the buyerrsquos accountif e(Tminust)rSt gt K or to the sellerrsquos account if e(Tminust)rSt lt K

62 European Call Options

Recall that in the case of the European call option with strike price K thepayoff function is given by h(x) = (xminusK)+ and the Black-Scholes PDE (67)reads

rgc(tx) =partgcpartt

(tx) + rxpartgcpartx

(tx) + 12σ

2x2 part2gcpartx2 (tx)

gc(T x) = (xminusK)+(69)

The next proposition will be proved in Sections 65 and 66 see Proposi-tion 611

206

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

Proposition 63 The solution of the PDE (69) is given by the Black-Scholes formula for call options

gc(tx) = Bl(Kxσ rT minus t) = xΦ(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)

(610)with

d+(T minus t) =log(xK) + (r+ σ22)(T minus t)

|σ|radicT minus t

(611)

dminus(T minus t) =log(xK) + (rminus σ22)(T minus t)

|σ|radicT minus t

0 6 t lt T (612)

We note the relation

d+(T minus t) = dminus(T minus t) + |σ|radicT minus t 0 6 t lt T (613)

Here ldquologrdquo denotes the natural logarithm ldquolnrdquo and

Φ(x) = P(X 6 x) =1radic2π

w xminusinfin

eminusy22dy x isin R

denotes the standard Gaussian Cumulative Distribution Function (CDF) ofa standard normal random variable X N (0 1) with the relation

Φ(minusx) = 1minusΦ(x) x isin R (614)

0

02

04

06

08

1

12

-4 -3 -2 -1 0 1 2 3 4

Φ(x)

x

1Gaussian CDF Φ(x)

Fig 63 Graph of the Gaussian CDF

In other words the European call option with strike price K and maturityT is priced at time t isin [0T ] as

gc(tSt) = Bl(KStσ rT minus t)= StΦ

(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

) 0 6 t 6 T

207

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

The following R script is an implementation of the Black-Scholes formula forEuropean call options in Rlowast

1 BSCall lt- function(S K r T sigma)d1 lt- (log(SK)+(r+sigma^22)T)(sigmasqrt(T))

3 d2 lt- d1 - sigma sqrt(T)BSCall = Spnorm(d1) - Kexp(-rT)pnorm(d2)

5 BSCall

In comparison with the discrete-time Cox-Ross-Rubinstein (CRR) model ofSection 26 the interest in the formula (610) is to provide an analytical so-lution that can be evaluated in a single step which is computationally muchmore efficient

Fig 64 Graph of the Black-Scholes call price map with strike price K = 100dagger

Figure 64 presents an interactive graph of the Black-Scholes call price mapie the solution

(tx) 7minusrarr gc(tx) = xΦ(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)of the Black-Scholes PDE (67) for a call optionlowast Download the corresponding that can be run heredagger Right-click on the figure for interaction and ldquoFull Screen Multimediardquo view

208

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

(C) 2012--today Alexander Grahn 3Dmenujs version 20140923 3D JavaScript used by media9sty Extended functionality of the (right click) context menu of 3D annotations 1) Adds the following items to the 3D context menu `Generate Default View Finds good default camera settings returned as options for use with the includemedia command `Get Current View Determines camera cross section and part settings of the current view returned as `VIEW section that can be copied into a views file of additional views The views file is inserted using the `3Dviews option of includemedia `Cross Section Toggle switch to add or remove a cross section into or from the current view The cross section can be moved in the x y z directions using x y z and X Y Z keys on the keyboard be tilted against and spun around the upright Z axis using the UpDown and LeftRight arrow keys and caled using the s and S keys 2) Enables manipulation of position and orientation of indiviual parts and groups of parts in the 3D scene Parts which have been selected with the mouse can be scaled moved around and rotated like the cross section as described above To spin the parts around their local up-axis keep Control key pressed while using the UpDown and LeftRight arrow keys This work may be distributed andor modified under the conditions of the LaTeX Project Public License The latest version of this license is in httpmirrorsctanorgmacroslatexbaselppltxt This work has the LPPL maintenance status `maintained The Current Maintainer of this work is A Grahn The code borrows heavily from Bernd Gaertners `Miniball software originally written in C++ for computing the smallest enclosing ball of a set of points see httpwwwinfethzchpersonalgaertnerminiballhtmlhostconsoleshow()constructor for doubly linked listfunction List() thisfirst_node=null thislast_node=new Node(undefined)Listprototypepush_back=function(x) var new_node=new Node(x) if(thisfirst_node==null) thisfirst_node=new_node new_nodeprev=null else new_nodeprev=thislast_nodeprev new_nodeprevnext=new_node new_nodenext=thislast_node thislast_nodeprev=new_nodeListprototypemove_to_front=function(it) var node=itget() if(nodenext=null ampamp nodeprev=null) nodenextprev=nodeprev nodeprevnext=nodenext nodeprev=null nodenext=thisfirst_node thisfirst_nodeprev=node thisfirst_node=node Listprototypebegin=function() var i=new Iterator() itarget=thisfirst_node return(i)Listprototypeend=function() var i=new Iterator() itarget=thislast_node return(i)function Iterator(it) if( it=undefined ) thistarget=ittarget else thistarget=null Iteratorprototypeset=function(it)thistarget=ittargetIteratorprototypeget=function()return(thistarget)Iteratorprototypederef=function()return(thistargetdata)Iteratorprototypeincr=function() if(thistargetnext=null) thistarget=thistargetnextconstructor for node objects that populate the linked listfunction Node(x) thisprev=null thisnext=null thisdata=xfunction sqr(r)return(rr)helper functionMiniball algorithm by B Gaertnerfunction Basis() thism=0 thisq0=new Array(3) thisz=new Array(4) thisf=new Array(4) thisv=new Array(new Array(3) new Array(3) new Array(3) new Array(3)) thisa=new Array(new Array(3) new Array(3) new Array(3) new Array(3)) thisc=new Array(new Array(3) new Array(3) new Array(3) new Array(3)) thissqr_r=new Array(4) thiscurrent_c=thisc[0] thiscurrent_sqr_r=0 thisreset()Basisprototypecenter=function()return(thiscurrent_c)Basisprototypesize=function()return(thism)Basisprototypepop=function()--thismBasisprototypeexcess=function(p) var e=-thiscurrent_sqr_r for(var k=0klt3++k) e+=sqr(p[k]-thiscurrent_c[k]) return(e)Basisprototypereset=function() thism=0 for(var j=0jlt3++j) thisc[0][j]=0 thiscurrent_c=thisc[0] thiscurrent_sqr_r=-1Basisprototypepush=function(p) var i j var eps=1e-32 if(thism==0) for(i=0ilt3++i) thisq0[i]=p[i] for(i=0ilt3++i) thisc[0][i]=thisq0[i] thissqr_r[0]=0 else for(i=0ilt3++i) thisv[thism][i]=p[i]-thisq0[i] for(i=1iltthism++i) thisa[thism][i]=0 for(j=0jlt3++j) thisa[thism][i]+=thisv[i][j]thisv[thism][j] thisa[thism][i]=(2thisz[i]) for(i=1iltthism++i) for(j=0jlt3++j) thisv[thism][j]-=thisa[thism][i]thisv[i][j] thisz[thism]=0 for(j=0jlt3++j) thisz[thism]+=sqr(thisv[thism][j]) thisz[thism]=2 if(thisz[thism]ltepsthiscurrent_sqr_r) return(false) var e=-thissqr_r[thism-1] for(i=0ilt3++i) e+=sqr(p[i]-thisc[thism-1][i]) thisf[thism]=ethisz[thism] for(i=0ilt3++i) thisc[thism][i]=thisc[thism-1][i]+thisf[thism]thisv[thism][i] thissqr_r[thism]=thissqr_r[thism-1]+ethisf[thism]2 thiscurrent_c=thisc[thism] thiscurrent_sqr_r=thissqr_r[thism] ++thism return(true)function Miniball() thisL=new List() thisB=new Basis() thissupport_end=new Iterator()Miniballprototypemtf_mb=function(it) var i=new Iterator(it) thissupport_endset(thisLbegin()) if((thisBsize())==4) return for(var k=new Iterator(thisLbegin())kget()=iget()) var j=new Iterator(k) kincr() if(thisBexcess(jderef()) gt 0) if(thisBpush(jderef())) thismtf_mb(j) thisBpop() if(thissupport_endget()==jget()) thissupport_endincr() thisLmove_to_front(j) Miniballprototypecheck_in=function(b) thisLpush_back(b)Miniballprototypebuild=function() thisBreset() thissupport_endset(thisLbegin()) thismtf_mb(thisLend())Miniballprototypecenter=function() return(thisBcenter())Miniballprototyperadius=function() return(Mathsqrt(thisBcurrent_sqr_r))functions called by menu itemsfunction calc3Dopts () create Miniball object var mb=new Miniball() auxiliary vector var corner=new Vector3() iterate over all visible mesh nodes in the scene for(i=0iltscenemeshescounti++) var mesh=scenemeshesgetByIndex(i) if(meshvisible) continue local to parent transformation matrix var trans=meshtransform build local to world transformation matrix by recursively multiplying the parents transf matrix on the right var parent=meshparent while(parenttransform) trans=transmultiply(parenttransform) parent=parentparent get the bbox of the mesh (local coordinates) var bbox=meshcomputeBoundingBox() transform the local bounding box corner coordinates to world coordinates for bounding sphere determination BBoxmin cornerset(bboxmin) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) BBoxmax cornerset(bboxmax) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) remaining six BBox corners cornerset(bboxminx bboxmaxy bboxmaxz) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) cornerset(bboxminx bboxminy bboxmaxz) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) cornerset(bboxminx bboxmaxy bboxminz) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) cornerset(bboxmaxx bboxminy bboxminz) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) cornerset(bboxmaxx bboxminy bboxmaxz) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) cornerset(bboxmaxx bboxmaxy bboxminz) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) compute the smallest enclosing bounding sphere mbbuild() current camera settings var camera=scenecamerasgetByIndex(0) var res= initialize result string aperture angle of the virtual camera (perspective projection) or orthographic scale (orthographic projection) if(cameraprojectionType==cameraTYPE_PERSPECTIVE) var aac=camerafov180MathPI if(hostutilprintf(4f aac)=30) res+=hostutilprintf(n3Daac=s aac) else cameraviewPlaneSize=2mbradius() res+=hostutilprintf(n3Dortho=s 1cameraviewPlaneSize) camera roll var roll = cameraroll180MathPI if(hostutilprintf(4f roll)=0) res+=hostutilprintf(n3Droll=sroll) target to camera vector var c2c=new Vector3() c2cset(cameraposition) c2csubtractInPlace(cameratargetPosition) c2cnormalize() if((c2cx==0 ampamp c2cy==-1 ampamp c2cz==0)) res+=hostutilprintf(n3Dc2c=s s s c2cx c2cy c2cz) new camera settings bounding sphere centre --gt new camera target var coo=new Vector3() cooset((mbcenter())[0] (mbcenter())[1] (mbcenter())[2]) if(coolength) res+=hostutilprintf(n3Dcoo=s s s coox cooy cooz) radius of orbit if(cameraprojectionType==cameraTYPE_PERSPECTIVE) var roo=mbradius() Mathsin(aac MathPI 360) else orthographic projection var roo=mbradius() res+=hostutilprintf(n3Droo=s roo) update camera settings in the viewer var currol=cameraroll cameratargetPositionset(coo) camerapositionset(cooadd(c2cscale(roo))) cameraroll=currol determine background colour rgb=scenebackgroundgetColor() if((rgbr==1 ampamp rgbg==1 ampamp rgbb==1)) res+=hostutilprintf(n3Dbg=s s s rgbr rgbg rgbb) determine lighting scheme switch(scenelightScheme) case sceneLIGHT_MODE_FILE curlights=Artworkbreak case sceneLIGHT_MODE_NONE curlights=Nonebreak case sceneLIGHT_MODE_WHITE curlights=Whitebreak case sceneLIGHT_MODE_DAY curlights=Daybreak case sceneLIGHT_MODE_NIGHT curlights=Nightbreak case sceneLIGHT_MODE_BRIGHT curlights=Hardbreak case sceneLIGHT_MODE_RGB curlights=Primarybreak case sceneLIGHT_MODE_BLUE curlights=Bluebreak case sceneLIGHT_MODE_RED curlights=Redbreak case sceneLIGHT_MODE_CUBE curlights=Cubebreak case sceneLIGHT_MODE_CAD curlights=CADbreak case sceneLIGHT_MODE_HEADLAMP curlights=Headlampbreak if(curlights=Artwork) res+=hostutilprintf(n3Dlights=s curlights) determine global render mode switch(scenerenderMode) case sceneRENDER_MODE_BOUNDING_BOX currender=BoundingBoxbreak case sceneRENDER_MODE_TRANSPARENT_BOUNDING_BOX currender=TransparentBoundingBoxbreak case sceneRENDER_MODE_TRANSPARENT_BOUNDING_BOX_OUTLINE currender=TransparentBoundingBoxOutlinebreak case sceneRENDER_MODE_VERTICES currender=Verticesbreak case sceneRENDER_MODE_SHADED_VERTICES currender=ShadedVerticesbreak case sceneRENDER_MODE_WIREFRAME currender=Wireframebreak case sceneRENDER_MODE_SHADED_WIREFRAME currender=ShadedWireframebreak case sceneRENDER_MODE_SOLID currender=Solidbreak case sceneRENDER_MODE_TRANSPARENT currender=Transparentbreak case sceneRENDER_MODE_SOLID_WIREFRAME currender=SolidWireframebreak case sceneRENDER_MODE_TRANSPARENT_WIREFRAME currender=TransparentWireframebreak case sceneRENDER_MODE_ILLUSTRATION currender=Illustrationbreak case sceneRENDER_MODE_SOLID_OUTLINE currender=SolidOutlinebreak case sceneRENDER_MODE_SHADED_ILLUSTRATION currender=ShadedIllustrationbreak case sceneRENDER_MODE_HIDDEN_WIREFRAME currender=HiddenWireframebreak if(currender=Solid) res+=hostutilprintf(n3Drender=s currender) write result string to the console hostconsoleshow() hostconsoleclear() hostconsoleprintln(n Copy and paste the following text to then+ option list of includemedian + res + n)function get3Dview () var camera=scenecamerasgetByIndex(0) var coo=cameratargetPosition var c2c=camerapositionsubtract(coo) var roo=c2clength c2cnormalize() var res=VIEW=insert optional name heren if((coox==0 ampamp cooy==0 ampamp cooz==0)) res+=hostutilprintf( COO=s s sn coox cooy cooz) if((c2cx==0 ampamp c2cy==-1 ampamp c2cz==0)) res+=hostutilprintf( C2C=s s sn c2cx c2cy c2cz) if(roo gt 1e-9) res+=hostutilprintf( ROO=sn roo) var roll = cameraroll180MathPI if(hostutilprintf(4f roll)=0) res+=hostutilprintf( ROLL=sn roll) if(cameraprojectionType==cameraTYPE_PERSPECTIVE) var aac=camerafov 180MathPI if(hostutilprintf(4f aac)=30) res+=hostutilprintf( AAC=sn aac) else if(hostutilprintf(4f cameraviewPlaneSize)=1) res+=hostutilprintf( ORTHO=sn 1cameraviewPlaneSize) rgb=scenebackgroundgetColor() if((rgbr==1 ampamp rgbg==1 ampamp rgbb==1)) res+=hostutilprintf( BGCOLOR=s s sn rgbr rgbg rgbb) switch(scenelightScheme) case sceneLIGHT_MODE_FILE curlights=Artworkbreak case sceneLIGHT_MODE_NONE curlights=Nonebreak case sceneLIGHT_MODE_WHITE curlights=Whitebreak case sceneLIGHT_MODE_DAY curlights=Daybreak case sceneLIGHT_MODE_NIGHT curlights=Nightbreak case sceneLIGHT_MODE_BRIGHT curlights=Hardbreak case sceneLIGHT_MODE_RGB curlights=Primarybreak case sceneLIGHT_MODE_BLUE curlights=Bluebreak case sceneLIGHT_MODE_RED curlights=Redbreak case sceneLIGHT_MODE_CUBE curlights=Cubebreak case sceneLIGHT_MODE_CAD curlights=CADbreak case sceneLIGHT_MODE_HEADLAMP curlights=Headlampbreak if(curlights=Artwork) res+= LIGHTS=+curlights+n switch(scenerenderMode) case sceneRENDER_MODE_BOUNDING_BOX defaultrender=BoundingBoxbreak case sceneRENDER_MODE_TRANSPARENT_BOUNDING_BOX defaultrender=TransparentBoundingBoxbreak case sceneRENDER_MODE_TRANSPARENT_BOUNDING_BOX_OUTLINE defaultrender=TransparentBoundingBoxOutlinebreak case sceneRENDER_MODE_VERTICES defaultrender=Verticesbreak case sceneRENDER_MODE_SHADED_VERTICES defaultrender=ShadedVerticesbreak case sceneRENDER_MODE_WIREFRAME defaultrender=Wireframebreak case sceneRENDER_MODE_SHADED_WIREFRAME defaultrender=ShadedWireframebreak case sceneRENDER_MODE_SOLID defaultrender=Solidbreak case sceneRENDER_MODE_TRANSPARENT defaultrender=Transparentbreak case sceneRENDER_MODE_SOLID_WIREFRAME defaultrender=SolidWireframebreak case sceneRENDER_MODE_TRANSPARENT_WIREFRAME defaultrender=TransparentWireframebreak case sceneRENDER_MODE_ILLUSTRATION defaultrender=Illustrationbreak case sceneRENDER_MODE_SOLID_OUTLINE defaultrender=SolidOutlinebreak case sceneRENDER_MODE_SHADED_ILLUSTRATION defaultrender=ShadedIllustrationbreak case sceneRENDER_MODE_HIDDEN_WIREFRAME defaultrender=HiddenWireframebreak if(defaultrender=Solid) res+= RENDERMODE=+defaultrender+n detect existing Clipping Plane (3D Cross Section) var clip=null if( clip=scenenodesgetByName($$$$$$)|| clip=scenenodesgetByName(Clipping Plane) ) for(var i=0iltscenenodescounti++) var nd=scenenodesgetByIndex(i) if(nd==clip||ndname==) continue var ndUTFName= for (var j=0 jltndnamelength j++) var theUnicode = ndnamecharCodeAt(j)toString(16) while (theUnicodelengthlt4) theUnicode = 0 + theUnicode ndUTFName += theUnicode var end=ndnamelastIndexOf() if(endgt0) var ndUserName=ndnamesubstr(0end) else var ndUserName=ndname respart= PART=+ndUserName+n respart+= UTF16NAME=+ndUTFName+n defaultvals=true if(ndvisible) respart+= VISIBLE=falsen defaultvals=false if(ndopacitylt10) respart+= OPACITY=+ndopacity+n defaultvals=false if(ndconstructorname==Mesh) currender=defaultrender switch(ndrenderMode) case sceneRENDER_MODE_BOUNDING_BOX currender=BoundingBoxbreak case sceneRENDER_MODE_TRANSPARENT_BOUNDING_BOX currender=TransparentBoundingBoxbreak case sceneRENDER_MODE_TRANSPARENT_BOUNDING_BOX_OUTLINE currender=TransparentBoundingBoxOutlinebreak case sceneRENDER_MODE_VERTICES currender=Verticesbreak case sceneRENDER_MODE_SHADED_VERTICES currender=ShadedVerticesbreak case sceneRENDER_MODE_WIREFRAME currender=Wireframebreak case sceneRENDER_MODE_SHADED_WIREFRAME currender=ShadedWireframebreak case sceneRENDER_MODE_SOLID currender=Solidbreak case sceneRENDER_MODE_TRANSPARENT currender=Transparentbreak case sceneRENDER_MODE_SOLID_WIREFRAME currender=SolidWireframebreak case sceneRENDER_MODE_TRANSPARENT_WIREFRAME currender=TransparentWireframebreak case sceneRENDER_MODE_ILLUSTRATION currender=Illustrationbreak case sceneRENDER_MODE_SOLID_OUTLINE currender=SolidOutlinebreak case sceneRENDER_MODE_SHADED_ILLUSTRATION currender=ShadedIllustrationbreak case sceneRENDER_MODE_HIDDEN_WIREFRAME currender=HiddenWireframebreak case sceneRENDER_MODE_DEFAULT currender=Defaultbreak if(currender=defaultrender) respart+= RENDERMODE=+currender+n defaultvals=false if(origtrans[ndname]ampampndtransformisEqual(origtrans[ndname])) var lvec=ndtransformtransformDirection(new Vector3(100)) var uvec=ndtransformtransformDirection(new Vector3(010)) var vvec=ndtransformtransformDirection(new Vector3(001)) respart+= TRANSFORM= +lvecx+ +lvecy+ +lvecz+ +uvecx+ +uvecy+ +uvecz+ +vvecx+ +vvecy+ +vvecz+ +ndtransformtranslationx+ +ndtransformtranslationy+ +ndtransformtranslationz+n defaultvals=false respart+= ENDn if(defaultvals) res+=respart if(clip) var centre=cliptransformtranslation var normal=cliptransformtransformDirection(new Vector3(001)) res+= CROSSSECTn if((centrex==0 ampamp centrey==0 ampamp centrez==0)) res+=hostutilprintf( CENTER=s s sn centrex centrey centrez) if((normalx==1 ampamp normaly==0 ampamp normalz==0)) res+=hostutilprintf( NORMAL=s s sn normalx normaly normalz) res+=hostutilprintf( VISIBLE=sn clipvisible) res+=hostutilprintf( PLANECOLOR=s s sn clipmaterialemissiveColorr clipmaterialemissiveColorg clipmaterialemissiveColorb) res+=hostutilprintf( OPACITY=sn clipopacity) res+=hostutilprintf( INTERSECTIONCOLOR=s s sn clipwireframeColorr clipwireframeColorg clipwireframeColorb) res+= ENDn for(var propt in clip) consoleprintln(propt++clip[propt]) res+=ENDn hostconsoleshow() hostconsoleclear() hostconsoleprintln(n Add the following VIEW section to a file ofn+ predefined views (See option 3Dviews)nn + The view may be given a name after VIEW=n + (Remove in front of =)n) hostconsoleprintln(res + n)add items to 3D context menuruntimeaddCustomMenuItem(dfltview Generate Default View default 0)runtimeaddCustomMenuItem(currview Get Current View default 0)runtimeaddCustomMenuItem(csection Cross Section checked 0)menu event handlersmenuEventHandler = new MenuEventHandler()menuEventHandleronEvent = function(e) switch(emenuItemName) case dfltview calc3Dopts() break case currview get3Dview() break case csection addremoveClipPlane(emenuItemChecked) break runtimeaddEventHandler(menuEventHandler)global variable taking reference to currently selected nodevar target=nullselectionEventHandler=new SelectionEventHandler()selectionEventHandleronEvent=function(e) if(eselectedampampenodename=) target=enode else target=null runtimeaddEventHandler(selectionEventHandler)cameraEventHandler=new CameraEventHandler()cameraEventHandleronEvent=function(e) var clip=null runtimeremoveCustomMenuItem(csection) runtimeaddCustomMenuItem(csection Cross Section checked 0) if(clip=scenenodesgetByName($$$$$$)|| predefined scenenodesgetByName(Clipping Plane)) added via context menu runtimeremoveCustomMenuItem(csection) runtimeaddCustomMenuItem(csection Cross Section checked 1) if(clip)plane in predefined views must be rotated by 90 deg around normal cliptransformrotateAboutLineInPlace( MathPI2cliptransformtranslation cliptransformtransformDirection(new Vector3(001)) ) for(var i=0 iltrot4x4length i++)rot4x4[i]setIdentity() target=nullruntimeaddEventHandler(cameraEventHandler)var rot4x4=new Array() keeps track of spin and tilt axes transformationskey event handler for scaling moving spinning and tilting objectskeyEventHandler=new KeyEventHandler()keyEventHandleronEvent=function(e) var backtrans=new Matrix4x4() var trgt=null if(target) trgt=target var backtrans=new Matrix4x4() var trans=trgttransform var parent=trgtparent while(parenttransform) build local to world transformation matrix transmultiplyInPlace(parenttransform) also build world to local back-transformation matrix backtransmultiplyInPlace(parenttransforminversetranspose) parent=parentparent backtranstransposeInPlace() else if( trgt=scenenodesgetByName($$$$$$)|| trgt=scenenodesgetByName(Clipping Plane) ) var trans=trgttransform if(trgt) return var tname=trgtname if(typeof(rot4x4[tname])==undefined) rot4x4[tname]=new Matrix4x4() if(target) var tiltAxis=rot4x4[tname]transformDirection(new Vector3(010)) else var tiltAxis=transtransformDirection(new Vector3(010)) var spinAxis=rot4x4[tname]transformDirection(new Vector3(001)) get the centre of the mesh if(targetampamptrgtconstructorname==Mesh) var centre=transtransformPosition(trgtcomputeBoundingBox()center) else part group (Node3 parent node clipping plane) var centre=new Vector3(transtranslation) switch(echaracterCode) case 30tilt up rot4x4[tname]rotateAboutLineInPlace( -MathPI900rot4x4[tname]translationtiltAxis) transrotateAboutLineInPlace(-MathPI900centretiltAxis) break case 31tilt down rot4x4[tname]rotateAboutLineInPlace( MathPI900rot4x4[tname]translationtiltAxis) transrotateAboutLineInPlace(MathPI900centretiltAxis) break case 28spin right if(ectrlKeyDownampamptarget) transrotateAboutLineInPlace(-MathPI900centrespinAxis) else rot4x4[tname]rotateAboutLineInPlace( -MathPI900rot4x4[tname]translationnew Vector3(001)) transrotateAboutLineInPlace(-MathPI900centrenew Vector3(001)) break case 29spin left if(ectrlKeyDownampamptarget) transrotateAboutLineInPlace(MathPI900centrespinAxis) else rot4x4[tname]rotateAboutLineInPlace( MathPI900rot4x4[tname]translationnew Vector3(001)) transrotateAboutLineInPlace(MathPI900centrenew Vector3(001)) break case 120 x translateTarget(trans new Vector3(100) e) break case 121 y translateTarget(trans new Vector3(010) e) break case 122 z translateTarget(trans new Vector3(001) e) break case 88 shift + x translateTarget(trans new Vector3(-100) e) break case 89 shift + y translateTarget(trans new Vector3(0-10) e) break case 90 shift + z translateTarget(trans new Vector3(00-1) e) break case 115 s transtranslateInPlace(centrescale(-1)) transscaleInPlace(101) transtranslateInPlace(centrescale(1)) break case 83 shift + s transtranslateInPlace(centrescale(-1)) transscaleInPlace(1101) transtranslateInPlace(centrescale(1)) break transmultiplyInPlace(backtrans)runtimeaddEventHandler(keyEventHandler)translates object by amount calculated from Canvas sizefunction translateTarget(t d e) var cam=scenecamerasgetByIndex(0) if(camprojectionType==camTYPE_PERSPECTIVE) var scale=Mathtan(camfov2) camtargetPositionsubtract(camposition)length Mathmin(ecanvasPixelWidthecanvasPixelHeight) else var scale=camviewPlaneSize2 Mathmin(ecanvasPixelWidthecanvasPixelHeight) ttranslateInPlace(dscale(scale))function addremoveClipPlane(chk) var curTrans=getCurTrans() var clip=scenecreateClippingPlane() if(chk) add Clipping Plane and place its center either into the camera target position or into the centre of the currently selected mesh node var centre=new Vector3() if(target) var trans=targettransform var parent=targetparent while(parenttransform) trans=transmultiply(parenttransform) parent=parentparent if(targetconstructorname==Mesh) var centre=transtransformPosition(targetcomputeBoundingBox()center) else var centre=new Vector3(transtranslation) target=null else centreset(scenecamerasgetByIndex(0)targetPosition) cliptransformsetView( new Vector3(000) new Vector3(100) new Vector3(010)) cliptransformtranslateInPlace(centre) else if( scenenodesgetByName($$$$$$)|| scenenodesgetByName(Clipping Plane) ) clipremove()clip=null restoreTrans(curTrans) return clipfunction to store current transformation matrix of all nodes in the scenefunction getCurTrans() var tA=new Array() for(var i=0 iltscenenodescount i++) var nd=scenenodesgetByIndex(i) if(ndname==) continue tA[ndname]=new Matrix4x4(ndtransform) return tAfunction to restore transformation matrices given as argfunction restoreTrans(tA) for(var i=0 iltscenenodescount i++) var nd=scenenodesgetByIndex(i) if(tA[ndname]) ndtransformset(tA[ndname]) store original transformation matrix of all mesh nodes in the scenevar origtrans=getCurTrans()set initial state of Cross Section menu entrycameraEventHandleronEvent(1)hostconsoleclear()

var ocgs=hostgetOCGs(hostpageNum)for(var i=0iltocgslengthi++)if(ocgs[i]name==MediaPlayButton1)ocgs[i]state=false

(C) 2012 Michail Vidiassov John C Bowman Alexander Grahn asylabelsjs version 20120912 3D JavaScript to be used with media9sty (option `add3Djscript) for Asymptote generated PRC files adds billboard behaviour to text labels in Asymptote PRC files so that they always face the camera under 3D rotation This work may be distributed andor modified under the conditions of the LaTeX Project Public License The latest version of this license is in httpmirrorsctanorgmacroslatexbaselppltxt This work has the LPPL maintenance status `maintained The Current Maintainer of this work is A Grahnvar bbnodes=new Array() billboard meshesvar bbtrans=new Array() billboard transformsfunction fulltransform(mesh) var t=new Matrix4x4(meshtransform) if(meshparentname = ) var parentTransform=fulltransform(meshparent) tmultiplyInPlace(parentTransform) return t else return t find all text labels in the scene and determine pivoting pointsvar nodes=scenenodesvar nodescount=nodescountvar third=1030for(var i=0 i lt nodescount i++) var node=nodesgetByIndex(i) var name=nodename var end=namelastIndexOf()-1 if(end gt 0) if(namecharAt(end) == 001) var start=namelastIndexOf(-)+1 if(end gt start) nodename=namesubstr(0start-1) var nodeMatrix=fulltransform(nodeparent) var c=nodeMatrixtranslation position var d=Mathpow(Mathabs(nodeMatrixdeterminant)third) scale bbnodespush(node) bbtranspush(Matrix4x4()scale(ddd)translate(c)multiply(nodeMatrixinverse)) var camera=scenecamerasgetByIndex(0) var zero=new Vector3(000)var bbcount=bbnodeslength event handler to maintain camera-facing text labelsbillboardHandler=new RenderEventHandler()billboardHandleronEvent=function(event) var T=new Matrix4x4() TsetView(zerocamerapositionsubtract(cameratargetPosition) cameraupsubtract(cameraposition)) for(var j=0 j lt bbcount j++) bbnodes[j]transformset(Tmultiply(bbtrans[j])) runtimerefresh() runtimeaddEventHandler(billboardHandler)runtimerefresh()

(C) 2012 Alexander Grahn 3Dspintooljs version 20120301 3D JavaScript to be used with media9sty (option `add3Djscript) enables the Spin tool (also accessible via 3D toolbar or context menu) upon activation of the 3D scene the scene then rotates around the upright axis while dragging with the mouse This work may be distributed andor modified under the conditions of the LaTeX Project Public License The latest version of this license is in httpmirrorsctanorgmacroslatexbaselppltxt This work has the LPPL maintenance status `maintained The Current Maintainer of this work is A GrahnruntimesetCurrentTool(runtimeTOOL_NAME_SPIN)

cells [ cell_type code execution_count null metadata outputs [] source [ from IPythoncoredisplay import display HTMLn display(HTML( )) ] cell_type code execution_count null metadata collapsed true outputs [] source [ import numpy as npn import scipystats as ssn import time n n Black and Scholesn def d1(S0 K r sigma T)n return (nplog(S0K) + (r + sigma2 2) T)(sigma npsqrt(T))n n def d2(S0 K r sigma T)n return (nplog(S0 K) + (r - sigma2 2) T) (sigma npsqrt(T))n n def BlackScholes(typeS0 K r sigma T)n if type==Cn return S0 ssnormcdf(d1(S0 K r sigma T)) - K npexp(-r T) ssnormcdf(d2(S0 K r sigma T))n elsen return K npexp(-r T) ssnormcdf(-d2(S0 K r sigma T)) - S0 ssnormcdf(-d1(S0 K r sigma T)) ] cell_type code execution_count null metadata outputs [] source [ BlackScholes(C100 120 002 02 10) ] ] metadata anaconda-cloud kernelspec display_name Python 3 language python name python3 language_info codemirror_mode name ipython version 3 file_extension py mimetype textx-python name python nbconvert_exporter python pygments_lexer ipython3 version 375rc1 nbformat 4 nbformat_minor 1

Black-Scholes Pricing and Hedging

Fig 65 Time-dependent solution of the Black-Scholes PDE (call option)lowast

The next proposition is proved by a direct differentiation of the Black-Scholesfunction and will be recovered later using a probabilistic argument in Propo-sition 714 below

Proposition 64 The Black-Scholes Delta of the European call option isgiven by

ξt = ξt(St) =partgcpartx

(tSt) = Φ(d+(T minus t)

)isin [0 1] (615)

where d+(T minus t) is given by (611)

Proof From Relation (613) we note that the standard normal probabilitydensity function

ϕ(x) = Φprime(x) =1radic2π

eminusx22 x isin R

satisfies

ϕ(d+(T minus t)) = ϕ

(log(xK) + (r+ σ22)(T minus t)

|σ|radicT minus t

)=

1radic2π

exp(minus1

2

(log(xK) + (r+ σ22)(T minus t)

|σ|radicT minus t

)2)

=1radic2π

exp(minus1

2

(log(xK) + (rminus σ22)(T minus t)

|σ|radicT minus t

+ |σ|radicT minus t

)2)

=1radic2π

exp(minus1

2 (dminus(T minus t))2 minus (T minus t)rminus log x

K

)=

K

xradic

2πeminus(Tminust)r exp

(minus1

2 (dminus(T minus t))2)

lowast The animation works in Acrobat Reader on the entire pdf file

209

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

=K

xeminus(Tminust)rϕ(dminus(T minus t))

hence by (610) we have

partgcpartx

(tx) = part

partx

(xΦ(

log(xK) + (r+ σ22)(T minus t)|σ|radicT minus t

))(616)

minusK eminus(Tminust)r partpartx

(Φ(

log(xK) + (rminus σ22)(T minus t)|σ|radicT minus t

))= Φ

(log(xK) + (r+ σ22)(T minus t)

|σ|radicT minus t

)+x

part

partxΦ(

log(xK) + (r+ σ22)(T minus t)|σ|radicT minus t

)minusK eminus(Tminust)r part

partxΦ(

log(xK) + (rminus σ22)(T minus t)|σ|radicT minus t

)= Φ

(log(xK) + (r+ σ22)(T minus t)

|σ|radicT minus t

)+

x

|σ|radicT minus t

ϕ

(log(xK) + (r+ σ22)(T minus t)

|σ|radicT minus t

)minusK eminus(Tminust)r

|σ|radicT minus t

ϕ

(log(xK) + (rminus σ22)(T minus t)

|σ|radicT minus t

)= Φ(d+(T minus t)) +

x

|σ|radicT minus t

ϕ(d+(T minus t))minusK eminus(Tminust)r

|σ|radicT minus t

ϕ(dminus(T minus t))

= Φ(d+(T minus t))

As a consequence of Proposition 64 the Black-Scholes call price splits into arisky component StΦ

(d+(T minus t)

)and a riskless componentminusK eminus(Tminust)rΦ

(dminus(T minus

t)) as follows

gc(tSt) = StΦ(d+(T minus t)

)︸ ︷︷ ︸risky investment (held)

minus K eminus(Tminust)rΦ(dminus(T minus t)

)︸ ︷︷ ︸

riskminusfree investment (borrowed)

0 6 t 6 T

See Exercise 64 for a computation of the boundary values of gc(tx) t isin[0T ) x gt 0 The following R script is an implementation of the Black-ScholesDelta for European call options in R

1 Delta lt- function(S K r T sigma)d1 lt- (log(SK)+(r+sigma^22)T)(sigmasqrt(T))

3 Delta = pnorm(d1)Delta

210

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

In Figure 66 we plot the Delta of the European call option as a function ofthe underlying asset price and of the time remaining until maturity

Payoff function (x-K)+

0

50

100

150

200

Underlying

0

5

10

15

Time to maturity T-t

0

025

05

075

1

Fig 66 Delta of a European call option with strike price K = 100 r = 3 σ = 10

The Gamma of the European call option is defined as the first derivative ofDelta or second derivative of the option price with respect to the underlyingasset price This gives

γt =1

St|σ|radicT minus t

Φprime(d+(T minus t)

)=

1St|σ|

radic2(T minus t)π

exp(minus1

2

(log(StK) + (r+ σ22)(T minus t)

|σ|radicT minus t

)2)gt 0

In particular a positive value of γt implies that the Delta ξt = ξt(St) shouldincrease when the underlying asset price St increases In other words the po-sition ξt in the underlying asset should be increased by additional purchasesif the underlying asset price St increases

In Figure 67 we plot the (truncated) value of the Gamma of a European calloption as a function of the underlying asset price and of time to maturity

211

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

Fig 67 Gamma of a European call option with strike price K = 100

As Gamma is always nonnegative the Black-Scholes hedging strategy is tokeep buying the risky underlying asset when its price increases and to sell itwhen its price decreases as can be checked from Figure 67

Numerical example - hedging of a call option

In Figure 68 we consider the historical stock price of HSBC Holdings(0005HK) over one year

Fig 68 Graph of the stock price of HSBC Holdings

Consider the call option issued by Societe Generale on 31 December 2008 withstrike price K=$63704 maturity T = October 05 2009 and an entitlementratio of 100 meaning that one option contract is divided into 100 warrants cfpage 9 The next graph gives the time evolution of the Black-Scholes portfoliovalue

t 7minusrarr gc(tSt)

driven by the market price t 7minusrarr St of the risky underlying asset as given inFigure 68 in which the number of days is counted from the origin and notfrom maturity

212

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

40 50 60 70 80 90 0 50 100 150 200

0

5

10

15

20

25

30

35

40

Underlying (HK$) Time in days

Fig 69 Path of the Black-Scholes price for a call option on HSBC

As a consequence of Proposition 64 in the Black-Scholes call option hedgingmodel the amount invested in the risky asset is

Stξt = StΦ(d+(T minus t)

)= StΦ

(log(StK) + (r+ σ22)(T minus t)

|σ|radicT minus t

)gt 0

which is always nonnegative ie there is no short selling and the amountinvested on the riskless asset is

ηtAt = minusK eminus(Tminust)rΦ(dminus(T minus t)

)= minusK eminus(Tminust)rΦ

(log(StK) + (rminus σ22)(T minus t)

|σ|radicT minus t

)6 0

which is always nonpositive ie we are constantly borrowing money on theriskless asset as noted in Figure 610

-60

-40

-20

0

20

40

60

80

100

0 50 100 150 200

K

HK$

Black-Scholes priceRisky investment ξtSt

Riskless investment ηtAtUnderlying asset price

Fig 610 Time evolution of a hedging portfolio for a call option on HSBC

213

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

A comparison of Figure 610 with market data can be found in Figures 911and 912 below

Cash settlement In the case of a cash settlement the option issuer will sat-isfy the option contract by selling ξT = 1 stock at the price ST = $83refund the K = $63 risk-free investment and hand in the remaining amountC = (ST minusK)+ = 83minus 63 = $20 to the option holder

Physical delivery In the case of physical delivery of the underlying asset theoption issuer will deliver ξT = 1 stock to the option holder in exchange forK = $63 which will be used together with the portfolio value to refund therisk-free loan

63 European Put Options

Similarly in the case of the European put option with strike price K thepayoff function is given by h(x) = (Kminusx)+ and the Black-Scholes PDE (67)reads

rgp(tx) =partgppartt

(tx) + rxpartgppartx

(tx) + 12σ

2x2 part2gppartx2 (tx)

gp(T x) = (K minus x)+(617)

The next proposition can be proved as in Sections 65 and 66 see Proposi-tion 611

Proposition 65 The solution of the PDE (617) is given by the Black-Scholes formula for put options

gp(tx) = K eminus(Tminust)rΦ(minus dminus(T minus t)

)minus xΦ

(minus d+(T minus t)

) (618)

withd+(T minus t) =

log(xK) + (r+ σ22)(T minus t)|σ|radicT minus t

(619)

dminus(T minus t) =log(xK) + (rminus σ22)(T minus t)

|σ|radicT minus t

(620)

as illustrated in Figure 611

214

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

Fig 611 Graph of the Black-Scholes put price function with strike price K = 100lowast

In other words the European put option with strike price K and maturityT is priced at time t isin [0T ] as

gp(tSt) = K eminus(Tminust)rΦ(minus dminus(T minus t)

)minus StΦ

(minus d+(T minus t)

) 0 6 t 6 T

Fig 612 Time-dependent solution of the Black-Scholes PDE (put option)dagger

The following R script is an implementation of the Black-Scholes formula forEuropean put options in R

1 BSPut lt- function(S K r T sigma)d1 = (log(SK)+(r+sigma^22)T)(sigmasqrt(T))

3 d2 = d1 - sigma sqrt(T)BSPut = Kexp(-rT) pnorm(-d2) - Spnorm(-d1)

5 BSPut

Call-put parity

lowast Right-click on the figure for interaction and ldquoFull Screen Multimediardquo viewdagger The animation works in Acrobat Reader on the entire pdf file

215

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

(C) 2012--today Alexander Grahn 3Dmenujs version 20140923 3D JavaScript used by media9sty Extended functionality of the (right click) context menu of 3D annotations 1) Adds the following items to the 3D context menu `Generate Default View Finds good default camera settings returned as options for use with the includemedia command `Get Current View Determines camera cross section and part settings of the current view returned as `VIEW section that can be copied into a views file of additional views The views file is inserted using the `3Dviews option of includemedia `Cross Section Toggle switch to add or remove a cross section into or from the current view The cross section can be moved in the x y z directions using x y z and X Y Z keys on the keyboard be tilted against and spun around the upright Z axis using the UpDown and LeftRight arrow keys and caled using the s and S keys 2) Enables manipulation of position and orientation of indiviual parts and groups of parts in the 3D scene Parts which have been selected with the mouse can be scaled moved around and rotated like the cross section as described above To spin the parts around their local up-axis keep Control key pressed while using the UpDown and LeftRight arrow keys This work may be distributed andor modified under the conditions of the LaTeX Project Public License The latest version of this license is in httpmirrorsctanorgmacroslatexbaselppltxt This work has the LPPL maintenance status `maintained The Current Maintainer of this work is A Grahn The code borrows heavily from Bernd Gaertners `Miniball software originally written in C++ for computing the smallest enclosing ball of a set of points see httpwwwinfethzchpersonalgaertnerminiballhtmlhostconsoleshow()constructor for doubly linked listfunction List() thisfirst_node=null thislast_node=new Node(undefined)Listprototypepush_back=function(x) var new_node=new Node(x) if(thisfirst_node==null) thisfirst_node=new_node new_nodeprev=null else new_nodeprev=thislast_nodeprev new_nodeprevnext=new_node new_nodenext=thislast_node thislast_nodeprev=new_nodeListprototypemove_to_front=function(it) var node=itget() if(nodenext=null ampamp nodeprev=null) nodenextprev=nodeprev nodeprevnext=nodenext nodeprev=null nodenext=thisfirst_node thisfirst_nodeprev=node thisfirst_node=node Listprototypebegin=function() var i=new Iterator() itarget=thisfirst_node return(i)Listprototypeend=function() var i=new Iterator() itarget=thislast_node return(i)function Iterator(it) if( it=undefined ) thistarget=ittarget else thistarget=null Iteratorprototypeset=function(it)thistarget=ittargetIteratorprototypeget=function()return(thistarget)Iteratorprototypederef=function()return(thistargetdata)Iteratorprototypeincr=function() if(thistargetnext=null) thistarget=thistargetnextconstructor for node objects that populate the linked listfunction Node(x) thisprev=null thisnext=null thisdata=xfunction sqr(r)return(rr)helper functionMiniball algorithm by B Gaertnerfunction Basis() thism=0 thisq0=new Array(3) thisz=new Array(4) thisf=new Array(4) thisv=new Array(new Array(3) new Array(3) new Array(3) new Array(3)) thisa=new Array(new Array(3) new Array(3) new Array(3) new Array(3)) thisc=new Array(new Array(3) new Array(3) new Array(3) new Array(3)) thissqr_r=new Array(4) thiscurrent_c=thisc[0] thiscurrent_sqr_r=0 thisreset()Basisprototypecenter=function()return(thiscurrent_c)Basisprototypesize=function()return(thism)Basisprototypepop=function()--thismBasisprototypeexcess=function(p) var e=-thiscurrent_sqr_r for(var k=0klt3++k) e+=sqr(p[k]-thiscurrent_c[k]) return(e)Basisprototypereset=function() thism=0 for(var j=0jlt3++j) thisc[0][j]=0 thiscurrent_c=thisc[0] thiscurrent_sqr_r=-1Basisprototypepush=function(p) var i j var eps=1e-32 if(thism==0) for(i=0ilt3++i) thisq0[i]=p[i] for(i=0ilt3++i) thisc[0][i]=thisq0[i] thissqr_r[0]=0 else for(i=0ilt3++i) thisv[thism][i]=p[i]-thisq0[i] for(i=1iltthism++i) thisa[thism][i]=0 for(j=0jlt3++j) thisa[thism][i]+=thisv[i][j]thisv[thism][j] thisa[thism][i]=(2thisz[i]) for(i=1iltthism++i) for(j=0jlt3++j) thisv[thism][j]-=thisa[thism][i]thisv[i][j] thisz[thism]=0 for(j=0jlt3++j) thisz[thism]+=sqr(thisv[thism][j]) thisz[thism]=2 if(thisz[thism]ltepsthiscurrent_sqr_r) return(false) var e=-thissqr_r[thism-1] for(i=0ilt3++i) e+=sqr(p[i]-thisc[thism-1][i]) thisf[thism]=ethisz[thism] for(i=0ilt3++i) thisc[thism][i]=thisc[thism-1][i]+thisf[thism]thisv[thism][i] thissqr_r[thism]=thissqr_r[thism-1]+ethisf[thism]2 thiscurrent_c=thisc[thism] thiscurrent_sqr_r=thissqr_r[thism] ++thism return(true)function Miniball() thisL=new List() thisB=new Basis() thissupport_end=new Iterator()Miniballprototypemtf_mb=function(it) var i=new Iterator(it) thissupport_endset(thisLbegin()) if((thisBsize())==4) return for(var k=new Iterator(thisLbegin())kget()=iget()) var j=new Iterator(k) kincr() if(thisBexcess(jderef()) gt 0) if(thisBpush(jderef())) thismtf_mb(j) thisBpop() if(thissupport_endget()==jget()) thissupport_endincr() thisLmove_to_front(j) Miniballprototypecheck_in=function(b) thisLpush_back(b)Miniballprototypebuild=function() thisBreset() thissupport_endset(thisLbegin()) thismtf_mb(thisLend())Miniballprototypecenter=function() return(thisBcenter())Miniballprototyperadius=function() return(Mathsqrt(thisBcurrent_sqr_r))functions called by menu itemsfunction calc3Dopts () create Miniball object var mb=new Miniball() auxiliary vector var corner=new Vector3() iterate over all visible mesh nodes in the scene for(i=0iltscenemeshescounti++) var mesh=scenemeshesgetByIndex(i) if(meshvisible) continue local to parent transformation matrix var trans=meshtransform build local to world transformation matrix by recursively multiplying the parents transf matrix on the right var parent=meshparent while(parenttransform) trans=transmultiply(parenttransform) parent=parentparent get the bbox of the mesh (local coordinates) var bbox=meshcomputeBoundingBox() transform the local bounding box corner coordinates to world coordinates for bounding sphere determination BBoxmin cornerset(bboxmin) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) BBoxmax cornerset(bboxmax) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) remaining six BBox corners cornerset(bboxminx bboxmaxy bboxmaxz) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) cornerset(bboxminx bboxminy bboxmaxz) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) cornerset(bboxminx bboxmaxy bboxminz) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) cornerset(bboxmaxx bboxminy bboxminz) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) cornerset(bboxmaxx bboxminy bboxmaxz) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) cornerset(bboxmaxx bboxmaxy bboxminz) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) compute the smallest enclosing bounding sphere mbbuild() current camera settings var camera=scenecamerasgetByIndex(0) var res= initialize result string aperture angle of the virtual camera (perspective projection) or orthographic scale (orthographic projection) if(cameraprojectionType==cameraTYPE_PERSPECTIVE) var aac=camerafov180MathPI if(hostutilprintf(4f aac)=30) res+=hostutilprintf(n3Daac=s aac) else cameraviewPlaneSize=2mbradius() res+=hostutilprintf(n3Dortho=s 1cameraviewPlaneSize) camera roll var roll = cameraroll180MathPI if(hostutilprintf(4f roll)=0) res+=hostutilprintf(n3Droll=sroll) target to camera vector var c2c=new Vector3() c2cset(cameraposition) c2csubtractInPlace(cameratargetPosition) c2cnormalize() if((c2cx==0 ampamp c2cy==-1 ampamp c2cz==0)) res+=hostutilprintf(n3Dc2c=s s s c2cx c2cy c2cz) new camera settings bounding sphere centre --gt new camera target var coo=new Vector3() cooset((mbcenter())[0] (mbcenter())[1] (mbcenter())[2]) if(coolength) res+=hostutilprintf(n3Dcoo=s s s coox cooy cooz) radius of orbit if(cameraprojectionType==cameraTYPE_PERSPECTIVE) var roo=mbradius() Mathsin(aac MathPI 360) else orthographic projection var roo=mbradius() res+=hostutilprintf(n3Droo=s roo) update camera settings in the viewer var currol=cameraroll cameratargetPositionset(coo) camerapositionset(cooadd(c2cscale(roo))) cameraroll=currol determine background colour rgb=scenebackgroundgetColor() if((rgbr==1 ampamp rgbg==1 ampamp rgbb==1)) res+=hostutilprintf(n3Dbg=s s s rgbr rgbg rgbb) determine lighting scheme switch(scenelightScheme) case sceneLIGHT_MODE_FILE curlights=Artworkbreak case sceneLIGHT_MODE_NONE curlights=Nonebreak case sceneLIGHT_MODE_WHITE curlights=Whitebreak case sceneLIGHT_MODE_DAY curlights=Daybreak case sceneLIGHT_MODE_NIGHT curlights=Nightbreak case sceneLIGHT_MODE_BRIGHT curlights=Hardbreak case sceneLIGHT_MODE_RGB curlights=Primarybreak case sceneLIGHT_MODE_BLUE curlights=Bluebreak case sceneLIGHT_MODE_RED curlights=Redbreak case sceneLIGHT_MODE_CUBE curlights=Cubebreak case sceneLIGHT_MODE_CAD curlights=CADbreak case sceneLIGHT_MODE_HEADLAMP curlights=Headlampbreak if(curlights=Artwork) res+=hostutilprintf(n3Dlights=s curlights) determine global render mode switch(scenerenderMode) case sceneRENDER_MODE_BOUNDING_BOX currender=BoundingBoxbreak case sceneRENDER_MODE_TRANSPARENT_BOUNDING_BOX currender=TransparentBoundingBoxbreak case sceneRENDER_MODE_TRANSPARENT_BOUNDING_BOX_OUTLINE currender=TransparentBoundingBoxOutlinebreak case sceneRENDER_MODE_VERTICES currender=Verticesbreak case sceneRENDER_MODE_SHADED_VERTICES currender=ShadedVerticesbreak case sceneRENDER_MODE_WIREFRAME currender=Wireframebreak case sceneRENDER_MODE_SHADED_WIREFRAME currender=ShadedWireframebreak case sceneRENDER_MODE_SOLID currender=Solidbreak case sceneRENDER_MODE_TRANSPARENT currender=Transparentbreak case sceneRENDER_MODE_SOLID_WIREFRAME currender=SolidWireframebreak case sceneRENDER_MODE_TRANSPARENT_WIREFRAME currender=TransparentWireframebreak case sceneRENDER_MODE_ILLUSTRATION currender=Illustrationbreak case sceneRENDER_MODE_SOLID_OUTLINE currender=SolidOutlinebreak case sceneRENDER_MODE_SHADED_ILLUSTRATION currender=ShadedIllustrationbreak case sceneRENDER_MODE_HIDDEN_WIREFRAME currender=HiddenWireframebreak if(currender=Solid) res+=hostutilprintf(n3Drender=s currender) write result string to the console hostconsoleshow() hostconsoleclear() hostconsoleprintln(n Copy and paste the following text to then+ option list of includemedian + res + n)function get3Dview () var camera=scenecamerasgetByIndex(0) var coo=cameratargetPosition var c2c=camerapositionsubtract(coo) var roo=c2clength c2cnormalize() var res=VIEW=insert optional name heren if((coox==0 ampamp cooy==0 ampamp cooz==0)) res+=hostutilprintf( COO=s s sn coox cooy cooz) if((c2cx==0 ampamp c2cy==-1 ampamp c2cz==0)) res+=hostutilprintf( C2C=s s sn c2cx c2cy c2cz) if(roo gt 1e-9) res+=hostutilprintf( ROO=sn roo) var roll = cameraroll180MathPI if(hostutilprintf(4f roll)=0) res+=hostutilprintf( ROLL=sn roll) if(cameraprojectionType==cameraTYPE_PERSPECTIVE) var aac=camerafov 180MathPI if(hostutilprintf(4f aac)=30) res+=hostutilprintf( AAC=sn aac) else if(hostutilprintf(4f cameraviewPlaneSize)=1) res+=hostutilprintf( ORTHO=sn 1cameraviewPlaneSize) rgb=scenebackgroundgetColor() if((rgbr==1 ampamp rgbg==1 ampamp rgbb==1)) res+=hostutilprintf( BGCOLOR=s s sn rgbr rgbg rgbb) switch(scenelightScheme) case sceneLIGHT_MODE_FILE curlights=Artworkbreak case sceneLIGHT_MODE_NONE curlights=Nonebreak case sceneLIGHT_MODE_WHITE curlights=Whitebreak case sceneLIGHT_MODE_DAY curlights=Daybreak case sceneLIGHT_MODE_NIGHT curlights=Nightbreak case sceneLIGHT_MODE_BRIGHT curlights=Hardbreak case sceneLIGHT_MODE_RGB curlights=Primarybreak case sceneLIGHT_MODE_BLUE curlights=Bluebreak case sceneLIGHT_MODE_RED curlights=Redbreak case sceneLIGHT_MODE_CUBE curlights=Cubebreak case sceneLIGHT_MODE_CAD curlights=CADbreak case sceneLIGHT_MODE_HEADLAMP curlights=Headlampbreak if(curlights=Artwork) res+= LIGHTS=+curlights+n switch(scenerenderMode) case sceneRENDER_MODE_BOUNDING_BOX defaultrender=BoundingBoxbreak case sceneRENDER_MODE_TRANSPARENT_BOUNDING_BOX defaultrender=TransparentBoundingBoxbreak case sceneRENDER_MODE_TRANSPARENT_BOUNDING_BOX_OUTLINE defaultrender=TransparentBoundingBoxOutlinebreak case sceneRENDER_MODE_VERTICES defaultrender=Verticesbreak case sceneRENDER_MODE_SHADED_VERTICES defaultrender=ShadedVerticesbreak case sceneRENDER_MODE_WIREFRAME defaultrender=Wireframebreak case sceneRENDER_MODE_SHADED_WIREFRAME defaultrender=ShadedWireframebreak case sceneRENDER_MODE_SOLID defaultrender=Solidbreak case sceneRENDER_MODE_TRANSPARENT defaultrender=Transparentbreak case sceneRENDER_MODE_SOLID_WIREFRAME defaultrender=SolidWireframebreak case sceneRENDER_MODE_TRANSPARENT_WIREFRAME defaultrender=TransparentWireframebreak case sceneRENDER_MODE_ILLUSTRATION defaultrender=Illustrationbreak case sceneRENDER_MODE_SOLID_OUTLINE defaultrender=SolidOutlinebreak case sceneRENDER_MODE_SHADED_ILLUSTRATION defaultrender=ShadedIllustrationbreak case sceneRENDER_MODE_HIDDEN_WIREFRAME defaultrender=HiddenWireframebreak if(defaultrender=Solid) res+= RENDERMODE=+defaultrender+n detect existing Clipping Plane (3D Cross Section) var clip=null if( clip=scenenodesgetByName($$$$$$)|| clip=scenenodesgetByName(Clipping Plane) ) for(var i=0iltscenenodescounti++) var nd=scenenodesgetByIndex(i) if(nd==clip||ndname==) continue var ndUTFName= for (var j=0 jltndnamelength j++) var theUnicode = ndnamecharCodeAt(j)toString(16) while (theUnicodelengthlt4) theUnicode = 0 + theUnicode ndUTFName += theUnicode var end=ndnamelastIndexOf() if(endgt0) var ndUserName=ndnamesubstr(0end) else var ndUserName=ndname respart= PART=+ndUserName+n respart+= UTF16NAME=+ndUTFName+n defaultvals=true if(ndvisible) respart+= VISIBLE=falsen defaultvals=false if(ndopacitylt10) respart+= OPACITY=+ndopacity+n defaultvals=false if(ndconstructorname==Mesh) currender=defaultrender switch(ndrenderMode) case sceneRENDER_MODE_BOUNDING_BOX currender=BoundingBoxbreak case sceneRENDER_MODE_TRANSPARENT_BOUNDING_BOX currender=TransparentBoundingBoxbreak case sceneRENDER_MODE_TRANSPARENT_BOUNDING_BOX_OUTLINE currender=TransparentBoundingBoxOutlinebreak case sceneRENDER_MODE_VERTICES currender=Verticesbreak case sceneRENDER_MODE_SHADED_VERTICES currender=ShadedVerticesbreak case sceneRENDER_MODE_WIREFRAME currender=Wireframebreak case sceneRENDER_MODE_SHADED_WIREFRAME currender=ShadedWireframebreak case sceneRENDER_MODE_SOLID currender=Solidbreak case sceneRENDER_MODE_TRANSPARENT currender=Transparentbreak case sceneRENDER_MODE_SOLID_WIREFRAME currender=SolidWireframebreak case sceneRENDER_MODE_TRANSPARENT_WIREFRAME currender=TransparentWireframebreak case sceneRENDER_MODE_ILLUSTRATION currender=Illustrationbreak case sceneRENDER_MODE_SOLID_OUTLINE currender=SolidOutlinebreak case sceneRENDER_MODE_SHADED_ILLUSTRATION currender=ShadedIllustrationbreak case sceneRENDER_MODE_HIDDEN_WIREFRAME currender=HiddenWireframebreak case sceneRENDER_MODE_DEFAULT currender=Defaultbreak if(currender=defaultrender) respart+= RENDERMODE=+currender+n defaultvals=false if(origtrans[ndname]ampampndtransformisEqual(origtrans[ndname])) var lvec=ndtransformtransformDirection(new Vector3(100)) var uvec=ndtransformtransformDirection(new Vector3(010)) var vvec=ndtransformtransformDirection(new Vector3(001)) respart+= TRANSFORM= +lvecx+ +lvecy+ +lvecz+ +uvecx+ +uvecy+ +uvecz+ +vvecx+ +vvecy+ +vvecz+ +ndtransformtranslationx+ +ndtransformtranslationy+ +ndtransformtranslationz+n defaultvals=false respart+= ENDn if(defaultvals) res+=respart if(clip) var centre=cliptransformtranslation var normal=cliptransformtransformDirection(new Vector3(001)) res+= CROSSSECTn if((centrex==0 ampamp centrey==0 ampamp centrez==0)) res+=hostutilprintf( CENTER=s s sn centrex centrey centrez) if((normalx==1 ampamp normaly==0 ampamp normalz==0)) res+=hostutilprintf( NORMAL=s s sn normalx normaly normalz) res+=hostutilprintf( VISIBLE=sn clipvisible) res+=hostutilprintf( PLANECOLOR=s s sn clipmaterialemissiveColorr clipmaterialemissiveColorg clipmaterialemissiveColorb) res+=hostutilprintf( OPACITY=sn clipopacity) res+=hostutilprintf( INTERSECTIONCOLOR=s s sn clipwireframeColorr clipwireframeColorg clipwireframeColorb) res+= ENDn for(var propt in clip) consoleprintln(propt++clip[propt]) res+=ENDn hostconsoleshow() hostconsoleclear() hostconsoleprintln(n Add the following VIEW section to a file ofn+ predefined views (See option 3Dviews)nn + The view may be given a name after VIEW=n + (Remove in front of =)n) hostconsoleprintln(res + n)add items to 3D context menuruntimeaddCustomMenuItem(dfltview Generate Default View default 0)runtimeaddCustomMenuItem(currview Get Current View default 0)runtimeaddCustomMenuItem(csection Cross Section checked 0)menu event handlersmenuEventHandler = new MenuEventHandler()menuEventHandleronEvent = function(e) switch(emenuItemName) case dfltview calc3Dopts() break case currview get3Dview() break case csection addremoveClipPlane(emenuItemChecked) break runtimeaddEventHandler(menuEventHandler)global variable taking reference to currently selected nodevar target=nullselectionEventHandler=new SelectionEventHandler()selectionEventHandleronEvent=function(e) if(eselectedampampenodename=) target=enode else target=null runtimeaddEventHandler(selectionEventHandler)cameraEventHandler=new CameraEventHandler()cameraEventHandleronEvent=function(e) var clip=null runtimeremoveCustomMenuItem(csection) runtimeaddCustomMenuItem(csection Cross Section checked 0) if(clip=scenenodesgetByName($$$$$$)|| predefined scenenodesgetByName(Clipping Plane)) added via context menu runtimeremoveCustomMenuItem(csection) runtimeaddCustomMenuItem(csection Cross Section checked 1) if(clip)plane in predefined views must be rotated by 90 deg around normal cliptransformrotateAboutLineInPlace( MathPI2cliptransformtranslation cliptransformtransformDirection(new Vector3(001)) ) for(var i=0 iltrot4x4length i++)rot4x4[i]setIdentity() target=nullruntimeaddEventHandler(cameraEventHandler)var rot4x4=new Array() keeps track of spin and tilt axes transformationskey event handler for scaling moving spinning and tilting objectskeyEventHandler=new KeyEventHandler()keyEventHandleronEvent=function(e) var backtrans=new Matrix4x4() var trgt=null if(target) trgt=target var backtrans=new Matrix4x4() var trans=trgttransform var parent=trgtparent while(parenttransform) build local to world transformation matrix transmultiplyInPlace(parenttransform) also build world to local back-transformation matrix backtransmultiplyInPlace(parenttransforminversetranspose) parent=parentparent backtranstransposeInPlace() else if( trgt=scenenodesgetByName($$$$$$)|| trgt=scenenodesgetByName(Clipping Plane) ) var trans=trgttransform if(trgt) return var tname=trgtname if(typeof(rot4x4[tname])==undefined) rot4x4[tname]=new Matrix4x4() if(target) var tiltAxis=rot4x4[tname]transformDirection(new Vector3(010)) else var tiltAxis=transtransformDirection(new Vector3(010)) var spinAxis=rot4x4[tname]transformDirection(new Vector3(001)) get the centre of the mesh if(targetampamptrgtconstructorname==Mesh) var centre=transtransformPosition(trgtcomputeBoundingBox()center) else part group (Node3 parent node clipping plane) var centre=new Vector3(transtranslation) switch(echaracterCode) case 30tilt up rot4x4[tname]rotateAboutLineInPlace( -MathPI900rot4x4[tname]translationtiltAxis) transrotateAboutLineInPlace(-MathPI900centretiltAxis) break case 31tilt down rot4x4[tname]rotateAboutLineInPlace( MathPI900rot4x4[tname]translationtiltAxis) transrotateAboutLineInPlace(MathPI900centretiltAxis) break case 28spin right if(ectrlKeyDownampamptarget) transrotateAboutLineInPlace(-MathPI900centrespinAxis) else rot4x4[tname]rotateAboutLineInPlace( -MathPI900rot4x4[tname]translationnew Vector3(001)) transrotateAboutLineInPlace(-MathPI900centrenew Vector3(001)) break case 29spin left if(ectrlKeyDownampamptarget) transrotateAboutLineInPlace(MathPI900centrespinAxis) else rot4x4[tname]rotateAboutLineInPlace( MathPI900rot4x4[tname]translationnew Vector3(001)) transrotateAboutLineInPlace(MathPI900centrenew Vector3(001)) break case 120 x translateTarget(trans new Vector3(100) e) break case 121 y translateTarget(trans new Vector3(010) e) break case 122 z translateTarget(trans new Vector3(001) e) break case 88 shift + x translateTarget(trans new Vector3(-100) e) break case 89 shift + y translateTarget(trans new Vector3(0-10) e) break case 90 shift + z translateTarget(trans new Vector3(00-1) e) break case 115 s transtranslateInPlace(centrescale(-1)) transscaleInPlace(101) transtranslateInPlace(centrescale(1)) break case 83 shift + s transtranslateInPlace(centrescale(-1)) transscaleInPlace(1101) transtranslateInPlace(centrescale(1)) break transmultiplyInPlace(backtrans)runtimeaddEventHandler(keyEventHandler)translates object by amount calculated from Canvas sizefunction translateTarget(t d e) var cam=scenecamerasgetByIndex(0) if(camprojectionType==camTYPE_PERSPECTIVE) var scale=Mathtan(camfov2) camtargetPositionsubtract(camposition)length Mathmin(ecanvasPixelWidthecanvasPixelHeight) else var scale=camviewPlaneSize2 Mathmin(ecanvasPixelWidthecanvasPixelHeight) ttranslateInPlace(dscale(scale))function addremoveClipPlane(chk) var curTrans=getCurTrans() var clip=scenecreateClippingPlane() if(chk) add Clipping Plane and place its center either into the camera target position or into the centre of the currently selected mesh node var centre=new Vector3() if(target) var trans=targettransform var parent=targetparent while(parenttransform) trans=transmultiply(parenttransform) parent=parentparent if(targetconstructorname==Mesh) var centre=transtransformPosition(targetcomputeBoundingBox()center) else var centre=new Vector3(transtranslation) target=null else centreset(scenecamerasgetByIndex(0)targetPosition) cliptransformsetView( new Vector3(000) new Vector3(100) new Vector3(010)) cliptransformtranslateInPlace(centre) else if( scenenodesgetByName($$$$$$)|| scenenodesgetByName(Clipping Plane) ) clipremove()clip=null restoreTrans(curTrans) return clipfunction to store current transformation matrix of all nodes in the scenefunction getCurTrans() var tA=new Array() for(var i=0 iltscenenodescount i++) var nd=scenenodesgetByIndex(i) if(ndname==) continue tA[ndname]=new Matrix4x4(ndtransform) return tAfunction to restore transformation matrices given as argfunction restoreTrans(tA) for(var i=0 iltscenenodescount i++) var nd=scenenodesgetByIndex(i) if(tA[ndname]) ndtransformset(tA[ndname]) store original transformation matrix of all mesh nodes in the scenevar origtrans=getCurTrans()set initial state of Cross Section menu entrycameraEventHandleronEvent(1)hostconsoleclear()

var ocgs=hostgetOCGs(hostpageNum)for(var i=0iltocgslengthi++)if(ocgs[i]name==MediaPlayButton2)ocgs[i]state=false

(C) 2012 Michail Vidiassov John C Bowman Alexander Grahn asylabelsjs version 20120912 3D JavaScript to be used with media9sty (option `add3Djscript) for Asymptote generated PRC files adds billboard behaviour to text labels in Asymptote PRC files so that they always face the camera under 3D rotation This work may be distributed andor modified under the conditions of the LaTeX Project Public License The latest version of this license is in httpmirrorsctanorgmacroslatexbaselppltxt This work has the LPPL maintenance status `maintained The Current Maintainer of this work is A Grahnvar bbnodes=new Array() billboard meshesvar bbtrans=new Array() billboard transformsfunction fulltransform(mesh) var t=new Matrix4x4(meshtransform) if(meshparentname = ) var parentTransform=fulltransform(meshparent) tmultiplyInPlace(parentTransform) return t else return t find all text labels in the scene and determine pivoting pointsvar nodes=scenenodesvar nodescount=nodescountvar third=1030for(var i=0 i lt nodescount i++) var node=nodesgetByIndex(i) var name=nodename var end=namelastIndexOf()-1 if(end gt 0) if(namecharAt(end) == 001) var start=namelastIndexOf(-)+1 if(end gt start) nodename=namesubstr(0start-1) var nodeMatrix=fulltransform(nodeparent) var c=nodeMatrixtranslation position var d=Mathpow(Mathabs(nodeMatrixdeterminant)third) scale bbnodespush(node) bbtranspush(Matrix4x4()scale(ddd)translate(c)multiply(nodeMatrixinverse)) var camera=scenecamerasgetByIndex(0) var zero=new Vector3(000)var bbcount=bbnodeslength event handler to maintain camera-facing text labelsbillboardHandler=new RenderEventHandler()billboardHandleronEvent=function(event) var T=new Matrix4x4() TsetView(zerocamerapositionsubtract(cameratargetPosition) cameraupsubtract(cameraposition)) for(var j=0 j lt bbcount j++) bbnodes[j]transformset(Tmultiply(bbtrans[j])) runtimerefresh() runtimeaddEventHandler(billboardHandler)runtimerefresh()

(C) 2012 Alexander Grahn 3Dspintooljs version 20120301 3D JavaScript to be used with media9sty (option `add3Djscript) enables the Spin tool (also accessible via 3D toolbar or context menu) upon activation of the 3D scene the scene then rotates around the upright axis while dragging with the mouse This work may be distributed andor modified under the conditions of the LaTeX Project Public License The latest version of this license is in httpmirrorsctanorgmacroslatexbaselppltxt This work has the LPPL maintenance status `maintained The Current Maintainer of this work is A GrahnruntimesetCurrentTool(runtimeTOOL_NAME_SPIN)

N Privault

Proposition 66 Call-put parity We have the call-put parity relation

gc(tSt)minus gp(tSt) = St minusK eminus(Tminust)r 0 6 t 6 T (621)

between the Black-Scholes prices of call and put options in terms of theforward contract price St minusK eminus(Tminust)r

Proof The call-put parity (621) is a consequence of the relation

xminusK = (xminusK)+ minus (K minus x)+

satisfied by the terminal call and put payoff functions in the Black-ScholesPDE (67) It can also be verified directly from (610) and (618) as

gc(tx)minus gp(tx) = xΦ(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)minus(K eminus(Tminust)rΦ

(minus dminus(T minus t)

)minus xΦ

(minus d+(T minus t)

))= xΦ

(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)minusK eminus(Tminust)r

(1minusΦ

(dminus(T minus t)

))+ x

(1minusΦ

(d+(T minus t)

))= xminusK

The Delta of the Black-Scholes put option can be obtained by differentiationof the call-put parity relation (621) and Proposition 64

Proposition 67 The Delta of the Black-Scholes put option is given by

ξt = minus(1minusΦ(d+(T minus t)

)) = minusΦ

(minus d+(T minus t)

)isin [minus1 0] 0 6 t 6 T

Proof By the call-put parity relation (621) and Proposition 64 we have

partgppartx

(tSt) =partgcpartx

(tSt)minus 1

= Φ(d+(T minus t))minus 1= minusΦ(minusd+(T minus t)) 0 6 t 6 T

where we applied (614)

As a consequence of Proposition 67 the Black-Scholes put price splitsinto a risky component minusStΦ

(minus d+(T minus t)

)and a riskless component

K eminus(Tminust)rΦ(minus dminus(T minus t)

) as follows

gp(tSt) = K eminus(Tminust)rΦ(minus dminus(T minus t)

)︸ ︷︷ ︸riskminusfree investment (savings)

minus StΦ(minus d+(T minus t)

)︸ ︷︷ ︸

risky investment (short)

0 6 t 6 T

216

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

In Figure 613 we plot the Delta of the European put option as a function ofthe underlying asset price and of the time remaining until maturity

Payoff function (x-K)+

0

50

100

150

200

Underlying

0

5

10

15 Time to maturity T-t

-1

-075

-05

-025

0

Fig 613 Delta of a European put option with strike price K = 100 r = 3 σ = 10

Numerical example - hedging of a put option

For one more example we consider a put option issued by BNP Paribas on04 November 2008 with strike price K=$77667 maturity T = October 052009 and entitlement ratio 92593 cf page 9 In the next Figure 614 thenumber of days is counted from the origin not from maturity

40 50 60 70 80 90 100

0 50 100 150 200

0 5

10 15 20 25 30 35 40 45

Underlying (HK$)Time in days

Fig 614 Path of the Black-Scholes price for a put option on HSBC

As a consequence of Proposition 67 the amount invested on the risky assetfor the hedging of a put option is

minusStΦ(minus d+(T minus t)

)= minusStΦ

(minus log(StK) + (r+ σ22)(T minus t)

|σ|radicT minus t

)6 0

217

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

ie there is always short selling and the amount invested on the riskless assetpriced At = ert t isin [0T ] is

ηtAt = K eminus(Tminust)rΦ(minus dminus(T minus t)

)= K eminus(Tminust)rΦ

(minus log(StK) + (rminus σ22)(T minus t)

|σ|radicT minus t

)gt 0

which is always nonnegative ie we are constantly saving money on theriskless asset as noted in Figure 615

-60

-40

-20

0

20

40

60

80

100

0 50 100 150 200

K

HK$

Black-Scholes priceRisky investment ξtSt

Riskless investment ηtAtUnderlying asset price

Fig 615 Time evolution of the hedging portfolio for a put option on HSBC

In the above example the put option finished out of the money (OTM) so thatno cash settlement or physical delivery occurs A comparison of Figure 610with market data can be found in Figures 913 and 914 below

64 Market Terms and Data

The following Table 61 provides a summary of formulas for the computationof Black-Scholes sensitivities also called Greekslowast

lowast ldquoEvery class feels like attending a Greek lessonrdquo (AY2018-2019 student feedback)

218

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

Call option Put option

Option price g(tSt) StΦ(d+(T minus t))minusK eminus(Tminust)rΦ(dminus(T minus t)) K eminus(Tminust)rΦ(minusdminus(T minus t))minus StΦ(minusd+(T minus t))

Delta (∆) partg

partx(tSt) Φ(d+(T minus t)) gt 0 minusΦ(minusd+(T minus t)) 6 0

Gamma (Γ) part2g

partx2 (tSt)Φprime(d+(T minus t))St|σ|

radicT minus t

gt 0

Vega partg

partσ(tSt) St

radicT minus tΦprime(d+(T minus t)) gt 0

Theta (Θ) partg

partt(tSt) minusSt|σ|Φ

prime(d+(T minus t))2radicT minus t

minus rK eminus(Tminust)rΦ(dminus(T minus t)) 6 0 minusSt|σ|Φprime(d+(T minus t))

2radicT minus t

+ rK eminus(Tminust)rΦ(minusdminus(T minus t))

Rho (ρ) partg

partr(tSt) K(T minus t) eminus(Tminust)rΦ(dminus(T minus t)) minusK(T minus t) eminus(Tminust)rΦ(minusdminus(T minus t))

Table 61 Black-Scholes Greeks (Wikipedia)

From Table 61 we can conclude that call option prices are increasing func-tions of the underlying asset price St of the interest rate r and of the volatil-ity parameter σ Similarly put option prices are decreasing functions of theunderlying asset price St of the interest rate r and increasing functions ofthe volatility parameter σ

Parameter Variation of call option prices Variation of put option prices

Underlying St increasing decreasing

Volatility σ increasing increasing

Time t decreasing depends on the underlying price level

Interest rate r increasing decreasing

Table 62 Variations of Black-Scholes prices

The change of sign of the sensitivity Theta (Θ) with respect to time t can beverified in the following Figure 616

219

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

(a) Black-Scholes call price maps (b) Black-Scholes put price maps

Fig 616 Time-dependent solutions of the Black-Scholes PDElowast

Intrinsic value The intrinsic value at time t isin [0T ] of the option withpayoff C = h

(S(1)T

)is given by the immediate exercise payoff h

(S(1)t

) The

extrinsic value at time t isin [0T ] of the option is the remaining differenceπt(C) minus h

(S(1)t

)between the option price πt(C) and the immediate ex-

ercise payoff h(S(1)t

) In general the option price πt(C) decomposes as

πt(C) = h(S(1)t

)︸ ︷︷ ︸intrinsic value

+ πt(C)minus h(S(1)t

)︸ ︷︷ ︸

extrinsic value

0 6 t 6 T ]

Gearing The gearing at time t isin [0T ] of the option with payoff C = h(ST )is defined as the ratio

Gt =St

πt(C)=

Stg(tSt)

0 6 t 6 T

Effective gearing The effective gearing at time t isin [0T ] of the option withpayoff C = h(ST ) is defined as the ratio

Get = Gtξt

=ξtStπt(C)

=St

πt(C)

partg

partx(tSt)

=St

g(tSt)partg

partx(tSt)

= Stpart

partxlog g(tSt) 0 6 t 6 T

lowast The animation works in Acrobat Reader on the entire pdf file

220

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

The effective gearingGet =

ξtStπt(C)

can be interpreted as the hedge ratio ie the percentage of the portfoliowhich is invested on the risky asset When written as

∆g(tSt)g(tSt)

= Get times

∆StSt

the effective gearing gives the relative variation or percentage change∆g(tSt)g(tSt) of the option price g(tSt) from the relative variation∆StSt in the underlying asset price

The ratio Get = Stpart log g(tSt)partx can also be interpreted as an elasticity

coefficient

Break-even price The break-even price BEPt of the underlying asset is thevalue of S for which the intrinsic option value h(S) equals the option priceπt(C) at time t isin [0T ] For European call options it is given by

BEPt = K + πt(C) = K + g(tSt) t = 0 1 N

whereas for European put options it is given by

BEPt = K minus πt(C) = K minus g(tSt) 0 6 t 6 T

Premium The option premium OPt can be defined as the variation requiredfrom the underlying asset price in order to reach the break-even price iewe have

OPt =BEPt minus St

St=K + g(tSt)minus St

St 0 6 t 6 T

for European call options and

OPt =St minusBEPt

St=St + g(tSt)minusK

St 0 6 t 6 T

for European put options see Figure 617 below The term ldquopremiumrdquo issometimes also used to denote the arbitrage price g(tSt) of the option

221

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

f (tx σ)100

=

x =

K =

xpart log f

partx=

σ =

partf

partt(tx σ)=

T=

=(xminusK)x

∆ = = partf

partx(tx σ)

= partf

partσ(tx σ)

=K+f (txσ)minusx

x

=K+f (tx σ)

rf=

partf

partt+rxpartf

partx+

σ2 2x2part2f

partx2

Fig 617 Warrant terms and data

The R package bizdays (requires to install QuantLib) can be used to computecalendar time vs business time to maturity1 installpackages(bizdays)

library(bizdays)3 load_quantlib_calendars(HongKong from=2018-01-01 to=2018-12-31)

load_quantlib_calendars(Singapore from=2018-01-01 to=2018-12-31)5 bizdays(2018-03-10 2018-04-03 QuantLibHongKong)

bizdays(2018-03-10 2018-04-03 QuantLibSingapore)

65 The Heat Equation

In the next proposition we notice that the solution f(tx) of the Black-Scholes PDE (67) can be transformed into a solution g(t y) of the simplerheat equation by a change of variable and a time inversion t 7minusrarr T minus t onthe interval [0T ] so that the terminal condition at time T in the Black-Scholes equation (622) becomes an initial condition at time t = 0 in theheat equation (625) See also here for a related discussion on changes ofvariables for the Black-Scholes PDE

222

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

Proposition 68 Assume that f(tx) solves the Black-Scholes PDErf(tx) = partf

partt(tx) + rx

partf

partx(tx) + 1

2σ2x2 part

2f

partx2 (tx)

f(T x) = (xminusK)+(622)

with terminal condition h(x) = (xminusK)+ x gt 0 Then the function g(t y)defined by

g(t y) = ertf(T minus t e|σ|y+(σ22minusr)t) (623)

solves the heat equation (625) with initial condition

ψ(y) = h(

e|σ|y) y isin R (624)

ie we have partg

partt(t y) = 1

2part2g

party2 (t y)

g(0 y) = h(

e|σ|y)

(625)

Proposition 68 will be proved in Section 66 It will allow us to solve theBlack-Scholes PDE (622) based on the solution of the heat equation (625)with initial condition ψ(y) = h

(e|σ|y

) y isin R by inversion of Relation (623)

with s = T minus t x = e|σ|y+(σ22minusr)t ie

f(sx) = eminus(Tminuss)rg(T minus s minus(σ

22minus r)(T minus s) + log x|σ|

)

Next we focus on the heat equation

partϕ

partt(t y) = 1

2part2ϕ

party2 (t y) (626)

which is used to model the diffusion of heat over time through solids Herethe data of g(x t) represents the temperature measured at time t and pointx We refer the reader to Widder (1975) for a complete treatment of thistopic

223

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

Fig 618 Time-dependent solution of the heat equationlowast

Proposition 69 The fundamental solution of the heat equation (626) isgiven by the Gaussian probability density function

ϕ(t y) =1radic2πt

eminusy2(2t) y isin R

with variance t gt 0

Proof The proof is done by a direct calculation as follows

partϕ

partt(t y) = part

partt

(eminusy2(2t)radic

2πt

)

= minus eminusy2(2t)

2t32radic

2π+

y2

2t2eminusy2(2t)radic

2πt

=

(minus 1

2t +y2

2t2

)ϕ(t y)

and

12part2ϕ

party2 (t y) = minus12part

party

(y

t

eminusy2(2t)radic

2πt

)

= minus eminusy2(2t)

2tradic

2πt+

y2

2t2eminusy2(2t)radic

2πt

=

(minus 1

2t +y2

2t2

)ϕ(t y) t gt 0 y isin R

lowast The animation works in Acrobat Reader on the entire pdf file

224

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

In Section 66 the heat equation (626) will be shown to be equivalent to theBlack-Scholes PDE after a change of variables In particular this will lead tothe explicit solution of the Black-Scholes PDE

Proposition 610 The heat equationpartg

partt(t y) = 1

2part2g

party2 (t y)

g(0 y) = ψ(y)

(627)

with continuous initial condition

g(0 y) = ψ(y)

has the solution

g(t y) =winfinminusinfin

ψ(z) eminus(yminusz)2(2t) dzradic2πt

y isin R t gt 0 (628)

Proof We have

partg

partt(t y) = part

partt

winfinminusinfin

ψ(z) eminus(yminusz)2(2t) dzradic2πt

=winfinminusinfin

ψ(z)part

partt

(eminus(yminusz)2(2t)radic

2πt

)dz

=12winfinminusinfin

ψ(z)

((yminus z)2

t2minus 1t

)eminus(yminusz)2(2t) dzradic

2πt

=12winfinminusinfin

ψ(z)part2

partz2 eminus(yminusz)2(2t) dzradic2πt

=12winfinminusinfin

ψ(z)part2

party2 eminus(yminusz)2(2t) dzradic2πt

=12part2

party2

winfinminusinfin

ψ(z) eminus(yminusz)2(2t) dzradic2πt

=12part2g

party2 (t y)

On the other hand it can be checked that at time t = 0 we have

limtrarr0

winfinminusinfin

ψ(z) eminus(yminusz)2(2t) dzradic2πt

= limtrarr0

winfinminusinfin

ψ(y+ z) eminusz2(2t) dzradic2πt

= ψ(y) y isin R

225

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

The next Figure 619 shows the evolution of g(tx) with initial conditionbased on the European call payoff function h(x) = (xminusK)+ ie

g(0 y) = ψ(y) = h(

e|σ|y)=(

e|σ|y minusK)+ y isin R

Fig 619 Time-dependent solution of the heat equationlowast

Let us provide a second proof of Proposition 610 this time using Brownianmotion and stochastic calculus

Proof of Proposition 610 First note that under the change of variable x =z minus y we have

g(t y) =winfinminusinfin

ψ(z) eminus(yminusz)2(2t) dzradic2πt

=winfinminusinfin

ψ(y+ x) eminusx2(2t) dxradic2πt

= IE[ψ(y+Bt)]

= IE[ψ(yminusBt)]

where (Bt)tisinR+ is a standard Brownian motion and Bt N (0 t) t isin R+Applying Itocircrsquos formula and using the fact that the expectation of the stochas-tic integral with respect to Brownian motion is zero see Relation (417) inProposition 420 we find

g(t y) = IE[ψ(yminusBt)]

= ψ(y)minus IE[w t

0ψprime(yminusBs)dBs

]+

12 IE

[w t0ψprimeprime(yminusBs)ds

]= ψ(y) +

12w t

0IE[ψprimeprime(yminusBs)

]ds

lowast The animation works in Acrobat Reader on the entire pdf file

226

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

= ψ(y) +12w t

0part2

party2 IE [ψ(yminusBs)] ds

= ψ(y) +12w t

0part2g

party2 (s y)ds

Hence we have

partg

partt(t y) = part

parttIE[ψ(yminusBt)]

=12part2

party2 IE [ψ(yminusBt)]

=12part2g

party2 (t y)

Regarding the initial condition we check that

g(0 y) = IE[ψ(yminusB0)] = IE[ψ(y)] = ψ(y)

The expression g(t y) = IE[ψ(yminusBt)] provides a probabilistic interpreta-tion of the heat diffusion phenomenon based on Brownian motion Namelywhen ψε(y) = 1[minusεε](y) we find that

gε(t y) = IE[ψε(yminusBt)]= IE[1[minusεε](yminusBt)]= P

(yminusBt isin [minusε ε]

)= P

(yminus ε 6 Bt 6 y+ ε

)represents the probability of finding Bt within a neighborhood [y minus ε y + ε]of the point y isin R

66 Solution of the Black-Scholes PDE

In this section we solve the Black-Scholes PDE by the kernel method of Sec-tion 65 and a change of variables This solution method uses the change ofvariables (623) of Proposition 68 and a time inversion from which the ter-minal condition at time T in the Black-Scholes equation becomes an initialcondition at time t = 0 in the heat equation

Next we state the proof Proposition 68

Proof Letting s = T minus t and x = e|σ|y+(σ22minusr)t and using Relation (623)ie

g(t y) = ertf(T minus t e|σ|y+(σ22minusr)t)

227

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

we have

partg

partt(t y) = r ertf

(T minus t e|σ|y+(σ22minusr)t)minus ert partf

parts

(T minus t e|σ|y+(σ22minusr)t)

+

(σ2

2 minus r)

ert e|σ|y+(σ22minusr)t partf

partx

(T minus t e|σ|y+(σ22minusr)t)

= r ertf(T minus tx)minus ert partfparts

(T minus tx) +(σ2

2 minus r)

ertxpartfpartx

(T minus tx)

=12 ertx2σ2 part

2f

partx2 (T minus tx) +σ2

2 ertxpartfpartx

(T minus tx) (629)

where on the last step we used the Black-Scholes PDE On the other handwe have

partg

party(t y) = |σ| ert e|σ|y+(σ22minusr)t partf

partx

(T minus t e|σ|y+(σ22minusr)t)

and

12partg2

party2 (t y) =σ2

2 ert e|σ|y+(σ22minusr)t partf

partx

(T minus t e|σ|y+(σ22minusr)t)

+σ2

2 ert e2|σ|y+2(σ22minusr)t part2f

partx2(T minus t e|σ|y+(σ22minusr)t)

=σ2

2 ertxpartfpartx

(T minus tx) + σ2

2 ertx2 part2f

partx2 (T minus tx) (630)

We conclude by comparing (629) with (630) which shows that g(tx) solvesthe heat equation (627) with initial condition

g(0 y) = f(T e|σ|y

)= h

(e|σ|y

)

In the next proposition we derive the Black-Scholes formula (610) by solv-ing the PDE (622) The Black-Scholes formula will also be recovered by aprobabilistic argument via the computation of an expected value in Proposi-tion 77

Proposition 611 When h(x) = (x minusK)+ the solution of the Black-Scholes PDE (622) is given by

f(tx) = xΦ(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

) x gt 0

whereΦ(x) =

1radic2π

w xminusinfin

eminusy22dy x isin R

and

228

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

d+(T minus t) =

log(xK) + (r+ σ22)(T minus t)|σ|radicT minus t

dminus(T minus t) =log(xK) + (rminus σ22)(T minus t)

|σ|radicT minus t

x gt 0 t isin [0T )

Proof By inversion of Relation (623) with s = T minus t and x = e|σ|y+(σ22minusr)twe get

f(sx) = eminus(Tminuss)rg(T minus s minus(σ

22minus r)(T minus s) + log x|σ|

)and

h(x) = ψ

(log x|σ|

) x gt 0 or ψ(y) = h

(e|σ|y

) y isin R

Hence using the solution (628) and Relation (624) we get

f(tx) = eminus(Tminust)rg(T minus t minus(σ

22minus r)(T minus t) + log x|σ|

)= eminus(Tminust)r

winfinminusinfin

ψ

(minus(σ22minus r)(T minus t) + log x

|σ|+ z

)eminusz2(2(Tminust)) dzradic

2(T minus t)π

= eminus(Tminust)rwinfinminusinfin

h(x e|σ|zminus(σ22minusr)(Tminust)) eminusz2(2(Tminust)) dzradic

2(T minus t)π

= eminus(Tminust)rwinfinminusinfin

(x e|σ|zminus(σ22minusr)(Tminust) minusK

)+ eminusz2(2(Tminust)) dzradic2(T minus t)π

= eminus(Tminust)r

timeswinfin

(minusr+σ22)(Tminust)+log(Kx)|σ|

(x e|σ|zminus(σ22minusr)(Tminust) minusK

)eminusz2(2(Tminust)) dzradic

2(T minus t)π

= x eminus(Tminust)rwinfinminusdminus(Tminust)

radicTminust

e|σ|zminus(σ22minusr)(Tminust) eminusz2(2(Tminust)) dzradic2(T minus t)π

minusK eminus(Tminust)rwinfinminusdminus(Tminust)

radicTminust

eminusz2(2(Tminust)) dzradic2(T minus t)π

= xwinfinminusdminus(Tminust)

radicTminust

e|σ|zminus(Tminust)σ22minusz2(2(Tminust)) dzradic2(T minus t)π

minusK eminus(Tminust)rwinfinminusdminus(Tminust)

radicTminust

eminusz2(2(Tminust)) dzradic2(T minus t)π

= xwinfinminusdminus(Tminust)

radicTminust

eminus(zminus(Tminust)|σ|)2(2(Tminust)) dzradic2(T minus t)π

229

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

minusK eminus(Tminust)rwinfinminusdminus(Tminust)

radicTminust

eminusz2(2(Tminust)) dzradic2(T minus t)π

= xwinfinminusdminus(Tminust)

radicTminustminus(Tminust)|σ|

eminusz2(2(Tminust)) dzradic2(T minus t)π

minusK eminus(Tminust)rwinfinminusdminus(Tminust)

radicTminust

eminusz2(2(Tminust)) dzradic2(T minus t)π

= xwinfinminusdminus(Tminust)minus|σ|

radicTminust

eminusz22 dzradic2πminusK eminus(Tminust)r

winfinminusdminus(Tminust)

eminusz22 dzradic2π

= x(1minusΦ

(minus d+(T minus t)

))minusK eminus(Tminust)r

(1minusΦ

(minus dminus(T minus t)

))= xΦ

(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)

where we used the relation (614) ie

1minusΦ(a) = Φ(minusa) a isin R

Exercises

Exercise 61 Bachelier (1900) model Consider a market made of a risklessasset valued At = A0 with zero interest rate t isin R+ and a risky asset whoseprice St is modeled by a standard Brownian motion as St = Bt t isin R+

a) Show that the price g(tBt) of the option with payoff C = B2T satisfies

the heat equationpartϕ

partt(t y) = minus1

2part2ϕ

party2 (t y)

with terminal condition g(T x) = x2b) Find the function g(tx) by solving the PDE of Question (a)

Hint Try a solution of the form g(tx) = x2 + f(t)

See Exercises 611 713 and 714 for extensions to nonzero interest rates

Exercise 62 Consider a risky asset price (St)tisinR modeled in the Cox et al(1985) (CIR) model as

dSt = β(αminus St)dt+ σradicStdBt αβσ gt 0 (631)

and let (ηt ξt)tisinR+ be a portfolio strategy whose value Vt = ηtAt + ξtSttakes the form Vt = g(tSt) t isin R+ Figure 620 presents a random simula-tion of the solution to (631) with α = 0025 β = 1 and σ = 13230

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

0

1

2

3

4

5

6

7

8

0 01 02 03 04 05 06 07 08 09 1

St

t

Fig 620 Graph of the CIR short rate t 7rarr rt with α = 25 β = 1 and σ = 13

N=10000 t lt- 0(N-1) dt lt- 10Na=0025 b=2 sigma=0052 X lt- rnorm(Nmean=0sd=sqrt(dt))R lt- rep(0N)R[1]=001

for (j in 2N)R[j]=max(0R[j-1]+(a-bR[j-1])dt+sigmasqrt(R[j-1])X[j])4 plot(t R xlab = t ylab = type = l ylim = c(0002) col = blue)

Based on the self-financing condition written as

dVt = rVtdtminus rξtStdt+ ξtdSt

= rVtdtminus rξtStdt+ β(αminus St)ξtdt+ σξtradicStdBt t isin R+ (632)

derive the PDE satisfied by the function g(tx) using the Itocirc formula

Exercise 63 Black-Scholes PDE with dividends Consider a riskless as-set with price At = A0 ert t isin R+ and an underlying asset price process(St)tisinR+ modeled as

dSt = (microminus δ)Stdt+ σStdBt

where (Bt)tisinR+ is a standard Brownian motion and δ gt 0 is a continuous-time dividend rate By absence of arbitrage the payment of a dividend entailsa drop in the stock price by the same amount occuring generally on the ex-dividend date on which the purchase of the security no longer entitles theinvestor to the dividend amount The list of investors entitled to dividendpayment is consolidated on the date of record and payment is made on thepayable date

library(quantmod)2 getSymbols(0005HKfrom=2010-01-01to=SysDate()src=yahoo)

getDividends(0005HKfrom=2010-01-01to=SysDate()src=yahoo)

a) Assuming that the portfolio with value Vt = ξtSt + ηtAt at time t is self-financing and that dividends are continuously reinvested write down theportfolio variation dVt

231

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

b) Assuming that the portfolio value Vt takes the form Vt = g(tSt) at timet derive the Black-Scholes PDE for the function g(tx) with its terminalcondition

c) Compute the price at time t isin [0T ] of the European call option withstrike price K by solving the corresponding Black-Scholes PDE

d) Compute the Delta of the option

Exercise 64

a) Check that the Black-Scholes formula (610) for European call options

gc(tx) = xΦ(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)

satisfies the following boundary conditions

i) at x = 0 gc(t 0) = 0ii) at maturity t = T

gc(T x) = (xminusK)+ =

xminusK x gt K

0 x 6 K

iii) as time to maturity tends to infinity

limTrarrinfin

Bl(Kxσ rT minus t) = x t isin R+

b) Check that the Black-Scholes formula (618) for European put options

gp(tx) = K eminus(Tminust)rΦ(minus dminus(T minus t)

)minus xΦ

(minus d+(T minus t)

)satisfies the following boundary conditions

i) at x = 0 gp(t 0) = K eminus(Tminust)rii) as x tends to infinity gp(tinfin) = 0 for all t isin [0T )iii) at maturity t = T

gp(T x) = (K minus x)+ =

0 x gt K

K minus x x 6 K

iv) as time to maturity tends to infinity

limTrarrinfin

Blp(KStσ rT minus t) = 0 t isin R+

Exercise 65 Power option (Exercise 314 continued)

232

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

a) Solve the Black-Scholes PDE

rg(x t) = partg

partt(x t) + rx

partg

partx(x t) + σ2

2 x2 part2g

partx2 (x t) (633)

with terminal condition g(xT ) = x2 x gt 0 t isin [0T ]

Hint Try a solution of the form g(x t) = x2f(t) and find f(t)b) Find the respective quantities ξt and ηt of the risky asset St and riskless

asset At = ert in the portfolio with value

Vt = g(St t) = ξtSt + ηtAt 0 6 t 6 T

hedging the contract with payoff S2T at maturity

Exercise 66 On December 18 2007 a call warrant has been issued byFortis Bank on the stock price S of the MTR Corporation with maturityT = 23122008 strike price K = HK$ 3608 and entitlement ratio=10Recall that in the Black-Scholes model the price at time t of the Europeanclaim on the underlying asset priced St with strike price K maturity T interest rate r and volatility σ gt 0 is given by the Black-Scholes formula as

f(tSt) = StΦ(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)

wheredminus(T minus t) =

(rminus σ22)(T minus t) + log(StK)

|σ|radicT minus t

d+(T minus t) = dminus(T minus t) + |σ|radicT minus t = (r+ σ22)(T minus t) + log(StK)

|σ|radicT minus t

Recall that by Proposition 64 we have

partf

partx(tSt) = Φ

(d+(T minus t)

) 0 6 t 6 T

a) Using the values of the Gaussian cumulative distribution function com-pute the Black-Scholes price of the corresponding call option at timet =November 07 2008 with St = HK$ 17200 assuming a volatility σ =90 = 090 and an annual risk-free interest rate r = 4377 = 004377

b) Still using the Gaussian cumulative distribution function compute thequantity of the risky asset required in your portfolio at time t =November07 2008 in order to hedge one such option at maturity T = 23122008

c) Figure 1 represents the Black-Scholes price of the call option as a functionof σ isin [05 15] = [50 150]

233

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

0

01

02

03

04

05

06

05 06 07 08 09 1 11 12 13 14 15σimp

Optio

n pr

ice

σ

Market price

Fig 621 Option price as a function of the volatility σ gt 0

1 BSCall lt- function(S K r T sigma)d1 lt- (log(SK)+(r+sigma^22)T)(sigmasqrt(T))d2 lt- d1 - sigma sqrt(T)

3 BSCall = Spnorm(d1) - Kexp(-rT)pnorm(d2)BSCallsigma lt- seq(0515 length=100)

5 plot(sigmaBSCall(172360800437746365sigma) type=llty=1 xlab=Sigmaylab=Black-Scholes Call Price ylim = c(006)col=bluelwd=3)grid()

abline(h=023col=redlwd=3)

Knowing that the closing price of the warrant on November 07 2008 wasHK$ 0023 which value can you infer for the implied volatility σ at thisdatelowast

Exercise 67 Forward contracts Recall that the price πt(C) of a claimpayoff C = h(ST ) of maturity T can be written as πt(C) = g(tSt) wherethe function g(tx) satisfies the Black-Scholes PDE

rg(tx) = partg

partt(tx) + rx

partg

partx(tx) + 1

2σ2x2 part

2g

partx2 (tx)

g(T x) = h(x) (1)

with terminal condition g(T x) = h(x) x gt 0

a) Assume that C is a forward contract with payoff

C = ST minusK

at time T Find the function h(x) in (1)b) Find the solution g(tx) of the above PDE and compute the price πt(C)

at time t isin [0T ]Hint search for a solution of the form g(tx) = xminus α(t) where α(t) is afunction of t to be determined

lowast Download the corresponding or the that can be runhere

234

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

BS lt- function(S K T r sig)d1 lt- (log(SK) + (r + sig^22)T) (sigsqrt(T))d2 lt- d1 - sigsqrt(T)return(Spnorm(d1) - Kexp(-rT)pnorm(d2))impliedvol lt- function(S K T r market)sig lt- 020sigup lt- 1sigdown lt- 0001count lt- 0err lt- BS(S K T r sig) - marketwhile(abs(err) gt 000001 ampamp countlt1000)if(err lt 0)sigdown lt- sigsig lt- (sigup + sig)2elsesigup lt- sigsig lt- (sigdown + sig)2err lt- BS(S K T r sig) - marketcount lt- count + 1if(count==2000)return(NA)elsereturn(sig)market = 083K = 628T = 7 365S = 634r = 002impliedvol(S K T r market)

cells [ cell_type code execution_count null metadata outputs [] source [ from IPythoncoredisplay import display HTMLn display(HTML( )) ] cell_type code execution_count null metadata collapsed true outputs [] source [ import numpy as npn import scipystats as ssn import time n n Black and Scholesn def d1(S0 K r sigma T)n return (nplog(S0K) + (r + sigma2 2) T)(sigma npsqrt(T))n n def d2(S0 K r sigma T)n return (nplog(S0 K) + (r - sigma2 2) T) (sigma npsqrt(T))n n def BlackScholes(typeS0 K r sigma T)n if type==Cn return S0 ssnormcdf(d1(S0 K r sigma T)) - K npexp(-r T) ssnormcdf(d2(S0 K r sigma T))n elsen return K npexp(-r T) ssnormcdf(-d2(S0 K r sigma T)) - S0 ssnormcdf(-d1(S0 K r sigma T)) ] cell_type code execution_count null metadata outputs [] source [ BlackScholes(C1000 1200 002 015 10) ] cell_type code execution_count null metadata outputs [] source [ def difference(x p S K r t)n return BlackScholes(CS K r x t) - p ] cell_type code execution_count null metadata outputs [] source [ from scipyoptimize import bisectn bisect(difference00011args=(11541763731112766 1000 1200 002 10)) ] ] metadata anaconda-cloud kernelspec display_name Python 3 language python name python3 language_info codemirror_mode name ipython version 3 file_extension py mimetype textx-python name python nbconvert_exporter python pygments_lexer ipython3 version 375rc1 nbformat 4 nbformat_minor 1

Black-Scholes Pricing and Hedging

c) Compute the quantityξt =

partg

partx(tSt)

of risky assets in a self-financing portfolio hedging Cd) Repeat the above questions with the terminal condition g(T x) = x

Exercise 68a) Solve the Black-Scholes PDE

rg(tx) = partg

partt(tx) + rx

partg

partx(tx) + σ2

2 x2 part2g

partx2 (tx) (634)

with terminal condition g(T x) = 1 x gt 0

Hint Try a solution of the form g(tx) = f(t) and find f(t)

b) Find the respective quantities ξt and ηt of the risky asset St and risklessasset At = ert in the portfolio with value

Vt = g(tSt) = ξtSt + ηtAt

hedging the contract with payoff $1 at maturity

Exercise 69 Log-contracts see also Exercise 84a) Solve the PDE

0 =partg

partt(x t) + rx

partg

partx(x t) + σ2

2 x2 part2g

partx2 (x t)

with the terminal condition g(xT ) = log x x gt 0

Hint Try a solution of the form g(x t) = f(t) + log x and find f(t)b) Solve the Black-Scholes PDE

rh(x t) = parth

partt(x t) + rx

parth

partx(x t) + σ2

2 x2 part2h

partx2 (x t) (635)

with the terminal condition h(xT ) = log x x gt 0

Hint Try a solution of the form h(x t) = u(t)g(x t) and find u(t)c) Find the respective quantities ξt and ηt of the risky asset St and riskless

asset At = ert in the portfolio with value

Vt = g(St t) = ξtSt + ηtAt

hedging a log-contract with payoff logST at maturity 235

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

Exercise 610 Binary options Consider a price process (St)tisinR+ given by

dStSt

= rdt+ σdBt S0 = 1

under the risk-neutral probability measure Plowast The binary (or digital) calloption is a contract with maturity T strike price K and payoff

Cd = 1[Kinfin)(ST ) =

$1 if ST gt K

0 if ST lt K

a) Derive the Black-Schole PDE satisfied by the pricing function Cd(tSt) ofthe binary call option together with its terminal condition

b) Show that the solution Cd(tx) of the Black-Scholes PDE of Question (a)is given by

Cd(tx) = eminus(Tminust)rΦ((rminus σ22)(T minus t) + log(xK)

|σ|radicT minus t

)= eminus(Tminust)rΦ

(dminus(T minus t)

)

where

dminus(T minus t) =(rminus σ22)(T minus t) + log(StK)

|σ|radicT minus t

0 6 t lt T

Exercise 611

a) Bachelier (1900) model Solve the stochastic differential equation

dSt = αStdt+ σdBt (636)

in terms of ασ isin R and the initial condition S0b) Write down the Bachelier PDE satisfied by the function C(tx) where

C(tSt) is the price at time t isin [0T ] of the contingent claim with payoffφ(ST ) = exp(ST ) and identify the process Delta (ξt)tisin[0T ] that hedgesthis claim

c) Solve the Black-Scholes PDE of Question (b) with the terminal conditionφ(x) = ex x isin R

Hint Search for a solution of the form

C(tx) = exp(minus(T minus t)r+ xh(t) +

σ2

4r (h2(t)minus 1)

) (637)

where h(t) is a function to be determined with h(T ) = 1

236

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

d) Compute the portfolio strategy (ξt ηt)tisin[0T ] that hedges the contingentclaim with payoff exp(ST )

Exercise 612

a) Show that for every fixed value of S the function

d 7minusrarr h(S d) = SΦ(d+ |σ|

radicT)minusK eminusrTΦ(d)

reaches its maximum at dlowast(S) =log(SK) + (rminus σ22)T

|σ|radicT

b) By the differentiation rule

d

dSh(S dlowast(S)) =

parth

partS(S dlowast(S)) + dprimelowast(S)

parth

partd(S dlowast(S))

recover the value of the Black-Scholes Delta

Exercise 613 Compute the Black-Scholes Vega by differentiation of theBlack-Scholes function

gc(tx) = Bl(Kxσ rT minus t) = xΦ(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)

with respect to the volatility parameter σ knowing that

minus12(dminus(T minus t)

)2= minus1

2

(log(xK) + (rminus σ22)(T minus t)

|σ|radicT minus t

)2

= minus12(d+(T minus t)

)2+ (T minus t)r+ log x

K (638)

Exercise 614 Consider the backward induction relation (313) ie

v(tx) = (1minus plowastN )v (t+ 1x(1 + aN )) + plowastN v (t+ 1x(1 + bN ))

using the renormalizations rN = rTN and

aN = (1 + rN )(1minus |σ|radicTN)minus 1 bN = (1 + rN )(1 + |σ|

radicTN)minus 1

of Section 36 N gt 1 with

plowastN =rN minus aNbN minus aN

and plowastN =bN minus rNbN minus aN

a) Show that the Black-Scholes PDE (62) of Proposition 61 can be recoveredfrom the induction relation (313) when the number N of time steps tendsto infinity

237

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

b) Show that the expression of the Delta ξt =partgcpartx

(tSt) can be similarlyrecovered from the finite difference relation (319) ie

ξ(1)t (Stminus1) =

v (t (1 + bN )Stminus1)minus v (t (1 + aN )Stminus1)

Stminus1(bN minus aN )

as N tends to infinity

Problem 615 (Leung and Sircar (2015)) ProShares Ultra SampP500 andProShares UltraShort SampP500 are leveraged investment funds that seek dailyinvestment results before fees and expenses that correspond to β times (βx)the daily performance of the SampP500reg with respectively β = 2 for ProSharesUltra and β = minus2 for ProShares UltraShort Here leveraging with a factorβ 1 aims at multiplying the potential return of an investment by a factorβ The following 10 questions are interdependent and should be treated insequence

a) Consider a risky asset priced S0 = $4 at time t = 0 and taking twopossible values S1 = $5 and S1 = $2 at time t = 1 Compute the twopossible returns (in ) achieved when investing $4 in one share of the assetS and the expected return under the risk-neutral probability measureassuming that the risk-free interest rate is zero

b) Leveraging Still based on an initial $4 investment we decide to leverageby a factor β = 3 by borrowing another (β minus 1) times $4 = 2times $4 at ratezero to purchase a total of β = 3 shares of the asset S Compute thetwo returns (in ) possibly achieved in this case and the expected returnunder the risk-neutral probability measure assuming that the risk-freeinterest rate is zero

c) Denoting by Ft the ProShares value at time t how much should the fundinvest in the underlying asset priced St and how much $ should it borrowor save on the risk-free market at any time t in order to leverage with afactor β 1

d) Find the portfolio allocation (ξt ηt) for the fund value

Ft = ξtSt + ηtAt t isin R+

according to Question (c) where At = A0 ert is the riskless money marketaccount

e) We choose to model the SampP500 index St as the geometric Brownianmotion

dSt = rStdt+ σStdBt t isin R+

under the risk-neutral probability measure Plowast Find the stochastic dif-ferential equation satisfied by (Ft)tisinR+ under the self-financing conditiondFt = ξtdSt + ηtdAt

238

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

f) Is the discounted fund value ( eminusrtFt)tisinR+ a martingale under the risk-neutral probability measure Plowast

g) Find the relation between the fund value Ft and the index St by solvingthe stochastic differential equation obtained for Ft in Question (e) Forsimplicity we normalize F0 = Sβ0

h) Write the price at time t = 0 of the call option with payoff (FT minusK)+ onthe ProShares index using the Black-Scholes formula

i) Show that when β gt 0 the Delta at time t isin [0T ) of the call optionwith payoff (FT minusK)+ on ProShares Ultra is equal to the Delta of thecall option with payoff (ST minusKβ(t))

+ on the SampP500 for a certain strikeprice Kβ(t) to be determined explicitly

j) When β lt 0 find the relation between the Delta at time t isin [0T ) ofthe call option with payoff (FT minusK)+ on ProShares UltraShort and theDelta of the put option with payoff (Kβ(t)minus ST )+ on the SampP500

239

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

  1. pbsARFix223
  2. pbsARFix224
  3. pbsARFix225
  4. pbsARFix226
  5. pbsARFix227
  6. pbsARFix228
  7. pbsARFix229
  8. pbsARFix230
  9. fdrm1
  10. pbsARFix231
  11. 100
  12. 101
  13. 102
  14. 103
  15. 104
  16. 105
  17. 106
  18. 107
  19. 108
  20. 109
  21. 1010
  22. 1011
  23. 1012
  24. 1013
  25. 1014
  26. 1015
  27. 1016
  28. 1017
  29. 1018
  30. 1019
  31. anm10
  32. 10EndLeft
  33. 10StepLeft
  34. 10PauseLeft
  35. 10PlayLeft
  36. 10PlayPauseLeft
  37. 10PauseRight
  38. 10PlayRight
  39. 10PlayPauseRight
  40. 10StepRight
  41. 10EndRight
  42. 10Minus
  43. 10Reset
  44. 10Plus
  45. pbsARFix232
  46. pbsARFix233
  47. pbsARFix234
  48. pbsARFix235
  49. pbsARFix236
  50. pbsARFix237
  51. fdrm2
  52. 110
  53. 111
  54. 112
  55. 113
  56. 114
  57. 115
  58. 116
  59. 117
  60. 118
  61. 119
  62. 1110
  63. 1111
  64. 1112
  65. 1113
  66. 1114
  67. 1115
  68. 1116
  69. 1117
  70. 1118
  71. 1119
  72. anm11
  73. 11EndLeft
  74. 11StepLeft
  75. 11PauseLeft
  76. 11PlayLeft
  77. 11PlayPauseLeft
  78. 11PauseRight
  79. 11PlayRight
  80. 11PlayPauseRight
  81. 11StepRight
  82. 11EndRight
  83. 11Minus
  84. 11Reset
  85. 11Plus
  86. pbsARFix238
  87. pbsARFix239
  88. pbsARFix240
  89. pbsARFix241
  90. pbsARFix242
  91. 120
  92. 121
  93. 122
  94. 123
  95. 124
  96. 125
  97. 126
  98. 127
  99. 128
  100. 129
  101. 1210
  102. anm12
  103. 12EndLeft
  104. 12StepLeft
  105. 12PauseLeft
  106. 12PlayLeft
  107. 12PlayPauseLeft
  108. 12PauseRight
  109. 12PlayRight
  110. 12PlayPauseRight
  111. 12StepRight
  112. 12EndRight
  113. 12Minus
  114. 12Reset
  115. 12Plus
  116. 130
  117. 131
  118. 132
  119. 133
  120. 134
  121. 135
  122. 136
  123. 137
  124. 138
  125. 139
  126. 1310
  127. anm13
  128. 13EndLeft
  129. 13StepLeft
  130. 13PauseLeft
  131. 13PlayLeft
  132. 13PlayPauseLeft
  133. 13PauseRight
  134. 13PlayRight
  135. 13PlayPauseRight
  136. 13StepRight
  137. 13EndRight
  138. 13Minus
  139. 13Reset
  140. 13Plus
  141. pbsARFix243
  142. pbsARFix244
  143. pbsARFix245
  144. pbsARFix246
  145. 140
  146. 141
  147. 142
  148. 143
  149. 144
  150. 145
  151. 146
  152. 147
  153. 148
  154. 149
  155. 1410
  156. 1411
  157. 1412
  158. 1413
  159. 1414
  160. 1415
  161. 1416
  162. 1417
  163. 1418
  164. 1419
  165. 1420
  166. 1421
  167. 1422
  168. 1423
  169. 1424
  170. 1425
  171. 1426
  172. 1427
  173. 1428
  174. 1429
  175. 1430
  176. 1431
  177. 1432
  178. 1433
  179. 1434
  180. 1435
  181. 1436
  182. 1437
  183. 1438
  184. 1439
  185. 1440
  186. 1441
  187. 1442
  188. 1443
  189. 1444
  190. 1445
  191. 1446
  192. 1447
  193. 1448
  194. 1449
  195. 1450
  196. 1451
  197. 1452
  198. 1453
  199. 1454
  200. 1455
  201. 1456
  202. 1457
  203. 1458
  204. 1459
  205. 1460
  206. 1461
  207. 1462
  208. 1463
  209. 1464
  210. 1465
  211. 1466
  212. 1467
  213. 1468
  214. 1469
  215. 1470
  216. 1471
  217. 1472
  218. 1473
  219. 1474
  220. 1475
  221. 1476
  222. 1477
  223. 1478
  224. 1479
  225. 1480
  226. 1481
  227. 1482
  228. 1483
  229. 1484
  230. 1485
  231. 1486
  232. 1487
  233. 1488
  234. 1489
  235. 1490
  236. 1491
  237. 1492
  238. 1493
  239. 1494
  240. 1495
  241. 1496
  242. 1497
  243. 1498
  244. 1499
  245. 14100
  246. 14101
  247. 14102
  248. 14103
  249. 14104
  250. 14105
  251. 14106
  252. 14107
  253. 14108
  254. 14109
  255. 14110
  256. 14111
  257. 14112
  258. 14113
  259. 14114
  260. 14115
  261. 14116
  262. 14117
  263. 14118
  264. 14119
  265. 14120
  266. 14121
  267. 14122
  268. 14123
  269. 14124
  270. 14125
  271. 14126
  272. 14127
  273. 14128
  274. 14129
  275. 14130
  276. 14131
  277. 14132
  278. 14133
  279. 14134
  280. 14135
  281. 14136
  282. 14137
  283. 14138
  284. 14139
  285. 14140
  286. 14141
  287. 14142
  288. 14143
  289. 14144
  290. 14145
  291. 14146
  292. 14147
  293. 14148
  294. 14149
  295. 14150
  296. 14151
  297. 14152
  298. 14153
  299. 14154
  300. 14155
  301. 14156
  302. 14157
  303. 14158
  304. 14159
  305. 14160
  306. 14161
  307. 14162
  308. 14163
  309. 14164
  310. 14165
  311. 14166
  312. 14167
  313. 14168
  314. 14169
  315. 14170
  316. 14171
  317. 14172
  318. 14173
  319. 14174
  320. 14175
  321. 14176
  322. 14177
  323. 14178
  324. 14179
  325. 14180
  326. 14181
  327. 14182
  328. 14183
  329. 14184
  330. 14185
  331. 14186
  332. 14187
  333. 14188
  334. 14189
  335. 14190
  336. 14191
  337. 14192
  338. 14193
  339. 14194
  340. 14195
  341. 14196
  342. 14197
  343. anm14
  344. 14EndLeft
  345. 14StepLeft
  346. 14PauseLeft
  347. 14PlayLeft
  348. 14PlayPauseLeft
  349. 14PauseRight
  350. 14PlayRight
  351. 14PlayPauseRight
  352. 14StepRight
  353. 14EndRight
  354. 14Minus
  355. 14Reset
  356. 14Plus
  357. pbsARFix247
  358. pbsARFix248
  359. 150
  360. 151
  361. 152
  362. 153
  363. 154
  364. 155
  365. 156
  366. 157
  367. 158
  368. 159
  369. 1510
  370. 1511
  371. 1512
  372. 1513
  373. 1514
  374. 1515
  375. 1516
  376. 1517
  377. 1518
  378. 1519
  379. anm15
  380. 15EndLeft
  381. 15StepLeft
  382. 15PauseLeft
  383. 15PlayLeft
  384. 15PlayPauseLeft
  385. 15PauseRight
  386. 15PlayRight
  387. 15PlayPauseRight
  388. 15StepRight
  389. 15EndRight
  390. 15Minus
  391. 15Reset
  392. 15Plus
  393. pbsARFix249
  394. pbsARFix250
  395. pbsARFix251
  396. pbsARFix252
  397. pbsARFix253
  398. pbsARFix254
  399. pbsARFix255
  400. pbsARFix256
  401. pbsARFix257
  402. pbsARFix258
  403. pbsARFix259
  404. pbsARFix260
  405. pbsARFix261
Page 3: Black-ScholesPricingandHedging - NTU · to the Black-Scholes PDE (6.2) in order to price a claim payoff Cof the formC= h(S T).Asinthediscrete-timecase,thearbitragepriceπt(C) at

Black-Scholes Pricing and Hedging

In the sequel we start by deriving the Black and Scholes (1973) Partial Dif-ferential Equation (PDE) for the value of a self-financing portfolio Note thatthe drift parameter micro in (61) is absent in the PDE (62) and it does notappear as well in the Black and Scholes (1973) formula (610)Proposition 61 Let (ηt ξt)tisinR+ be a portfolio strategy such that

(i) the porfolio strategy (ηt ξt)tisinR+ is self-financing

(ii) the portfolio value Vt = ηtAt + ξtSt takes the form

Vt = g(tSt) t isin R+

for some function g isin C12(R+ timesR+) of t and StThen the function g(tx) satisfies the Black and Scholes (1973) PDE

rg(tx) = partg

partt(tx) + rx

partg

partx(tx) + 1

2σ2x2 part

2g

partx2 (tx) x gt 0 (62)

and ξt = ξt(St) is given by the partial derivative

ξt = ξt(St) =partg

partx(tSt) t isin R+ (63)

Proof (i) First we note that the self-financing condition (58) in Proposi-tion 59 implies

dVt = ηtdAt + ξtdSt

= rηtAtdt+ microξtStdt+ σξtStdBt (64)= rVtdt+ (microminus r)ξtStdt+ σξtStdBt

= rg(tSt)dt+ (microminus r)ξtStdt+ σξtStdBt

t isin R+ We now rewrite (518) under the form of an Itocirc process

St = S0 +w t

0vsds+

w t0usdBs t isin R+

as in (422) by taking

ut = σSt and vt = microSt t isin R+

(ii) By (424) the application of Itocircrsquos formula Theorem 423 to Vt = g(tSt)leads to

dVt = dg(tSt)

=partg

partt(tSt)dt+

partg

partx(tSt)dSt +

12 (dSt)

2 part2g

partx2 (tSt) 203

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

=partg

partt(tSt)dt+ vt

partg

partx(tSt)dt+ ut

partg

partx(tSt)dBt +

12 |ut|

2 part2g

partx2 (tSt)dt

=partg

partt(tSt)dt+ microSt

partg

partx(tSt)dt+

12σ

2S2tpart2g

partx2 (tSt)dt+ σStpartg

partx(tSt)dBt

(65)

By respective identification of the terms in dBt and dt in (64) and (65) wegetrg(tSt)dt+ (microminus r)ξtStdt =

partg

partt(tSt)dt+ microSt

partg

partx(tSt)dt+

12σ

2S2tpart2g

partx2 (tSt)dt

ξtStσdBt = Stσpartg

partx(tSt)dBt

hence rg(tSt) =

partg

partt(tSt) + rSt

partg

partx(tSt) +

12σ

2S2tpart2g

partx2 (tSt)

ξt =partg

partx(tSt) 0 6 t 6 T

(66)

which yields (62) after substituting St with x gt 0

The derivative giving ξt in (63) is called the Delta of the option price seeProposition 64 below The amount invested on the riskless asset is

ηtAt = Vt minus ξtSt = g(tSt)minus Stpartg

partx(tSt)

and ηt is given by

ηt =Vt minus ξtSt

At

=1At

(g(tSt)minus St

partg

partx(tSt)

)=

1A0 ert

(g(tSt)minus St

partg

partx(tSt)

)

In the next Proposition 62 we add a terminal condition g(T x) = f(x)to the Black-Scholes PDE (62) in order to price a claim payoff C of theform C = h(ST ) As in the discrete-time case the arbitrage price πt(C) attime t isin [0T ] of the claim payoff C is defined to be the value Vt of theself-financing portfolio hedging C

Proposition 62 The arbitrage price πt(C) at time t isin [0T ] of the (vanilla)option with payoff C = h(ST ) is given by πt(C) = g(tSt) and the hedging

204

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

allocation ξt is given by the partial derivative (63) where the function g(tx)is solution of the following Black-Scholes PDE

rg(tx) = partg

partt(tx) + rx

partg

partx(tx) + 1

2σ2x2 part

2g

partx2 (tx)

g(T x) = h(x) x gt 0(67)

Proof Proposition 61 shows that the solution g(tx) of (62) g isin C12(R+timesR+) represents the value Vt = ηtAt + ξtSt = g(tSt) t isin R+ of a self-financing portfolio strategy (ηt ξt)tisinR+ By Definition 31 πt(C) = Vt =g(tSt) is the arbitrage price at time t isin [0T ] of the vanilla option withpayoff C = h(ST )

The absence of the drift parameter micro from the PDE (67) can be understoodin the next forward contract example in which the claim payoff can be hedgedby leveraging on the value St of the underlying asset independently of thetrend parameter micro

Example - forward contracts

When C = ST minusK is the (linear) payoff function of a long forward contractie h(x) = xminusK the Black-Scholes PDE (67) admits the easy solution

g(tx) = xminusK eminus(Tminust)r x gt 0 0 6 t 6 T (68)

showing that the price at time t of the forward contract with payoff C =ST minusK is

St minusK eminus(Tminust)r x gt 0 0 6 t 6 T

In addition the Delta of the option price is given by

ξt =partg

partx(tSt) = 1 0 6 t 6 T

which leads to a static ldquohedge and forgetrdquo strategy cf Exercise 67 Theforward contract can be realized by the option issuer as followsa) At time t receive the option premium Vt = St minus eminus(Tminust)rK from the

option buyerb) Borrow eminus(Tminust)rK from the bank to be refunded at maturityc) Buy the risky asset using the amount Stminus eminus(Tminust)rK + eminus(Tminust)rK = Std) Hold the risky asset until maturity (do nothing constant portfolio strat-

egy)e) At maturity T hand in the asset to the option holder who will pay the

amount K in return 205

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

f) Use the amountK = e(Tminust)r eminus(Tminust)rK to refund the lender of eminus(Tminust)rKborrowed at time t

Another way to compute the option premium Vt is to state that the amountVtminusSt has to be borrowed at time t in order to purchase the asset and thatthe asset price K received at maturity T should be used to refund the loanwhich yields

(Vt minus St) eminus(Tminust)r = K 0 6 t 6 T

Forward contracts can be used for physical delivery eg for live cattle In thecase of European options the basic ldquohedge and forgetrdquo constant strategy

ξt = 1 ηt = η0 0 6 t 6 T

will hedge the option only if

ST + η0AT gt (ST minusK)+

ie if minusη0AT 6 K 6 ST

Future contracts

For a future contract expiring at time T we take K = S0 erT and the contractis usually quoted at time t in terms of the forward price

e(Tminust)r(St minusK eminus(Tminust)r

)= e(Tminust)rSt minusK = e(Tminust)rSt minus S0 erT

discounted at time T or simply using e(Tminust)rSt Future contracts are non-deliverable forward contracts which are ldquomarked to marketrdquo at each timestep via a cash flow exchange between the two parties ensuring that theabsolute difference | e(Tminust)rSt minusK| is being credited to the buyerrsquos accountif e(Tminust)rSt gt K or to the sellerrsquos account if e(Tminust)rSt lt K

62 European Call Options

Recall that in the case of the European call option with strike price K thepayoff function is given by h(x) = (xminusK)+ and the Black-Scholes PDE (67)reads

rgc(tx) =partgcpartt

(tx) + rxpartgcpartx

(tx) + 12σ

2x2 part2gcpartx2 (tx)

gc(T x) = (xminusK)+(69)

The next proposition will be proved in Sections 65 and 66 see Proposi-tion 611

206

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

Proposition 63 The solution of the PDE (69) is given by the Black-Scholes formula for call options

gc(tx) = Bl(Kxσ rT minus t) = xΦ(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)

(610)with

d+(T minus t) =log(xK) + (r+ σ22)(T minus t)

|σ|radicT minus t

(611)

dminus(T minus t) =log(xK) + (rminus σ22)(T minus t)

|σ|radicT minus t

0 6 t lt T (612)

We note the relation

d+(T minus t) = dminus(T minus t) + |σ|radicT minus t 0 6 t lt T (613)

Here ldquologrdquo denotes the natural logarithm ldquolnrdquo and

Φ(x) = P(X 6 x) =1radic2π

w xminusinfin

eminusy22dy x isin R

denotes the standard Gaussian Cumulative Distribution Function (CDF) ofa standard normal random variable X N (0 1) with the relation

Φ(minusx) = 1minusΦ(x) x isin R (614)

0

02

04

06

08

1

12

-4 -3 -2 -1 0 1 2 3 4

Φ(x)

x

1Gaussian CDF Φ(x)

Fig 63 Graph of the Gaussian CDF

In other words the European call option with strike price K and maturityT is priced at time t isin [0T ] as

gc(tSt) = Bl(KStσ rT minus t)= StΦ

(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

) 0 6 t 6 T

207

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

The following R script is an implementation of the Black-Scholes formula forEuropean call options in Rlowast

1 BSCall lt- function(S K r T sigma)d1 lt- (log(SK)+(r+sigma^22)T)(sigmasqrt(T))

3 d2 lt- d1 - sigma sqrt(T)BSCall = Spnorm(d1) - Kexp(-rT)pnorm(d2)

5 BSCall

In comparison with the discrete-time Cox-Ross-Rubinstein (CRR) model ofSection 26 the interest in the formula (610) is to provide an analytical so-lution that can be evaluated in a single step which is computationally muchmore efficient

Fig 64 Graph of the Black-Scholes call price map with strike price K = 100dagger

Figure 64 presents an interactive graph of the Black-Scholes call price mapie the solution

(tx) 7minusrarr gc(tx) = xΦ(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)of the Black-Scholes PDE (67) for a call optionlowast Download the corresponding that can be run heredagger Right-click on the figure for interaction and ldquoFull Screen Multimediardquo view

208

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

(C) 2012--today Alexander Grahn 3Dmenujs version 20140923 3D JavaScript used by media9sty Extended functionality of the (right click) context menu of 3D annotations 1) Adds the following items to the 3D context menu `Generate Default View Finds good default camera settings returned as options for use with the includemedia command `Get Current View Determines camera cross section and part settings of the current view returned as `VIEW section that can be copied into a views file of additional views The views file is inserted using the `3Dviews option of includemedia `Cross Section Toggle switch to add or remove a cross section into or from the current view The cross section can be moved in the x y z directions using x y z and X Y Z keys on the keyboard be tilted against and spun around the upright Z axis using the UpDown and LeftRight arrow keys and caled using the s and S keys 2) Enables manipulation of position and orientation of indiviual parts and groups of parts in the 3D scene Parts which have been selected with the mouse can be scaled moved around and rotated like the cross section as described above To spin the parts around their local up-axis keep Control key pressed while using the UpDown and LeftRight arrow keys This work may be distributed andor modified under the conditions of the LaTeX Project Public License The latest version of this license is in httpmirrorsctanorgmacroslatexbaselppltxt This work has the LPPL maintenance status `maintained The Current Maintainer of this work is A Grahn The code borrows heavily from Bernd Gaertners `Miniball software originally written in C++ for computing the smallest enclosing ball of a set of points see httpwwwinfethzchpersonalgaertnerminiballhtmlhostconsoleshow()constructor for doubly linked listfunction List() thisfirst_node=null thislast_node=new Node(undefined)Listprototypepush_back=function(x) var new_node=new Node(x) if(thisfirst_node==null) thisfirst_node=new_node new_nodeprev=null else new_nodeprev=thislast_nodeprev new_nodeprevnext=new_node new_nodenext=thislast_node thislast_nodeprev=new_nodeListprototypemove_to_front=function(it) var node=itget() if(nodenext=null ampamp nodeprev=null) nodenextprev=nodeprev nodeprevnext=nodenext nodeprev=null nodenext=thisfirst_node thisfirst_nodeprev=node thisfirst_node=node Listprototypebegin=function() var i=new Iterator() itarget=thisfirst_node return(i)Listprototypeend=function() var i=new Iterator() itarget=thislast_node return(i)function Iterator(it) if( it=undefined ) thistarget=ittarget else thistarget=null Iteratorprototypeset=function(it)thistarget=ittargetIteratorprototypeget=function()return(thistarget)Iteratorprototypederef=function()return(thistargetdata)Iteratorprototypeincr=function() if(thistargetnext=null) thistarget=thistargetnextconstructor for node objects that populate the linked listfunction Node(x) thisprev=null thisnext=null thisdata=xfunction sqr(r)return(rr)helper functionMiniball algorithm by B Gaertnerfunction Basis() thism=0 thisq0=new Array(3) thisz=new Array(4) thisf=new Array(4) thisv=new Array(new Array(3) new Array(3) new Array(3) new Array(3)) thisa=new Array(new Array(3) new Array(3) new Array(3) new Array(3)) thisc=new Array(new Array(3) new Array(3) new Array(3) new Array(3)) thissqr_r=new Array(4) thiscurrent_c=thisc[0] thiscurrent_sqr_r=0 thisreset()Basisprototypecenter=function()return(thiscurrent_c)Basisprototypesize=function()return(thism)Basisprototypepop=function()--thismBasisprototypeexcess=function(p) var e=-thiscurrent_sqr_r for(var k=0klt3++k) e+=sqr(p[k]-thiscurrent_c[k]) return(e)Basisprototypereset=function() thism=0 for(var j=0jlt3++j) thisc[0][j]=0 thiscurrent_c=thisc[0] thiscurrent_sqr_r=-1Basisprototypepush=function(p) var i j var eps=1e-32 if(thism==0) for(i=0ilt3++i) thisq0[i]=p[i] for(i=0ilt3++i) thisc[0][i]=thisq0[i] thissqr_r[0]=0 else for(i=0ilt3++i) thisv[thism][i]=p[i]-thisq0[i] for(i=1iltthism++i) thisa[thism][i]=0 for(j=0jlt3++j) thisa[thism][i]+=thisv[i][j]thisv[thism][j] thisa[thism][i]=(2thisz[i]) for(i=1iltthism++i) for(j=0jlt3++j) thisv[thism][j]-=thisa[thism][i]thisv[i][j] thisz[thism]=0 for(j=0jlt3++j) thisz[thism]+=sqr(thisv[thism][j]) thisz[thism]=2 if(thisz[thism]ltepsthiscurrent_sqr_r) return(false) var e=-thissqr_r[thism-1] for(i=0ilt3++i) e+=sqr(p[i]-thisc[thism-1][i]) thisf[thism]=ethisz[thism] for(i=0ilt3++i) thisc[thism][i]=thisc[thism-1][i]+thisf[thism]thisv[thism][i] thissqr_r[thism]=thissqr_r[thism-1]+ethisf[thism]2 thiscurrent_c=thisc[thism] thiscurrent_sqr_r=thissqr_r[thism] ++thism return(true)function Miniball() thisL=new List() thisB=new Basis() thissupport_end=new Iterator()Miniballprototypemtf_mb=function(it) var i=new Iterator(it) thissupport_endset(thisLbegin()) if((thisBsize())==4) return for(var k=new Iterator(thisLbegin())kget()=iget()) var j=new Iterator(k) kincr() if(thisBexcess(jderef()) gt 0) if(thisBpush(jderef())) thismtf_mb(j) thisBpop() if(thissupport_endget()==jget()) thissupport_endincr() thisLmove_to_front(j) Miniballprototypecheck_in=function(b) thisLpush_back(b)Miniballprototypebuild=function() thisBreset() thissupport_endset(thisLbegin()) thismtf_mb(thisLend())Miniballprototypecenter=function() return(thisBcenter())Miniballprototyperadius=function() return(Mathsqrt(thisBcurrent_sqr_r))functions called by menu itemsfunction calc3Dopts () create Miniball object var mb=new Miniball() auxiliary vector var corner=new Vector3() iterate over all visible mesh nodes in the scene for(i=0iltscenemeshescounti++) var mesh=scenemeshesgetByIndex(i) if(meshvisible) continue local to parent transformation matrix var trans=meshtransform build local to world transformation matrix by recursively multiplying the parents transf matrix on the right var parent=meshparent while(parenttransform) trans=transmultiply(parenttransform) parent=parentparent get the bbox of the mesh (local coordinates) var bbox=meshcomputeBoundingBox() transform the local bounding box corner coordinates to world coordinates for bounding sphere determination BBoxmin cornerset(bboxmin) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) BBoxmax cornerset(bboxmax) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) remaining six BBox corners cornerset(bboxminx bboxmaxy bboxmaxz) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) cornerset(bboxminx bboxminy bboxmaxz) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) cornerset(bboxminx bboxmaxy bboxminz) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) cornerset(bboxmaxx bboxminy bboxminz) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) cornerset(bboxmaxx bboxminy bboxmaxz) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) cornerset(bboxmaxx bboxmaxy bboxminz) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) compute the smallest enclosing bounding sphere mbbuild() current camera settings var camera=scenecamerasgetByIndex(0) var res= initialize result string aperture angle of the virtual camera (perspective projection) or orthographic scale (orthographic projection) if(cameraprojectionType==cameraTYPE_PERSPECTIVE) var aac=camerafov180MathPI if(hostutilprintf(4f aac)=30) res+=hostutilprintf(n3Daac=s aac) else cameraviewPlaneSize=2mbradius() res+=hostutilprintf(n3Dortho=s 1cameraviewPlaneSize) camera roll var roll = cameraroll180MathPI if(hostutilprintf(4f roll)=0) res+=hostutilprintf(n3Droll=sroll) target to camera vector var c2c=new Vector3() c2cset(cameraposition) c2csubtractInPlace(cameratargetPosition) c2cnormalize() if((c2cx==0 ampamp c2cy==-1 ampamp c2cz==0)) res+=hostutilprintf(n3Dc2c=s s s c2cx c2cy c2cz) new camera settings bounding sphere centre --gt new camera target var coo=new Vector3() cooset((mbcenter())[0] (mbcenter())[1] (mbcenter())[2]) if(coolength) res+=hostutilprintf(n3Dcoo=s s s coox cooy cooz) radius of orbit if(cameraprojectionType==cameraTYPE_PERSPECTIVE) var roo=mbradius() Mathsin(aac MathPI 360) else orthographic projection var roo=mbradius() res+=hostutilprintf(n3Droo=s roo) update camera settings in the viewer var currol=cameraroll cameratargetPositionset(coo) camerapositionset(cooadd(c2cscale(roo))) cameraroll=currol determine background colour rgb=scenebackgroundgetColor() if((rgbr==1 ampamp rgbg==1 ampamp rgbb==1)) res+=hostutilprintf(n3Dbg=s s s rgbr rgbg rgbb) determine lighting scheme switch(scenelightScheme) case sceneLIGHT_MODE_FILE curlights=Artworkbreak case sceneLIGHT_MODE_NONE curlights=Nonebreak case sceneLIGHT_MODE_WHITE curlights=Whitebreak case sceneLIGHT_MODE_DAY curlights=Daybreak case sceneLIGHT_MODE_NIGHT curlights=Nightbreak case sceneLIGHT_MODE_BRIGHT curlights=Hardbreak case sceneLIGHT_MODE_RGB curlights=Primarybreak case sceneLIGHT_MODE_BLUE curlights=Bluebreak case sceneLIGHT_MODE_RED curlights=Redbreak case sceneLIGHT_MODE_CUBE curlights=Cubebreak case sceneLIGHT_MODE_CAD curlights=CADbreak case sceneLIGHT_MODE_HEADLAMP curlights=Headlampbreak if(curlights=Artwork) res+=hostutilprintf(n3Dlights=s curlights) determine global render mode switch(scenerenderMode) case sceneRENDER_MODE_BOUNDING_BOX currender=BoundingBoxbreak case sceneRENDER_MODE_TRANSPARENT_BOUNDING_BOX currender=TransparentBoundingBoxbreak case sceneRENDER_MODE_TRANSPARENT_BOUNDING_BOX_OUTLINE currender=TransparentBoundingBoxOutlinebreak case sceneRENDER_MODE_VERTICES currender=Verticesbreak case sceneRENDER_MODE_SHADED_VERTICES currender=ShadedVerticesbreak case sceneRENDER_MODE_WIREFRAME currender=Wireframebreak case sceneRENDER_MODE_SHADED_WIREFRAME currender=ShadedWireframebreak case sceneRENDER_MODE_SOLID currender=Solidbreak case sceneRENDER_MODE_TRANSPARENT currender=Transparentbreak case sceneRENDER_MODE_SOLID_WIREFRAME currender=SolidWireframebreak case sceneRENDER_MODE_TRANSPARENT_WIREFRAME currender=TransparentWireframebreak case sceneRENDER_MODE_ILLUSTRATION currender=Illustrationbreak case sceneRENDER_MODE_SOLID_OUTLINE currender=SolidOutlinebreak case sceneRENDER_MODE_SHADED_ILLUSTRATION currender=ShadedIllustrationbreak case sceneRENDER_MODE_HIDDEN_WIREFRAME currender=HiddenWireframebreak if(currender=Solid) res+=hostutilprintf(n3Drender=s currender) write result string to the console hostconsoleshow() hostconsoleclear() hostconsoleprintln(n Copy and paste the following text to then+ option list of includemedian + res + n)function get3Dview () var camera=scenecamerasgetByIndex(0) var coo=cameratargetPosition var c2c=camerapositionsubtract(coo) var roo=c2clength c2cnormalize() var res=VIEW=insert optional name heren if((coox==0 ampamp cooy==0 ampamp cooz==0)) res+=hostutilprintf( COO=s s sn coox cooy cooz) if((c2cx==0 ampamp c2cy==-1 ampamp c2cz==0)) res+=hostutilprintf( C2C=s s sn c2cx c2cy c2cz) if(roo gt 1e-9) res+=hostutilprintf( ROO=sn roo) var roll = cameraroll180MathPI if(hostutilprintf(4f roll)=0) res+=hostutilprintf( ROLL=sn roll) if(cameraprojectionType==cameraTYPE_PERSPECTIVE) var aac=camerafov 180MathPI if(hostutilprintf(4f aac)=30) res+=hostutilprintf( AAC=sn aac) else if(hostutilprintf(4f cameraviewPlaneSize)=1) res+=hostutilprintf( ORTHO=sn 1cameraviewPlaneSize) rgb=scenebackgroundgetColor() if((rgbr==1 ampamp rgbg==1 ampamp rgbb==1)) res+=hostutilprintf( BGCOLOR=s s sn rgbr rgbg rgbb) switch(scenelightScheme) case sceneLIGHT_MODE_FILE curlights=Artworkbreak case sceneLIGHT_MODE_NONE curlights=Nonebreak case sceneLIGHT_MODE_WHITE curlights=Whitebreak case sceneLIGHT_MODE_DAY curlights=Daybreak case sceneLIGHT_MODE_NIGHT curlights=Nightbreak case sceneLIGHT_MODE_BRIGHT curlights=Hardbreak case sceneLIGHT_MODE_RGB curlights=Primarybreak case sceneLIGHT_MODE_BLUE curlights=Bluebreak case sceneLIGHT_MODE_RED curlights=Redbreak case sceneLIGHT_MODE_CUBE curlights=Cubebreak case sceneLIGHT_MODE_CAD curlights=CADbreak case sceneLIGHT_MODE_HEADLAMP curlights=Headlampbreak if(curlights=Artwork) res+= LIGHTS=+curlights+n switch(scenerenderMode) case sceneRENDER_MODE_BOUNDING_BOX defaultrender=BoundingBoxbreak case sceneRENDER_MODE_TRANSPARENT_BOUNDING_BOX defaultrender=TransparentBoundingBoxbreak case sceneRENDER_MODE_TRANSPARENT_BOUNDING_BOX_OUTLINE defaultrender=TransparentBoundingBoxOutlinebreak case sceneRENDER_MODE_VERTICES defaultrender=Verticesbreak case sceneRENDER_MODE_SHADED_VERTICES defaultrender=ShadedVerticesbreak case sceneRENDER_MODE_WIREFRAME defaultrender=Wireframebreak case sceneRENDER_MODE_SHADED_WIREFRAME defaultrender=ShadedWireframebreak case sceneRENDER_MODE_SOLID defaultrender=Solidbreak case sceneRENDER_MODE_TRANSPARENT defaultrender=Transparentbreak case sceneRENDER_MODE_SOLID_WIREFRAME defaultrender=SolidWireframebreak case sceneRENDER_MODE_TRANSPARENT_WIREFRAME defaultrender=TransparentWireframebreak case sceneRENDER_MODE_ILLUSTRATION defaultrender=Illustrationbreak case sceneRENDER_MODE_SOLID_OUTLINE defaultrender=SolidOutlinebreak case sceneRENDER_MODE_SHADED_ILLUSTRATION defaultrender=ShadedIllustrationbreak case sceneRENDER_MODE_HIDDEN_WIREFRAME defaultrender=HiddenWireframebreak if(defaultrender=Solid) res+= RENDERMODE=+defaultrender+n detect existing Clipping Plane (3D Cross Section) var clip=null if( clip=scenenodesgetByName($$$$$$)|| clip=scenenodesgetByName(Clipping Plane) ) for(var i=0iltscenenodescounti++) var nd=scenenodesgetByIndex(i) if(nd==clip||ndname==) continue var ndUTFName= for (var j=0 jltndnamelength j++) var theUnicode = ndnamecharCodeAt(j)toString(16) while (theUnicodelengthlt4) theUnicode = 0 + theUnicode ndUTFName += theUnicode var end=ndnamelastIndexOf() if(endgt0) var ndUserName=ndnamesubstr(0end) else var ndUserName=ndname respart= PART=+ndUserName+n respart+= UTF16NAME=+ndUTFName+n defaultvals=true if(ndvisible) respart+= VISIBLE=falsen defaultvals=false if(ndopacitylt10) respart+= OPACITY=+ndopacity+n defaultvals=false if(ndconstructorname==Mesh) currender=defaultrender switch(ndrenderMode) case sceneRENDER_MODE_BOUNDING_BOX currender=BoundingBoxbreak case sceneRENDER_MODE_TRANSPARENT_BOUNDING_BOX currender=TransparentBoundingBoxbreak case sceneRENDER_MODE_TRANSPARENT_BOUNDING_BOX_OUTLINE currender=TransparentBoundingBoxOutlinebreak case sceneRENDER_MODE_VERTICES currender=Verticesbreak case sceneRENDER_MODE_SHADED_VERTICES currender=ShadedVerticesbreak case sceneRENDER_MODE_WIREFRAME currender=Wireframebreak case sceneRENDER_MODE_SHADED_WIREFRAME currender=ShadedWireframebreak case sceneRENDER_MODE_SOLID currender=Solidbreak case sceneRENDER_MODE_TRANSPARENT currender=Transparentbreak case sceneRENDER_MODE_SOLID_WIREFRAME currender=SolidWireframebreak case sceneRENDER_MODE_TRANSPARENT_WIREFRAME currender=TransparentWireframebreak case sceneRENDER_MODE_ILLUSTRATION currender=Illustrationbreak case sceneRENDER_MODE_SOLID_OUTLINE currender=SolidOutlinebreak case sceneRENDER_MODE_SHADED_ILLUSTRATION currender=ShadedIllustrationbreak case sceneRENDER_MODE_HIDDEN_WIREFRAME currender=HiddenWireframebreak case sceneRENDER_MODE_DEFAULT currender=Defaultbreak if(currender=defaultrender) respart+= RENDERMODE=+currender+n defaultvals=false if(origtrans[ndname]ampampndtransformisEqual(origtrans[ndname])) var lvec=ndtransformtransformDirection(new Vector3(100)) var uvec=ndtransformtransformDirection(new Vector3(010)) var vvec=ndtransformtransformDirection(new Vector3(001)) respart+= TRANSFORM= +lvecx+ +lvecy+ +lvecz+ +uvecx+ +uvecy+ +uvecz+ +vvecx+ +vvecy+ +vvecz+ +ndtransformtranslationx+ +ndtransformtranslationy+ +ndtransformtranslationz+n defaultvals=false respart+= ENDn if(defaultvals) res+=respart if(clip) var centre=cliptransformtranslation var normal=cliptransformtransformDirection(new Vector3(001)) res+= CROSSSECTn if((centrex==0 ampamp centrey==0 ampamp centrez==0)) res+=hostutilprintf( CENTER=s s sn centrex centrey centrez) if((normalx==1 ampamp normaly==0 ampamp normalz==0)) res+=hostutilprintf( NORMAL=s s sn normalx normaly normalz) res+=hostutilprintf( VISIBLE=sn clipvisible) res+=hostutilprintf( PLANECOLOR=s s sn clipmaterialemissiveColorr clipmaterialemissiveColorg clipmaterialemissiveColorb) res+=hostutilprintf( OPACITY=sn clipopacity) res+=hostutilprintf( INTERSECTIONCOLOR=s s sn clipwireframeColorr clipwireframeColorg clipwireframeColorb) res+= ENDn for(var propt in clip) consoleprintln(propt++clip[propt]) res+=ENDn hostconsoleshow() hostconsoleclear() hostconsoleprintln(n Add the following VIEW section to a file ofn+ predefined views (See option 3Dviews)nn + The view may be given a name after VIEW=n + (Remove in front of =)n) hostconsoleprintln(res + n)add items to 3D context menuruntimeaddCustomMenuItem(dfltview Generate Default View default 0)runtimeaddCustomMenuItem(currview Get Current View default 0)runtimeaddCustomMenuItem(csection Cross Section checked 0)menu event handlersmenuEventHandler = new MenuEventHandler()menuEventHandleronEvent = function(e) switch(emenuItemName) case dfltview calc3Dopts() break case currview get3Dview() break case csection addremoveClipPlane(emenuItemChecked) break runtimeaddEventHandler(menuEventHandler)global variable taking reference to currently selected nodevar target=nullselectionEventHandler=new SelectionEventHandler()selectionEventHandleronEvent=function(e) if(eselectedampampenodename=) target=enode else target=null runtimeaddEventHandler(selectionEventHandler)cameraEventHandler=new CameraEventHandler()cameraEventHandleronEvent=function(e) var clip=null runtimeremoveCustomMenuItem(csection) runtimeaddCustomMenuItem(csection Cross Section checked 0) if(clip=scenenodesgetByName($$$$$$)|| predefined scenenodesgetByName(Clipping Plane)) added via context menu runtimeremoveCustomMenuItem(csection) runtimeaddCustomMenuItem(csection Cross Section checked 1) if(clip)plane in predefined views must be rotated by 90 deg around normal cliptransformrotateAboutLineInPlace( MathPI2cliptransformtranslation cliptransformtransformDirection(new Vector3(001)) ) for(var i=0 iltrot4x4length i++)rot4x4[i]setIdentity() target=nullruntimeaddEventHandler(cameraEventHandler)var rot4x4=new Array() keeps track of spin and tilt axes transformationskey event handler for scaling moving spinning and tilting objectskeyEventHandler=new KeyEventHandler()keyEventHandleronEvent=function(e) var backtrans=new Matrix4x4() var trgt=null if(target) trgt=target var backtrans=new Matrix4x4() var trans=trgttransform var parent=trgtparent while(parenttransform) build local to world transformation matrix transmultiplyInPlace(parenttransform) also build world to local back-transformation matrix backtransmultiplyInPlace(parenttransforminversetranspose) parent=parentparent backtranstransposeInPlace() else if( trgt=scenenodesgetByName($$$$$$)|| trgt=scenenodesgetByName(Clipping Plane) ) var trans=trgttransform if(trgt) return var tname=trgtname if(typeof(rot4x4[tname])==undefined) rot4x4[tname]=new Matrix4x4() if(target) var tiltAxis=rot4x4[tname]transformDirection(new Vector3(010)) else var tiltAxis=transtransformDirection(new Vector3(010)) var spinAxis=rot4x4[tname]transformDirection(new Vector3(001)) get the centre of the mesh if(targetampamptrgtconstructorname==Mesh) var centre=transtransformPosition(trgtcomputeBoundingBox()center) else part group (Node3 parent node clipping plane) var centre=new Vector3(transtranslation) switch(echaracterCode) case 30tilt up rot4x4[tname]rotateAboutLineInPlace( -MathPI900rot4x4[tname]translationtiltAxis) transrotateAboutLineInPlace(-MathPI900centretiltAxis) break case 31tilt down rot4x4[tname]rotateAboutLineInPlace( MathPI900rot4x4[tname]translationtiltAxis) transrotateAboutLineInPlace(MathPI900centretiltAxis) break case 28spin right if(ectrlKeyDownampamptarget) transrotateAboutLineInPlace(-MathPI900centrespinAxis) else rot4x4[tname]rotateAboutLineInPlace( -MathPI900rot4x4[tname]translationnew Vector3(001)) transrotateAboutLineInPlace(-MathPI900centrenew Vector3(001)) break case 29spin left if(ectrlKeyDownampamptarget) transrotateAboutLineInPlace(MathPI900centrespinAxis) else rot4x4[tname]rotateAboutLineInPlace( MathPI900rot4x4[tname]translationnew Vector3(001)) transrotateAboutLineInPlace(MathPI900centrenew Vector3(001)) break case 120 x translateTarget(trans new Vector3(100) e) break case 121 y translateTarget(trans new Vector3(010) e) break case 122 z translateTarget(trans new Vector3(001) e) break case 88 shift + x translateTarget(trans new Vector3(-100) e) break case 89 shift + y translateTarget(trans new Vector3(0-10) e) break case 90 shift + z translateTarget(trans new Vector3(00-1) e) break case 115 s transtranslateInPlace(centrescale(-1)) transscaleInPlace(101) transtranslateInPlace(centrescale(1)) break case 83 shift + s transtranslateInPlace(centrescale(-1)) transscaleInPlace(1101) transtranslateInPlace(centrescale(1)) break transmultiplyInPlace(backtrans)runtimeaddEventHandler(keyEventHandler)translates object by amount calculated from Canvas sizefunction translateTarget(t d e) var cam=scenecamerasgetByIndex(0) if(camprojectionType==camTYPE_PERSPECTIVE) var scale=Mathtan(camfov2) camtargetPositionsubtract(camposition)length Mathmin(ecanvasPixelWidthecanvasPixelHeight) else var scale=camviewPlaneSize2 Mathmin(ecanvasPixelWidthecanvasPixelHeight) ttranslateInPlace(dscale(scale))function addremoveClipPlane(chk) var curTrans=getCurTrans() var clip=scenecreateClippingPlane() if(chk) add Clipping Plane and place its center either into the camera target position or into the centre of the currently selected mesh node var centre=new Vector3() if(target) var trans=targettransform var parent=targetparent while(parenttransform) trans=transmultiply(parenttransform) parent=parentparent if(targetconstructorname==Mesh) var centre=transtransformPosition(targetcomputeBoundingBox()center) else var centre=new Vector3(transtranslation) target=null else centreset(scenecamerasgetByIndex(0)targetPosition) cliptransformsetView( new Vector3(000) new Vector3(100) new Vector3(010)) cliptransformtranslateInPlace(centre) else if( scenenodesgetByName($$$$$$)|| scenenodesgetByName(Clipping Plane) ) clipremove()clip=null restoreTrans(curTrans) return clipfunction to store current transformation matrix of all nodes in the scenefunction getCurTrans() var tA=new Array() for(var i=0 iltscenenodescount i++) var nd=scenenodesgetByIndex(i) if(ndname==) continue tA[ndname]=new Matrix4x4(ndtransform) return tAfunction to restore transformation matrices given as argfunction restoreTrans(tA) for(var i=0 iltscenenodescount i++) var nd=scenenodesgetByIndex(i) if(tA[ndname]) ndtransformset(tA[ndname]) store original transformation matrix of all mesh nodes in the scenevar origtrans=getCurTrans()set initial state of Cross Section menu entrycameraEventHandleronEvent(1)hostconsoleclear()

var ocgs=hostgetOCGs(hostpageNum)for(var i=0iltocgslengthi++)if(ocgs[i]name==MediaPlayButton1)ocgs[i]state=false

(C) 2012 Michail Vidiassov John C Bowman Alexander Grahn asylabelsjs version 20120912 3D JavaScript to be used with media9sty (option `add3Djscript) for Asymptote generated PRC files adds billboard behaviour to text labels in Asymptote PRC files so that they always face the camera under 3D rotation This work may be distributed andor modified under the conditions of the LaTeX Project Public License The latest version of this license is in httpmirrorsctanorgmacroslatexbaselppltxt This work has the LPPL maintenance status `maintained The Current Maintainer of this work is A Grahnvar bbnodes=new Array() billboard meshesvar bbtrans=new Array() billboard transformsfunction fulltransform(mesh) var t=new Matrix4x4(meshtransform) if(meshparentname = ) var parentTransform=fulltransform(meshparent) tmultiplyInPlace(parentTransform) return t else return t find all text labels in the scene and determine pivoting pointsvar nodes=scenenodesvar nodescount=nodescountvar third=1030for(var i=0 i lt nodescount i++) var node=nodesgetByIndex(i) var name=nodename var end=namelastIndexOf()-1 if(end gt 0) if(namecharAt(end) == 001) var start=namelastIndexOf(-)+1 if(end gt start) nodename=namesubstr(0start-1) var nodeMatrix=fulltransform(nodeparent) var c=nodeMatrixtranslation position var d=Mathpow(Mathabs(nodeMatrixdeterminant)third) scale bbnodespush(node) bbtranspush(Matrix4x4()scale(ddd)translate(c)multiply(nodeMatrixinverse)) var camera=scenecamerasgetByIndex(0) var zero=new Vector3(000)var bbcount=bbnodeslength event handler to maintain camera-facing text labelsbillboardHandler=new RenderEventHandler()billboardHandleronEvent=function(event) var T=new Matrix4x4() TsetView(zerocamerapositionsubtract(cameratargetPosition) cameraupsubtract(cameraposition)) for(var j=0 j lt bbcount j++) bbnodes[j]transformset(Tmultiply(bbtrans[j])) runtimerefresh() runtimeaddEventHandler(billboardHandler)runtimerefresh()

(C) 2012 Alexander Grahn 3Dspintooljs version 20120301 3D JavaScript to be used with media9sty (option `add3Djscript) enables the Spin tool (also accessible via 3D toolbar or context menu) upon activation of the 3D scene the scene then rotates around the upright axis while dragging with the mouse This work may be distributed andor modified under the conditions of the LaTeX Project Public License The latest version of this license is in httpmirrorsctanorgmacroslatexbaselppltxt This work has the LPPL maintenance status `maintained The Current Maintainer of this work is A GrahnruntimesetCurrentTool(runtimeTOOL_NAME_SPIN)

cells [ cell_type code execution_count null metadata outputs [] source [ from IPythoncoredisplay import display HTMLn display(HTML( )) ] cell_type code execution_count null metadata collapsed true outputs [] source [ import numpy as npn import scipystats as ssn import time n n Black and Scholesn def d1(S0 K r sigma T)n return (nplog(S0K) + (r + sigma2 2) T)(sigma npsqrt(T))n n def d2(S0 K r sigma T)n return (nplog(S0 K) + (r - sigma2 2) T) (sigma npsqrt(T))n n def BlackScholes(typeS0 K r sigma T)n if type==Cn return S0 ssnormcdf(d1(S0 K r sigma T)) - K npexp(-r T) ssnormcdf(d2(S0 K r sigma T))n elsen return K npexp(-r T) ssnormcdf(-d2(S0 K r sigma T)) - S0 ssnormcdf(-d1(S0 K r sigma T)) ] cell_type code execution_count null metadata outputs [] source [ BlackScholes(C100 120 002 02 10) ] ] metadata anaconda-cloud kernelspec display_name Python 3 language python name python3 language_info codemirror_mode name ipython version 3 file_extension py mimetype textx-python name python nbconvert_exporter python pygments_lexer ipython3 version 375rc1 nbformat 4 nbformat_minor 1

Black-Scholes Pricing and Hedging

Fig 65 Time-dependent solution of the Black-Scholes PDE (call option)lowast

The next proposition is proved by a direct differentiation of the Black-Scholesfunction and will be recovered later using a probabilistic argument in Propo-sition 714 below

Proposition 64 The Black-Scholes Delta of the European call option isgiven by

ξt = ξt(St) =partgcpartx

(tSt) = Φ(d+(T minus t)

)isin [0 1] (615)

where d+(T minus t) is given by (611)

Proof From Relation (613) we note that the standard normal probabilitydensity function

ϕ(x) = Φprime(x) =1radic2π

eminusx22 x isin R

satisfies

ϕ(d+(T minus t)) = ϕ

(log(xK) + (r+ σ22)(T minus t)

|σ|radicT minus t

)=

1radic2π

exp(minus1

2

(log(xK) + (r+ σ22)(T minus t)

|σ|radicT minus t

)2)

=1radic2π

exp(minus1

2

(log(xK) + (rminus σ22)(T minus t)

|σ|radicT minus t

+ |σ|radicT minus t

)2)

=1radic2π

exp(minus1

2 (dminus(T minus t))2 minus (T minus t)rminus log x

K

)=

K

xradic

2πeminus(Tminust)r exp

(minus1

2 (dminus(T minus t))2)

lowast The animation works in Acrobat Reader on the entire pdf file

209

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

=K

xeminus(Tminust)rϕ(dminus(T minus t))

hence by (610) we have

partgcpartx

(tx) = part

partx

(xΦ(

log(xK) + (r+ σ22)(T minus t)|σ|radicT minus t

))(616)

minusK eminus(Tminust)r partpartx

(Φ(

log(xK) + (rminus σ22)(T minus t)|σ|radicT minus t

))= Φ

(log(xK) + (r+ σ22)(T minus t)

|σ|radicT minus t

)+x

part

partxΦ(

log(xK) + (r+ σ22)(T minus t)|σ|radicT minus t

)minusK eminus(Tminust)r part

partxΦ(

log(xK) + (rminus σ22)(T minus t)|σ|radicT minus t

)= Φ

(log(xK) + (r+ σ22)(T minus t)

|σ|radicT minus t

)+

x

|σ|radicT minus t

ϕ

(log(xK) + (r+ σ22)(T minus t)

|σ|radicT minus t

)minusK eminus(Tminust)r

|σ|radicT minus t

ϕ

(log(xK) + (rminus σ22)(T minus t)

|σ|radicT minus t

)= Φ(d+(T minus t)) +

x

|σ|radicT minus t

ϕ(d+(T minus t))minusK eminus(Tminust)r

|σ|radicT minus t

ϕ(dminus(T minus t))

= Φ(d+(T minus t))

As a consequence of Proposition 64 the Black-Scholes call price splits into arisky component StΦ

(d+(T minus t)

)and a riskless componentminusK eminus(Tminust)rΦ

(dminus(T minus

t)) as follows

gc(tSt) = StΦ(d+(T minus t)

)︸ ︷︷ ︸risky investment (held)

minus K eminus(Tminust)rΦ(dminus(T minus t)

)︸ ︷︷ ︸

riskminusfree investment (borrowed)

0 6 t 6 T

See Exercise 64 for a computation of the boundary values of gc(tx) t isin[0T ) x gt 0 The following R script is an implementation of the Black-ScholesDelta for European call options in R

1 Delta lt- function(S K r T sigma)d1 lt- (log(SK)+(r+sigma^22)T)(sigmasqrt(T))

3 Delta = pnorm(d1)Delta

210

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

In Figure 66 we plot the Delta of the European call option as a function ofthe underlying asset price and of the time remaining until maturity

Payoff function (x-K)+

0

50

100

150

200

Underlying

0

5

10

15

Time to maturity T-t

0

025

05

075

1

Fig 66 Delta of a European call option with strike price K = 100 r = 3 σ = 10

The Gamma of the European call option is defined as the first derivative ofDelta or second derivative of the option price with respect to the underlyingasset price This gives

γt =1

St|σ|radicT minus t

Φprime(d+(T minus t)

)=

1St|σ|

radic2(T minus t)π

exp(minus1

2

(log(StK) + (r+ σ22)(T minus t)

|σ|radicT minus t

)2)gt 0

In particular a positive value of γt implies that the Delta ξt = ξt(St) shouldincrease when the underlying asset price St increases In other words the po-sition ξt in the underlying asset should be increased by additional purchasesif the underlying asset price St increases

In Figure 67 we plot the (truncated) value of the Gamma of a European calloption as a function of the underlying asset price and of time to maturity

211

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

Fig 67 Gamma of a European call option with strike price K = 100

As Gamma is always nonnegative the Black-Scholes hedging strategy is tokeep buying the risky underlying asset when its price increases and to sell itwhen its price decreases as can be checked from Figure 67

Numerical example - hedging of a call option

In Figure 68 we consider the historical stock price of HSBC Holdings(0005HK) over one year

Fig 68 Graph of the stock price of HSBC Holdings

Consider the call option issued by Societe Generale on 31 December 2008 withstrike price K=$63704 maturity T = October 05 2009 and an entitlementratio of 100 meaning that one option contract is divided into 100 warrants cfpage 9 The next graph gives the time evolution of the Black-Scholes portfoliovalue

t 7minusrarr gc(tSt)

driven by the market price t 7minusrarr St of the risky underlying asset as given inFigure 68 in which the number of days is counted from the origin and notfrom maturity

212

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

40 50 60 70 80 90 0 50 100 150 200

0

5

10

15

20

25

30

35

40

Underlying (HK$) Time in days

Fig 69 Path of the Black-Scholes price for a call option on HSBC

As a consequence of Proposition 64 in the Black-Scholes call option hedgingmodel the amount invested in the risky asset is

Stξt = StΦ(d+(T minus t)

)= StΦ

(log(StK) + (r+ σ22)(T minus t)

|σ|radicT minus t

)gt 0

which is always nonnegative ie there is no short selling and the amountinvested on the riskless asset is

ηtAt = minusK eminus(Tminust)rΦ(dminus(T minus t)

)= minusK eminus(Tminust)rΦ

(log(StK) + (rminus σ22)(T minus t)

|σ|radicT minus t

)6 0

which is always nonpositive ie we are constantly borrowing money on theriskless asset as noted in Figure 610

-60

-40

-20

0

20

40

60

80

100

0 50 100 150 200

K

HK$

Black-Scholes priceRisky investment ξtSt

Riskless investment ηtAtUnderlying asset price

Fig 610 Time evolution of a hedging portfolio for a call option on HSBC

213

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

A comparison of Figure 610 with market data can be found in Figures 911and 912 below

Cash settlement In the case of a cash settlement the option issuer will sat-isfy the option contract by selling ξT = 1 stock at the price ST = $83refund the K = $63 risk-free investment and hand in the remaining amountC = (ST minusK)+ = 83minus 63 = $20 to the option holder

Physical delivery In the case of physical delivery of the underlying asset theoption issuer will deliver ξT = 1 stock to the option holder in exchange forK = $63 which will be used together with the portfolio value to refund therisk-free loan

63 European Put Options

Similarly in the case of the European put option with strike price K thepayoff function is given by h(x) = (Kminusx)+ and the Black-Scholes PDE (67)reads

rgp(tx) =partgppartt

(tx) + rxpartgppartx

(tx) + 12σ

2x2 part2gppartx2 (tx)

gp(T x) = (K minus x)+(617)

The next proposition can be proved as in Sections 65 and 66 see Proposi-tion 611

Proposition 65 The solution of the PDE (617) is given by the Black-Scholes formula for put options

gp(tx) = K eminus(Tminust)rΦ(minus dminus(T minus t)

)minus xΦ

(minus d+(T minus t)

) (618)

withd+(T minus t) =

log(xK) + (r+ σ22)(T minus t)|σ|radicT minus t

(619)

dminus(T minus t) =log(xK) + (rminus σ22)(T minus t)

|σ|radicT minus t

(620)

as illustrated in Figure 611

214

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

Fig 611 Graph of the Black-Scholes put price function with strike price K = 100lowast

In other words the European put option with strike price K and maturityT is priced at time t isin [0T ] as

gp(tSt) = K eminus(Tminust)rΦ(minus dminus(T minus t)

)minus StΦ

(minus d+(T minus t)

) 0 6 t 6 T

Fig 612 Time-dependent solution of the Black-Scholes PDE (put option)dagger

The following R script is an implementation of the Black-Scholes formula forEuropean put options in R

1 BSPut lt- function(S K r T sigma)d1 = (log(SK)+(r+sigma^22)T)(sigmasqrt(T))

3 d2 = d1 - sigma sqrt(T)BSPut = Kexp(-rT) pnorm(-d2) - Spnorm(-d1)

5 BSPut

Call-put parity

lowast Right-click on the figure for interaction and ldquoFull Screen Multimediardquo viewdagger The animation works in Acrobat Reader on the entire pdf file

215

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

(C) 2012--today Alexander Grahn 3Dmenujs version 20140923 3D JavaScript used by media9sty Extended functionality of the (right click) context menu of 3D annotations 1) Adds the following items to the 3D context menu `Generate Default View Finds good default camera settings returned as options for use with the includemedia command `Get Current View Determines camera cross section and part settings of the current view returned as `VIEW section that can be copied into a views file of additional views The views file is inserted using the `3Dviews option of includemedia `Cross Section Toggle switch to add or remove a cross section into or from the current view The cross section can be moved in the x y z directions using x y z and X Y Z keys on the keyboard be tilted against and spun around the upright Z axis using the UpDown and LeftRight arrow keys and caled using the s and S keys 2) Enables manipulation of position and orientation of indiviual parts and groups of parts in the 3D scene Parts which have been selected with the mouse can be scaled moved around and rotated like the cross section as described above To spin the parts around their local up-axis keep Control key pressed while using the UpDown and LeftRight arrow keys This work may be distributed andor modified under the conditions of the LaTeX Project Public License The latest version of this license is in httpmirrorsctanorgmacroslatexbaselppltxt This work has the LPPL maintenance status `maintained The Current Maintainer of this work is A Grahn The code borrows heavily from Bernd Gaertners `Miniball software originally written in C++ for computing the smallest enclosing ball of a set of points see httpwwwinfethzchpersonalgaertnerminiballhtmlhostconsoleshow()constructor for doubly linked listfunction List() thisfirst_node=null thislast_node=new Node(undefined)Listprototypepush_back=function(x) var new_node=new Node(x) if(thisfirst_node==null) thisfirst_node=new_node new_nodeprev=null else new_nodeprev=thislast_nodeprev new_nodeprevnext=new_node new_nodenext=thislast_node thislast_nodeprev=new_nodeListprototypemove_to_front=function(it) var node=itget() if(nodenext=null ampamp nodeprev=null) nodenextprev=nodeprev nodeprevnext=nodenext nodeprev=null nodenext=thisfirst_node thisfirst_nodeprev=node thisfirst_node=node Listprototypebegin=function() var i=new Iterator() itarget=thisfirst_node return(i)Listprototypeend=function() var i=new Iterator() itarget=thislast_node return(i)function Iterator(it) if( it=undefined ) thistarget=ittarget else thistarget=null Iteratorprototypeset=function(it)thistarget=ittargetIteratorprototypeget=function()return(thistarget)Iteratorprototypederef=function()return(thistargetdata)Iteratorprototypeincr=function() if(thistargetnext=null) thistarget=thistargetnextconstructor for node objects that populate the linked listfunction Node(x) thisprev=null thisnext=null thisdata=xfunction sqr(r)return(rr)helper functionMiniball algorithm by B Gaertnerfunction Basis() thism=0 thisq0=new Array(3) thisz=new Array(4) thisf=new Array(4) thisv=new Array(new Array(3) new Array(3) new Array(3) new Array(3)) thisa=new Array(new Array(3) new Array(3) new Array(3) new Array(3)) thisc=new Array(new Array(3) new Array(3) new Array(3) new Array(3)) thissqr_r=new Array(4) thiscurrent_c=thisc[0] thiscurrent_sqr_r=0 thisreset()Basisprototypecenter=function()return(thiscurrent_c)Basisprototypesize=function()return(thism)Basisprototypepop=function()--thismBasisprototypeexcess=function(p) var e=-thiscurrent_sqr_r for(var k=0klt3++k) e+=sqr(p[k]-thiscurrent_c[k]) return(e)Basisprototypereset=function() thism=0 for(var j=0jlt3++j) thisc[0][j]=0 thiscurrent_c=thisc[0] thiscurrent_sqr_r=-1Basisprototypepush=function(p) var i j var eps=1e-32 if(thism==0) for(i=0ilt3++i) thisq0[i]=p[i] for(i=0ilt3++i) thisc[0][i]=thisq0[i] thissqr_r[0]=0 else for(i=0ilt3++i) thisv[thism][i]=p[i]-thisq0[i] for(i=1iltthism++i) thisa[thism][i]=0 for(j=0jlt3++j) thisa[thism][i]+=thisv[i][j]thisv[thism][j] thisa[thism][i]=(2thisz[i]) for(i=1iltthism++i) for(j=0jlt3++j) thisv[thism][j]-=thisa[thism][i]thisv[i][j] thisz[thism]=0 for(j=0jlt3++j) thisz[thism]+=sqr(thisv[thism][j]) thisz[thism]=2 if(thisz[thism]ltepsthiscurrent_sqr_r) return(false) var e=-thissqr_r[thism-1] for(i=0ilt3++i) e+=sqr(p[i]-thisc[thism-1][i]) thisf[thism]=ethisz[thism] for(i=0ilt3++i) thisc[thism][i]=thisc[thism-1][i]+thisf[thism]thisv[thism][i] thissqr_r[thism]=thissqr_r[thism-1]+ethisf[thism]2 thiscurrent_c=thisc[thism] thiscurrent_sqr_r=thissqr_r[thism] ++thism return(true)function Miniball() thisL=new List() thisB=new Basis() thissupport_end=new Iterator()Miniballprototypemtf_mb=function(it) var i=new Iterator(it) thissupport_endset(thisLbegin()) if((thisBsize())==4) return for(var k=new Iterator(thisLbegin())kget()=iget()) var j=new Iterator(k) kincr() if(thisBexcess(jderef()) gt 0) if(thisBpush(jderef())) thismtf_mb(j) thisBpop() if(thissupport_endget()==jget()) thissupport_endincr() thisLmove_to_front(j) Miniballprototypecheck_in=function(b) thisLpush_back(b)Miniballprototypebuild=function() thisBreset() thissupport_endset(thisLbegin()) thismtf_mb(thisLend())Miniballprototypecenter=function() return(thisBcenter())Miniballprototyperadius=function() return(Mathsqrt(thisBcurrent_sqr_r))functions called by menu itemsfunction calc3Dopts () create Miniball object var mb=new Miniball() auxiliary vector var corner=new Vector3() iterate over all visible mesh nodes in the scene for(i=0iltscenemeshescounti++) var mesh=scenemeshesgetByIndex(i) if(meshvisible) continue local to parent transformation matrix var trans=meshtransform build local to world transformation matrix by recursively multiplying the parents transf matrix on the right var parent=meshparent while(parenttransform) trans=transmultiply(parenttransform) parent=parentparent get the bbox of the mesh (local coordinates) var bbox=meshcomputeBoundingBox() transform the local bounding box corner coordinates to world coordinates for bounding sphere determination BBoxmin cornerset(bboxmin) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) BBoxmax cornerset(bboxmax) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) remaining six BBox corners cornerset(bboxminx bboxmaxy bboxmaxz) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) cornerset(bboxminx bboxminy bboxmaxz) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) cornerset(bboxminx bboxmaxy bboxminz) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) cornerset(bboxmaxx bboxminy bboxminz) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) cornerset(bboxmaxx bboxminy bboxmaxz) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) cornerset(bboxmaxx bboxmaxy bboxminz) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) compute the smallest enclosing bounding sphere mbbuild() current camera settings var camera=scenecamerasgetByIndex(0) var res= initialize result string aperture angle of the virtual camera (perspective projection) or orthographic scale (orthographic projection) if(cameraprojectionType==cameraTYPE_PERSPECTIVE) var aac=camerafov180MathPI if(hostutilprintf(4f aac)=30) res+=hostutilprintf(n3Daac=s aac) else cameraviewPlaneSize=2mbradius() res+=hostutilprintf(n3Dortho=s 1cameraviewPlaneSize) camera roll var roll = cameraroll180MathPI if(hostutilprintf(4f roll)=0) res+=hostutilprintf(n3Droll=sroll) target to camera vector var c2c=new Vector3() c2cset(cameraposition) c2csubtractInPlace(cameratargetPosition) c2cnormalize() if((c2cx==0 ampamp c2cy==-1 ampamp c2cz==0)) res+=hostutilprintf(n3Dc2c=s s s c2cx c2cy c2cz) new camera settings bounding sphere centre --gt new camera target var coo=new Vector3() cooset((mbcenter())[0] (mbcenter())[1] (mbcenter())[2]) if(coolength) res+=hostutilprintf(n3Dcoo=s s s coox cooy cooz) radius of orbit if(cameraprojectionType==cameraTYPE_PERSPECTIVE) var roo=mbradius() Mathsin(aac MathPI 360) else orthographic projection var roo=mbradius() res+=hostutilprintf(n3Droo=s roo) update camera settings in the viewer var currol=cameraroll cameratargetPositionset(coo) camerapositionset(cooadd(c2cscale(roo))) cameraroll=currol determine background colour rgb=scenebackgroundgetColor() if((rgbr==1 ampamp rgbg==1 ampamp rgbb==1)) res+=hostutilprintf(n3Dbg=s s s rgbr rgbg rgbb) determine lighting scheme switch(scenelightScheme) case sceneLIGHT_MODE_FILE curlights=Artworkbreak case sceneLIGHT_MODE_NONE curlights=Nonebreak case sceneLIGHT_MODE_WHITE curlights=Whitebreak case sceneLIGHT_MODE_DAY curlights=Daybreak case sceneLIGHT_MODE_NIGHT curlights=Nightbreak case sceneLIGHT_MODE_BRIGHT curlights=Hardbreak case sceneLIGHT_MODE_RGB curlights=Primarybreak case sceneLIGHT_MODE_BLUE curlights=Bluebreak case sceneLIGHT_MODE_RED curlights=Redbreak case sceneLIGHT_MODE_CUBE curlights=Cubebreak case sceneLIGHT_MODE_CAD curlights=CADbreak case sceneLIGHT_MODE_HEADLAMP curlights=Headlampbreak if(curlights=Artwork) res+=hostutilprintf(n3Dlights=s curlights) determine global render mode switch(scenerenderMode) case sceneRENDER_MODE_BOUNDING_BOX currender=BoundingBoxbreak case sceneRENDER_MODE_TRANSPARENT_BOUNDING_BOX currender=TransparentBoundingBoxbreak case sceneRENDER_MODE_TRANSPARENT_BOUNDING_BOX_OUTLINE currender=TransparentBoundingBoxOutlinebreak case sceneRENDER_MODE_VERTICES currender=Verticesbreak case sceneRENDER_MODE_SHADED_VERTICES currender=ShadedVerticesbreak case sceneRENDER_MODE_WIREFRAME currender=Wireframebreak case sceneRENDER_MODE_SHADED_WIREFRAME currender=ShadedWireframebreak case sceneRENDER_MODE_SOLID currender=Solidbreak case sceneRENDER_MODE_TRANSPARENT currender=Transparentbreak case sceneRENDER_MODE_SOLID_WIREFRAME currender=SolidWireframebreak case sceneRENDER_MODE_TRANSPARENT_WIREFRAME currender=TransparentWireframebreak case sceneRENDER_MODE_ILLUSTRATION currender=Illustrationbreak case sceneRENDER_MODE_SOLID_OUTLINE currender=SolidOutlinebreak case sceneRENDER_MODE_SHADED_ILLUSTRATION currender=ShadedIllustrationbreak case sceneRENDER_MODE_HIDDEN_WIREFRAME currender=HiddenWireframebreak if(currender=Solid) res+=hostutilprintf(n3Drender=s currender) write result string to the console hostconsoleshow() hostconsoleclear() hostconsoleprintln(n Copy and paste the following text to then+ option list of includemedian + res + n)function get3Dview () var camera=scenecamerasgetByIndex(0) var coo=cameratargetPosition var c2c=camerapositionsubtract(coo) var roo=c2clength c2cnormalize() var res=VIEW=insert optional name heren if((coox==0 ampamp cooy==0 ampamp cooz==0)) res+=hostutilprintf( COO=s s sn coox cooy cooz) if((c2cx==0 ampamp c2cy==-1 ampamp c2cz==0)) res+=hostutilprintf( C2C=s s sn c2cx c2cy c2cz) if(roo gt 1e-9) res+=hostutilprintf( ROO=sn roo) var roll = cameraroll180MathPI if(hostutilprintf(4f roll)=0) res+=hostutilprintf( ROLL=sn roll) if(cameraprojectionType==cameraTYPE_PERSPECTIVE) var aac=camerafov 180MathPI if(hostutilprintf(4f aac)=30) res+=hostutilprintf( AAC=sn aac) else if(hostutilprintf(4f cameraviewPlaneSize)=1) res+=hostutilprintf( ORTHO=sn 1cameraviewPlaneSize) rgb=scenebackgroundgetColor() if((rgbr==1 ampamp rgbg==1 ampamp rgbb==1)) res+=hostutilprintf( BGCOLOR=s s sn rgbr rgbg rgbb) switch(scenelightScheme) case sceneLIGHT_MODE_FILE curlights=Artworkbreak case sceneLIGHT_MODE_NONE curlights=Nonebreak case sceneLIGHT_MODE_WHITE curlights=Whitebreak case sceneLIGHT_MODE_DAY curlights=Daybreak case sceneLIGHT_MODE_NIGHT curlights=Nightbreak case sceneLIGHT_MODE_BRIGHT curlights=Hardbreak case sceneLIGHT_MODE_RGB curlights=Primarybreak case sceneLIGHT_MODE_BLUE curlights=Bluebreak case sceneLIGHT_MODE_RED curlights=Redbreak case sceneLIGHT_MODE_CUBE curlights=Cubebreak case sceneLIGHT_MODE_CAD curlights=CADbreak case sceneLIGHT_MODE_HEADLAMP curlights=Headlampbreak if(curlights=Artwork) res+= LIGHTS=+curlights+n switch(scenerenderMode) case sceneRENDER_MODE_BOUNDING_BOX defaultrender=BoundingBoxbreak case sceneRENDER_MODE_TRANSPARENT_BOUNDING_BOX defaultrender=TransparentBoundingBoxbreak case sceneRENDER_MODE_TRANSPARENT_BOUNDING_BOX_OUTLINE defaultrender=TransparentBoundingBoxOutlinebreak case sceneRENDER_MODE_VERTICES defaultrender=Verticesbreak case sceneRENDER_MODE_SHADED_VERTICES defaultrender=ShadedVerticesbreak case sceneRENDER_MODE_WIREFRAME defaultrender=Wireframebreak case sceneRENDER_MODE_SHADED_WIREFRAME defaultrender=ShadedWireframebreak case sceneRENDER_MODE_SOLID defaultrender=Solidbreak case sceneRENDER_MODE_TRANSPARENT defaultrender=Transparentbreak case sceneRENDER_MODE_SOLID_WIREFRAME defaultrender=SolidWireframebreak case sceneRENDER_MODE_TRANSPARENT_WIREFRAME defaultrender=TransparentWireframebreak case sceneRENDER_MODE_ILLUSTRATION defaultrender=Illustrationbreak case sceneRENDER_MODE_SOLID_OUTLINE defaultrender=SolidOutlinebreak case sceneRENDER_MODE_SHADED_ILLUSTRATION defaultrender=ShadedIllustrationbreak case sceneRENDER_MODE_HIDDEN_WIREFRAME defaultrender=HiddenWireframebreak if(defaultrender=Solid) res+= RENDERMODE=+defaultrender+n detect existing Clipping Plane (3D Cross Section) var clip=null if( clip=scenenodesgetByName($$$$$$)|| clip=scenenodesgetByName(Clipping Plane) ) for(var i=0iltscenenodescounti++) var nd=scenenodesgetByIndex(i) if(nd==clip||ndname==) continue var ndUTFName= for (var j=0 jltndnamelength j++) var theUnicode = ndnamecharCodeAt(j)toString(16) while (theUnicodelengthlt4) theUnicode = 0 + theUnicode ndUTFName += theUnicode var end=ndnamelastIndexOf() if(endgt0) var ndUserName=ndnamesubstr(0end) else var ndUserName=ndname respart= PART=+ndUserName+n respart+= UTF16NAME=+ndUTFName+n defaultvals=true if(ndvisible) respart+= VISIBLE=falsen defaultvals=false if(ndopacitylt10) respart+= OPACITY=+ndopacity+n defaultvals=false if(ndconstructorname==Mesh) currender=defaultrender switch(ndrenderMode) case sceneRENDER_MODE_BOUNDING_BOX currender=BoundingBoxbreak case sceneRENDER_MODE_TRANSPARENT_BOUNDING_BOX currender=TransparentBoundingBoxbreak case sceneRENDER_MODE_TRANSPARENT_BOUNDING_BOX_OUTLINE currender=TransparentBoundingBoxOutlinebreak case sceneRENDER_MODE_VERTICES currender=Verticesbreak case sceneRENDER_MODE_SHADED_VERTICES currender=ShadedVerticesbreak case sceneRENDER_MODE_WIREFRAME currender=Wireframebreak case sceneRENDER_MODE_SHADED_WIREFRAME currender=ShadedWireframebreak case sceneRENDER_MODE_SOLID currender=Solidbreak case sceneRENDER_MODE_TRANSPARENT currender=Transparentbreak case sceneRENDER_MODE_SOLID_WIREFRAME currender=SolidWireframebreak case sceneRENDER_MODE_TRANSPARENT_WIREFRAME currender=TransparentWireframebreak case sceneRENDER_MODE_ILLUSTRATION currender=Illustrationbreak case sceneRENDER_MODE_SOLID_OUTLINE currender=SolidOutlinebreak case sceneRENDER_MODE_SHADED_ILLUSTRATION currender=ShadedIllustrationbreak case sceneRENDER_MODE_HIDDEN_WIREFRAME currender=HiddenWireframebreak case sceneRENDER_MODE_DEFAULT currender=Defaultbreak if(currender=defaultrender) respart+= RENDERMODE=+currender+n defaultvals=false if(origtrans[ndname]ampampndtransformisEqual(origtrans[ndname])) var lvec=ndtransformtransformDirection(new Vector3(100)) var uvec=ndtransformtransformDirection(new Vector3(010)) var vvec=ndtransformtransformDirection(new Vector3(001)) respart+= TRANSFORM= +lvecx+ +lvecy+ +lvecz+ +uvecx+ +uvecy+ +uvecz+ +vvecx+ +vvecy+ +vvecz+ +ndtransformtranslationx+ +ndtransformtranslationy+ +ndtransformtranslationz+n defaultvals=false respart+= ENDn if(defaultvals) res+=respart if(clip) var centre=cliptransformtranslation var normal=cliptransformtransformDirection(new Vector3(001)) res+= CROSSSECTn if((centrex==0 ampamp centrey==0 ampamp centrez==0)) res+=hostutilprintf( CENTER=s s sn centrex centrey centrez) if((normalx==1 ampamp normaly==0 ampamp normalz==0)) res+=hostutilprintf( NORMAL=s s sn normalx normaly normalz) res+=hostutilprintf( VISIBLE=sn clipvisible) res+=hostutilprintf( PLANECOLOR=s s sn clipmaterialemissiveColorr clipmaterialemissiveColorg clipmaterialemissiveColorb) res+=hostutilprintf( OPACITY=sn clipopacity) res+=hostutilprintf( INTERSECTIONCOLOR=s s sn clipwireframeColorr clipwireframeColorg clipwireframeColorb) res+= ENDn for(var propt in clip) consoleprintln(propt++clip[propt]) res+=ENDn hostconsoleshow() hostconsoleclear() hostconsoleprintln(n Add the following VIEW section to a file ofn+ predefined views (See option 3Dviews)nn + The view may be given a name after VIEW=n + (Remove in front of =)n) hostconsoleprintln(res + n)add items to 3D context menuruntimeaddCustomMenuItem(dfltview Generate Default View default 0)runtimeaddCustomMenuItem(currview Get Current View default 0)runtimeaddCustomMenuItem(csection Cross Section checked 0)menu event handlersmenuEventHandler = new MenuEventHandler()menuEventHandleronEvent = function(e) switch(emenuItemName) case dfltview calc3Dopts() break case currview get3Dview() break case csection addremoveClipPlane(emenuItemChecked) break runtimeaddEventHandler(menuEventHandler)global variable taking reference to currently selected nodevar target=nullselectionEventHandler=new SelectionEventHandler()selectionEventHandleronEvent=function(e) if(eselectedampampenodename=) target=enode else target=null runtimeaddEventHandler(selectionEventHandler)cameraEventHandler=new CameraEventHandler()cameraEventHandleronEvent=function(e) var clip=null runtimeremoveCustomMenuItem(csection) runtimeaddCustomMenuItem(csection Cross Section checked 0) if(clip=scenenodesgetByName($$$$$$)|| predefined scenenodesgetByName(Clipping Plane)) added via context menu runtimeremoveCustomMenuItem(csection) runtimeaddCustomMenuItem(csection Cross Section checked 1) if(clip)plane in predefined views must be rotated by 90 deg around normal cliptransformrotateAboutLineInPlace( MathPI2cliptransformtranslation cliptransformtransformDirection(new Vector3(001)) ) for(var i=0 iltrot4x4length i++)rot4x4[i]setIdentity() target=nullruntimeaddEventHandler(cameraEventHandler)var rot4x4=new Array() keeps track of spin and tilt axes transformationskey event handler for scaling moving spinning and tilting objectskeyEventHandler=new KeyEventHandler()keyEventHandleronEvent=function(e) var backtrans=new Matrix4x4() var trgt=null if(target) trgt=target var backtrans=new Matrix4x4() var trans=trgttransform var parent=trgtparent while(parenttransform) build local to world transformation matrix transmultiplyInPlace(parenttransform) also build world to local back-transformation matrix backtransmultiplyInPlace(parenttransforminversetranspose) parent=parentparent backtranstransposeInPlace() else if( trgt=scenenodesgetByName($$$$$$)|| trgt=scenenodesgetByName(Clipping Plane) ) var trans=trgttransform if(trgt) return var tname=trgtname if(typeof(rot4x4[tname])==undefined) rot4x4[tname]=new Matrix4x4() if(target) var tiltAxis=rot4x4[tname]transformDirection(new Vector3(010)) else var tiltAxis=transtransformDirection(new Vector3(010)) var spinAxis=rot4x4[tname]transformDirection(new Vector3(001)) get the centre of the mesh if(targetampamptrgtconstructorname==Mesh) var centre=transtransformPosition(trgtcomputeBoundingBox()center) else part group (Node3 parent node clipping plane) var centre=new Vector3(transtranslation) switch(echaracterCode) case 30tilt up rot4x4[tname]rotateAboutLineInPlace( -MathPI900rot4x4[tname]translationtiltAxis) transrotateAboutLineInPlace(-MathPI900centretiltAxis) break case 31tilt down rot4x4[tname]rotateAboutLineInPlace( MathPI900rot4x4[tname]translationtiltAxis) transrotateAboutLineInPlace(MathPI900centretiltAxis) break case 28spin right if(ectrlKeyDownampamptarget) transrotateAboutLineInPlace(-MathPI900centrespinAxis) else rot4x4[tname]rotateAboutLineInPlace( -MathPI900rot4x4[tname]translationnew Vector3(001)) transrotateAboutLineInPlace(-MathPI900centrenew Vector3(001)) break case 29spin left if(ectrlKeyDownampamptarget) transrotateAboutLineInPlace(MathPI900centrespinAxis) else rot4x4[tname]rotateAboutLineInPlace( MathPI900rot4x4[tname]translationnew Vector3(001)) transrotateAboutLineInPlace(MathPI900centrenew Vector3(001)) break case 120 x translateTarget(trans new Vector3(100) e) break case 121 y translateTarget(trans new Vector3(010) e) break case 122 z translateTarget(trans new Vector3(001) e) break case 88 shift + x translateTarget(trans new Vector3(-100) e) break case 89 shift + y translateTarget(trans new Vector3(0-10) e) break case 90 shift + z translateTarget(trans new Vector3(00-1) e) break case 115 s transtranslateInPlace(centrescale(-1)) transscaleInPlace(101) transtranslateInPlace(centrescale(1)) break case 83 shift + s transtranslateInPlace(centrescale(-1)) transscaleInPlace(1101) transtranslateInPlace(centrescale(1)) break transmultiplyInPlace(backtrans)runtimeaddEventHandler(keyEventHandler)translates object by amount calculated from Canvas sizefunction translateTarget(t d e) var cam=scenecamerasgetByIndex(0) if(camprojectionType==camTYPE_PERSPECTIVE) var scale=Mathtan(camfov2) camtargetPositionsubtract(camposition)length Mathmin(ecanvasPixelWidthecanvasPixelHeight) else var scale=camviewPlaneSize2 Mathmin(ecanvasPixelWidthecanvasPixelHeight) ttranslateInPlace(dscale(scale))function addremoveClipPlane(chk) var curTrans=getCurTrans() var clip=scenecreateClippingPlane() if(chk) add Clipping Plane and place its center either into the camera target position or into the centre of the currently selected mesh node var centre=new Vector3() if(target) var trans=targettransform var parent=targetparent while(parenttransform) trans=transmultiply(parenttransform) parent=parentparent if(targetconstructorname==Mesh) var centre=transtransformPosition(targetcomputeBoundingBox()center) else var centre=new Vector3(transtranslation) target=null else centreset(scenecamerasgetByIndex(0)targetPosition) cliptransformsetView( new Vector3(000) new Vector3(100) new Vector3(010)) cliptransformtranslateInPlace(centre) else if( scenenodesgetByName($$$$$$)|| scenenodesgetByName(Clipping Plane) ) clipremove()clip=null restoreTrans(curTrans) return clipfunction to store current transformation matrix of all nodes in the scenefunction getCurTrans() var tA=new Array() for(var i=0 iltscenenodescount i++) var nd=scenenodesgetByIndex(i) if(ndname==) continue tA[ndname]=new Matrix4x4(ndtransform) return tAfunction to restore transformation matrices given as argfunction restoreTrans(tA) for(var i=0 iltscenenodescount i++) var nd=scenenodesgetByIndex(i) if(tA[ndname]) ndtransformset(tA[ndname]) store original transformation matrix of all mesh nodes in the scenevar origtrans=getCurTrans()set initial state of Cross Section menu entrycameraEventHandleronEvent(1)hostconsoleclear()

var ocgs=hostgetOCGs(hostpageNum)for(var i=0iltocgslengthi++)if(ocgs[i]name==MediaPlayButton2)ocgs[i]state=false

(C) 2012 Michail Vidiassov John C Bowman Alexander Grahn asylabelsjs version 20120912 3D JavaScript to be used with media9sty (option `add3Djscript) for Asymptote generated PRC files adds billboard behaviour to text labels in Asymptote PRC files so that they always face the camera under 3D rotation This work may be distributed andor modified under the conditions of the LaTeX Project Public License The latest version of this license is in httpmirrorsctanorgmacroslatexbaselppltxt This work has the LPPL maintenance status `maintained The Current Maintainer of this work is A Grahnvar bbnodes=new Array() billboard meshesvar bbtrans=new Array() billboard transformsfunction fulltransform(mesh) var t=new Matrix4x4(meshtransform) if(meshparentname = ) var parentTransform=fulltransform(meshparent) tmultiplyInPlace(parentTransform) return t else return t find all text labels in the scene and determine pivoting pointsvar nodes=scenenodesvar nodescount=nodescountvar third=1030for(var i=0 i lt nodescount i++) var node=nodesgetByIndex(i) var name=nodename var end=namelastIndexOf()-1 if(end gt 0) if(namecharAt(end) == 001) var start=namelastIndexOf(-)+1 if(end gt start) nodename=namesubstr(0start-1) var nodeMatrix=fulltransform(nodeparent) var c=nodeMatrixtranslation position var d=Mathpow(Mathabs(nodeMatrixdeterminant)third) scale bbnodespush(node) bbtranspush(Matrix4x4()scale(ddd)translate(c)multiply(nodeMatrixinverse)) var camera=scenecamerasgetByIndex(0) var zero=new Vector3(000)var bbcount=bbnodeslength event handler to maintain camera-facing text labelsbillboardHandler=new RenderEventHandler()billboardHandleronEvent=function(event) var T=new Matrix4x4() TsetView(zerocamerapositionsubtract(cameratargetPosition) cameraupsubtract(cameraposition)) for(var j=0 j lt bbcount j++) bbnodes[j]transformset(Tmultiply(bbtrans[j])) runtimerefresh() runtimeaddEventHandler(billboardHandler)runtimerefresh()

(C) 2012 Alexander Grahn 3Dspintooljs version 20120301 3D JavaScript to be used with media9sty (option `add3Djscript) enables the Spin tool (also accessible via 3D toolbar or context menu) upon activation of the 3D scene the scene then rotates around the upright axis while dragging with the mouse This work may be distributed andor modified under the conditions of the LaTeX Project Public License The latest version of this license is in httpmirrorsctanorgmacroslatexbaselppltxt This work has the LPPL maintenance status `maintained The Current Maintainer of this work is A GrahnruntimesetCurrentTool(runtimeTOOL_NAME_SPIN)

N Privault

Proposition 66 Call-put parity We have the call-put parity relation

gc(tSt)minus gp(tSt) = St minusK eminus(Tminust)r 0 6 t 6 T (621)

between the Black-Scholes prices of call and put options in terms of theforward contract price St minusK eminus(Tminust)r

Proof The call-put parity (621) is a consequence of the relation

xminusK = (xminusK)+ minus (K minus x)+

satisfied by the terminal call and put payoff functions in the Black-ScholesPDE (67) It can also be verified directly from (610) and (618) as

gc(tx)minus gp(tx) = xΦ(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)minus(K eminus(Tminust)rΦ

(minus dminus(T minus t)

)minus xΦ

(minus d+(T minus t)

))= xΦ

(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)minusK eminus(Tminust)r

(1minusΦ

(dminus(T minus t)

))+ x

(1minusΦ

(d+(T minus t)

))= xminusK

The Delta of the Black-Scholes put option can be obtained by differentiationof the call-put parity relation (621) and Proposition 64

Proposition 67 The Delta of the Black-Scholes put option is given by

ξt = minus(1minusΦ(d+(T minus t)

)) = minusΦ

(minus d+(T minus t)

)isin [minus1 0] 0 6 t 6 T

Proof By the call-put parity relation (621) and Proposition 64 we have

partgppartx

(tSt) =partgcpartx

(tSt)minus 1

= Φ(d+(T minus t))minus 1= minusΦ(minusd+(T minus t)) 0 6 t 6 T

where we applied (614)

As a consequence of Proposition 67 the Black-Scholes put price splitsinto a risky component minusStΦ

(minus d+(T minus t)

)and a riskless component

K eminus(Tminust)rΦ(minus dminus(T minus t)

) as follows

gp(tSt) = K eminus(Tminust)rΦ(minus dminus(T minus t)

)︸ ︷︷ ︸riskminusfree investment (savings)

minus StΦ(minus d+(T minus t)

)︸ ︷︷ ︸

risky investment (short)

0 6 t 6 T

216

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

In Figure 613 we plot the Delta of the European put option as a function ofthe underlying asset price and of the time remaining until maturity

Payoff function (x-K)+

0

50

100

150

200

Underlying

0

5

10

15 Time to maturity T-t

-1

-075

-05

-025

0

Fig 613 Delta of a European put option with strike price K = 100 r = 3 σ = 10

Numerical example - hedging of a put option

For one more example we consider a put option issued by BNP Paribas on04 November 2008 with strike price K=$77667 maturity T = October 052009 and entitlement ratio 92593 cf page 9 In the next Figure 614 thenumber of days is counted from the origin not from maturity

40 50 60 70 80 90 100

0 50 100 150 200

0 5

10 15 20 25 30 35 40 45

Underlying (HK$)Time in days

Fig 614 Path of the Black-Scholes price for a put option on HSBC

As a consequence of Proposition 67 the amount invested on the risky assetfor the hedging of a put option is

minusStΦ(minus d+(T minus t)

)= minusStΦ

(minus log(StK) + (r+ σ22)(T minus t)

|σ|radicT minus t

)6 0

217

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

ie there is always short selling and the amount invested on the riskless assetpriced At = ert t isin [0T ] is

ηtAt = K eminus(Tminust)rΦ(minus dminus(T minus t)

)= K eminus(Tminust)rΦ

(minus log(StK) + (rminus σ22)(T minus t)

|σ|radicT minus t

)gt 0

which is always nonnegative ie we are constantly saving money on theriskless asset as noted in Figure 615

-60

-40

-20

0

20

40

60

80

100

0 50 100 150 200

K

HK$

Black-Scholes priceRisky investment ξtSt

Riskless investment ηtAtUnderlying asset price

Fig 615 Time evolution of the hedging portfolio for a put option on HSBC

In the above example the put option finished out of the money (OTM) so thatno cash settlement or physical delivery occurs A comparison of Figure 610with market data can be found in Figures 913 and 914 below

64 Market Terms and Data

The following Table 61 provides a summary of formulas for the computationof Black-Scholes sensitivities also called Greekslowast

lowast ldquoEvery class feels like attending a Greek lessonrdquo (AY2018-2019 student feedback)

218

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

Call option Put option

Option price g(tSt) StΦ(d+(T minus t))minusK eminus(Tminust)rΦ(dminus(T minus t)) K eminus(Tminust)rΦ(minusdminus(T minus t))minus StΦ(minusd+(T minus t))

Delta (∆) partg

partx(tSt) Φ(d+(T minus t)) gt 0 minusΦ(minusd+(T minus t)) 6 0

Gamma (Γ) part2g

partx2 (tSt)Φprime(d+(T minus t))St|σ|

radicT minus t

gt 0

Vega partg

partσ(tSt) St

radicT minus tΦprime(d+(T minus t)) gt 0

Theta (Θ) partg

partt(tSt) minusSt|σ|Φ

prime(d+(T minus t))2radicT minus t

minus rK eminus(Tminust)rΦ(dminus(T minus t)) 6 0 minusSt|σ|Φprime(d+(T minus t))

2radicT minus t

+ rK eminus(Tminust)rΦ(minusdminus(T minus t))

Rho (ρ) partg

partr(tSt) K(T minus t) eminus(Tminust)rΦ(dminus(T minus t)) minusK(T minus t) eminus(Tminust)rΦ(minusdminus(T minus t))

Table 61 Black-Scholes Greeks (Wikipedia)

From Table 61 we can conclude that call option prices are increasing func-tions of the underlying asset price St of the interest rate r and of the volatil-ity parameter σ Similarly put option prices are decreasing functions of theunderlying asset price St of the interest rate r and increasing functions ofthe volatility parameter σ

Parameter Variation of call option prices Variation of put option prices

Underlying St increasing decreasing

Volatility σ increasing increasing

Time t decreasing depends on the underlying price level

Interest rate r increasing decreasing

Table 62 Variations of Black-Scholes prices

The change of sign of the sensitivity Theta (Θ) with respect to time t can beverified in the following Figure 616

219

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

(a) Black-Scholes call price maps (b) Black-Scholes put price maps

Fig 616 Time-dependent solutions of the Black-Scholes PDElowast

Intrinsic value The intrinsic value at time t isin [0T ] of the option withpayoff C = h

(S(1)T

)is given by the immediate exercise payoff h

(S(1)t

) The

extrinsic value at time t isin [0T ] of the option is the remaining differenceπt(C) minus h

(S(1)t

)between the option price πt(C) and the immediate ex-

ercise payoff h(S(1)t

) In general the option price πt(C) decomposes as

πt(C) = h(S(1)t

)︸ ︷︷ ︸intrinsic value

+ πt(C)minus h(S(1)t

)︸ ︷︷ ︸

extrinsic value

0 6 t 6 T ]

Gearing The gearing at time t isin [0T ] of the option with payoff C = h(ST )is defined as the ratio

Gt =St

πt(C)=

Stg(tSt)

0 6 t 6 T

Effective gearing The effective gearing at time t isin [0T ] of the option withpayoff C = h(ST ) is defined as the ratio

Get = Gtξt

=ξtStπt(C)

=St

πt(C)

partg

partx(tSt)

=St

g(tSt)partg

partx(tSt)

= Stpart

partxlog g(tSt) 0 6 t 6 T

lowast The animation works in Acrobat Reader on the entire pdf file

220

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

The effective gearingGet =

ξtStπt(C)

can be interpreted as the hedge ratio ie the percentage of the portfoliowhich is invested on the risky asset When written as

∆g(tSt)g(tSt)

= Get times

∆StSt

the effective gearing gives the relative variation or percentage change∆g(tSt)g(tSt) of the option price g(tSt) from the relative variation∆StSt in the underlying asset price

The ratio Get = Stpart log g(tSt)partx can also be interpreted as an elasticity

coefficient

Break-even price The break-even price BEPt of the underlying asset is thevalue of S for which the intrinsic option value h(S) equals the option priceπt(C) at time t isin [0T ] For European call options it is given by

BEPt = K + πt(C) = K + g(tSt) t = 0 1 N

whereas for European put options it is given by

BEPt = K minus πt(C) = K minus g(tSt) 0 6 t 6 T

Premium The option premium OPt can be defined as the variation requiredfrom the underlying asset price in order to reach the break-even price iewe have

OPt =BEPt minus St

St=K + g(tSt)minus St

St 0 6 t 6 T

for European call options and

OPt =St minusBEPt

St=St + g(tSt)minusK

St 0 6 t 6 T

for European put options see Figure 617 below The term ldquopremiumrdquo issometimes also used to denote the arbitrage price g(tSt) of the option

221

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

f (tx σ)100

=

x =

K =

xpart log f

partx=

σ =

partf

partt(tx σ)=

T=

=(xminusK)x

∆ = = partf

partx(tx σ)

= partf

partσ(tx σ)

=K+f (txσ)minusx

x

=K+f (tx σ)

rf=

partf

partt+rxpartf

partx+

σ2 2x2part2f

partx2

Fig 617 Warrant terms and data

The R package bizdays (requires to install QuantLib) can be used to computecalendar time vs business time to maturity1 installpackages(bizdays)

library(bizdays)3 load_quantlib_calendars(HongKong from=2018-01-01 to=2018-12-31)

load_quantlib_calendars(Singapore from=2018-01-01 to=2018-12-31)5 bizdays(2018-03-10 2018-04-03 QuantLibHongKong)

bizdays(2018-03-10 2018-04-03 QuantLibSingapore)

65 The Heat Equation

In the next proposition we notice that the solution f(tx) of the Black-Scholes PDE (67) can be transformed into a solution g(t y) of the simplerheat equation by a change of variable and a time inversion t 7minusrarr T minus t onthe interval [0T ] so that the terminal condition at time T in the Black-Scholes equation (622) becomes an initial condition at time t = 0 in theheat equation (625) See also here for a related discussion on changes ofvariables for the Black-Scholes PDE

222

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

Proposition 68 Assume that f(tx) solves the Black-Scholes PDErf(tx) = partf

partt(tx) + rx

partf

partx(tx) + 1

2σ2x2 part

2f

partx2 (tx)

f(T x) = (xminusK)+(622)

with terminal condition h(x) = (xminusK)+ x gt 0 Then the function g(t y)defined by

g(t y) = ertf(T minus t e|σ|y+(σ22minusr)t) (623)

solves the heat equation (625) with initial condition

ψ(y) = h(

e|σ|y) y isin R (624)

ie we have partg

partt(t y) = 1

2part2g

party2 (t y)

g(0 y) = h(

e|σ|y)

(625)

Proposition 68 will be proved in Section 66 It will allow us to solve theBlack-Scholes PDE (622) based on the solution of the heat equation (625)with initial condition ψ(y) = h

(e|σ|y

) y isin R by inversion of Relation (623)

with s = T minus t x = e|σ|y+(σ22minusr)t ie

f(sx) = eminus(Tminuss)rg(T minus s minus(σ

22minus r)(T minus s) + log x|σ|

)

Next we focus on the heat equation

partϕ

partt(t y) = 1

2part2ϕ

party2 (t y) (626)

which is used to model the diffusion of heat over time through solids Herethe data of g(x t) represents the temperature measured at time t and pointx We refer the reader to Widder (1975) for a complete treatment of thistopic

223

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

Fig 618 Time-dependent solution of the heat equationlowast

Proposition 69 The fundamental solution of the heat equation (626) isgiven by the Gaussian probability density function

ϕ(t y) =1radic2πt

eminusy2(2t) y isin R

with variance t gt 0

Proof The proof is done by a direct calculation as follows

partϕ

partt(t y) = part

partt

(eminusy2(2t)radic

2πt

)

= minus eminusy2(2t)

2t32radic

2π+

y2

2t2eminusy2(2t)radic

2πt

=

(minus 1

2t +y2

2t2

)ϕ(t y)

and

12part2ϕ

party2 (t y) = minus12part

party

(y

t

eminusy2(2t)radic

2πt

)

= minus eminusy2(2t)

2tradic

2πt+

y2

2t2eminusy2(2t)radic

2πt

=

(minus 1

2t +y2

2t2

)ϕ(t y) t gt 0 y isin R

lowast The animation works in Acrobat Reader on the entire pdf file

224

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

In Section 66 the heat equation (626) will be shown to be equivalent to theBlack-Scholes PDE after a change of variables In particular this will lead tothe explicit solution of the Black-Scholes PDE

Proposition 610 The heat equationpartg

partt(t y) = 1

2part2g

party2 (t y)

g(0 y) = ψ(y)

(627)

with continuous initial condition

g(0 y) = ψ(y)

has the solution

g(t y) =winfinminusinfin

ψ(z) eminus(yminusz)2(2t) dzradic2πt

y isin R t gt 0 (628)

Proof We have

partg

partt(t y) = part

partt

winfinminusinfin

ψ(z) eminus(yminusz)2(2t) dzradic2πt

=winfinminusinfin

ψ(z)part

partt

(eminus(yminusz)2(2t)radic

2πt

)dz

=12winfinminusinfin

ψ(z)

((yminus z)2

t2minus 1t

)eminus(yminusz)2(2t) dzradic

2πt

=12winfinminusinfin

ψ(z)part2

partz2 eminus(yminusz)2(2t) dzradic2πt

=12winfinminusinfin

ψ(z)part2

party2 eminus(yminusz)2(2t) dzradic2πt

=12part2

party2

winfinminusinfin

ψ(z) eminus(yminusz)2(2t) dzradic2πt

=12part2g

party2 (t y)

On the other hand it can be checked that at time t = 0 we have

limtrarr0

winfinminusinfin

ψ(z) eminus(yminusz)2(2t) dzradic2πt

= limtrarr0

winfinminusinfin

ψ(y+ z) eminusz2(2t) dzradic2πt

= ψ(y) y isin R

225

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

The next Figure 619 shows the evolution of g(tx) with initial conditionbased on the European call payoff function h(x) = (xminusK)+ ie

g(0 y) = ψ(y) = h(

e|σ|y)=(

e|σ|y minusK)+ y isin R

Fig 619 Time-dependent solution of the heat equationlowast

Let us provide a second proof of Proposition 610 this time using Brownianmotion and stochastic calculus

Proof of Proposition 610 First note that under the change of variable x =z minus y we have

g(t y) =winfinminusinfin

ψ(z) eminus(yminusz)2(2t) dzradic2πt

=winfinminusinfin

ψ(y+ x) eminusx2(2t) dxradic2πt

= IE[ψ(y+Bt)]

= IE[ψ(yminusBt)]

where (Bt)tisinR+ is a standard Brownian motion and Bt N (0 t) t isin R+Applying Itocircrsquos formula and using the fact that the expectation of the stochas-tic integral with respect to Brownian motion is zero see Relation (417) inProposition 420 we find

g(t y) = IE[ψ(yminusBt)]

= ψ(y)minus IE[w t

0ψprime(yminusBs)dBs

]+

12 IE

[w t0ψprimeprime(yminusBs)ds

]= ψ(y) +

12w t

0IE[ψprimeprime(yminusBs)

]ds

lowast The animation works in Acrobat Reader on the entire pdf file

226

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

= ψ(y) +12w t

0part2

party2 IE [ψ(yminusBs)] ds

= ψ(y) +12w t

0part2g

party2 (s y)ds

Hence we have

partg

partt(t y) = part

parttIE[ψ(yminusBt)]

=12part2

party2 IE [ψ(yminusBt)]

=12part2g

party2 (t y)

Regarding the initial condition we check that

g(0 y) = IE[ψ(yminusB0)] = IE[ψ(y)] = ψ(y)

The expression g(t y) = IE[ψ(yminusBt)] provides a probabilistic interpreta-tion of the heat diffusion phenomenon based on Brownian motion Namelywhen ψε(y) = 1[minusεε](y) we find that

gε(t y) = IE[ψε(yminusBt)]= IE[1[minusεε](yminusBt)]= P

(yminusBt isin [minusε ε]

)= P

(yminus ε 6 Bt 6 y+ ε

)represents the probability of finding Bt within a neighborhood [y minus ε y + ε]of the point y isin R

66 Solution of the Black-Scholes PDE

In this section we solve the Black-Scholes PDE by the kernel method of Sec-tion 65 and a change of variables This solution method uses the change ofvariables (623) of Proposition 68 and a time inversion from which the ter-minal condition at time T in the Black-Scholes equation becomes an initialcondition at time t = 0 in the heat equation

Next we state the proof Proposition 68

Proof Letting s = T minus t and x = e|σ|y+(σ22minusr)t and using Relation (623)ie

g(t y) = ertf(T minus t e|σ|y+(σ22minusr)t)

227

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

we have

partg

partt(t y) = r ertf

(T minus t e|σ|y+(σ22minusr)t)minus ert partf

parts

(T minus t e|σ|y+(σ22minusr)t)

+

(σ2

2 minus r)

ert e|σ|y+(σ22minusr)t partf

partx

(T minus t e|σ|y+(σ22minusr)t)

= r ertf(T minus tx)minus ert partfparts

(T minus tx) +(σ2

2 minus r)

ertxpartfpartx

(T minus tx)

=12 ertx2σ2 part

2f

partx2 (T minus tx) +σ2

2 ertxpartfpartx

(T minus tx) (629)

where on the last step we used the Black-Scholes PDE On the other handwe have

partg

party(t y) = |σ| ert e|σ|y+(σ22minusr)t partf

partx

(T minus t e|σ|y+(σ22minusr)t)

and

12partg2

party2 (t y) =σ2

2 ert e|σ|y+(σ22minusr)t partf

partx

(T minus t e|σ|y+(σ22minusr)t)

+σ2

2 ert e2|σ|y+2(σ22minusr)t part2f

partx2(T minus t e|σ|y+(σ22minusr)t)

=σ2

2 ertxpartfpartx

(T minus tx) + σ2

2 ertx2 part2f

partx2 (T minus tx) (630)

We conclude by comparing (629) with (630) which shows that g(tx) solvesthe heat equation (627) with initial condition

g(0 y) = f(T e|σ|y

)= h

(e|σ|y

)

In the next proposition we derive the Black-Scholes formula (610) by solv-ing the PDE (622) The Black-Scholes formula will also be recovered by aprobabilistic argument via the computation of an expected value in Proposi-tion 77

Proposition 611 When h(x) = (x minusK)+ the solution of the Black-Scholes PDE (622) is given by

f(tx) = xΦ(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

) x gt 0

whereΦ(x) =

1radic2π

w xminusinfin

eminusy22dy x isin R

and

228

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

d+(T minus t) =

log(xK) + (r+ σ22)(T minus t)|σ|radicT minus t

dminus(T minus t) =log(xK) + (rminus σ22)(T minus t)

|σ|radicT minus t

x gt 0 t isin [0T )

Proof By inversion of Relation (623) with s = T minus t and x = e|σ|y+(σ22minusr)twe get

f(sx) = eminus(Tminuss)rg(T minus s minus(σ

22minus r)(T minus s) + log x|σ|

)and

h(x) = ψ

(log x|σ|

) x gt 0 or ψ(y) = h

(e|σ|y

) y isin R

Hence using the solution (628) and Relation (624) we get

f(tx) = eminus(Tminust)rg(T minus t minus(σ

22minus r)(T minus t) + log x|σ|

)= eminus(Tminust)r

winfinminusinfin

ψ

(minus(σ22minus r)(T minus t) + log x

|σ|+ z

)eminusz2(2(Tminust)) dzradic

2(T minus t)π

= eminus(Tminust)rwinfinminusinfin

h(x e|σ|zminus(σ22minusr)(Tminust)) eminusz2(2(Tminust)) dzradic

2(T minus t)π

= eminus(Tminust)rwinfinminusinfin

(x e|σ|zminus(σ22minusr)(Tminust) minusK

)+ eminusz2(2(Tminust)) dzradic2(T minus t)π

= eminus(Tminust)r

timeswinfin

(minusr+σ22)(Tminust)+log(Kx)|σ|

(x e|σ|zminus(σ22minusr)(Tminust) minusK

)eminusz2(2(Tminust)) dzradic

2(T minus t)π

= x eminus(Tminust)rwinfinminusdminus(Tminust)

radicTminust

e|σ|zminus(σ22minusr)(Tminust) eminusz2(2(Tminust)) dzradic2(T minus t)π

minusK eminus(Tminust)rwinfinminusdminus(Tminust)

radicTminust

eminusz2(2(Tminust)) dzradic2(T minus t)π

= xwinfinminusdminus(Tminust)

radicTminust

e|σ|zminus(Tminust)σ22minusz2(2(Tminust)) dzradic2(T minus t)π

minusK eminus(Tminust)rwinfinminusdminus(Tminust)

radicTminust

eminusz2(2(Tminust)) dzradic2(T minus t)π

= xwinfinminusdminus(Tminust)

radicTminust

eminus(zminus(Tminust)|σ|)2(2(Tminust)) dzradic2(T minus t)π

229

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

minusK eminus(Tminust)rwinfinminusdminus(Tminust)

radicTminust

eminusz2(2(Tminust)) dzradic2(T minus t)π

= xwinfinminusdminus(Tminust)

radicTminustminus(Tminust)|σ|

eminusz2(2(Tminust)) dzradic2(T minus t)π

minusK eminus(Tminust)rwinfinminusdminus(Tminust)

radicTminust

eminusz2(2(Tminust)) dzradic2(T minus t)π

= xwinfinminusdminus(Tminust)minus|σ|

radicTminust

eminusz22 dzradic2πminusK eminus(Tminust)r

winfinminusdminus(Tminust)

eminusz22 dzradic2π

= x(1minusΦ

(minus d+(T minus t)

))minusK eminus(Tminust)r

(1minusΦ

(minus dminus(T minus t)

))= xΦ

(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)

where we used the relation (614) ie

1minusΦ(a) = Φ(minusa) a isin R

Exercises

Exercise 61 Bachelier (1900) model Consider a market made of a risklessasset valued At = A0 with zero interest rate t isin R+ and a risky asset whoseprice St is modeled by a standard Brownian motion as St = Bt t isin R+

a) Show that the price g(tBt) of the option with payoff C = B2T satisfies

the heat equationpartϕ

partt(t y) = minus1

2part2ϕ

party2 (t y)

with terminal condition g(T x) = x2b) Find the function g(tx) by solving the PDE of Question (a)

Hint Try a solution of the form g(tx) = x2 + f(t)

See Exercises 611 713 and 714 for extensions to nonzero interest rates

Exercise 62 Consider a risky asset price (St)tisinR modeled in the Cox et al(1985) (CIR) model as

dSt = β(αminus St)dt+ σradicStdBt αβσ gt 0 (631)

and let (ηt ξt)tisinR+ be a portfolio strategy whose value Vt = ηtAt + ξtSttakes the form Vt = g(tSt) t isin R+ Figure 620 presents a random simula-tion of the solution to (631) with α = 0025 β = 1 and σ = 13230

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

0

1

2

3

4

5

6

7

8

0 01 02 03 04 05 06 07 08 09 1

St

t

Fig 620 Graph of the CIR short rate t 7rarr rt with α = 25 β = 1 and σ = 13

N=10000 t lt- 0(N-1) dt lt- 10Na=0025 b=2 sigma=0052 X lt- rnorm(Nmean=0sd=sqrt(dt))R lt- rep(0N)R[1]=001

for (j in 2N)R[j]=max(0R[j-1]+(a-bR[j-1])dt+sigmasqrt(R[j-1])X[j])4 plot(t R xlab = t ylab = type = l ylim = c(0002) col = blue)

Based on the self-financing condition written as

dVt = rVtdtminus rξtStdt+ ξtdSt

= rVtdtminus rξtStdt+ β(αminus St)ξtdt+ σξtradicStdBt t isin R+ (632)

derive the PDE satisfied by the function g(tx) using the Itocirc formula

Exercise 63 Black-Scholes PDE with dividends Consider a riskless as-set with price At = A0 ert t isin R+ and an underlying asset price process(St)tisinR+ modeled as

dSt = (microminus δ)Stdt+ σStdBt

where (Bt)tisinR+ is a standard Brownian motion and δ gt 0 is a continuous-time dividend rate By absence of arbitrage the payment of a dividend entailsa drop in the stock price by the same amount occuring generally on the ex-dividend date on which the purchase of the security no longer entitles theinvestor to the dividend amount The list of investors entitled to dividendpayment is consolidated on the date of record and payment is made on thepayable date

library(quantmod)2 getSymbols(0005HKfrom=2010-01-01to=SysDate()src=yahoo)

getDividends(0005HKfrom=2010-01-01to=SysDate()src=yahoo)

a) Assuming that the portfolio with value Vt = ξtSt + ηtAt at time t is self-financing and that dividends are continuously reinvested write down theportfolio variation dVt

231

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

b) Assuming that the portfolio value Vt takes the form Vt = g(tSt) at timet derive the Black-Scholes PDE for the function g(tx) with its terminalcondition

c) Compute the price at time t isin [0T ] of the European call option withstrike price K by solving the corresponding Black-Scholes PDE

d) Compute the Delta of the option

Exercise 64

a) Check that the Black-Scholes formula (610) for European call options

gc(tx) = xΦ(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)

satisfies the following boundary conditions

i) at x = 0 gc(t 0) = 0ii) at maturity t = T

gc(T x) = (xminusK)+ =

xminusK x gt K

0 x 6 K

iii) as time to maturity tends to infinity

limTrarrinfin

Bl(Kxσ rT minus t) = x t isin R+

b) Check that the Black-Scholes formula (618) for European put options

gp(tx) = K eminus(Tminust)rΦ(minus dminus(T minus t)

)minus xΦ

(minus d+(T minus t)

)satisfies the following boundary conditions

i) at x = 0 gp(t 0) = K eminus(Tminust)rii) as x tends to infinity gp(tinfin) = 0 for all t isin [0T )iii) at maturity t = T

gp(T x) = (K minus x)+ =

0 x gt K

K minus x x 6 K

iv) as time to maturity tends to infinity

limTrarrinfin

Blp(KStσ rT minus t) = 0 t isin R+

Exercise 65 Power option (Exercise 314 continued)

232

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

a) Solve the Black-Scholes PDE

rg(x t) = partg

partt(x t) + rx

partg

partx(x t) + σ2

2 x2 part2g

partx2 (x t) (633)

with terminal condition g(xT ) = x2 x gt 0 t isin [0T ]

Hint Try a solution of the form g(x t) = x2f(t) and find f(t)b) Find the respective quantities ξt and ηt of the risky asset St and riskless

asset At = ert in the portfolio with value

Vt = g(St t) = ξtSt + ηtAt 0 6 t 6 T

hedging the contract with payoff S2T at maturity

Exercise 66 On December 18 2007 a call warrant has been issued byFortis Bank on the stock price S of the MTR Corporation with maturityT = 23122008 strike price K = HK$ 3608 and entitlement ratio=10Recall that in the Black-Scholes model the price at time t of the Europeanclaim on the underlying asset priced St with strike price K maturity T interest rate r and volatility σ gt 0 is given by the Black-Scholes formula as

f(tSt) = StΦ(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)

wheredminus(T minus t) =

(rminus σ22)(T minus t) + log(StK)

|σ|radicT minus t

d+(T minus t) = dminus(T minus t) + |σ|radicT minus t = (r+ σ22)(T minus t) + log(StK)

|σ|radicT minus t

Recall that by Proposition 64 we have

partf

partx(tSt) = Φ

(d+(T minus t)

) 0 6 t 6 T

a) Using the values of the Gaussian cumulative distribution function com-pute the Black-Scholes price of the corresponding call option at timet =November 07 2008 with St = HK$ 17200 assuming a volatility σ =90 = 090 and an annual risk-free interest rate r = 4377 = 004377

b) Still using the Gaussian cumulative distribution function compute thequantity of the risky asset required in your portfolio at time t =November07 2008 in order to hedge one such option at maturity T = 23122008

c) Figure 1 represents the Black-Scholes price of the call option as a functionof σ isin [05 15] = [50 150]

233

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

0

01

02

03

04

05

06

05 06 07 08 09 1 11 12 13 14 15σimp

Optio

n pr

ice

σ

Market price

Fig 621 Option price as a function of the volatility σ gt 0

1 BSCall lt- function(S K r T sigma)d1 lt- (log(SK)+(r+sigma^22)T)(sigmasqrt(T))d2 lt- d1 - sigma sqrt(T)

3 BSCall = Spnorm(d1) - Kexp(-rT)pnorm(d2)BSCallsigma lt- seq(0515 length=100)

5 plot(sigmaBSCall(172360800437746365sigma) type=llty=1 xlab=Sigmaylab=Black-Scholes Call Price ylim = c(006)col=bluelwd=3)grid()

abline(h=023col=redlwd=3)

Knowing that the closing price of the warrant on November 07 2008 wasHK$ 0023 which value can you infer for the implied volatility σ at thisdatelowast

Exercise 67 Forward contracts Recall that the price πt(C) of a claimpayoff C = h(ST ) of maturity T can be written as πt(C) = g(tSt) wherethe function g(tx) satisfies the Black-Scholes PDE

rg(tx) = partg

partt(tx) + rx

partg

partx(tx) + 1

2σ2x2 part

2g

partx2 (tx)

g(T x) = h(x) (1)

with terminal condition g(T x) = h(x) x gt 0

a) Assume that C is a forward contract with payoff

C = ST minusK

at time T Find the function h(x) in (1)b) Find the solution g(tx) of the above PDE and compute the price πt(C)

at time t isin [0T ]Hint search for a solution of the form g(tx) = xminus α(t) where α(t) is afunction of t to be determined

lowast Download the corresponding or the that can be runhere

234

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

BS lt- function(S K T r sig)d1 lt- (log(SK) + (r + sig^22)T) (sigsqrt(T))d2 lt- d1 - sigsqrt(T)return(Spnorm(d1) - Kexp(-rT)pnorm(d2))impliedvol lt- function(S K T r market)sig lt- 020sigup lt- 1sigdown lt- 0001count lt- 0err lt- BS(S K T r sig) - marketwhile(abs(err) gt 000001 ampamp countlt1000)if(err lt 0)sigdown lt- sigsig lt- (sigup + sig)2elsesigup lt- sigsig lt- (sigdown + sig)2err lt- BS(S K T r sig) - marketcount lt- count + 1if(count==2000)return(NA)elsereturn(sig)market = 083K = 628T = 7 365S = 634r = 002impliedvol(S K T r market)

cells [ cell_type code execution_count null metadata outputs [] source [ from IPythoncoredisplay import display HTMLn display(HTML( )) ] cell_type code execution_count null metadata collapsed true outputs [] source [ import numpy as npn import scipystats as ssn import time n n Black and Scholesn def d1(S0 K r sigma T)n return (nplog(S0K) + (r + sigma2 2) T)(sigma npsqrt(T))n n def d2(S0 K r sigma T)n return (nplog(S0 K) + (r - sigma2 2) T) (sigma npsqrt(T))n n def BlackScholes(typeS0 K r sigma T)n if type==Cn return S0 ssnormcdf(d1(S0 K r sigma T)) - K npexp(-r T) ssnormcdf(d2(S0 K r sigma T))n elsen return K npexp(-r T) ssnormcdf(-d2(S0 K r sigma T)) - S0 ssnormcdf(-d1(S0 K r sigma T)) ] cell_type code execution_count null metadata outputs [] source [ BlackScholes(C1000 1200 002 015 10) ] cell_type code execution_count null metadata outputs [] source [ def difference(x p S K r t)n return BlackScholes(CS K r x t) - p ] cell_type code execution_count null metadata outputs [] source [ from scipyoptimize import bisectn bisect(difference00011args=(11541763731112766 1000 1200 002 10)) ] ] metadata anaconda-cloud kernelspec display_name Python 3 language python name python3 language_info codemirror_mode name ipython version 3 file_extension py mimetype textx-python name python nbconvert_exporter python pygments_lexer ipython3 version 375rc1 nbformat 4 nbformat_minor 1

Black-Scholes Pricing and Hedging

c) Compute the quantityξt =

partg

partx(tSt)

of risky assets in a self-financing portfolio hedging Cd) Repeat the above questions with the terminal condition g(T x) = x

Exercise 68a) Solve the Black-Scholes PDE

rg(tx) = partg

partt(tx) + rx

partg

partx(tx) + σ2

2 x2 part2g

partx2 (tx) (634)

with terminal condition g(T x) = 1 x gt 0

Hint Try a solution of the form g(tx) = f(t) and find f(t)

b) Find the respective quantities ξt and ηt of the risky asset St and risklessasset At = ert in the portfolio with value

Vt = g(tSt) = ξtSt + ηtAt

hedging the contract with payoff $1 at maturity

Exercise 69 Log-contracts see also Exercise 84a) Solve the PDE

0 =partg

partt(x t) + rx

partg

partx(x t) + σ2

2 x2 part2g

partx2 (x t)

with the terminal condition g(xT ) = log x x gt 0

Hint Try a solution of the form g(x t) = f(t) + log x and find f(t)b) Solve the Black-Scholes PDE

rh(x t) = parth

partt(x t) + rx

parth

partx(x t) + σ2

2 x2 part2h

partx2 (x t) (635)

with the terminal condition h(xT ) = log x x gt 0

Hint Try a solution of the form h(x t) = u(t)g(x t) and find u(t)c) Find the respective quantities ξt and ηt of the risky asset St and riskless

asset At = ert in the portfolio with value

Vt = g(St t) = ξtSt + ηtAt

hedging a log-contract with payoff logST at maturity 235

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

Exercise 610 Binary options Consider a price process (St)tisinR+ given by

dStSt

= rdt+ σdBt S0 = 1

under the risk-neutral probability measure Plowast The binary (or digital) calloption is a contract with maturity T strike price K and payoff

Cd = 1[Kinfin)(ST ) =

$1 if ST gt K

0 if ST lt K

a) Derive the Black-Schole PDE satisfied by the pricing function Cd(tSt) ofthe binary call option together with its terminal condition

b) Show that the solution Cd(tx) of the Black-Scholes PDE of Question (a)is given by

Cd(tx) = eminus(Tminust)rΦ((rminus σ22)(T minus t) + log(xK)

|σ|radicT minus t

)= eminus(Tminust)rΦ

(dminus(T minus t)

)

where

dminus(T minus t) =(rminus σ22)(T minus t) + log(StK)

|σ|radicT minus t

0 6 t lt T

Exercise 611

a) Bachelier (1900) model Solve the stochastic differential equation

dSt = αStdt+ σdBt (636)

in terms of ασ isin R and the initial condition S0b) Write down the Bachelier PDE satisfied by the function C(tx) where

C(tSt) is the price at time t isin [0T ] of the contingent claim with payoffφ(ST ) = exp(ST ) and identify the process Delta (ξt)tisin[0T ] that hedgesthis claim

c) Solve the Black-Scholes PDE of Question (b) with the terminal conditionφ(x) = ex x isin R

Hint Search for a solution of the form

C(tx) = exp(minus(T minus t)r+ xh(t) +

σ2

4r (h2(t)minus 1)

) (637)

where h(t) is a function to be determined with h(T ) = 1

236

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

d) Compute the portfolio strategy (ξt ηt)tisin[0T ] that hedges the contingentclaim with payoff exp(ST )

Exercise 612

a) Show that for every fixed value of S the function

d 7minusrarr h(S d) = SΦ(d+ |σ|

radicT)minusK eminusrTΦ(d)

reaches its maximum at dlowast(S) =log(SK) + (rminus σ22)T

|σ|radicT

b) By the differentiation rule

d

dSh(S dlowast(S)) =

parth

partS(S dlowast(S)) + dprimelowast(S)

parth

partd(S dlowast(S))

recover the value of the Black-Scholes Delta

Exercise 613 Compute the Black-Scholes Vega by differentiation of theBlack-Scholes function

gc(tx) = Bl(Kxσ rT minus t) = xΦ(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)

with respect to the volatility parameter σ knowing that

minus12(dminus(T minus t)

)2= minus1

2

(log(xK) + (rminus σ22)(T minus t)

|σ|radicT minus t

)2

= minus12(d+(T minus t)

)2+ (T minus t)r+ log x

K (638)

Exercise 614 Consider the backward induction relation (313) ie

v(tx) = (1minus plowastN )v (t+ 1x(1 + aN )) + plowastN v (t+ 1x(1 + bN ))

using the renormalizations rN = rTN and

aN = (1 + rN )(1minus |σ|radicTN)minus 1 bN = (1 + rN )(1 + |σ|

radicTN)minus 1

of Section 36 N gt 1 with

plowastN =rN minus aNbN minus aN

and plowastN =bN minus rNbN minus aN

a) Show that the Black-Scholes PDE (62) of Proposition 61 can be recoveredfrom the induction relation (313) when the number N of time steps tendsto infinity

237

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

b) Show that the expression of the Delta ξt =partgcpartx

(tSt) can be similarlyrecovered from the finite difference relation (319) ie

ξ(1)t (Stminus1) =

v (t (1 + bN )Stminus1)minus v (t (1 + aN )Stminus1)

Stminus1(bN minus aN )

as N tends to infinity

Problem 615 (Leung and Sircar (2015)) ProShares Ultra SampP500 andProShares UltraShort SampP500 are leveraged investment funds that seek dailyinvestment results before fees and expenses that correspond to β times (βx)the daily performance of the SampP500reg with respectively β = 2 for ProSharesUltra and β = minus2 for ProShares UltraShort Here leveraging with a factorβ 1 aims at multiplying the potential return of an investment by a factorβ The following 10 questions are interdependent and should be treated insequence

a) Consider a risky asset priced S0 = $4 at time t = 0 and taking twopossible values S1 = $5 and S1 = $2 at time t = 1 Compute the twopossible returns (in ) achieved when investing $4 in one share of the assetS and the expected return under the risk-neutral probability measureassuming that the risk-free interest rate is zero

b) Leveraging Still based on an initial $4 investment we decide to leverageby a factor β = 3 by borrowing another (β minus 1) times $4 = 2times $4 at ratezero to purchase a total of β = 3 shares of the asset S Compute thetwo returns (in ) possibly achieved in this case and the expected returnunder the risk-neutral probability measure assuming that the risk-freeinterest rate is zero

c) Denoting by Ft the ProShares value at time t how much should the fundinvest in the underlying asset priced St and how much $ should it borrowor save on the risk-free market at any time t in order to leverage with afactor β 1

d) Find the portfolio allocation (ξt ηt) for the fund value

Ft = ξtSt + ηtAt t isin R+

according to Question (c) where At = A0 ert is the riskless money marketaccount

e) We choose to model the SampP500 index St as the geometric Brownianmotion

dSt = rStdt+ σStdBt t isin R+

under the risk-neutral probability measure Plowast Find the stochastic dif-ferential equation satisfied by (Ft)tisinR+ under the self-financing conditiondFt = ξtdSt + ηtdAt

238

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

f) Is the discounted fund value ( eminusrtFt)tisinR+ a martingale under the risk-neutral probability measure Plowast

g) Find the relation between the fund value Ft and the index St by solvingthe stochastic differential equation obtained for Ft in Question (e) Forsimplicity we normalize F0 = Sβ0

h) Write the price at time t = 0 of the call option with payoff (FT minusK)+ onthe ProShares index using the Black-Scholes formula

i) Show that when β gt 0 the Delta at time t isin [0T ) of the call optionwith payoff (FT minusK)+ on ProShares Ultra is equal to the Delta of thecall option with payoff (ST minusKβ(t))

+ on the SampP500 for a certain strikeprice Kβ(t) to be determined explicitly

j) When β lt 0 find the relation between the Delta at time t isin [0T ) ofthe call option with payoff (FT minusK)+ on ProShares UltraShort and theDelta of the put option with payoff (Kβ(t)minus ST )+ on the SampP500

239

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

  1. pbsARFix223
  2. pbsARFix224
  3. pbsARFix225
  4. pbsARFix226
  5. pbsARFix227
  6. pbsARFix228
  7. pbsARFix229
  8. pbsARFix230
  9. fdrm1
  10. pbsARFix231
  11. 100
  12. 101
  13. 102
  14. 103
  15. 104
  16. 105
  17. 106
  18. 107
  19. 108
  20. 109
  21. 1010
  22. 1011
  23. 1012
  24. 1013
  25. 1014
  26. 1015
  27. 1016
  28. 1017
  29. 1018
  30. 1019
  31. anm10
  32. 10EndLeft
  33. 10StepLeft
  34. 10PauseLeft
  35. 10PlayLeft
  36. 10PlayPauseLeft
  37. 10PauseRight
  38. 10PlayRight
  39. 10PlayPauseRight
  40. 10StepRight
  41. 10EndRight
  42. 10Minus
  43. 10Reset
  44. 10Plus
  45. pbsARFix232
  46. pbsARFix233
  47. pbsARFix234
  48. pbsARFix235
  49. pbsARFix236
  50. pbsARFix237
  51. fdrm2
  52. 110
  53. 111
  54. 112
  55. 113
  56. 114
  57. 115
  58. 116
  59. 117
  60. 118
  61. 119
  62. 1110
  63. 1111
  64. 1112
  65. 1113
  66. 1114
  67. 1115
  68. 1116
  69. 1117
  70. 1118
  71. 1119
  72. anm11
  73. 11EndLeft
  74. 11StepLeft
  75. 11PauseLeft
  76. 11PlayLeft
  77. 11PlayPauseLeft
  78. 11PauseRight
  79. 11PlayRight
  80. 11PlayPauseRight
  81. 11StepRight
  82. 11EndRight
  83. 11Minus
  84. 11Reset
  85. 11Plus
  86. pbsARFix238
  87. pbsARFix239
  88. pbsARFix240
  89. pbsARFix241
  90. pbsARFix242
  91. 120
  92. 121
  93. 122
  94. 123
  95. 124
  96. 125
  97. 126
  98. 127
  99. 128
  100. 129
  101. 1210
  102. anm12
  103. 12EndLeft
  104. 12StepLeft
  105. 12PauseLeft
  106. 12PlayLeft
  107. 12PlayPauseLeft
  108. 12PauseRight
  109. 12PlayRight
  110. 12PlayPauseRight
  111. 12StepRight
  112. 12EndRight
  113. 12Minus
  114. 12Reset
  115. 12Plus
  116. 130
  117. 131
  118. 132
  119. 133
  120. 134
  121. 135
  122. 136
  123. 137
  124. 138
  125. 139
  126. 1310
  127. anm13
  128. 13EndLeft
  129. 13StepLeft
  130. 13PauseLeft
  131. 13PlayLeft
  132. 13PlayPauseLeft
  133. 13PauseRight
  134. 13PlayRight
  135. 13PlayPauseRight
  136. 13StepRight
  137. 13EndRight
  138. 13Minus
  139. 13Reset
  140. 13Plus
  141. pbsARFix243
  142. pbsARFix244
  143. pbsARFix245
  144. pbsARFix246
  145. 140
  146. 141
  147. 142
  148. 143
  149. 144
  150. 145
  151. 146
  152. 147
  153. 148
  154. 149
  155. 1410
  156. 1411
  157. 1412
  158. 1413
  159. 1414
  160. 1415
  161. 1416
  162. 1417
  163. 1418
  164. 1419
  165. 1420
  166. 1421
  167. 1422
  168. 1423
  169. 1424
  170. 1425
  171. 1426
  172. 1427
  173. 1428
  174. 1429
  175. 1430
  176. 1431
  177. 1432
  178. 1433
  179. 1434
  180. 1435
  181. 1436
  182. 1437
  183. 1438
  184. 1439
  185. 1440
  186. 1441
  187. 1442
  188. 1443
  189. 1444
  190. 1445
  191. 1446
  192. 1447
  193. 1448
  194. 1449
  195. 1450
  196. 1451
  197. 1452
  198. 1453
  199. 1454
  200. 1455
  201. 1456
  202. 1457
  203. 1458
  204. 1459
  205. 1460
  206. 1461
  207. 1462
  208. 1463
  209. 1464
  210. 1465
  211. 1466
  212. 1467
  213. 1468
  214. 1469
  215. 1470
  216. 1471
  217. 1472
  218. 1473
  219. 1474
  220. 1475
  221. 1476
  222. 1477
  223. 1478
  224. 1479
  225. 1480
  226. 1481
  227. 1482
  228. 1483
  229. 1484
  230. 1485
  231. 1486
  232. 1487
  233. 1488
  234. 1489
  235. 1490
  236. 1491
  237. 1492
  238. 1493
  239. 1494
  240. 1495
  241. 1496
  242. 1497
  243. 1498
  244. 1499
  245. 14100
  246. 14101
  247. 14102
  248. 14103
  249. 14104
  250. 14105
  251. 14106
  252. 14107
  253. 14108
  254. 14109
  255. 14110
  256. 14111
  257. 14112
  258. 14113
  259. 14114
  260. 14115
  261. 14116
  262. 14117
  263. 14118
  264. 14119
  265. 14120
  266. 14121
  267. 14122
  268. 14123
  269. 14124
  270. 14125
  271. 14126
  272. 14127
  273. 14128
  274. 14129
  275. 14130
  276. 14131
  277. 14132
  278. 14133
  279. 14134
  280. 14135
  281. 14136
  282. 14137
  283. 14138
  284. 14139
  285. 14140
  286. 14141
  287. 14142
  288. 14143
  289. 14144
  290. 14145
  291. 14146
  292. 14147
  293. 14148
  294. 14149
  295. 14150
  296. 14151
  297. 14152
  298. 14153
  299. 14154
  300. 14155
  301. 14156
  302. 14157
  303. 14158
  304. 14159
  305. 14160
  306. 14161
  307. 14162
  308. 14163
  309. 14164
  310. 14165
  311. 14166
  312. 14167
  313. 14168
  314. 14169
  315. 14170
  316. 14171
  317. 14172
  318. 14173
  319. 14174
  320. 14175
  321. 14176
  322. 14177
  323. 14178
  324. 14179
  325. 14180
  326. 14181
  327. 14182
  328. 14183
  329. 14184
  330. 14185
  331. 14186
  332. 14187
  333. 14188
  334. 14189
  335. 14190
  336. 14191
  337. 14192
  338. 14193
  339. 14194
  340. 14195
  341. 14196
  342. 14197
  343. anm14
  344. 14EndLeft
  345. 14StepLeft
  346. 14PauseLeft
  347. 14PlayLeft
  348. 14PlayPauseLeft
  349. 14PauseRight
  350. 14PlayRight
  351. 14PlayPauseRight
  352. 14StepRight
  353. 14EndRight
  354. 14Minus
  355. 14Reset
  356. 14Plus
  357. pbsARFix247
  358. pbsARFix248
  359. 150
  360. 151
  361. 152
  362. 153
  363. 154
  364. 155
  365. 156
  366. 157
  367. 158
  368. 159
  369. 1510
  370. 1511
  371. 1512
  372. 1513
  373. 1514
  374. 1515
  375. 1516
  376. 1517
  377. 1518
  378. 1519
  379. anm15
  380. 15EndLeft
  381. 15StepLeft
  382. 15PauseLeft
  383. 15PlayLeft
  384. 15PlayPauseLeft
  385. 15PauseRight
  386. 15PlayRight
  387. 15PlayPauseRight
  388. 15StepRight
  389. 15EndRight
  390. 15Minus
  391. 15Reset
  392. 15Plus
  393. pbsARFix249
  394. pbsARFix250
  395. pbsARFix251
  396. pbsARFix252
  397. pbsARFix253
  398. pbsARFix254
  399. pbsARFix255
  400. pbsARFix256
  401. pbsARFix257
  402. pbsARFix258
  403. pbsARFix259
  404. pbsARFix260
  405. pbsARFix261
Page 4: Black-ScholesPricingandHedging - NTU · to the Black-Scholes PDE (6.2) in order to price a claim payoff Cof the formC= h(S T).Asinthediscrete-timecase,thearbitragepriceπt(C) at

N Privault

=partg

partt(tSt)dt+ vt

partg

partx(tSt)dt+ ut

partg

partx(tSt)dBt +

12 |ut|

2 part2g

partx2 (tSt)dt

=partg

partt(tSt)dt+ microSt

partg

partx(tSt)dt+

12σ

2S2tpart2g

partx2 (tSt)dt+ σStpartg

partx(tSt)dBt

(65)

By respective identification of the terms in dBt and dt in (64) and (65) wegetrg(tSt)dt+ (microminus r)ξtStdt =

partg

partt(tSt)dt+ microSt

partg

partx(tSt)dt+

12σ

2S2tpart2g

partx2 (tSt)dt

ξtStσdBt = Stσpartg

partx(tSt)dBt

hence rg(tSt) =

partg

partt(tSt) + rSt

partg

partx(tSt) +

12σ

2S2tpart2g

partx2 (tSt)

ξt =partg

partx(tSt) 0 6 t 6 T

(66)

which yields (62) after substituting St with x gt 0

The derivative giving ξt in (63) is called the Delta of the option price seeProposition 64 below The amount invested on the riskless asset is

ηtAt = Vt minus ξtSt = g(tSt)minus Stpartg

partx(tSt)

and ηt is given by

ηt =Vt minus ξtSt

At

=1At

(g(tSt)minus St

partg

partx(tSt)

)=

1A0 ert

(g(tSt)minus St

partg

partx(tSt)

)

In the next Proposition 62 we add a terminal condition g(T x) = f(x)to the Black-Scholes PDE (62) in order to price a claim payoff C of theform C = h(ST ) As in the discrete-time case the arbitrage price πt(C) attime t isin [0T ] of the claim payoff C is defined to be the value Vt of theself-financing portfolio hedging C

Proposition 62 The arbitrage price πt(C) at time t isin [0T ] of the (vanilla)option with payoff C = h(ST ) is given by πt(C) = g(tSt) and the hedging

204

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

allocation ξt is given by the partial derivative (63) where the function g(tx)is solution of the following Black-Scholes PDE

rg(tx) = partg

partt(tx) + rx

partg

partx(tx) + 1

2σ2x2 part

2g

partx2 (tx)

g(T x) = h(x) x gt 0(67)

Proof Proposition 61 shows that the solution g(tx) of (62) g isin C12(R+timesR+) represents the value Vt = ηtAt + ξtSt = g(tSt) t isin R+ of a self-financing portfolio strategy (ηt ξt)tisinR+ By Definition 31 πt(C) = Vt =g(tSt) is the arbitrage price at time t isin [0T ] of the vanilla option withpayoff C = h(ST )

The absence of the drift parameter micro from the PDE (67) can be understoodin the next forward contract example in which the claim payoff can be hedgedby leveraging on the value St of the underlying asset independently of thetrend parameter micro

Example - forward contracts

When C = ST minusK is the (linear) payoff function of a long forward contractie h(x) = xminusK the Black-Scholes PDE (67) admits the easy solution

g(tx) = xminusK eminus(Tminust)r x gt 0 0 6 t 6 T (68)

showing that the price at time t of the forward contract with payoff C =ST minusK is

St minusK eminus(Tminust)r x gt 0 0 6 t 6 T

In addition the Delta of the option price is given by

ξt =partg

partx(tSt) = 1 0 6 t 6 T

which leads to a static ldquohedge and forgetrdquo strategy cf Exercise 67 Theforward contract can be realized by the option issuer as followsa) At time t receive the option premium Vt = St minus eminus(Tminust)rK from the

option buyerb) Borrow eminus(Tminust)rK from the bank to be refunded at maturityc) Buy the risky asset using the amount Stminus eminus(Tminust)rK + eminus(Tminust)rK = Std) Hold the risky asset until maturity (do nothing constant portfolio strat-

egy)e) At maturity T hand in the asset to the option holder who will pay the

amount K in return 205

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

f) Use the amountK = e(Tminust)r eminus(Tminust)rK to refund the lender of eminus(Tminust)rKborrowed at time t

Another way to compute the option premium Vt is to state that the amountVtminusSt has to be borrowed at time t in order to purchase the asset and thatthe asset price K received at maturity T should be used to refund the loanwhich yields

(Vt minus St) eminus(Tminust)r = K 0 6 t 6 T

Forward contracts can be used for physical delivery eg for live cattle In thecase of European options the basic ldquohedge and forgetrdquo constant strategy

ξt = 1 ηt = η0 0 6 t 6 T

will hedge the option only if

ST + η0AT gt (ST minusK)+

ie if minusη0AT 6 K 6 ST

Future contracts

For a future contract expiring at time T we take K = S0 erT and the contractis usually quoted at time t in terms of the forward price

e(Tminust)r(St minusK eminus(Tminust)r

)= e(Tminust)rSt minusK = e(Tminust)rSt minus S0 erT

discounted at time T or simply using e(Tminust)rSt Future contracts are non-deliverable forward contracts which are ldquomarked to marketrdquo at each timestep via a cash flow exchange between the two parties ensuring that theabsolute difference | e(Tminust)rSt minusK| is being credited to the buyerrsquos accountif e(Tminust)rSt gt K or to the sellerrsquos account if e(Tminust)rSt lt K

62 European Call Options

Recall that in the case of the European call option with strike price K thepayoff function is given by h(x) = (xminusK)+ and the Black-Scholes PDE (67)reads

rgc(tx) =partgcpartt

(tx) + rxpartgcpartx

(tx) + 12σ

2x2 part2gcpartx2 (tx)

gc(T x) = (xminusK)+(69)

The next proposition will be proved in Sections 65 and 66 see Proposi-tion 611

206

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

Proposition 63 The solution of the PDE (69) is given by the Black-Scholes formula for call options

gc(tx) = Bl(Kxσ rT minus t) = xΦ(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)

(610)with

d+(T minus t) =log(xK) + (r+ σ22)(T minus t)

|σ|radicT minus t

(611)

dminus(T minus t) =log(xK) + (rminus σ22)(T minus t)

|σ|radicT minus t

0 6 t lt T (612)

We note the relation

d+(T minus t) = dminus(T minus t) + |σ|radicT minus t 0 6 t lt T (613)

Here ldquologrdquo denotes the natural logarithm ldquolnrdquo and

Φ(x) = P(X 6 x) =1radic2π

w xminusinfin

eminusy22dy x isin R

denotes the standard Gaussian Cumulative Distribution Function (CDF) ofa standard normal random variable X N (0 1) with the relation

Φ(minusx) = 1minusΦ(x) x isin R (614)

0

02

04

06

08

1

12

-4 -3 -2 -1 0 1 2 3 4

Φ(x)

x

1Gaussian CDF Φ(x)

Fig 63 Graph of the Gaussian CDF

In other words the European call option with strike price K and maturityT is priced at time t isin [0T ] as

gc(tSt) = Bl(KStσ rT minus t)= StΦ

(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

) 0 6 t 6 T

207

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

The following R script is an implementation of the Black-Scholes formula forEuropean call options in Rlowast

1 BSCall lt- function(S K r T sigma)d1 lt- (log(SK)+(r+sigma^22)T)(sigmasqrt(T))

3 d2 lt- d1 - sigma sqrt(T)BSCall = Spnorm(d1) - Kexp(-rT)pnorm(d2)

5 BSCall

In comparison with the discrete-time Cox-Ross-Rubinstein (CRR) model ofSection 26 the interest in the formula (610) is to provide an analytical so-lution that can be evaluated in a single step which is computationally muchmore efficient

Fig 64 Graph of the Black-Scholes call price map with strike price K = 100dagger

Figure 64 presents an interactive graph of the Black-Scholes call price mapie the solution

(tx) 7minusrarr gc(tx) = xΦ(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)of the Black-Scholes PDE (67) for a call optionlowast Download the corresponding that can be run heredagger Right-click on the figure for interaction and ldquoFull Screen Multimediardquo view

208

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

(C) 2012--today Alexander Grahn 3Dmenujs version 20140923 3D JavaScript used by media9sty Extended functionality of the (right click) context menu of 3D annotations 1) Adds the following items to the 3D context menu `Generate Default View Finds good default camera settings returned as options for use with the includemedia command `Get Current View Determines camera cross section and part settings of the current view returned as `VIEW section that can be copied into a views file of additional views The views file is inserted using the `3Dviews option of includemedia `Cross Section Toggle switch to add or remove a cross section into or from the current view The cross section can be moved in the x y z directions using x y z and X Y Z keys on the keyboard be tilted against and spun around the upright Z axis using the UpDown and LeftRight arrow keys and caled using the s and S keys 2) Enables manipulation of position and orientation of indiviual parts and groups of parts in the 3D scene Parts which have been selected with the mouse can be scaled moved around and rotated like the cross section as described above To spin the parts around their local up-axis keep Control key pressed while using the UpDown and LeftRight arrow keys This work may be distributed andor modified under the conditions of the LaTeX Project Public License The latest version of this license is in httpmirrorsctanorgmacroslatexbaselppltxt This work has the LPPL maintenance status `maintained The Current Maintainer of this work is A Grahn The code borrows heavily from Bernd Gaertners `Miniball software originally written in C++ for computing the smallest enclosing ball of a set of points see httpwwwinfethzchpersonalgaertnerminiballhtmlhostconsoleshow()constructor for doubly linked listfunction List() thisfirst_node=null thislast_node=new Node(undefined)Listprototypepush_back=function(x) var new_node=new Node(x) if(thisfirst_node==null) thisfirst_node=new_node new_nodeprev=null else new_nodeprev=thislast_nodeprev new_nodeprevnext=new_node new_nodenext=thislast_node thislast_nodeprev=new_nodeListprototypemove_to_front=function(it) var node=itget() if(nodenext=null ampamp nodeprev=null) nodenextprev=nodeprev nodeprevnext=nodenext nodeprev=null nodenext=thisfirst_node thisfirst_nodeprev=node thisfirst_node=node Listprototypebegin=function() var i=new Iterator() itarget=thisfirst_node return(i)Listprototypeend=function() var i=new Iterator() itarget=thislast_node return(i)function Iterator(it) if( it=undefined ) thistarget=ittarget else thistarget=null Iteratorprototypeset=function(it)thistarget=ittargetIteratorprototypeget=function()return(thistarget)Iteratorprototypederef=function()return(thistargetdata)Iteratorprototypeincr=function() if(thistargetnext=null) thistarget=thistargetnextconstructor for node objects that populate the linked listfunction Node(x) thisprev=null thisnext=null thisdata=xfunction sqr(r)return(rr)helper functionMiniball algorithm by B Gaertnerfunction Basis() thism=0 thisq0=new Array(3) thisz=new Array(4) thisf=new Array(4) thisv=new Array(new Array(3) new Array(3) new Array(3) new Array(3)) thisa=new Array(new Array(3) new Array(3) new Array(3) new Array(3)) thisc=new Array(new Array(3) new Array(3) new Array(3) new Array(3)) thissqr_r=new Array(4) thiscurrent_c=thisc[0] thiscurrent_sqr_r=0 thisreset()Basisprototypecenter=function()return(thiscurrent_c)Basisprototypesize=function()return(thism)Basisprototypepop=function()--thismBasisprototypeexcess=function(p) var e=-thiscurrent_sqr_r for(var k=0klt3++k) e+=sqr(p[k]-thiscurrent_c[k]) return(e)Basisprototypereset=function() thism=0 for(var j=0jlt3++j) thisc[0][j]=0 thiscurrent_c=thisc[0] thiscurrent_sqr_r=-1Basisprototypepush=function(p) var i j var eps=1e-32 if(thism==0) for(i=0ilt3++i) thisq0[i]=p[i] for(i=0ilt3++i) thisc[0][i]=thisq0[i] thissqr_r[0]=0 else for(i=0ilt3++i) thisv[thism][i]=p[i]-thisq0[i] for(i=1iltthism++i) thisa[thism][i]=0 for(j=0jlt3++j) thisa[thism][i]+=thisv[i][j]thisv[thism][j] thisa[thism][i]=(2thisz[i]) for(i=1iltthism++i) for(j=0jlt3++j) thisv[thism][j]-=thisa[thism][i]thisv[i][j] thisz[thism]=0 for(j=0jlt3++j) thisz[thism]+=sqr(thisv[thism][j]) thisz[thism]=2 if(thisz[thism]ltepsthiscurrent_sqr_r) return(false) var e=-thissqr_r[thism-1] for(i=0ilt3++i) e+=sqr(p[i]-thisc[thism-1][i]) thisf[thism]=ethisz[thism] for(i=0ilt3++i) thisc[thism][i]=thisc[thism-1][i]+thisf[thism]thisv[thism][i] thissqr_r[thism]=thissqr_r[thism-1]+ethisf[thism]2 thiscurrent_c=thisc[thism] thiscurrent_sqr_r=thissqr_r[thism] ++thism return(true)function Miniball() thisL=new List() thisB=new Basis() thissupport_end=new Iterator()Miniballprototypemtf_mb=function(it) var i=new Iterator(it) thissupport_endset(thisLbegin()) if((thisBsize())==4) return for(var k=new Iterator(thisLbegin())kget()=iget()) var j=new Iterator(k) kincr() if(thisBexcess(jderef()) gt 0) if(thisBpush(jderef())) thismtf_mb(j) thisBpop() if(thissupport_endget()==jget()) thissupport_endincr() thisLmove_to_front(j) Miniballprototypecheck_in=function(b) thisLpush_back(b)Miniballprototypebuild=function() thisBreset() thissupport_endset(thisLbegin()) thismtf_mb(thisLend())Miniballprototypecenter=function() return(thisBcenter())Miniballprototyperadius=function() return(Mathsqrt(thisBcurrent_sqr_r))functions called by menu itemsfunction calc3Dopts () create Miniball object var mb=new Miniball() auxiliary vector var corner=new Vector3() iterate over all visible mesh nodes in the scene for(i=0iltscenemeshescounti++) var mesh=scenemeshesgetByIndex(i) if(meshvisible) continue local to parent transformation matrix var trans=meshtransform build local to world transformation matrix by recursively multiplying the parents transf matrix on the right var parent=meshparent while(parenttransform) trans=transmultiply(parenttransform) parent=parentparent get the bbox of the mesh (local coordinates) var bbox=meshcomputeBoundingBox() transform the local bounding box corner coordinates to world coordinates for bounding sphere determination BBoxmin cornerset(bboxmin) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) BBoxmax cornerset(bboxmax) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) remaining six BBox corners cornerset(bboxminx bboxmaxy bboxmaxz) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) cornerset(bboxminx bboxminy bboxmaxz) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) cornerset(bboxminx bboxmaxy bboxminz) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) cornerset(bboxmaxx bboxminy bboxminz) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) cornerset(bboxmaxx bboxminy bboxmaxz) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) cornerset(bboxmaxx bboxmaxy bboxminz) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) compute the smallest enclosing bounding sphere mbbuild() current camera settings var camera=scenecamerasgetByIndex(0) var res= initialize result string aperture angle of the virtual camera (perspective projection) or orthographic scale (orthographic projection) if(cameraprojectionType==cameraTYPE_PERSPECTIVE) var aac=camerafov180MathPI if(hostutilprintf(4f aac)=30) res+=hostutilprintf(n3Daac=s aac) else cameraviewPlaneSize=2mbradius() res+=hostutilprintf(n3Dortho=s 1cameraviewPlaneSize) camera roll var roll = cameraroll180MathPI if(hostutilprintf(4f roll)=0) res+=hostutilprintf(n3Droll=sroll) target to camera vector var c2c=new Vector3() c2cset(cameraposition) c2csubtractInPlace(cameratargetPosition) c2cnormalize() if((c2cx==0 ampamp c2cy==-1 ampamp c2cz==0)) res+=hostutilprintf(n3Dc2c=s s s c2cx c2cy c2cz) new camera settings bounding sphere centre --gt new camera target var coo=new Vector3() cooset((mbcenter())[0] (mbcenter())[1] (mbcenter())[2]) if(coolength) res+=hostutilprintf(n3Dcoo=s s s coox cooy cooz) radius of orbit if(cameraprojectionType==cameraTYPE_PERSPECTIVE) var roo=mbradius() Mathsin(aac MathPI 360) else orthographic projection var roo=mbradius() res+=hostutilprintf(n3Droo=s roo) update camera settings in the viewer var currol=cameraroll cameratargetPositionset(coo) camerapositionset(cooadd(c2cscale(roo))) cameraroll=currol determine background colour rgb=scenebackgroundgetColor() if((rgbr==1 ampamp rgbg==1 ampamp rgbb==1)) res+=hostutilprintf(n3Dbg=s s s rgbr rgbg rgbb) determine lighting scheme switch(scenelightScheme) case sceneLIGHT_MODE_FILE curlights=Artworkbreak case sceneLIGHT_MODE_NONE curlights=Nonebreak case sceneLIGHT_MODE_WHITE curlights=Whitebreak case sceneLIGHT_MODE_DAY curlights=Daybreak case sceneLIGHT_MODE_NIGHT curlights=Nightbreak case sceneLIGHT_MODE_BRIGHT curlights=Hardbreak case sceneLIGHT_MODE_RGB curlights=Primarybreak case sceneLIGHT_MODE_BLUE curlights=Bluebreak case sceneLIGHT_MODE_RED curlights=Redbreak case sceneLIGHT_MODE_CUBE curlights=Cubebreak case sceneLIGHT_MODE_CAD curlights=CADbreak case sceneLIGHT_MODE_HEADLAMP curlights=Headlampbreak if(curlights=Artwork) res+=hostutilprintf(n3Dlights=s curlights) determine global render mode switch(scenerenderMode) case sceneRENDER_MODE_BOUNDING_BOX currender=BoundingBoxbreak case sceneRENDER_MODE_TRANSPARENT_BOUNDING_BOX currender=TransparentBoundingBoxbreak case sceneRENDER_MODE_TRANSPARENT_BOUNDING_BOX_OUTLINE currender=TransparentBoundingBoxOutlinebreak case sceneRENDER_MODE_VERTICES currender=Verticesbreak case sceneRENDER_MODE_SHADED_VERTICES currender=ShadedVerticesbreak case sceneRENDER_MODE_WIREFRAME currender=Wireframebreak case sceneRENDER_MODE_SHADED_WIREFRAME currender=ShadedWireframebreak case sceneRENDER_MODE_SOLID currender=Solidbreak case sceneRENDER_MODE_TRANSPARENT currender=Transparentbreak case sceneRENDER_MODE_SOLID_WIREFRAME currender=SolidWireframebreak case sceneRENDER_MODE_TRANSPARENT_WIREFRAME currender=TransparentWireframebreak case sceneRENDER_MODE_ILLUSTRATION currender=Illustrationbreak case sceneRENDER_MODE_SOLID_OUTLINE currender=SolidOutlinebreak case sceneRENDER_MODE_SHADED_ILLUSTRATION currender=ShadedIllustrationbreak case sceneRENDER_MODE_HIDDEN_WIREFRAME currender=HiddenWireframebreak if(currender=Solid) res+=hostutilprintf(n3Drender=s currender) write result string to the console hostconsoleshow() hostconsoleclear() hostconsoleprintln(n Copy and paste the following text to then+ option list of includemedian + res + n)function get3Dview () var camera=scenecamerasgetByIndex(0) var coo=cameratargetPosition var c2c=camerapositionsubtract(coo) var roo=c2clength c2cnormalize() var res=VIEW=insert optional name heren if((coox==0 ampamp cooy==0 ampamp cooz==0)) res+=hostutilprintf( COO=s s sn coox cooy cooz) if((c2cx==0 ampamp c2cy==-1 ampamp c2cz==0)) res+=hostutilprintf( C2C=s s sn c2cx c2cy c2cz) if(roo gt 1e-9) res+=hostutilprintf( ROO=sn roo) var roll = cameraroll180MathPI if(hostutilprintf(4f roll)=0) res+=hostutilprintf( ROLL=sn roll) if(cameraprojectionType==cameraTYPE_PERSPECTIVE) var aac=camerafov 180MathPI if(hostutilprintf(4f aac)=30) res+=hostutilprintf( AAC=sn aac) else if(hostutilprintf(4f cameraviewPlaneSize)=1) res+=hostutilprintf( ORTHO=sn 1cameraviewPlaneSize) rgb=scenebackgroundgetColor() if((rgbr==1 ampamp rgbg==1 ampamp rgbb==1)) res+=hostutilprintf( BGCOLOR=s s sn rgbr rgbg rgbb) switch(scenelightScheme) case sceneLIGHT_MODE_FILE curlights=Artworkbreak case sceneLIGHT_MODE_NONE curlights=Nonebreak case sceneLIGHT_MODE_WHITE curlights=Whitebreak case sceneLIGHT_MODE_DAY curlights=Daybreak case sceneLIGHT_MODE_NIGHT curlights=Nightbreak case sceneLIGHT_MODE_BRIGHT curlights=Hardbreak case sceneLIGHT_MODE_RGB curlights=Primarybreak case sceneLIGHT_MODE_BLUE curlights=Bluebreak case sceneLIGHT_MODE_RED curlights=Redbreak case sceneLIGHT_MODE_CUBE curlights=Cubebreak case sceneLIGHT_MODE_CAD curlights=CADbreak case sceneLIGHT_MODE_HEADLAMP curlights=Headlampbreak if(curlights=Artwork) res+= LIGHTS=+curlights+n switch(scenerenderMode) case sceneRENDER_MODE_BOUNDING_BOX defaultrender=BoundingBoxbreak case sceneRENDER_MODE_TRANSPARENT_BOUNDING_BOX defaultrender=TransparentBoundingBoxbreak case sceneRENDER_MODE_TRANSPARENT_BOUNDING_BOX_OUTLINE defaultrender=TransparentBoundingBoxOutlinebreak case sceneRENDER_MODE_VERTICES defaultrender=Verticesbreak case sceneRENDER_MODE_SHADED_VERTICES defaultrender=ShadedVerticesbreak case sceneRENDER_MODE_WIREFRAME defaultrender=Wireframebreak case sceneRENDER_MODE_SHADED_WIREFRAME defaultrender=ShadedWireframebreak case sceneRENDER_MODE_SOLID defaultrender=Solidbreak case sceneRENDER_MODE_TRANSPARENT defaultrender=Transparentbreak case sceneRENDER_MODE_SOLID_WIREFRAME defaultrender=SolidWireframebreak case sceneRENDER_MODE_TRANSPARENT_WIREFRAME defaultrender=TransparentWireframebreak case sceneRENDER_MODE_ILLUSTRATION defaultrender=Illustrationbreak case sceneRENDER_MODE_SOLID_OUTLINE defaultrender=SolidOutlinebreak case sceneRENDER_MODE_SHADED_ILLUSTRATION defaultrender=ShadedIllustrationbreak case sceneRENDER_MODE_HIDDEN_WIREFRAME defaultrender=HiddenWireframebreak if(defaultrender=Solid) res+= RENDERMODE=+defaultrender+n detect existing Clipping Plane (3D Cross Section) var clip=null if( clip=scenenodesgetByName($$$$$$)|| clip=scenenodesgetByName(Clipping Plane) ) for(var i=0iltscenenodescounti++) var nd=scenenodesgetByIndex(i) if(nd==clip||ndname==) continue var ndUTFName= for (var j=0 jltndnamelength j++) var theUnicode = ndnamecharCodeAt(j)toString(16) while (theUnicodelengthlt4) theUnicode = 0 + theUnicode ndUTFName += theUnicode var end=ndnamelastIndexOf() if(endgt0) var ndUserName=ndnamesubstr(0end) else var ndUserName=ndname respart= PART=+ndUserName+n respart+= UTF16NAME=+ndUTFName+n defaultvals=true if(ndvisible) respart+= VISIBLE=falsen defaultvals=false if(ndopacitylt10) respart+= OPACITY=+ndopacity+n defaultvals=false if(ndconstructorname==Mesh) currender=defaultrender switch(ndrenderMode) case sceneRENDER_MODE_BOUNDING_BOX currender=BoundingBoxbreak case sceneRENDER_MODE_TRANSPARENT_BOUNDING_BOX currender=TransparentBoundingBoxbreak case sceneRENDER_MODE_TRANSPARENT_BOUNDING_BOX_OUTLINE currender=TransparentBoundingBoxOutlinebreak case sceneRENDER_MODE_VERTICES currender=Verticesbreak case sceneRENDER_MODE_SHADED_VERTICES currender=ShadedVerticesbreak case sceneRENDER_MODE_WIREFRAME currender=Wireframebreak case sceneRENDER_MODE_SHADED_WIREFRAME currender=ShadedWireframebreak case sceneRENDER_MODE_SOLID currender=Solidbreak case sceneRENDER_MODE_TRANSPARENT currender=Transparentbreak case sceneRENDER_MODE_SOLID_WIREFRAME currender=SolidWireframebreak case sceneRENDER_MODE_TRANSPARENT_WIREFRAME currender=TransparentWireframebreak case sceneRENDER_MODE_ILLUSTRATION currender=Illustrationbreak case sceneRENDER_MODE_SOLID_OUTLINE currender=SolidOutlinebreak case sceneRENDER_MODE_SHADED_ILLUSTRATION currender=ShadedIllustrationbreak case sceneRENDER_MODE_HIDDEN_WIREFRAME currender=HiddenWireframebreak case sceneRENDER_MODE_DEFAULT currender=Defaultbreak if(currender=defaultrender) respart+= RENDERMODE=+currender+n defaultvals=false if(origtrans[ndname]ampampndtransformisEqual(origtrans[ndname])) var lvec=ndtransformtransformDirection(new Vector3(100)) var uvec=ndtransformtransformDirection(new Vector3(010)) var vvec=ndtransformtransformDirection(new Vector3(001)) respart+= TRANSFORM= +lvecx+ +lvecy+ +lvecz+ +uvecx+ +uvecy+ +uvecz+ +vvecx+ +vvecy+ +vvecz+ +ndtransformtranslationx+ +ndtransformtranslationy+ +ndtransformtranslationz+n defaultvals=false respart+= ENDn if(defaultvals) res+=respart if(clip) var centre=cliptransformtranslation var normal=cliptransformtransformDirection(new Vector3(001)) res+= CROSSSECTn if((centrex==0 ampamp centrey==0 ampamp centrez==0)) res+=hostutilprintf( CENTER=s s sn centrex centrey centrez) if((normalx==1 ampamp normaly==0 ampamp normalz==0)) res+=hostutilprintf( NORMAL=s s sn normalx normaly normalz) res+=hostutilprintf( VISIBLE=sn clipvisible) res+=hostutilprintf( PLANECOLOR=s s sn clipmaterialemissiveColorr clipmaterialemissiveColorg clipmaterialemissiveColorb) res+=hostutilprintf( OPACITY=sn clipopacity) res+=hostutilprintf( INTERSECTIONCOLOR=s s sn clipwireframeColorr clipwireframeColorg clipwireframeColorb) res+= ENDn for(var propt in clip) consoleprintln(propt++clip[propt]) res+=ENDn hostconsoleshow() hostconsoleclear() hostconsoleprintln(n Add the following VIEW section to a file ofn+ predefined views (See option 3Dviews)nn + The view may be given a name after VIEW=n + (Remove in front of =)n) hostconsoleprintln(res + n)add items to 3D context menuruntimeaddCustomMenuItem(dfltview Generate Default View default 0)runtimeaddCustomMenuItem(currview Get Current View default 0)runtimeaddCustomMenuItem(csection Cross Section checked 0)menu event handlersmenuEventHandler = new MenuEventHandler()menuEventHandleronEvent = function(e) switch(emenuItemName) case dfltview calc3Dopts() break case currview get3Dview() break case csection addremoveClipPlane(emenuItemChecked) break runtimeaddEventHandler(menuEventHandler)global variable taking reference to currently selected nodevar target=nullselectionEventHandler=new SelectionEventHandler()selectionEventHandleronEvent=function(e) if(eselectedampampenodename=) target=enode else target=null runtimeaddEventHandler(selectionEventHandler)cameraEventHandler=new CameraEventHandler()cameraEventHandleronEvent=function(e) var clip=null runtimeremoveCustomMenuItem(csection) runtimeaddCustomMenuItem(csection Cross Section checked 0) if(clip=scenenodesgetByName($$$$$$)|| predefined scenenodesgetByName(Clipping Plane)) added via context menu runtimeremoveCustomMenuItem(csection) runtimeaddCustomMenuItem(csection Cross Section checked 1) if(clip)plane in predefined views must be rotated by 90 deg around normal cliptransformrotateAboutLineInPlace( MathPI2cliptransformtranslation cliptransformtransformDirection(new Vector3(001)) ) for(var i=0 iltrot4x4length i++)rot4x4[i]setIdentity() target=nullruntimeaddEventHandler(cameraEventHandler)var rot4x4=new Array() keeps track of spin and tilt axes transformationskey event handler for scaling moving spinning and tilting objectskeyEventHandler=new KeyEventHandler()keyEventHandleronEvent=function(e) var backtrans=new Matrix4x4() var trgt=null if(target) trgt=target var backtrans=new Matrix4x4() var trans=trgttransform var parent=trgtparent while(parenttransform) build local to world transformation matrix transmultiplyInPlace(parenttransform) also build world to local back-transformation matrix backtransmultiplyInPlace(parenttransforminversetranspose) parent=parentparent backtranstransposeInPlace() else if( trgt=scenenodesgetByName($$$$$$)|| trgt=scenenodesgetByName(Clipping Plane) ) var trans=trgttransform if(trgt) return var tname=trgtname if(typeof(rot4x4[tname])==undefined) rot4x4[tname]=new Matrix4x4() if(target) var tiltAxis=rot4x4[tname]transformDirection(new Vector3(010)) else var tiltAxis=transtransformDirection(new Vector3(010)) var spinAxis=rot4x4[tname]transformDirection(new Vector3(001)) get the centre of the mesh if(targetampamptrgtconstructorname==Mesh) var centre=transtransformPosition(trgtcomputeBoundingBox()center) else part group (Node3 parent node clipping plane) var centre=new Vector3(transtranslation) switch(echaracterCode) case 30tilt up rot4x4[tname]rotateAboutLineInPlace( -MathPI900rot4x4[tname]translationtiltAxis) transrotateAboutLineInPlace(-MathPI900centretiltAxis) break case 31tilt down rot4x4[tname]rotateAboutLineInPlace( MathPI900rot4x4[tname]translationtiltAxis) transrotateAboutLineInPlace(MathPI900centretiltAxis) break case 28spin right if(ectrlKeyDownampamptarget) transrotateAboutLineInPlace(-MathPI900centrespinAxis) else rot4x4[tname]rotateAboutLineInPlace( -MathPI900rot4x4[tname]translationnew Vector3(001)) transrotateAboutLineInPlace(-MathPI900centrenew Vector3(001)) break case 29spin left if(ectrlKeyDownampamptarget) transrotateAboutLineInPlace(MathPI900centrespinAxis) else rot4x4[tname]rotateAboutLineInPlace( MathPI900rot4x4[tname]translationnew Vector3(001)) transrotateAboutLineInPlace(MathPI900centrenew Vector3(001)) break case 120 x translateTarget(trans new Vector3(100) e) break case 121 y translateTarget(trans new Vector3(010) e) break case 122 z translateTarget(trans new Vector3(001) e) break case 88 shift + x translateTarget(trans new Vector3(-100) e) break case 89 shift + y translateTarget(trans new Vector3(0-10) e) break case 90 shift + z translateTarget(trans new Vector3(00-1) e) break case 115 s transtranslateInPlace(centrescale(-1)) transscaleInPlace(101) transtranslateInPlace(centrescale(1)) break case 83 shift + s transtranslateInPlace(centrescale(-1)) transscaleInPlace(1101) transtranslateInPlace(centrescale(1)) break transmultiplyInPlace(backtrans)runtimeaddEventHandler(keyEventHandler)translates object by amount calculated from Canvas sizefunction translateTarget(t d e) var cam=scenecamerasgetByIndex(0) if(camprojectionType==camTYPE_PERSPECTIVE) var scale=Mathtan(camfov2) camtargetPositionsubtract(camposition)length Mathmin(ecanvasPixelWidthecanvasPixelHeight) else var scale=camviewPlaneSize2 Mathmin(ecanvasPixelWidthecanvasPixelHeight) ttranslateInPlace(dscale(scale))function addremoveClipPlane(chk) var curTrans=getCurTrans() var clip=scenecreateClippingPlane() if(chk) add Clipping Plane and place its center either into the camera target position or into the centre of the currently selected mesh node var centre=new Vector3() if(target) var trans=targettransform var parent=targetparent while(parenttransform) trans=transmultiply(parenttransform) parent=parentparent if(targetconstructorname==Mesh) var centre=transtransformPosition(targetcomputeBoundingBox()center) else var centre=new Vector3(transtranslation) target=null else centreset(scenecamerasgetByIndex(0)targetPosition) cliptransformsetView( new Vector3(000) new Vector3(100) new Vector3(010)) cliptransformtranslateInPlace(centre) else if( scenenodesgetByName($$$$$$)|| scenenodesgetByName(Clipping Plane) ) clipremove()clip=null restoreTrans(curTrans) return clipfunction to store current transformation matrix of all nodes in the scenefunction getCurTrans() var tA=new Array() for(var i=0 iltscenenodescount i++) var nd=scenenodesgetByIndex(i) if(ndname==) continue tA[ndname]=new Matrix4x4(ndtransform) return tAfunction to restore transformation matrices given as argfunction restoreTrans(tA) for(var i=0 iltscenenodescount i++) var nd=scenenodesgetByIndex(i) if(tA[ndname]) ndtransformset(tA[ndname]) store original transformation matrix of all mesh nodes in the scenevar origtrans=getCurTrans()set initial state of Cross Section menu entrycameraEventHandleronEvent(1)hostconsoleclear()

var ocgs=hostgetOCGs(hostpageNum)for(var i=0iltocgslengthi++)if(ocgs[i]name==MediaPlayButton1)ocgs[i]state=false

(C) 2012 Michail Vidiassov John C Bowman Alexander Grahn asylabelsjs version 20120912 3D JavaScript to be used with media9sty (option `add3Djscript) for Asymptote generated PRC files adds billboard behaviour to text labels in Asymptote PRC files so that they always face the camera under 3D rotation This work may be distributed andor modified under the conditions of the LaTeX Project Public License The latest version of this license is in httpmirrorsctanorgmacroslatexbaselppltxt This work has the LPPL maintenance status `maintained The Current Maintainer of this work is A Grahnvar bbnodes=new Array() billboard meshesvar bbtrans=new Array() billboard transformsfunction fulltransform(mesh) var t=new Matrix4x4(meshtransform) if(meshparentname = ) var parentTransform=fulltransform(meshparent) tmultiplyInPlace(parentTransform) return t else return t find all text labels in the scene and determine pivoting pointsvar nodes=scenenodesvar nodescount=nodescountvar third=1030for(var i=0 i lt nodescount i++) var node=nodesgetByIndex(i) var name=nodename var end=namelastIndexOf()-1 if(end gt 0) if(namecharAt(end) == 001) var start=namelastIndexOf(-)+1 if(end gt start) nodename=namesubstr(0start-1) var nodeMatrix=fulltransform(nodeparent) var c=nodeMatrixtranslation position var d=Mathpow(Mathabs(nodeMatrixdeterminant)third) scale bbnodespush(node) bbtranspush(Matrix4x4()scale(ddd)translate(c)multiply(nodeMatrixinverse)) var camera=scenecamerasgetByIndex(0) var zero=new Vector3(000)var bbcount=bbnodeslength event handler to maintain camera-facing text labelsbillboardHandler=new RenderEventHandler()billboardHandleronEvent=function(event) var T=new Matrix4x4() TsetView(zerocamerapositionsubtract(cameratargetPosition) cameraupsubtract(cameraposition)) for(var j=0 j lt bbcount j++) bbnodes[j]transformset(Tmultiply(bbtrans[j])) runtimerefresh() runtimeaddEventHandler(billboardHandler)runtimerefresh()

(C) 2012 Alexander Grahn 3Dspintooljs version 20120301 3D JavaScript to be used with media9sty (option `add3Djscript) enables the Spin tool (also accessible via 3D toolbar or context menu) upon activation of the 3D scene the scene then rotates around the upright axis while dragging with the mouse This work may be distributed andor modified under the conditions of the LaTeX Project Public License The latest version of this license is in httpmirrorsctanorgmacroslatexbaselppltxt This work has the LPPL maintenance status `maintained The Current Maintainer of this work is A GrahnruntimesetCurrentTool(runtimeTOOL_NAME_SPIN)

cells [ cell_type code execution_count null metadata outputs [] source [ from IPythoncoredisplay import display HTMLn display(HTML( )) ] cell_type code execution_count null metadata collapsed true outputs [] source [ import numpy as npn import scipystats as ssn import time n n Black and Scholesn def d1(S0 K r sigma T)n return (nplog(S0K) + (r + sigma2 2) T)(sigma npsqrt(T))n n def d2(S0 K r sigma T)n return (nplog(S0 K) + (r - sigma2 2) T) (sigma npsqrt(T))n n def BlackScholes(typeS0 K r sigma T)n if type==Cn return S0 ssnormcdf(d1(S0 K r sigma T)) - K npexp(-r T) ssnormcdf(d2(S0 K r sigma T))n elsen return K npexp(-r T) ssnormcdf(-d2(S0 K r sigma T)) - S0 ssnormcdf(-d1(S0 K r sigma T)) ] cell_type code execution_count null metadata outputs [] source [ BlackScholes(C100 120 002 02 10) ] ] metadata anaconda-cloud kernelspec display_name Python 3 language python name python3 language_info codemirror_mode name ipython version 3 file_extension py mimetype textx-python name python nbconvert_exporter python pygments_lexer ipython3 version 375rc1 nbformat 4 nbformat_minor 1

Black-Scholes Pricing and Hedging

Fig 65 Time-dependent solution of the Black-Scholes PDE (call option)lowast

The next proposition is proved by a direct differentiation of the Black-Scholesfunction and will be recovered later using a probabilistic argument in Propo-sition 714 below

Proposition 64 The Black-Scholes Delta of the European call option isgiven by

ξt = ξt(St) =partgcpartx

(tSt) = Φ(d+(T minus t)

)isin [0 1] (615)

where d+(T minus t) is given by (611)

Proof From Relation (613) we note that the standard normal probabilitydensity function

ϕ(x) = Φprime(x) =1radic2π

eminusx22 x isin R

satisfies

ϕ(d+(T minus t)) = ϕ

(log(xK) + (r+ σ22)(T minus t)

|σ|radicT minus t

)=

1radic2π

exp(minus1

2

(log(xK) + (r+ σ22)(T minus t)

|σ|radicT minus t

)2)

=1radic2π

exp(minus1

2

(log(xK) + (rminus σ22)(T minus t)

|σ|radicT minus t

+ |σ|radicT minus t

)2)

=1radic2π

exp(minus1

2 (dminus(T minus t))2 minus (T minus t)rminus log x

K

)=

K

xradic

2πeminus(Tminust)r exp

(minus1

2 (dminus(T minus t))2)

lowast The animation works in Acrobat Reader on the entire pdf file

209

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

=K

xeminus(Tminust)rϕ(dminus(T minus t))

hence by (610) we have

partgcpartx

(tx) = part

partx

(xΦ(

log(xK) + (r+ σ22)(T minus t)|σ|radicT minus t

))(616)

minusK eminus(Tminust)r partpartx

(Φ(

log(xK) + (rminus σ22)(T minus t)|σ|radicT minus t

))= Φ

(log(xK) + (r+ σ22)(T minus t)

|σ|radicT minus t

)+x

part

partxΦ(

log(xK) + (r+ σ22)(T minus t)|σ|radicT minus t

)minusK eminus(Tminust)r part

partxΦ(

log(xK) + (rminus σ22)(T minus t)|σ|radicT minus t

)= Φ

(log(xK) + (r+ σ22)(T minus t)

|σ|radicT minus t

)+

x

|σ|radicT minus t

ϕ

(log(xK) + (r+ σ22)(T minus t)

|σ|radicT minus t

)minusK eminus(Tminust)r

|σ|radicT minus t

ϕ

(log(xK) + (rminus σ22)(T minus t)

|σ|radicT minus t

)= Φ(d+(T minus t)) +

x

|σ|radicT minus t

ϕ(d+(T minus t))minusK eminus(Tminust)r

|σ|radicT minus t

ϕ(dminus(T minus t))

= Φ(d+(T minus t))

As a consequence of Proposition 64 the Black-Scholes call price splits into arisky component StΦ

(d+(T minus t)

)and a riskless componentminusK eminus(Tminust)rΦ

(dminus(T minus

t)) as follows

gc(tSt) = StΦ(d+(T minus t)

)︸ ︷︷ ︸risky investment (held)

minus K eminus(Tminust)rΦ(dminus(T minus t)

)︸ ︷︷ ︸

riskminusfree investment (borrowed)

0 6 t 6 T

See Exercise 64 for a computation of the boundary values of gc(tx) t isin[0T ) x gt 0 The following R script is an implementation of the Black-ScholesDelta for European call options in R

1 Delta lt- function(S K r T sigma)d1 lt- (log(SK)+(r+sigma^22)T)(sigmasqrt(T))

3 Delta = pnorm(d1)Delta

210

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

In Figure 66 we plot the Delta of the European call option as a function ofthe underlying asset price and of the time remaining until maturity

Payoff function (x-K)+

0

50

100

150

200

Underlying

0

5

10

15

Time to maturity T-t

0

025

05

075

1

Fig 66 Delta of a European call option with strike price K = 100 r = 3 σ = 10

The Gamma of the European call option is defined as the first derivative ofDelta or second derivative of the option price with respect to the underlyingasset price This gives

γt =1

St|σ|radicT minus t

Φprime(d+(T minus t)

)=

1St|σ|

radic2(T minus t)π

exp(minus1

2

(log(StK) + (r+ σ22)(T minus t)

|σ|radicT minus t

)2)gt 0

In particular a positive value of γt implies that the Delta ξt = ξt(St) shouldincrease when the underlying asset price St increases In other words the po-sition ξt in the underlying asset should be increased by additional purchasesif the underlying asset price St increases

In Figure 67 we plot the (truncated) value of the Gamma of a European calloption as a function of the underlying asset price and of time to maturity

211

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

Fig 67 Gamma of a European call option with strike price K = 100

As Gamma is always nonnegative the Black-Scholes hedging strategy is tokeep buying the risky underlying asset when its price increases and to sell itwhen its price decreases as can be checked from Figure 67

Numerical example - hedging of a call option

In Figure 68 we consider the historical stock price of HSBC Holdings(0005HK) over one year

Fig 68 Graph of the stock price of HSBC Holdings

Consider the call option issued by Societe Generale on 31 December 2008 withstrike price K=$63704 maturity T = October 05 2009 and an entitlementratio of 100 meaning that one option contract is divided into 100 warrants cfpage 9 The next graph gives the time evolution of the Black-Scholes portfoliovalue

t 7minusrarr gc(tSt)

driven by the market price t 7minusrarr St of the risky underlying asset as given inFigure 68 in which the number of days is counted from the origin and notfrom maturity

212

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

40 50 60 70 80 90 0 50 100 150 200

0

5

10

15

20

25

30

35

40

Underlying (HK$) Time in days

Fig 69 Path of the Black-Scholes price for a call option on HSBC

As a consequence of Proposition 64 in the Black-Scholes call option hedgingmodel the amount invested in the risky asset is

Stξt = StΦ(d+(T minus t)

)= StΦ

(log(StK) + (r+ σ22)(T minus t)

|σ|radicT minus t

)gt 0

which is always nonnegative ie there is no short selling and the amountinvested on the riskless asset is

ηtAt = minusK eminus(Tminust)rΦ(dminus(T minus t)

)= minusK eminus(Tminust)rΦ

(log(StK) + (rminus σ22)(T minus t)

|σ|radicT minus t

)6 0

which is always nonpositive ie we are constantly borrowing money on theriskless asset as noted in Figure 610

-60

-40

-20

0

20

40

60

80

100

0 50 100 150 200

K

HK$

Black-Scholes priceRisky investment ξtSt

Riskless investment ηtAtUnderlying asset price

Fig 610 Time evolution of a hedging portfolio for a call option on HSBC

213

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

A comparison of Figure 610 with market data can be found in Figures 911and 912 below

Cash settlement In the case of a cash settlement the option issuer will sat-isfy the option contract by selling ξT = 1 stock at the price ST = $83refund the K = $63 risk-free investment and hand in the remaining amountC = (ST minusK)+ = 83minus 63 = $20 to the option holder

Physical delivery In the case of physical delivery of the underlying asset theoption issuer will deliver ξT = 1 stock to the option holder in exchange forK = $63 which will be used together with the portfolio value to refund therisk-free loan

63 European Put Options

Similarly in the case of the European put option with strike price K thepayoff function is given by h(x) = (Kminusx)+ and the Black-Scholes PDE (67)reads

rgp(tx) =partgppartt

(tx) + rxpartgppartx

(tx) + 12σ

2x2 part2gppartx2 (tx)

gp(T x) = (K minus x)+(617)

The next proposition can be proved as in Sections 65 and 66 see Proposi-tion 611

Proposition 65 The solution of the PDE (617) is given by the Black-Scholes formula for put options

gp(tx) = K eminus(Tminust)rΦ(minus dminus(T minus t)

)minus xΦ

(minus d+(T minus t)

) (618)

withd+(T minus t) =

log(xK) + (r+ σ22)(T minus t)|σ|radicT minus t

(619)

dminus(T minus t) =log(xK) + (rminus σ22)(T minus t)

|σ|radicT minus t

(620)

as illustrated in Figure 611

214

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

Fig 611 Graph of the Black-Scholes put price function with strike price K = 100lowast

In other words the European put option with strike price K and maturityT is priced at time t isin [0T ] as

gp(tSt) = K eminus(Tminust)rΦ(minus dminus(T minus t)

)minus StΦ

(minus d+(T minus t)

) 0 6 t 6 T

Fig 612 Time-dependent solution of the Black-Scholes PDE (put option)dagger

The following R script is an implementation of the Black-Scholes formula forEuropean put options in R

1 BSPut lt- function(S K r T sigma)d1 = (log(SK)+(r+sigma^22)T)(sigmasqrt(T))

3 d2 = d1 - sigma sqrt(T)BSPut = Kexp(-rT) pnorm(-d2) - Spnorm(-d1)

5 BSPut

Call-put parity

lowast Right-click on the figure for interaction and ldquoFull Screen Multimediardquo viewdagger The animation works in Acrobat Reader on the entire pdf file

215

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

(C) 2012--today Alexander Grahn 3Dmenujs version 20140923 3D JavaScript used by media9sty Extended functionality of the (right click) context menu of 3D annotations 1) Adds the following items to the 3D context menu `Generate Default View Finds good default camera settings returned as options for use with the includemedia command `Get Current View Determines camera cross section and part settings of the current view returned as `VIEW section that can be copied into a views file of additional views The views file is inserted using the `3Dviews option of includemedia `Cross Section Toggle switch to add or remove a cross section into or from the current view The cross section can be moved in the x y z directions using x y z and X Y Z keys on the keyboard be tilted against and spun around the upright Z axis using the UpDown and LeftRight arrow keys and caled using the s and S keys 2) Enables manipulation of position and orientation of indiviual parts and groups of parts in the 3D scene Parts which have been selected with the mouse can be scaled moved around and rotated like the cross section as described above To spin the parts around their local up-axis keep Control key pressed while using the UpDown and LeftRight arrow keys This work may be distributed andor modified under the conditions of the LaTeX Project Public License The latest version of this license is in httpmirrorsctanorgmacroslatexbaselppltxt This work has the LPPL maintenance status `maintained The Current Maintainer of this work is A Grahn The code borrows heavily from Bernd Gaertners `Miniball software originally written in C++ for computing the smallest enclosing ball of a set of points see httpwwwinfethzchpersonalgaertnerminiballhtmlhostconsoleshow()constructor for doubly linked listfunction List() thisfirst_node=null thislast_node=new Node(undefined)Listprototypepush_back=function(x) var new_node=new Node(x) if(thisfirst_node==null) thisfirst_node=new_node new_nodeprev=null else new_nodeprev=thislast_nodeprev new_nodeprevnext=new_node new_nodenext=thislast_node thislast_nodeprev=new_nodeListprototypemove_to_front=function(it) var node=itget() if(nodenext=null ampamp nodeprev=null) nodenextprev=nodeprev nodeprevnext=nodenext nodeprev=null nodenext=thisfirst_node thisfirst_nodeprev=node thisfirst_node=node Listprototypebegin=function() var i=new Iterator() itarget=thisfirst_node return(i)Listprototypeend=function() var i=new Iterator() itarget=thislast_node return(i)function Iterator(it) if( it=undefined ) thistarget=ittarget else thistarget=null Iteratorprototypeset=function(it)thistarget=ittargetIteratorprototypeget=function()return(thistarget)Iteratorprototypederef=function()return(thistargetdata)Iteratorprototypeincr=function() if(thistargetnext=null) thistarget=thistargetnextconstructor for node objects that populate the linked listfunction Node(x) thisprev=null thisnext=null thisdata=xfunction sqr(r)return(rr)helper functionMiniball algorithm by B Gaertnerfunction Basis() thism=0 thisq0=new Array(3) thisz=new Array(4) thisf=new Array(4) thisv=new Array(new Array(3) new Array(3) new Array(3) new Array(3)) thisa=new Array(new Array(3) new Array(3) new Array(3) new Array(3)) thisc=new Array(new Array(3) new Array(3) new Array(3) new Array(3)) thissqr_r=new Array(4) thiscurrent_c=thisc[0] thiscurrent_sqr_r=0 thisreset()Basisprototypecenter=function()return(thiscurrent_c)Basisprototypesize=function()return(thism)Basisprototypepop=function()--thismBasisprototypeexcess=function(p) var e=-thiscurrent_sqr_r for(var k=0klt3++k) e+=sqr(p[k]-thiscurrent_c[k]) return(e)Basisprototypereset=function() thism=0 for(var j=0jlt3++j) thisc[0][j]=0 thiscurrent_c=thisc[0] thiscurrent_sqr_r=-1Basisprototypepush=function(p) var i j var eps=1e-32 if(thism==0) for(i=0ilt3++i) thisq0[i]=p[i] for(i=0ilt3++i) thisc[0][i]=thisq0[i] thissqr_r[0]=0 else for(i=0ilt3++i) thisv[thism][i]=p[i]-thisq0[i] for(i=1iltthism++i) thisa[thism][i]=0 for(j=0jlt3++j) thisa[thism][i]+=thisv[i][j]thisv[thism][j] thisa[thism][i]=(2thisz[i]) for(i=1iltthism++i) for(j=0jlt3++j) thisv[thism][j]-=thisa[thism][i]thisv[i][j] thisz[thism]=0 for(j=0jlt3++j) thisz[thism]+=sqr(thisv[thism][j]) thisz[thism]=2 if(thisz[thism]ltepsthiscurrent_sqr_r) return(false) var e=-thissqr_r[thism-1] for(i=0ilt3++i) e+=sqr(p[i]-thisc[thism-1][i]) thisf[thism]=ethisz[thism] for(i=0ilt3++i) thisc[thism][i]=thisc[thism-1][i]+thisf[thism]thisv[thism][i] thissqr_r[thism]=thissqr_r[thism-1]+ethisf[thism]2 thiscurrent_c=thisc[thism] thiscurrent_sqr_r=thissqr_r[thism] ++thism return(true)function Miniball() thisL=new List() thisB=new Basis() thissupport_end=new Iterator()Miniballprototypemtf_mb=function(it) var i=new Iterator(it) thissupport_endset(thisLbegin()) if((thisBsize())==4) return for(var k=new Iterator(thisLbegin())kget()=iget()) var j=new Iterator(k) kincr() if(thisBexcess(jderef()) gt 0) if(thisBpush(jderef())) thismtf_mb(j) thisBpop() if(thissupport_endget()==jget()) thissupport_endincr() thisLmove_to_front(j) Miniballprototypecheck_in=function(b) thisLpush_back(b)Miniballprototypebuild=function() thisBreset() thissupport_endset(thisLbegin()) thismtf_mb(thisLend())Miniballprototypecenter=function() return(thisBcenter())Miniballprototyperadius=function() return(Mathsqrt(thisBcurrent_sqr_r))functions called by menu itemsfunction calc3Dopts () create Miniball object var mb=new Miniball() auxiliary vector var corner=new Vector3() iterate over all visible mesh nodes in the scene for(i=0iltscenemeshescounti++) var mesh=scenemeshesgetByIndex(i) if(meshvisible) continue local to parent transformation matrix var trans=meshtransform build local to world transformation matrix by recursively multiplying the parents transf matrix on the right var parent=meshparent while(parenttransform) trans=transmultiply(parenttransform) parent=parentparent get the bbox of the mesh (local coordinates) var bbox=meshcomputeBoundingBox() transform the local bounding box corner coordinates to world coordinates for bounding sphere determination BBoxmin cornerset(bboxmin) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) BBoxmax cornerset(bboxmax) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) remaining six BBox corners cornerset(bboxminx bboxmaxy bboxmaxz) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) cornerset(bboxminx bboxminy bboxmaxz) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) cornerset(bboxminx bboxmaxy bboxminz) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) cornerset(bboxmaxx bboxminy bboxminz) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) cornerset(bboxmaxx bboxminy bboxmaxz) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) cornerset(bboxmaxx bboxmaxy bboxminz) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) compute the smallest enclosing bounding sphere mbbuild() current camera settings var camera=scenecamerasgetByIndex(0) var res= initialize result string aperture angle of the virtual camera (perspective projection) or orthographic scale (orthographic projection) if(cameraprojectionType==cameraTYPE_PERSPECTIVE) var aac=camerafov180MathPI if(hostutilprintf(4f aac)=30) res+=hostutilprintf(n3Daac=s aac) else cameraviewPlaneSize=2mbradius() res+=hostutilprintf(n3Dortho=s 1cameraviewPlaneSize) camera roll var roll = cameraroll180MathPI if(hostutilprintf(4f roll)=0) res+=hostutilprintf(n3Droll=sroll) target to camera vector var c2c=new Vector3() c2cset(cameraposition) c2csubtractInPlace(cameratargetPosition) c2cnormalize() if((c2cx==0 ampamp c2cy==-1 ampamp c2cz==0)) res+=hostutilprintf(n3Dc2c=s s s c2cx c2cy c2cz) new camera settings bounding sphere centre --gt new camera target var coo=new Vector3() cooset((mbcenter())[0] (mbcenter())[1] (mbcenter())[2]) if(coolength) res+=hostutilprintf(n3Dcoo=s s s coox cooy cooz) radius of orbit if(cameraprojectionType==cameraTYPE_PERSPECTIVE) var roo=mbradius() Mathsin(aac MathPI 360) else orthographic projection var roo=mbradius() res+=hostutilprintf(n3Droo=s roo) update camera settings in the viewer var currol=cameraroll cameratargetPositionset(coo) camerapositionset(cooadd(c2cscale(roo))) cameraroll=currol determine background colour rgb=scenebackgroundgetColor() if((rgbr==1 ampamp rgbg==1 ampamp rgbb==1)) res+=hostutilprintf(n3Dbg=s s s rgbr rgbg rgbb) determine lighting scheme switch(scenelightScheme) case sceneLIGHT_MODE_FILE curlights=Artworkbreak case sceneLIGHT_MODE_NONE curlights=Nonebreak case sceneLIGHT_MODE_WHITE curlights=Whitebreak case sceneLIGHT_MODE_DAY curlights=Daybreak case sceneLIGHT_MODE_NIGHT curlights=Nightbreak case sceneLIGHT_MODE_BRIGHT curlights=Hardbreak case sceneLIGHT_MODE_RGB curlights=Primarybreak case sceneLIGHT_MODE_BLUE curlights=Bluebreak case sceneLIGHT_MODE_RED curlights=Redbreak case sceneLIGHT_MODE_CUBE curlights=Cubebreak case sceneLIGHT_MODE_CAD curlights=CADbreak case sceneLIGHT_MODE_HEADLAMP curlights=Headlampbreak if(curlights=Artwork) res+=hostutilprintf(n3Dlights=s curlights) determine global render mode switch(scenerenderMode) case sceneRENDER_MODE_BOUNDING_BOX currender=BoundingBoxbreak case sceneRENDER_MODE_TRANSPARENT_BOUNDING_BOX currender=TransparentBoundingBoxbreak case sceneRENDER_MODE_TRANSPARENT_BOUNDING_BOX_OUTLINE currender=TransparentBoundingBoxOutlinebreak case sceneRENDER_MODE_VERTICES currender=Verticesbreak case sceneRENDER_MODE_SHADED_VERTICES currender=ShadedVerticesbreak case sceneRENDER_MODE_WIREFRAME currender=Wireframebreak case sceneRENDER_MODE_SHADED_WIREFRAME currender=ShadedWireframebreak case sceneRENDER_MODE_SOLID currender=Solidbreak case sceneRENDER_MODE_TRANSPARENT currender=Transparentbreak case sceneRENDER_MODE_SOLID_WIREFRAME currender=SolidWireframebreak case sceneRENDER_MODE_TRANSPARENT_WIREFRAME currender=TransparentWireframebreak case sceneRENDER_MODE_ILLUSTRATION currender=Illustrationbreak case sceneRENDER_MODE_SOLID_OUTLINE currender=SolidOutlinebreak case sceneRENDER_MODE_SHADED_ILLUSTRATION currender=ShadedIllustrationbreak case sceneRENDER_MODE_HIDDEN_WIREFRAME currender=HiddenWireframebreak if(currender=Solid) res+=hostutilprintf(n3Drender=s currender) write result string to the console hostconsoleshow() hostconsoleclear() hostconsoleprintln(n Copy and paste the following text to then+ option list of includemedian + res + n)function get3Dview () var camera=scenecamerasgetByIndex(0) var coo=cameratargetPosition var c2c=camerapositionsubtract(coo) var roo=c2clength c2cnormalize() var res=VIEW=insert optional name heren if((coox==0 ampamp cooy==0 ampamp cooz==0)) res+=hostutilprintf( COO=s s sn coox cooy cooz) if((c2cx==0 ampamp c2cy==-1 ampamp c2cz==0)) res+=hostutilprintf( C2C=s s sn c2cx c2cy c2cz) if(roo gt 1e-9) res+=hostutilprintf( ROO=sn roo) var roll = cameraroll180MathPI if(hostutilprintf(4f roll)=0) res+=hostutilprintf( ROLL=sn roll) if(cameraprojectionType==cameraTYPE_PERSPECTIVE) var aac=camerafov 180MathPI if(hostutilprintf(4f aac)=30) res+=hostutilprintf( AAC=sn aac) else if(hostutilprintf(4f cameraviewPlaneSize)=1) res+=hostutilprintf( ORTHO=sn 1cameraviewPlaneSize) rgb=scenebackgroundgetColor() if((rgbr==1 ampamp rgbg==1 ampamp rgbb==1)) res+=hostutilprintf( BGCOLOR=s s sn rgbr rgbg rgbb) switch(scenelightScheme) case sceneLIGHT_MODE_FILE curlights=Artworkbreak case sceneLIGHT_MODE_NONE curlights=Nonebreak case sceneLIGHT_MODE_WHITE curlights=Whitebreak case sceneLIGHT_MODE_DAY curlights=Daybreak case sceneLIGHT_MODE_NIGHT curlights=Nightbreak case sceneLIGHT_MODE_BRIGHT curlights=Hardbreak case sceneLIGHT_MODE_RGB curlights=Primarybreak case sceneLIGHT_MODE_BLUE curlights=Bluebreak case sceneLIGHT_MODE_RED curlights=Redbreak case sceneLIGHT_MODE_CUBE curlights=Cubebreak case sceneLIGHT_MODE_CAD curlights=CADbreak case sceneLIGHT_MODE_HEADLAMP curlights=Headlampbreak if(curlights=Artwork) res+= LIGHTS=+curlights+n switch(scenerenderMode) case sceneRENDER_MODE_BOUNDING_BOX defaultrender=BoundingBoxbreak case sceneRENDER_MODE_TRANSPARENT_BOUNDING_BOX defaultrender=TransparentBoundingBoxbreak case sceneRENDER_MODE_TRANSPARENT_BOUNDING_BOX_OUTLINE defaultrender=TransparentBoundingBoxOutlinebreak case sceneRENDER_MODE_VERTICES defaultrender=Verticesbreak case sceneRENDER_MODE_SHADED_VERTICES defaultrender=ShadedVerticesbreak case sceneRENDER_MODE_WIREFRAME defaultrender=Wireframebreak case sceneRENDER_MODE_SHADED_WIREFRAME defaultrender=ShadedWireframebreak case sceneRENDER_MODE_SOLID defaultrender=Solidbreak case sceneRENDER_MODE_TRANSPARENT defaultrender=Transparentbreak case sceneRENDER_MODE_SOLID_WIREFRAME defaultrender=SolidWireframebreak case sceneRENDER_MODE_TRANSPARENT_WIREFRAME defaultrender=TransparentWireframebreak case sceneRENDER_MODE_ILLUSTRATION defaultrender=Illustrationbreak case sceneRENDER_MODE_SOLID_OUTLINE defaultrender=SolidOutlinebreak case sceneRENDER_MODE_SHADED_ILLUSTRATION defaultrender=ShadedIllustrationbreak case sceneRENDER_MODE_HIDDEN_WIREFRAME defaultrender=HiddenWireframebreak if(defaultrender=Solid) res+= RENDERMODE=+defaultrender+n detect existing Clipping Plane (3D Cross Section) var clip=null if( clip=scenenodesgetByName($$$$$$)|| clip=scenenodesgetByName(Clipping Plane) ) for(var i=0iltscenenodescounti++) var nd=scenenodesgetByIndex(i) if(nd==clip||ndname==) continue var ndUTFName= for (var j=0 jltndnamelength j++) var theUnicode = ndnamecharCodeAt(j)toString(16) while (theUnicodelengthlt4) theUnicode = 0 + theUnicode ndUTFName += theUnicode var end=ndnamelastIndexOf() if(endgt0) var ndUserName=ndnamesubstr(0end) else var ndUserName=ndname respart= PART=+ndUserName+n respart+= UTF16NAME=+ndUTFName+n defaultvals=true if(ndvisible) respart+= VISIBLE=falsen defaultvals=false if(ndopacitylt10) respart+= OPACITY=+ndopacity+n defaultvals=false if(ndconstructorname==Mesh) currender=defaultrender switch(ndrenderMode) case sceneRENDER_MODE_BOUNDING_BOX currender=BoundingBoxbreak case sceneRENDER_MODE_TRANSPARENT_BOUNDING_BOX currender=TransparentBoundingBoxbreak case sceneRENDER_MODE_TRANSPARENT_BOUNDING_BOX_OUTLINE currender=TransparentBoundingBoxOutlinebreak case sceneRENDER_MODE_VERTICES currender=Verticesbreak case sceneRENDER_MODE_SHADED_VERTICES currender=ShadedVerticesbreak case sceneRENDER_MODE_WIREFRAME currender=Wireframebreak case sceneRENDER_MODE_SHADED_WIREFRAME currender=ShadedWireframebreak case sceneRENDER_MODE_SOLID currender=Solidbreak case sceneRENDER_MODE_TRANSPARENT currender=Transparentbreak case sceneRENDER_MODE_SOLID_WIREFRAME currender=SolidWireframebreak case sceneRENDER_MODE_TRANSPARENT_WIREFRAME currender=TransparentWireframebreak case sceneRENDER_MODE_ILLUSTRATION currender=Illustrationbreak case sceneRENDER_MODE_SOLID_OUTLINE currender=SolidOutlinebreak case sceneRENDER_MODE_SHADED_ILLUSTRATION currender=ShadedIllustrationbreak case sceneRENDER_MODE_HIDDEN_WIREFRAME currender=HiddenWireframebreak case sceneRENDER_MODE_DEFAULT currender=Defaultbreak if(currender=defaultrender) respart+= RENDERMODE=+currender+n defaultvals=false if(origtrans[ndname]ampampndtransformisEqual(origtrans[ndname])) var lvec=ndtransformtransformDirection(new Vector3(100)) var uvec=ndtransformtransformDirection(new Vector3(010)) var vvec=ndtransformtransformDirection(new Vector3(001)) respart+= TRANSFORM= +lvecx+ +lvecy+ +lvecz+ +uvecx+ +uvecy+ +uvecz+ +vvecx+ +vvecy+ +vvecz+ +ndtransformtranslationx+ +ndtransformtranslationy+ +ndtransformtranslationz+n defaultvals=false respart+= ENDn if(defaultvals) res+=respart if(clip) var centre=cliptransformtranslation var normal=cliptransformtransformDirection(new Vector3(001)) res+= CROSSSECTn if((centrex==0 ampamp centrey==0 ampamp centrez==0)) res+=hostutilprintf( CENTER=s s sn centrex centrey centrez) if((normalx==1 ampamp normaly==0 ampamp normalz==0)) res+=hostutilprintf( NORMAL=s s sn normalx normaly normalz) res+=hostutilprintf( VISIBLE=sn clipvisible) res+=hostutilprintf( PLANECOLOR=s s sn clipmaterialemissiveColorr clipmaterialemissiveColorg clipmaterialemissiveColorb) res+=hostutilprintf( OPACITY=sn clipopacity) res+=hostutilprintf( INTERSECTIONCOLOR=s s sn clipwireframeColorr clipwireframeColorg clipwireframeColorb) res+= ENDn for(var propt in clip) consoleprintln(propt++clip[propt]) res+=ENDn hostconsoleshow() hostconsoleclear() hostconsoleprintln(n Add the following VIEW section to a file ofn+ predefined views (See option 3Dviews)nn + The view may be given a name after VIEW=n + (Remove in front of =)n) hostconsoleprintln(res + n)add items to 3D context menuruntimeaddCustomMenuItem(dfltview Generate Default View default 0)runtimeaddCustomMenuItem(currview Get Current View default 0)runtimeaddCustomMenuItem(csection Cross Section checked 0)menu event handlersmenuEventHandler = new MenuEventHandler()menuEventHandleronEvent = function(e) switch(emenuItemName) case dfltview calc3Dopts() break case currview get3Dview() break case csection addremoveClipPlane(emenuItemChecked) break runtimeaddEventHandler(menuEventHandler)global variable taking reference to currently selected nodevar target=nullselectionEventHandler=new SelectionEventHandler()selectionEventHandleronEvent=function(e) if(eselectedampampenodename=) target=enode else target=null runtimeaddEventHandler(selectionEventHandler)cameraEventHandler=new CameraEventHandler()cameraEventHandleronEvent=function(e) var clip=null runtimeremoveCustomMenuItem(csection) runtimeaddCustomMenuItem(csection Cross Section checked 0) if(clip=scenenodesgetByName($$$$$$)|| predefined scenenodesgetByName(Clipping Plane)) added via context menu runtimeremoveCustomMenuItem(csection) runtimeaddCustomMenuItem(csection Cross Section checked 1) if(clip)plane in predefined views must be rotated by 90 deg around normal cliptransformrotateAboutLineInPlace( MathPI2cliptransformtranslation cliptransformtransformDirection(new Vector3(001)) ) for(var i=0 iltrot4x4length i++)rot4x4[i]setIdentity() target=nullruntimeaddEventHandler(cameraEventHandler)var rot4x4=new Array() keeps track of spin and tilt axes transformationskey event handler for scaling moving spinning and tilting objectskeyEventHandler=new KeyEventHandler()keyEventHandleronEvent=function(e) var backtrans=new Matrix4x4() var trgt=null if(target) trgt=target var backtrans=new Matrix4x4() var trans=trgttransform var parent=trgtparent while(parenttransform) build local to world transformation matrix transmultiplyInPlace(parenttransform) also build world to local back-transformation matrix backtransmultiplyInPlace(parenttransforminversetranspose) parent=parentparent backtranstransposeInPlace() else if( trgt=scenenodesgetByName($$$$$$)|| trgt=scenenodesgetByName(Clipping Plane) ) var trans=trgttransform if(trgt) return var tname=trgtname if(typeof(rot4x4[tname])==undefined) rot4x4[tname]=new Matrix4x4() if(target) var tiltAxis=rot4x4[tname]transformDirection(new Vector3(010)) else var tiltAxis=transtransformDirection(new Vector3(010)) var spinAxis=rot4x4[tname]transformDirection(new Vector3(001)) get the centre of the mesh if(targetampamptrgtconstructorname==Mesh) var centre=transtransformPosition(trgtcomputeBoundingBox()center) else part group (Node3 parent node clipping plane) var centre=new Vector3(transtranslation) switch(echaracterCode) case 30tilt up rot4x4[tname]rotateAboutLineInPlace( -MathPI900rot4x4[tname]translationtiltAxis) transrotateAboutLineInPlace(-MathPI900centretiltAxis) break case 31tilt down rot4x4[tname]rotateAboutLineInPlace( MathPI900rot4x4[tname]translationtiltAxis) transrotateAboutLineInPlace(MathPI900centretiltAxis) break case 28spin right if(ectrlKeyDownampamptarget) transrotateAboutLineInPlace(-MathPI900centrespinAxis) else rot4x4[tname]rotateAboutLineInPlace( -MathPI900rot4x4[tname]translationnew Vector3(001)) transrotateAboutLineInPlace(-MathPI900centrenew Vector3(001)) break case 29spin left if(ectrlKeyDownampamptarget) transrotateAboutLineInPlace(MathPI900centrespinAxis) else rot4x4[tname]rotateAboutLineInPlace( MathPI900rot4x4[tname]translationnew Vector3(001)) transrotateAboutLineInPlace(MathPI900centrenew Vector3(001)) break case 120 x translateTarget(trans new Vector3(100) e) break case 121 y translateTarget(trans new Vector3(010) e) break case 122 z translateTarget(trans new Vector3(001) e) break case 88 shift + x translateTarget(trans new Vector3(-100) e) break case 89 shift + y translateTarget(trans new Vector3(0-10) e) break case 90 shift + z translateTarget(trans new Vector3(00-1) e) break case 115 s transtranslateInPlace(centrescale(-1)) transscaleInPlace(101) transtranslateInPlace(centrescale(1)) break case 83 shift + s transtranslateInPlace(centrescale(-1)) transscaleInPlace(1101) transtranslateInPlace(centrescale(1)) break transmultiplyInPlace(backtrans)runtimeaddEventHandler(keyEventHandler)translates object by amount calculated from Canvas sizefunction translateTarget(t d e) var cam=scenecamerasgetByIndex(0) if(camprojectionType==camTYPE_PERSPECTIVE) var scale=Mathtan(camfov2) camtargetPositionsubtract(camposition)length Mathmin(ecanvasPixelWidthecanvasPixelHeight) else var scale=camviewPlaneSize2 Mathmin(ecanvasPixelWidthecanvasPixelHeight) ttranslateInPlace(dscale(scale))function addremoveClipPlane(chk) var curTrans=getCurTrans() var clip=scenecreateClippingPlane() if(chk) add Clipping Plane and place its center either into the camera target position or into the centre of the currently selected mesh node var centre=new Vector3() if(target) var trans=targettransform var parent=targetparent while(parenttransform) trans=transmultiply(parenttransform) parent=parentparent if(targetconstructorname==Mesh) var centre=transtransformPosition(targetcomputeBoundingBox()center) else var centre=new Vector3(transtranslation) target=null else centreset(scenecamerasgetByIndex(0)targetPosition) cliptransformsetView( new Vector3(000) new Vector3(100) new Vector3(010)) cliptransformtranslateInPlace(centre) else if( scenenodesgetByName($$$$$$)|| scenenodesgetByName(Clipping Plane) ) clipremove()clip=null restoreTrans(curTrans) return clipfunction to store current transformation matrix of all nodes in the scenefunction getCurTrans() var tA=new Array() for(var i=0 iltscenenodescount i++) var nd=scenenodesgetByIndex(i) if(ndname==) continue tA[ndname]=new Matrix4x4(ndtransform) return tAfunction to restore transformation matrices given as argfunction restoreTrans(tA) for(var i=0 iltscenenodescount i++) var nd=scenenodesgetByIndex(i) if(tA[ndname]) ndtransformset(tA[ndname]) store original transformation matrix of all mesh nodes in the scenevar origtrans=getCurTrans()set initial state of Cross Section menu entrycameraEventHandleronEvent(1)hostconsoleclear()

var ocgs=hostgetOCGs(hostpageNum)for(var i=0iltocgslengthi++)if(ocgs[i]name==MediaPlayButton2)ocgs[i]state=false

(C) 2012 Michail Vidiassov John C Bowman Alexander Grahn asylabelsjs version 20120912 3D JavaScript to be used with media9sty (option `add3Djscript) for Asymptote generated PRC files adds billboard behaviour to text labels in Asymptote PRC files so that they always face the camera under 3D rotation This work may be distributed andor modified under the conditions of the LaTeX Project Public License The latest version of this license is in httpmirrorsctanorgmacroslatexbaselppltxt This work has the LPPL maintenance status `maintained The Current Maintainer of this work is A Grahnvar bbnodes=new Array() billboard meshesvar bbtrans=new Array() billboard transformsfunction fulltransform(mesh) var t=new Matrix4x4(meshtransform) if(meshparentname = ) var parentTransform=fulltransform(meshparent) tmultiplyInPlace(parentTransform) return t else return t find all text labels in the scene and determine pivoting pointsvar nodes=scenenodesvar nodescount=nodescountvar third=1030for(var i=0 i lt nodescount i++) var node=nodesgetByIndex(i) var name=nodename var end=namelastIndexOf()-1 if(end gt 0) if(namecharAt(end) == 001) var start=namelastIndexOf(-)+1 if(end gt start) nodename=namesubstr(0start-1) var nodeMatrix=fulltransform(nodeparent) var c=nodeMatrixtranslation position var d=Mathpow(Mathabs(nodeMatrixdeterminant)third) scale bbnodespush(node) bbtranspush(Matrix4x4()scale(ddd)translate(c)multiply(nodeMatrixinverse)) var camera=scenecamerasgetByIndex(0) var zero=new Vector3(000)var bbcount=bbnodeslength event handler to maintain camera-facing text labelsbillboardHandler=new RenderEventHandler()billboardHandleronEvent=function(event) var T=new Matrix4x4() TsetView(zerocamerapositionsubtract(cameratargetPosition) cameraupsubtract(cameraposition)) for(var j=0 j lt bbcount j++) bbnodes[j]transformset(Tmultiply(bbtrans[j])) runtimerefresh() runtimeaddEventHandler(billboardHandler)runtimerefresh()

(C) 2012 Alexander Grahn 3Dspintooljs version 20120301 3D JavaScript to be used with media9sty (option `add3Djscript) enables the Spin tool (also accessible via 3D toolbar or context menu) upon activation of the 3D scene the scene then rotates around the upright axis while dragging with the mouse This work may be distributed andor modified under the conditions of the LaTeX Project Public License The latest version of this license is in httpmirrorsctanorgmacroslatexbaselppltxt This work has the LPPL maintenance status `maintained The Current Maintainer of this work is A GrahnruntimesetCurrentTool(runtimeTOOL_NAME_SPIN)

N Privault

Proposition 66 Call-put parity We have the call-put parity relation

gc(tSt)minus gp(tSt) = St minusK eminus(Tminust)r 0 6 t 6 T (621)

between the Black-Scholes prices of call and put options in terms of theforward contract price St minusK eminus(Tminust)r

Proof The call-put parity (621) is a consequence of the relation

xminusK = (xminusK)+ minus (K minus x)+

satisfied by the terminal call and put payoff functions in the Black-ScholesPDE (67) It can also be verified directly from (610) and (618) as

gc(tx)minus gp(tx) = xΦ(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)minus(K eminus(Tminust)rΦ

(minus dminus(T minus t)

)minus xΦ

(minus d+(T minus t)

))= xΦ

(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)minusK eminus(Tminust)r

(1minusΦ

(dminus(T minus t)

))+ x

(1minusΦ

(d+(T minus t)

))= xminusK

The Delta of the Black-Scholes put option can be obtained by differentiationof the call-put parity relation (621) and Proposition 64

Proposition 67 The Delta of the Black-Scholes put option is given by

ξt = minus(1minusΦ(d+(T minus t)

)) = minusΦ

(minus d+(T minus t)

)isin [minus1 0] 0 6 t 6 T

Proof By the call-put parity relation (621) and Proposition 64 we have

partgppartx

(tSt) =partgcpartx

(tSt)minus 1

= Φ(d+(T minus t))minus 1= minusΦ(minusd+(T minus t)) 0 6 t 6 T

where we applied (614)

As a consequence of Proposition 67 the Black-Scholes put price splitsinto a risky component minusStΦ

(minus d+(T minus t)

)and a riskless component

K eminus(Tminust)rΦ(minus dminus(T minus t)

) as follows

gp(tSt) = K eminus(Tminust)rΦ(minus dminus(T minus t)

)︸ ︷︷ ︸riskminusfree investment (savings)

minus StΦ(minus d+(T minus t)

)︸ ︷︷ ︸

risky investment (short)

0 6 t 6 T

216

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

In Figure 613 we plot the Delta of the European put option as a function ofthe underlying asset price and of the time remaining until maturity

Payoff function (x-K)+

0

50

100

150

200

Underlying

0

5

10

15 Time to maturity T-t

-1

-075

-05

-025

0

Fig 613 Delta of a European put option with strike price K = 100 r = 3 σ = 10

Numerical example - hedging of a put option

For one more example we consider a put option issued by BNP Paribas on04 November 2008 with strike price K=$77667 maturity T = October 052009 and entitlement ratio 92593 cf page 9 In the next Figure 614 thenumber of days is counted from the origin not from maturity

40 50 60 70 80 90 100

0 50 100 150 200

0 5

10 15 20 25 30 35 40 45

Underlying (HK$)Time in days

Fig 614 Path of the Black-Scholes price for a put option on HSBC

As a consequence of Proposition 67 the amount invested on the risky assetfor the hedging of a put option is

minusStΦ(minus d+(T minus t)

)= minusStΦ

(minus log(StK) + (r+ σ22)(T minus t)

|σ|radicT minus t

)6 0

217

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

ie there is always short selling and the amount invested on the riskless assetpriced At = ert t isin [0T ] is

ηtAt = K eminus(Tminust)rΦ(minus dminus(T minus t)

)= K eminus(Tminust)rΦ

(minus log(StK) + (rminus σ22)(T minus t)

|σ|radicT minus t

)gt 0

which is always nonnegative ie we are constantly saving money on theriskless asset as noted in Figure 615

-60

-40

-20

0

20

40

60

80

100

0 50 100 150 200

K

HK$

Black-Scholes priceRisky investment ξtSt

Riskless investment ηtAtUnderlying asset price

Fig 615 Time evolution of the hedging portfolio for a put option on HSBC

In the above example the put option finished out of the money (OTM) so thatno cash settlement or physical delivery occurs A comparison of Figure 610with market data can be found in Figures 913 and 914 below

64 Market Terms and Data

The following Table 61 provides a summary of formulas for the computationof Black-Scholes sensitivities also called Greekslowast

lowast ldquoEvery class feels like attending a Greek lessonrdquo (AY2018-2019 student feedback)

218

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

Call option Put option

Option price g(tSt) StΦ(d+(T minus t))minusK eminus(Tminust)rΦ(dminus(T minus t)) K eminus(Tminust)rΦ(minusdminus(T minus t))minus StΦ(minusd+(T minus t))

Delta (∆) partg

partx(tSt) Φ(d+(T minus t)) gt 0 minusΦ(minusd+(T minus t)) 6 0

Gamma (Γ) part2g

partx2 (tSt)Φprime(d+(T minus t))St|σ|

radicT minus t

gt 0

Vega partg

partσ(tSt) St

radicT minus tΦprime(d+(T minus t)) gt 0

Theta (Θ) partg

partt(tSt) minusSt|σ|Φ

prime(d+(T minus t))2radicT minus t

minus rK eminus(Tminust)rΦ(dminus(T minus t)) 6 0 minusSt|σ|Φprime(d+(T minus t))

2radicT minus t

+ rK eminus(Tminust)rΦ(minusdminus(T minus t))

Rho (ρ) partg

partr(tSt) K(T minus t) eminus(Tminust)rΦ(dminus(T minus t)) minusK(T minus t) eminus(Tminust)rΦ(minusdminus(T minus t))

Table 61 Black-Scholes Greeks (Wikipedia)

From Table 61 we can conclude that call option prices are increasing func-tions of the underlying asset price St of the interest rate r and of the volatil-ity parameter σ Similarly put option prices are decreasing functions of theunderlying asset price St of the interest rate r and increasing functions ofthe volatility parameter σ

Parameter Variation of call option prices Variation of put option prices

Underlying St increasing decreasing

Volatility σ increasing increasing

Time t decreasing depends on the underlying price level

Interest rate r increasing decreasing

Table 62 Variations of Black-Scholes prices

The change of sign of the sensitivity Theta (Θ) with respect to time t can beverified in the following Figure 616

219

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

(a) Black-Scholes call price maps (b) Black-Scholes put price maps

Fig 616 Time-dependent solutions of the Black-Scholes PDElowast

Intrinsic value The intrinsic value at time t isin [0T ] of the option withpayoff C = h

(S(1)T

)is given by the immediate exercise payoff h

(S(1)t

) The

extrinsic value at time t isin [0T ] of the option is the remaining differenceπt(C) minus h

(S(1)t

)between the option price πt(C) and the immediate ex-

ercise payoff h(S(1)t

) In general the option price πt(C) decomposes as

πt(C) = h(S(1)t

)︸ ︷︷ ︸intrinsic value

+ πt(C)minus h(S(1)t

)︸ ︷︷ ︸

extrinsic value

0 6 t 6 T ]

Gearing The gearing at time t isin [0T ] of the option with payoff C = h(ST )is defined as the ratio

Gt =St

πt(C)=

Stg(tSt)

0 6 t 6 T

Effective gearing The effective gearing at time t isin [0T ] of the option withpayoff C = h(ST ) is defined as the ratio

Get = Gtξt

=ξtStπt(C)

=St

πt(C)

partg

partx(tSt)

=St

g(tSt)partg

partx(tSt)

= Stpart

partxlog g(tSt) 0 6 t 6 T

lowast The animation works in Acrobat Reader on the entire pdf file

220

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

The effective gearingGet =

ξtStπt(C)

can be interpreted as the hedge ratio ie the percentage of the portfoliowhich is invested on the risky asset When written as

∆g(tSt)g(tSt)

= Get times

∆StSt

the effective gearing gives the relative variation or percentage change∆g(tSt)g(tSt) of the option price g(tSt) from the relative variation∆StSt in the underlying asset price

The ratio Get = Stpart log g(tSt)partx can also be interpreted as an elasticity

coefficient

Break-even price The break-even price BEPt of the underlying asset is thevalue of S for which the intrinsic option value h(S) equals the option priceπt(C) at time t isin [0T ] For European call options it is given by

BEPt = K + πt(C) = K + g(tSt) t = 0 1 N

whereas for European put options it is given by

BEPt = K minus πt(C) = K minus g(tSt) 0 6 t 6 T

Premium The option premium OPt can be defined as the variation requiredfrom the underlying asset price in order to reach the break-even price iewe have

OPt =BEPt minus St

St=K + g(tSt)minus St

St 0 6 t 6 T

for European call options and

OPt =St minusBEPt

St=St + g(tSt)minusK

St 0 6 t 6 T

for European put options see Figure 617 below The term ldquopremiumrdquo issometimes also used to denote the arbitrage price g(tSt) of the option

221

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

f (tx σ)100

=

x =

K =

xpart log f

partx=

σ =

partf

partt(tx σ)=

T=

=(xminusK)x

∆ = = partf

partx(tx σ)

= partf

partσ(tx σ)

=K+f (txσ)minusx

x

=K+f (tx σ)

rf=

partf

partt+rxpartf

partx+

σ2 2x2part2f

partx2

Fig 617 Warrant terms and data

The R package bizdays (requires to install QuantLib) can be used to computecalendar time vs business time to maturity1 installpackages(bizdays)

library(bizdays)3 load_quantlib_calendars(HongKong from=2018-01-01 to=2018-12-31)

load_quantlib_calendars(Singapore from=2018-01-01 to=2018-12-31)5 bizdays(2018-03-10 2018-04-03 QuantLibHongKong)

bizdays(2018-03-10 2018-04-03 QuantLibSingapore)

65 The Heat Equation

In the next proposition we notice that the solution f(tx) of the Black-Scholes PDE (67) can be transformed into a solution g(t y) of the simplerheat equation by a change of variable and a time inversion t 7minusrarr T minus t onthe interval [0T ] so that the terminal condition at time T in the Black-Scholes equation (622) becomes an initial condition at time t = 0 in theheat equation (625) See also here for a related discussion on changes ofvariables for the Black-Scholes PDE

222

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

Proposition 68 Assume that f(tx) solves the Black-Scholes PDErf(tx) = partf

partt(tx) + rx

partf

partx(tx) + 1

2σ2x2 part

2f

partx2 (tx)

f(T x) = (xminusK)+(622)

with terminal condition h(x) = (xminusK)+ x gt 0 Then the function g(t y)defined by

g(t y) = ertf(T minus t e|σ|y+(σ22minusr)t) (623)

solves the heat equation (625) with initial condition

ψ(y) = h(

e|σ|y) y isin R (624)

ie we have partg

partt(t y) = 1

2part2g

party2 (t y)

g(0 y) = h(

e|σ|y)

(625)

Proposition 68 will be proved in Section 66 It will allow us to solve theBlack-Scholes PDE (622) based on the solution of the heat equation (625)with initial condition ψ(y) = h

(e|σ|y

) y isin R by inversion of Relation (623)

with s = T minus t x = e|σ|y+(σ22minusr)t ie

f(sx) = eminus(Tminuss)rg(T minus s minus(σ

22minus r)(T minus s) + log x|σ|

)

Next we focus on the heat equation

partϕ

partt(t y) = 1

2part2ϕ

party2 (t y) (626)

which is used to model the diffusion of heat over time through solids Herethe data of g(x t) represents the temperature measured at time t and pointx We refer the reader to Widder (1975) for a complete treatment of thistopic

223

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

Fig 618 Time-dependent solution of the heat equationlowast

Proposition 69 The fundamental solution of the heat equation (626) isgiven by the Gaussian probability density function

ϕ(t y) =1radic2πt

eminusy2(2t) y isin R

with variance t gt 0

Proof The proof is done by a direct calculation as follows

partϕ

partt(t y) = part

partt

(eminusy2(2t)radic

2πt

)

= minus eminusy2(2t)

2t32radic

2π+

y2

2t2eminusy2(2t)radic

2πt

=

(minus 1

2t +y2

2t2

)ϕ(t y)

and

12part2ϕ

party2 (t y) = minus12part

party

(y

t

eminusy2(2t)radic

2πt

)

= minus eminusy2(2t)

2tradic

2πt+

y2

2t2eminusy2(2t)radic

2πt

=

(minus 1

2t +y2

2t2

)ϕ(t y) t gt 0 y isin R

lowast The animation works in Acrobat Reader on the entire pdf file

224

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

In Section 66 the heat equation (626) will be shown to be equivalent to theBlack-Scholes PDE after a change of variables In particular this will lead tothe explicit solution of the Black-Scholes PDE

Proposition 610 The heat equationpartg

partt(t y) = 1

2part2g

party2 (t y)

g(0 y) = ψ(y)

(627)

with continuous initial condition

g(0 y) = ψ(y)

has the solution

g(t y) =winfinminusinfin

ψ(z) eminus(yminusz)2(2t) dzradic2πt

y isin R t gt 0 (628)

Proof We have

partg

partt(t y) = part

partt

winfinminusinfin

ψ(z) eminus(yminusz)2(2t) dzradic2πt

=winfinminusinfin

ψ(z)part

partt

(eminus(yminusz)2(2t)radic

2πt

)dz

=12winfinminusinfin

ψ(z)

((yminus z)2

t2minus 1t

)eminus(yminusz)2(2t) dzradic

2πt

=12winfinminusinfin

ψ(z)part2

partz2 eminus(yminusz)2(2t) dzradic2πt

=12winfinminusinfin

ψ(z)part2

party2 eminus(yminusz)2(2t) dzradic2πt

=12part2

party2

winfinminusinfin

ψ(z) eminus(yminusz)2(2t) dzradic2πt

=12part2g

party2 (t y)

On the other hand it can be checked that at time t = 0 we have

limtrarr0

winfinminusinfin

ψ(z) eminus(yminusz)2(2t) dzradic2πt

= limtrarr0

winfinminusinfin

ψ(y+ z) eminusz2(2t) dzradic2πt

= ψ(y) y isin R

225

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

The next Figure 619 shows the evolution of g(tx) with initial conditionbased on the European call payoff function h(x) = (xminusK)+ ie

g(0 y) = ψ(y) = h(

e|σ|y)=(

e|σ|y minusK)+ y isin R

Fig 619 Time-dependent solution of the heat equationlowast

Let us provide a second proof of Proposition 610 this time using Brownianmotion and stochastic calculus

Proof of Proposition 610 First note that under the change of variable x =z minus y we have

g(t y) =winfinminusinfin

ψ(z) eminus(yminusz)2(2t) dzradic2πt

=winfinminusinfin

ψ(y+ x) eminusx2(2t) dxradic2πt

= IE[ψ(y+Bt)]

= IE[ψ(yminusBt)]

where (Bt)tisinR+ is a standard Brownian motion and Bt N (0 t) t isin R+Applying Itocircrsquos formula and using the fact that the expectation of the stochas-tic integral with respect to Brownian motion is zero see Relation (417) inProposition 420 we find

g(t y) = IE[ψ(yminusBt)]

= ψ(y)minus IE[w t

0ψprime(yminusBs)dBs

]+

12 IE

[w t0ψprimeprime(yminusBs)ds

]= ψ(y) +

12w t

0IE[ψprimeprime(yminusBs)

]ds

lowast The animation works in Acrobat Reader on the entire pdf file

226

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

= ψ(y) +12w t

0part2

party2 IE [ψ(yminusBs)] ds

= ψ(y) +12w t

0part2g

party2 (s y)ds

Hence we have

partg

partt(t y) = part

parttIE[ψ(yminusBt)]

=12part2

party2 IE [ψ(yminusBt)]

=12part2g

party2 (t y)

Regarding the initial condition we check that

g(0 y) = IE[ψ(yminusB0)] = IE[ψ(y)] = ψ(y)

The expression g(t y) = IE[ψ(yminusBt)] provides a probabilistic interpreta-tion of the heat diffusion phenomenon based on Brownian motion Namelywhen ψε(y) = 1[minusεε](y) we find that

gε(t y) = IE[ψε(yminusBt)]= IE[1[minusεε](yminusBt)]= P

(yminusBt isin [minusε ε]

)= P

(yminus ε 6 Bt 6 y+ ε

)represents the probability of finding Bt within a neighborhood [y minus ε y + ε]of the point y isin R

66 Solution of the Black-Scholes PDE

In this section we solve the Black-Scholes PDE by the kernel method of Sec-tion 65 and a change of variables This solution method uses the change ofvariables (623) of Proposition 68 and a time inversion from which the ter-minal condition at time T in the Black-Scholes equation becomes an initialcondition at time t = 0 in the heat equation

Next we state the proof Proposition 68

Proof Letting s = T minus t and x = e|σ|y+(σ22minusr)t and using Relation (623)ie

g(t y) = ertf(T minus t e|σ|y+(σ22minusr)t)

227

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

we have

partg

partt(t y) = r ertf

(T minus t e|σ|y+(σ22minusr)t)minus ert partf

parts

(T minus t e|σ|y+(σ22minusr)t)

+

(σ2

2 minus r)

ert e|σ|y+(σ22minusr)t partf

partx

(T minus t e|σ|y+(σ22minusr)t)

= r ertf(T minus tx)minus ert partfparts

(T minus tx) +(σ2

2 minus r)

ertxpartfpartx

(T minus tx)

=12 ertx2σ2 part

2f

partx2 (T minus tx) +σ2

2 ertxpartfpartx

(T minus tx) (629)

where on the last step we used the Black-Scholes PDE On the other handwe have

partg

party(t y) = |σ| ert e|σ|y+(σ22minusr)t partf

partx

(T minus t e|σ|y+(σ22minusr)t)

and

12partg2

party2 (t y) =σ2

2 ert e|σ|y+(σ22minusr)t partf

partx

(T minus t e|σ|y+(σ22minusr)t)

+σ2

2 ert e2|σ|y+2(σ22minusr)t part2f

partx2(T minus t e|σ|y+(σ22minusr)t)

=σ2

2 ertxpartfpartx

(T minus tx) + σ2

2 ertx2 part2f

partx2 (T minus tx) (630)

We conclude by comparing (629) with (630) which shows that g(tx) solvesthe heat equation (627) with initial condition

g(0 y) = f(T e|σ|y

)= h

(e|σ|y

)

In the next proposition we derive the Black-Scholes formula (610) by solv-ing the PDE (622) The Black-Scholes formula will also be recovered by aprobabilistic argument via the computation of an expected value in Proposi-tion 77

Proposition 611 When h(x) = (x minusK)+ the solution of the Black-Scholes PDE (622) is given by

f(tx) = xΦ(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

) x gt 0

whereΦ(x) =

1radic2π

w xminusinfin

eminusy22dy x isin R

and

228

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

d+(T minus t) =

log(xK) + (r+ σ22)(T minus t)|σ|radicT minus t

dminus(T minus t) =log(xK) + (rminus σ22)(T minus t)

|σ|radicT minus t

x gt 0 t isin [0T )

Proof By inversion of Relation (623) with s = T minus t and x = e|σ|y+(σ22minusr)twe get

f(sx) = eminus(Tminuss)rg(T minus s minus(σ

22minus r)(T minus s) + log x|σ|

)and

h(x) = ψ

(log x|σ|

) x gt 0 or ψ(y) = h

(e|σ|y

) y isin R

Hence using the solution (628) and Relation (624) we get

f(tx) = eminus(Tminust)rg(T minus t minus(σ

22minus r)(T minus t) + log x|σ|

)= eminus(Tminust)r

winfinminusinfin

ψ

(minus(σ22minus r)(T minus t) + log x

|σ|+ z

)eminusz2(2(Tminust)) dzradic

2(T minus t)π

= eminus(Tminust)rwinfinminusinfin

h(x e|σ|zminus(σ22minusr)(Tminust)) eminusz2(2(Tminust)) dzradic

2(T minus t)π

= eminus(Tminust)rwinfinminusinfin

(x e|σ|zminus(σ22minusr)(Tminust) minusK

)+ eminusz2(2(Tminust)) dzradic2(T minus t)π

= eminus(Tminust)r

timeswinfin

(minusr+σ22)(Tminust)+log(Kx)|σ|

(x e|σ|zminus(σ22minusr)(Tminust) minusK

)eminusz2(2(Tminust)) dzradic

2(T minus t)π

= x eminus(Tminust)rwinfinminusdminus(Tminust)

radicTminust

e|σ|zminus(σ22minusr)(Tminust) eminusz2(2(Tminust)) dzradic2(T minus t)π

minusK eminus(Tminust)rwinfinminusdminus(Tminust)

radicTminust

eminusz2(2(Tminust)) dzradic2(T minus t)π

= xwinfinminusdminus(Tminust)

radicTminust

e|σ|zminus(Tminust)σ22minusz2(2(Tminust)) dzradic2(T minus t)π

minusK eminus(Tminust)rwinfinminusdminus(Tminust)

radicTminust

eminusz2(2(Tminust)) dzradic2(T minus t)π

= xwinfinminusdminus(Tminust)

radicTminust

eminus(zminus(Tminust)|σ|)2(2(Tminust)) dzradic2(T minus t)π

229

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

minusK eminus(Tminust)rwinfinminusdminus(Tminust)

radicTminust

eminusz2(2(Tminust)) dzradic2(T minus t)π

= xwinfinminusdminus(Tminust)

radicTminustminus(Tminust)|σ|

eminusz2(2(Tminust)) dzradic2(T minus t)π

minusK eminus(Tminust)rwinfinminusdminus(Tminust)

radicTminust

eminusz2(2(Tminust)) dzradic2(T minus t)π

= xwinfinminusdminus(Tminust)minus|σ|

radicTminust

eminusz22 dzradic2πminusK eminus(Tminust)r

winfinminusdminus(Tminust)

eminusz22 dzradic2π

= x(1minusΦ

(minus d+(T minus t)

))minusK eminus(Tminust)r

(1minusΦ

(minus dminus(T minus t)

))= xΦ

(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)

where we used the relation (614) ie

1minusΦ(a) = Φ(minusa) a isin R

Exercises

Exercise 61 Bachelier (1900) model Consider a market made of a risklessasset valued At = A0 with zero interest rate t isin R+ and a risky asset whoseprice St is modeled by a standard Brownian motion as St = Bt t isin R+

a) Show that the price g(tBt) of the option with payoff C = B2T satisfies

the heat equationpartϕ

partt(t y) = minus1

2part2ϕ

party2 (t y)

with terminal condition g(T x) = x2b) Find the function g(tx) by solving the PDE of Question (a)

Hint Try a solution of the form g(tx) = x2 + f(t)

See Exercises 611 713 and 714 for extensions to nonzero interest rates

Exercise 62 Consider a risky asset price (St)tisinR modeled in the Cox et al(1985) (CIR) model as

dSt = β(αminus St)dt+ σradicStdBt αβσ gt 0 (631)

and let (ηt ξt)tisinR+ be a portfolio strategy whose value Vt = ηtAt + ξtSttakes the form Vt = g(tSt) t isin R+ Figure 620 presents a random simula-tion of the solution to (631) with α = 0025 β = 1 and σ = 13230

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

0

1

2

3

4

5

6

7

8

0 01 02 03 04 05 06 07 08 09 1

St

t

Fig 620 Graph of the CIR short rate t 7rarr rt with α = 25 β = 1 and σ = 13

N=10000 t lt- 0(N-1) dt lt- 10Na=0025 b=2 sigma=0052 X lt- rnorm(Nmean=0sd=sqrt(dt))R lt- rep(0N)R[1]=001

for (j in 2N)R[j]=max(0R[j-1]+(a-bR[j-1])dt+sigmasqrt(R[j-1])X[j])4 plot(t R xlab = t ylab = type = l ylim = c(0002) col = blue)

Based on the self-financing condition written as

dVt = rVtdtminus rξtStdt+ ξtdSt

= rVtdtminus rξtStdt+ β(αminus St)ξtdt+ σξtradicStdBt t isin R+ (632)

derive the PDE satisfied by the function g(tx) using the Itocirc formula

Exercise 63 Black-Scholes PDE with dividends Consider a riskless as-set with price At = A0 ert t isin R+ and an underlying asset price process(St)tisinR+ modeled as

dSt = (microminus δ)Stdt+ σStdBt

where (Bt)tisinR+ is a standard Brownian motion and δ gt 0 is a continuous-time dividend rate By absence of arbitrage the payment of a dividend entailsa drop in the stock price by the same amount occuring generally on the ex-dividend date on which the purchase of the security no longer entitles theinvestor to the dividend amount The list of investors entitled to dividendpayment is consolidated on the date of record and payment is made on thepayable date

library(quantmod)2 getSymbols(0005HKfrom=2010-01-01to=SysDate()src=yahoo)

getDividends(0005HKfrom=2010-01-01to=SysDate()src=yahoo)

a) Assuming that the portfolio with value Vt = ξtSt + ηtAt at time t is self-financing and that dividends are continuously reinvested write down theportfolio variation dVt

231

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

b) Assuming that the portfolio value Vt takes the form Vt = g(tSt) at timet derive the Black-Scholes PDE for the function g(tx) with its terminalcondition

c) Compute the price at time t isin [0T ] of the European call option withstrike price K by solving the corresponding Black-Scholes PDE

d) Compute the Delta of the option

Exercise 64

a) Check that the Black-Scholes formula (610) for European call options

gc(tx) = xΦ(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)

satisfies the following boundary conditions

i) at x = 0 gc(t 0) = 0ii) at maturity t = T

gc(T x) = (xminusK)+ =

xminusK x gt K

0 x 6 K

iii) as time to maturity tends to infinity

limTrarrinfin

Bl(Kxσ rT minus t) = x t isin R+

b) Check that the Black-Scholes formula (618) for European put options

gp(tx) = K eminus(Tminust)rΦ(minus dminus(T minus t)

)minus xΦ

(minus d+(T minus t)

)satisfies the following boundary conditions

i) at x = 0 gp(t 0) = K eminus(Tminust)rii) as x tends to infinity gp(tinfin) = 0 for all t isin [0T )iii) at maturity t = T

gp(T x) = (K minus x)+ =

0 x gt K

K minus x x 6 K

iv) as time to maturity tends to infinity

limTrarrinfin

Blp(KStσ rT minus t) = 0 t isin R+

Exercise 65 Power option (Exercise 314 continued)

232

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

a) Solve the Black-Scholes PDE

rg(x t) = partg

partt(x t) + rx

partg

partx(x t) + σ2

2 x2 part2g

partx2 (x t) (633)

with terminal condition g(xT ) = x2 x gt 0 t isin [0T ]

Hint Try a solution of the form g(x t) = x2f(t) and find f(t)b) Find the respective quantities ξt and ηt of the risky asset St and riskless

asset At = ert in the portfolio with value

Vt = g(St t) = ξtSt + ηtAt 0 6 t 6 T

hedging the contract with payoff S2T at maturity

Exercise 66 On December 18 2007 a call warrant has been issued byFortis Bank on the stock price S of the MTR Corporation with maturityT = 23122008 strike price K = HK$ 3608 and entitlement ratio=10Recall that in the Black-Scholes model the price at time t of the Europeanclaim on the underlying asset priced St with strike price K maturity T interest rate r and volatility σ gt 0 is given by the Black-Scholes formula as

f(tSt) = StΦ(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)

wheredminus(T minus t) =

(rminus σ22)(T minus t) + log(StK)

|σ|radicT minus t

d+(T minus t) = dminus(T minus t) + |σ|radicT minus t = (r+ σ22)(T minus t) + log(StK)

|σ|radicT minus t

Recall that by Proposition 64 we have

partf

partx(tSt) = Φ

(d+(T minus t)

) 0 6 t 6 T

a) Using the values of the Gaussian cumulative distribution function com-pute the Black-Scholes price of the corresponding call option at timet =November 07 2008 with St = HK$ 17200 assuming a volatility σ =90 = 090 and an annual risk-free interest rate r = 4377 = 004377

b) Still using the Gaussian cumulative distribution function compute thequantity of the risky asset required in your portfolio at time t =November07 2008 in order to hedge one such option at maturity T = 23122008

c) Figure 1 represents the Black-Scholes price of the call option as a functionof σ isin [05 15] = [50 150]

233

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

0

01

02

03

04

05

06

05 06 07 08 09 1 11 12 13 14 15σimp

Optio

n pr

ice

σ

Market price

Fig 621 Option price as a function of the volatility σ gt 0

1 BSCall lt- function(S K r T sigma)d1 lt- (log(SK)+(r+sigma^22)T)(sigmasqrt(T))d2 lt- d1 - sigma sqrt(T)

3 BSCall = Spnorm(d1) - Kexp(-rT)pnorm(d2)BSCallsigma lt- seq(0515 length=100)

5 plot(sigmaBSCall(172360800437746365sigma) type=llty=1 xlab=Sigmaylab=Black-Scholes Call Price ylim = c(006)col=bluelwd=3)grid()

abline(h=023col=redlwd=3)

Knowing that the closing price of the warrant on November 07 2008 wasHK$ 0023 which value can you infer for the implied volatility σ at thisdatelowast

Exercise 67 Forward contracts Recall that the price πt(C) of a claimpayoff C = h(ST ) of maturity T can be written as πt(C) = g(tSt) wherethe function g(tx) satisfies the Black-Scholes PDE

rg(tx) = partg

partt(tx) + rx

partg

partx(tx) + 1

2σ2x2 part

2g

partx2 (tx)

g(T x) = h(x) (1)

with terminal condition g(T x) = h(x) x gt 0

a) Assume that C is a forward contract with payoff

C = ST minusK

at time T Find the function h(x) in (1)b) Find the solution g(tx) of the above PDE and compute the price πt(C)

at time t isin [0T ]Hint search for a solution of the form g(tx) = xminus α(t) where α(t) is afunction of t to be determined

lowast Download the corresponding or the that can be runhere

234

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

BS lt- function(S K T r sig)d1 lt- (log(SK) + (r + sig^22)T) (sigsqrt(T))d2 lt- d1 - sigsqrt(T)return(Spnorm(d1) - Kexp(-rT)pnorm(d2))impliedvol lt- function(S K T r market)sig lt- 020sigup lt- 1sigdown lt- 0001count lt- 0err lt- BS(S K T r sig) - marketwhile(abs(err) gt 000001 ampamp countlt1000)if(err lt 0)sigdown lt- sigsig lt- (sigup + sig)2elsesigup lt- sigsig lt- (sigdown + sig)2err lt- BS(S K T r sig) - marketcount lt- count + 1if(count==2000)return(NA)elsereturn(sig)market = 083K = 628T = 7 365S = 634r = 002impliedvol(S K T r market)

cells [ cell_type code execution_count null metadata outputs [] source [ from IPythoncoredisplay import display HTMLn display(HTML( )) ] cell_type code execution_count null metadata collapsed true outputs [] source [ import numpy as npn import scipystats as ssn import time n n Black and Scholesn def d1(S0 K r sigma T)n return (nplog(S0K) + (r + sigma2 2) T)(sigma npsqrt(T))n n def d2(S0 K r sigma T)n return (nplog(S0 K) + (r - sigma2 2) T) (sigma npsqrt(T))n n def BlackScholes(typeS0 K r sigma T)n if type==Cn return S0 ssnormcdf(d1(S0 K r sigma T)) - K npexp(-r T) ssnormcdf(d2(S0 K r sigma T))n elsen return K npexp(-r T) ssnormcdf(-d2(S0 K r sigma T)) - S0 ssnormcdf(-d1(S0 K r sigma T)) ] cell_type code execution_count null metadata outputs [] source [ BlackScholes(C1000 1200 002 015 10) ] cell_type code execution_count null metadata outputs [] source [ def difference(x p S K r t)n return BlackScholes(CS K r x t) - p ] cell_type code execution_count null metadata outputs [] source [ from scipyoptimize import bisectn bisect(difference00011args=(11541763731112766 1000 1200 002 10)) ] ] metadata anaconda-cloud kernelspec display_name Python 3 language python name python3 language_info codemirror_mode name ipython version 3 file_extension py mimetype textx-python name python nbconvert_exporter python pygments_lexer ipython3 version 375rc1 nbformat 4 nbformat_minor 1

Black-Scholes Pricing and Hedging

c) Compute the quantityξt =

partg

partx(tSt)

of risky assets in a self-financing portfolio hedging Cd) Repeat the above questions with the terminal condition g(T x) = x

Exercise 68a) Solve the Black-Scholes PDE

rg(tx) = partg

partt(tx) + rx

partg

partx(tx) + σ2

2 x2 part2g

partx2 (tx) (634)

with terminal condition g(T x) = 1 x gt 0

Hint Try a solution of the form g(tx) = f(t) and find f(t)

b) Find the respective quantities ξt and ηt of the risky asset St and risklessasset At = ert in the portfolio with value

Vt = g(tSt) = ξtSt + ηtAt

hedging the contract with payoff $1 at maturity

Exercise 69 Log-contracts see also Exercise 84a) Solve the PDE

0 =partg

partt(x t) + rx

partg

partx(x t) + σ2

2 x2 part2g

partx2 (x t)

with the terminal condition g(xT ) = log x x gt 0

Hint Try a solution of the form g(x t) = f(t) + log x and find f(t)b) Solve the Black-Scholes PDE

rh(x t) = parth

partt(x t) + rx

parth

partx(x t) + σ2

2 x2 part2h

partx2 (x t) (635)

with the terminal condition h(xT ) = log x x gt 0

Hint Try a solution of the form h(x t) = u(t)g(x t) and find u(t)c) Find the respective quantities ξt and ηt of the risky asset St and riskless

asset At = ert in the portfolio with value

Vt = g(St t) = ξtSt + ηtAt

hedging a log-contract with payoff logST at maturity 235

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

Exercise 610 Binary options Consider a price process (St)tisinR+ given by

dStSt

= rdt+ σdBt S0 = 1

under the risk-neutral probability measure Plowast The binary (or digital) calloption is a contract with maturity T strike price K and payoff

Cd = 1[Kinfin)(ST ) =

$1 if ST gt K

0 if ST lt K

a) Derive the Black-Schole PDE satisfied by the pricing function Cd(tSt) ofthe binary call option together with its terminal condition

b) Show that the solution Cd(tx) of the Black-Scholes PDE of Question (a)is given by

Cd(tx) = eminus(Tminust)rΦ((rminus σ22)(T minus t) + log(xK)

|σ|radicT minus t

)= eminus(Tminust)rΦ

(dminus(T minus t)

)

where

dminus(T minus t) =(rminus σ22)(T minus t) + log(StK)

|σ|radicT minus t

0 6 t lt T

Exercise 611

a) Bachelier (1900) model Solve the stochastic differential equation

dSt = αStdt+ σdBt (636)

in terms of ασ isin R and the initial condition S0b) Write down the Bachelier PDE satisfied by the function C(tx) where

C(tSt) is the price at time t isin [0T ] of the contingent claim with payoffφ(ST ) = exp(ST ) and identify the process Delta (ξt)tisin[0T ] that hedgesthis claim

c) Solve the Black-Scholes PDE of Question (b) with the terminal conditionφ(x) = ex x isin R

Hint Search for a solution of the form

C(tx) = exp(minus(T minus t)r+ xh(t) +

σ2

4r (h2(t)minus 1)

) (637)

where h(t) is a function to be determined with h(T ) = 1

236

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

d) Compute the portfolio strategy (ξt ηt)tisin[0T ] that hedges the contingentclaim with payoff exp(ST )

Exercise 612

a) Show that for every fixed value of S the function

d 7minusrarr h(S d) = SΦ(d+ |σ|

radicT)minusK eminusrTΦ(d)

reaches its maximum at dlowast(S) =log(SK) + (rminus σ22)T

|σ|radicT

b) By the differentiation rule

d

dSh(S dlowast(S)) =

parth

partS(S dlowast(S)) + dprimelowast(S)

parth

partd(S dlowast(S))

recover the value of the Black-Scholes Delta

Exercise 613 Compute the Black-Scholes Vega by differentiation of theBlack-Scholes function

gc(tx) = Bl(Kxσ rT minus t) = xΦ(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)

with respect to the volatility parameter σ knowing that

minus12(dminus(T minus t)

)2= minus1

2

(log(xK) + (rminus σ22)(T minus t)

|σ|radicT minus t

)2

= minus12(d+(T minus t)

)2+ (T minus t)r+ log x

K (638)

Exercise 614 Consider the backward induction relation (313) ie

v(tx) = (1minus plowastN )v (t+ 1x(1 + aN )) + plowastN v (t+ 1x(1 + bN ))

using the renormalizations rN = rTN and

aN = (1 + rN )(1minus |σ|radicTN)minus 1 bN = (1 + rN )(1 + |σ|

radicTN)minus 1

of Section 36 N gt 1 with

plowastN =rN minus aNbN minus aN

and plowastN =bN minus rNbN minus aN

a) Show that the Black-Scholes PDE (62) of Proposition 61 can be recoveredfrom the induction relation (313) when the number N of time steps tendsto infinity

237

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

b) Show that the expression of the Delta ξt =partgcpartx

(tSt) can be similarlyrecovered from the finite difference relation (319) ie

ξ(1)t (Stminus1) =

v (t (1 + bN )Stminus1)minus v (t (1 + aN )Stminus1)

Stminus1(bN minus aN )

as N tends to infinity

Problem 615 (Leung and Sircar (2015)) ProShares Ultra SampP500 andProShares UltraShort SampP500 are leveraged investment funds that seek dailyinvestment results before fees and expenses that correspond to β times (βx)the daily performance of the SampP500reg with respectively β = 2 for ProSharesUltra and β = minus2 for ProShares UltraShort Here leveraging with a factorβ 1 aims at multiplying the potential return of an investment by a factorβ The following 10 questions are interdependent and should be treated insequence

a) Consider a risky asset priced S0 = $4 at time t = 0 and taking twopossible values S1 = $5 and S1 = $2 at time t = 1 Compute the twopossible returns (in ) achieved when investing $4 in one share of the assetS and the expected return under the risk-neutral probability measureassuming that the risk-free interest rate is zero

b) Leveraging Still based on an initial $4 investment we decide to leverageby a factor β = 3 by borrowing another (β minus 1) times $4 = 2times $4 at ratezero to purchase a total of β = 3 shares of the asset S Compute thetwo returns (in ) possibly achieved in this case and the expected returnunder the risk-neutral probability measure assuming that the risk-freeinterest rate is zero

c) Denoting by Ft the ProShares value at time t how much should the fundinvest in the underlying asset priced St and how much $ should it borrowor save on the risk-free market at any time t in order to leverage with afactor β 1

d) Find the portfolio allocation (ξt ηt) for the fund value

Ft = ξtSt + ηtAt t isin R+

according to Question (c) where At = A0 ert is the riskless money marketaccount

e) We choose to model the SampP500 index St as the geometric Brownianmotion

dSt = rStdt+ σStdBt t isin R+

under the risk-neutral probability measure Plowast Find the stochastic dif-ferential equation satisfied by (Ft)tisinR+ under the self-financing conditiondFt = ξtdSt + ηtdAt

238

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

f) Is the discounted fund value ( eminusrtFt)tisinR+ a martingale under the risk-neutral probability measure Plowast

g) Find the relation between the fund value Ft and the index St by solvingthe stochastic differential equation obtained for Ft in Question (e) Forsimplicity we normalize F0 = Sβ0

h) Write the price at time t = 0 of the call option with payoff (FT minusK)+ onthe ProShares index using the Black-Scholes formula

i) Show that when β gt 0 the Delta at time t isin [0T ) of the call optionwith payoff (FT minusK)+ on ProShares Ultra is equal to the Delta of thecall option with payoff (ST minusKβ(t))

+ on the SampP500 for a certain strikeprice Kβ(t) to be determined explicitly

j) When β lt 0 find the relation between the Delta at time t isin [0T ) ofthe call option with payoff (FT minusK)+ on ProShares UltraShort and theDelta of the put option with payoff (Kβ(t)minus ST )+ on the SampP500

239

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

  1. pbsARFix223
  2. pbsARFix224
  3. pbsARFix225
  4. pbsARFix226
  5. pbsARFix227
  6. pbsARFix228
  7. pbsARFix229
  8. pbsARFix230
  9. fdrm1
  10. pbsARFix231
  11. 100
  12. 101
  13. 102
  14. 103
  15. 104
  16. 105
  17. 106
  18. 107
  19. 108
  20. 109
  21. 1010
  22. 1011
  23. 1012
  24. 1013
  25. 1014
  26. 1015
  27. 1016
  28. 1017
  29. 1018
  30. 1019
  31. anm10
  32. 10EndLeft
  33. 10StepLeft
  34. 10PauseLeft
  35. 10PlayLeft
  36. 10PlayPauseLeft
  37. 10PauseRight
  38. 10PlayRight
  39. 10PlayPauseRight
  40. 10StepRight
  41. 10EndRight
  42. 10Minus
  43. 10Reset
  44. 10Plus
  45. pbsARFix232
  46. pbsARFix233
  47. pbsARFix234
  48. pbsARFix235
  49. pbsARFix236
  50. pbsARFix237
  51. fdrm2
  52. 110
  53. 111
  54. 112
  55. 113
  56. 114
  57. 115
  58. 116
  59. 117
  60. 118
  61. 119
  62. 1110
  63. 1111
  64. 1112
  65. 1113
  66. 1114
  67. 1115
  68. 1116
  69. 1117
  70. 1118
  71. 1119
  72. anm11
  73. 11EndLeft
  74. 11StepLeft
  75. 11PauseLeft
  76. 11PlayLeft
  77. 11PlayPauseLeft
  78. 11PauseRight
  79. 11PlayRight
  80. 11PlayPauseRight
  81. 11StepRight
  82. 11EndRight
  83. 11Minus
  84. 11Reset
  85. 11Plus
  86. pbsARFix238
  87. pbsARFix239
  88. pbsARFix240
  89. pbsARFix241
  90. pbsARFix242
  91. 120
  92. 121
  93. 122
  94. 123
  95. 124
  96. 125
  97. 126
  98. 127
  99. 128
  100. 129
  101. 1210
  102. anm12
  103. 12EndLeft
  104. 12StepLeft
  105. 12PauseLeft
  106. 12PlayLeft
  107. 12PlayPauseLeft
  108. 12PauseRight
  109. 12PlayRight
  110. 12PlayPauseRight
  111. 12StepRight
  112. 12EndRight
  113. 12Minus
  114. 12Reset
  115. 12Plus
  116. 130
  117. 131
  118. 132
  119. 133
  120. 134
  121. 135
  122. 136
  123. 137
  124. 138
  125. 139
  126. 1310
  127. anm13
  128. 13EndLeft
  129. 13StepLeft
  130. 13PauseLeft
  131. 13PlayLeft
  132. 13PlayPauseLeft
  133. 13PauseRight
  134. 13PlayRight
  135. 13PlayPauseRight
  136. 13StepRight
  137. 13EndRight
  138. 13Minus
  139. 13Reset
  140. 13Plus
  141. pbsARFix243
  142. pbsARFix244
  143. pbsARFix245
  144. pbsARFix246
  145. 140
  146. 141
  147. 142
  148. 143
  149. 144
  150. 145
  151. 146
  152. 147
  153. 148
  154. 149
  155. 1410
  156. 1411
  157. 1412
  158. 1413
  159. 1414
  160. 1415
  161. 1416
  162. 1417
  163. 1418
  164. 1419
  165. 1420
  166. 1421
  167. 1422
  168. 1423
  169. 1424
  170. 1425
  171. 1426
  172. 1427
  173. 1428
  174. 1429
  175. 1430
  176. 1431
  177. 1432
  178. 1433
  179. 1434
  180. 1435
  181. 1436
  182. 1437
  183. 1438
  184. 1439
  185. 1440
  186. 1441
  187. 1442
  188. 1443
  189. 1444
  190. 1445
  191. 1446
  192. 1447
  193. 1448
  194. 1449
  195. 1450
  196. 1451
  197. 1452
  198. 1453
  199. 1454
  200. 1455
  201. 1456
  202. 1457
  203. 1458
  204. 1459
  205. 1460
  206. 1461
  207. 1462
  208. 1463
  209. 1464
  210. 1465
  211. 1466
  212. 1467
  213. 1468
  214. 1469
  215. 1470
  216. 1471
  217. 1472
  218. 1473
  219. 1474
  220. 1475
  221. 1476
  222. 1477
  223. 1478
  224. 1479
  225. 1480
  226. 1481
  227. 1482
  228. 1483
  229. 1484
  230. 1485
  231. 1486
  232. 1487
  233. 1488
  234. 1489
  235. 1490
  236. 1491
  237. 1492
  238. 1493
  239. 1494
  240. 1495
  241. 1496
  242. 1497
  243. 1498
  244. 1499
  245. 14100
  246. 14101
  247. 14102
  248. 14103
  249. 14104
  250. 14105
  251. 14106
  252. 14107
  253. 14108
  254. 14109
  255. 14110
  256. 14111
  257. 14112
  258. 14113
  259. 14114
  260. 14115
  261. 14116
  262. 14117
  263. 14118
  264. 14119
  265. 14120
  266. 14121
  267. 14122
  268. 14123
  269. 14124
  270. 14125
  271. 14126
  272. 14127
  273. 14128
  274. 14129
  275. 14130
  276. 14131
  277. 14132
  278. 14133
  279. 14134
  280. 14135
  281. 14136
  282. 14137
  283. 14138
  284. 14139
  285. 14140
  286. 14141
  287. 14142
  288. 14143
  289. 14144
  290. 14145
  291. 14146
  292. 14147
  293. 14148
  294. 14149
  295. 14150
  296. 14151
  297. 14152
  298. 14153
  299. 14154
  300. 14155
  301. 14156
  302. 14157
  303. 14158
  304. 14159
  305. 14160
  306. 14161
  307. 14162
  308. 14163
  309. 14164
  310. 14165
  311. 14166
  312. 14167
  313. 14168
  314. 14169
  315. 14170
  316. 14171
  317. 14172
  318. 14173
  319. 14174
  320. 14175
  321. 14176
  322. 14177
  323. 14178
  324. 14179
  325. 14180
  326. 14181
  327. 14182
  328. 14183
  329. 14184
  330. 14185
  331. 14186
  332. 14187
  333. 14188
  334. 14189
  335. 14190
  336. 14191
  337. 14192
  338. 14193
  339. 14194
  340. 14195
  341. 14196
  342. 14197
  343. anm14
  344. 14EndLeft
  345. 14StepLeft
  346. 14PauseLeft
  347. 14PlayLeft
  348. 14PlayPauseLeft
  349. 14PauseRight
  350. 14PlayRight
  351. 14PlayPauseRight
  352. 14StepRight
  353. 14EndRight
  354. 14Minus
  355. 14Reset
  356. 14Plus
  357. pbsARFix247
  358. pbsARFix248
  359. 150
  360. 151
  361. 152
  362. 153
  363. 154
  364. 155
  365. 156
  366. 157
  367. 158
  368. 159
  369. 1510
  370. 1511
  371. 1512
  372. 1513
  373. 1514
  374. 1515
  375. 1516
  376. 1517
  377. 1518
  378. 1519
  379. anm15
  380. 15EndLeft
  381. 15StepLeft
  382. 15PauseLeft
  383. 15PlayLeft
  384. 15PlayPauseLeft
  385. 15PauseRight
  386. 15PlayRight
  387. 15PlayPauseRight
  388. 15StepRight
  389. 15EndRight
  390. 15Minus
  391. 15Reset
  392. 15Plus
  393. pbsARFix249
  394. pbsARFix250
  395. pbsARFix251
  396. pbsARFix252
  397. pbsARFix253
  398. pbsARFix254
  399. pbsARFix255
  400. pbsARFix256
  401. pbsARFix257
  402. pbsARFix258
  403. pbsARFix259
  404. pbsARFix260
  405. pbsARFix261
Page 5: Black-ScholesPricingandHedging - NTU · to the Black-Scholes PDE (6.2) in order to price a claim payoff Cof the formC= h(S T).Asinthediscrete-timecase,thearbitragepriceπt(C) at

Black-Scholes Pricing and Hedging

allocation ξt is given by the partial derivative (63) where the function g(tx)is solution of the following Black-Scholes PDE

rg(tx) = partg

partt(tx) + rx

partg

partx(tx) + 1

2σ2x2 part

2g

partx2 (tx)

g(T x) = h(x) x gt 0(67)

Proof Proposition 61 shows that the solution g(tx) of (62) g isin C12(R+timesR+) represents the value Vt = ηtAt + ξtSt = g(tSt) t isin R+ of a self-financing portfolio strategy (ηt ξt)tisinR+ By Definition 31 πt(C) = Vt =g(tSt) is the arbitrage price at time t isin [0T ] of the vanilla option withpayoff C = h(ST )

The absence of the drift parameter micro from the PDE (67) can be understoodin the next forward contract example in which the claim payoff can be hedgedby leveraging on the value St of the underlying asset independently of thetrend parameter micro

Example - forward contracts

When C = ST minusK is the (linear) payoff function of a long forward contractie h(x) = xminusK the Black-Scholes PDE (67) admits the easy solution

g(tx) = xminusK eminus(Tminust)r x gt 0 0 6 t 6 T (68)

showing that the price at time t of the forward contract with payoff C =ST minusK is

St minusK eminus(Tminust)r x gt 0 0 6 t 6 T

In addition the Delta of the option price is given by

ξt =partg

partx(tSt) = 1 0 6 t 6 T

which leads to a static ldquohedge and forgetrdquo strategy cf Exercise 67 Theforward contract can be realized by the option issuer as followsa) At time t receive the option premium Vt = St minus eminus(Tminust)rK from the

option buyerb) Borrow eminus(Tminust)rK from the bank to be refunded at maturityc) Buy the risky asset using the amount Stminus eminus(Tminust)rK + eminus(Tminust)rK = Std) Hold the risky asset until maturity (do nothing constant portfolio strat-

egy)e) At maturity T hand in the asset to the option holder who will pay the

amount K in return 205

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

f) Use the amountK = e(Tminust)r eminus(Tminust)rK to refund the lender of eminus(Tminust)rKborrowed at time t

Another way to compute the option premium Vt is to state that the amountVtminusSt has to be borrowed at time t in order to purchase the asset and thatthe asset price K received at maturity T should be used to refund the loanwhich yields

(Vt minus St) eminus(Tminust)r = K 0 6 t 6 T

Forward contracts can be used for physical delivery eg for live cattle In thecase of European options the basic ldquohedge and forgetrdquo constant strategy

ξt = 1 ηt = η0 0 6 t 6 T

will hedge the option only if

ST + η0AT gt (ST minusK)+

ie if minusη0AT 6 K 6 ST

Future contracts

For a future contract expiring at time T we take K = S0 erT and the contractis usually quoted at time t in terms of the forward price

e(Tminust)r(St minusK eminus(Tminust)r

)= e(Tminust)rSt minusK = e(Tminust)rSt minus S0 erT

discounted at time T or simply using e(Tminust)rSt Future contracts are non-deliverable forward contracts which are ldquomarked to marketrdquo at each timestep via a cash flow exchange between the two parties ensuring that theabsolute difference | e(Tminust)rSt minusK| is being credited to the buyerrsquos accountif e(Tminust)rSt gt K or to the sellerrsquos account if e(Tminust)rSt lt K

62 European Call Options

Recall that in the case of the European call option with strike price K thepayoff function is given by h(x) = (xminusK)+ and the Black-Scholes PDE (67)reads

rgc(tx) =partgcpartt

(tx) + rxpartgcpartx

(tx) + 12σ

2x2 part2gcpartx2 (tx)

gc(T x) = (xminusK)+(69)

The next proposition will be proved in Sections 65 and 66 see Proposi-tion 611

206

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

Proposition 63 The solution of the PDE (69) is given by the Black-Scholes formula for call options

gc(tx) = Bl(Kxσ rT minus t) = xΦ(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)

(610)with

d+(T minus t) =log(xK) + (r+ σ22)(T minus t)

|σ|radicT minus t

(611)

dminus(T minus t) =log(xK) + (rminus σ22)(T minus t)

|σ|radicT minus t

0 6 t lt T (612)

We note the relation

d+(T minus t) = dminus(T minus t) + |σ|radicT minus t 0 6 t lt T (613)

Here ldquologrdquo denotes the natural logarithm ldquolnrdquo and

Φ(x) = P(X 6 x) =1radic2π

w xminusinfin

eminusy22dy x isin R

denotes the standard Gaussian Cumulative Distribution Function (CDF) ofa standard normal random variable X N (0 1) with the relation

Φ(minusx) = 1minusΦ(x) x isin R (614)

0

02

04

06

08

1

12

-4 -3 -2 -1 0 1 2 3 4

Φ(x)

x

1Gaussian CDF Φ(x)

Fig 63 Graph of the Gaussian CDF

In other words the European call option with strike price K and maturityT is priced at time t isin [0T ] as

gc(tSt) = Bl(KStσ rT minus t)= StΦ

(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

) 0 6 t 6 T

207

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

The following R script is an implementation of the Black-Scholes formula forEuropean call options in Rlowast

1 BSCall lt- function(S K r T sigma)d1 lt- (log(SK)+(r+sigma^22)T)(sigmasqrt(T))

3 d2 lt- d1 - sigma sqrt(T)BSCall = Spnorm(d1) - Kexp(-rT)pnorm(d2)

5 BSCall

In comparison with the discrete-time Cox-Ross-Rubinstein (CRR) model ofSection 26 the interest in the formula (610) is to provide an analytical so-lution that can be evaluated in a single step which is computationally muchmore efficient

Fig 64 Graph of the Black-Scholes call price map with strike price K = 100dagger

Figure 64 presents an interactive graph of the Black-Scholes call price mapie the solution

(tx) 7minusrarr gc(tx) = xΦ(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)of the Black-Scholes PDE (67) for a call optionlowast Download the corresponding that can be run heredagger Right-click on the figure for interaction and ldquoFull Screen Multimediardquo view

208

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

(C) 2012--today Alexander Grahn 3Dmenujs version 20140923 3D JavaScript used by media9sty Extended functionality of the (right click) context menu of 3D annotations 1) Adds the following items to the 3D context menu `Generate Default View Finds good default camera settings returned as options for use with the includemedia command `Get Current View Determines camera cross section and part settings of the current view returned as `VIEW section that can be copied into a views file of additional views The views file is inserted using the `3Dviews option of includemedia `Cross Section Toggle switch to add or remove a cross section into or from the current view The cross section can be moved in the x y z directions using x y z and X Y Z keys on the keyboard be tilted against and spun around the upright Z axis using the UpDown and LeftRight arrow keys and caled using the s and S keys 2) Enables manipulation of position and orientation of indiviual parts and groups of parts in the 3D scene Parts which have been selected with the mouse can be scaled moved around and rotated like the cross section as described above To spin the parts around their local up-axis keep Control key pressed while using the UpDown and LeftRight arrow keys This work may be distributed andor modified under the conditions of the LaTeX Project Public License The latest version of this license is in httpmirrorsctanorgmacroslatexbaselppltxt This work has the LPPL maintenance status `maintained The Current Maintainer of this work is A Grahn The code borrows heavily from Bernd Gaertners `Miniball software originally written in C++ for computing the smallest enclosing ball of a set of points see httpwwwinfethzchpersonalgaertnerminiballhtmlhostconsoleshow()constructor for doubly linked listfunction List() thisfirst_node=null thislast_node=new Node(undefined)Listprototypepush_back=function(x) var new_node=new Node(x) if(thisfirst_node==null) thisfirst_node=new_node new_nodeprev=null else new_nodeprev=thislast_nodeprev new_nodeprevnext=new_node new_nodenext=thislast_node thislast_nodeprev=new_nodeListprototypemove_to_front=function(it) var node=itget() if(nodenext=null ampamp nodeprev=null) nodenextprev=nodeprev nodeprevnext=nodenext nodeprev=null nodenext=thisfirst_node thisfirst_nodeprev=node thisfirst_node=node Listprototypebegin=function() var i=new Iterator() itarget=thisfirst_node return(i)Listprototypeend=function() var i=new Iterator() itarget=thislast_node return(i)function Iterator(it) if( it=undefined ) thistarget=ittarget else thistarget=null Iteratorprototypeset=function(it)thistarget=ittargetIteratorprototypeget=function()return(thistarget)Iteratorprototypederef=function()return(thistargetdata)Iteratorprototypeincr=function() if(thistargetnext=null) thistarget=thistargetnextconstructor for node objects that populate the linked listfunction Node(x) thisprev=null thisnext=null thisdata=xfunction sqr(r)return(rr)helper functionMiniball algorithm by B Gaertnerfunction Basis() thism=0 thisq0=new Array(3) thisz=new Array(4) thisf=new Array(4) thisv=new Array(new Array(3) new Array(3) new Array(3) new Array(3)) thisa=new Array(new Array(3) new Array(3) new Array(3) new Array(3)) thisc=new Array(new Array(3) new Array(3) new Array(3) new Array(3)) thissqr_r=new Array(4) thiscurrent_c=thisc[0] thiscurrent_sqr_r=0 thisreset()Basisprototypecenter=function()return(thiscurrent_c)Basisprototypesize=function()return(thism)Basisprototypepop=function()--thismBasisprototypeexcess=function(p) var e=-thiscurrent_sqr_r for(var k=0klt3++k) e+=sqr(p[k]-thiscurrent_c[k]) return(e)Basisprototypereset=function() thism=0 for(var j=0jlt3++j) thisc[0][j]=0 thiscurrent_c=thisc[0] thiscurrent_sqr_r=-1Basisprototypepush=function(p) var i j var eps=1e-32 if(thism==0) for(i=0ilt3++i) thisq0[i]=p[i] for(i=0ilt3++i) thisc[0][i]=thisq0[i] thissqr_r[0]=0 else for(i=0ilt3++i) thisv[thism][i]=p[i]-thisq0[i] for(i=1iltthism++i) thisa[thism][i]=0 for(j=0jlt3++j) thisa[thism][i]+=thisv[i][j]thisv[thism][j] thisa[thism][i]=(2thisz[i]) for(i=1iltthism++i) for(j=0jlt3++j) thisv[thism][j]-=thisa[thism][i]thisv[i][j] thisz[thism]=0 for(j=0jlt3++j) thisz[thism]+=sqr(thisv[thism][j]) thisz[thism]=2 if(thisz[thism]ltepsthiscurrent_sqr_r) return(false) var e=-thissqr_r[thism-1] for(i=0ilt3++i) e+=sqr(p[i]-thisc[thism-1][i]) thisf[thism]=ethisz[thism] for(i=0ilt3++i) thisc[thism][i]=thisc[thism-1][i]+thisf[thism]thisv[thism][i] thissqr_r[thism]=thissqr_r[thism-1]+ethisf[thism]2 thiscurrent_c=thisc[thism] thiscurrent_sqr_r=thissqr_r[thism] ++thism return(true)function Miniball() thisL=new List() thisB=new Basis() thissupport_end=new Iterator()Miniballprototypemtf_mb=function(it) var i=new Iterator(it) thissupport_endset(thisLbegin()) if((thisBsize())==4) return for(var k=new Iterator(thisLbegin())kget()=iget()) var j=new Iterator(k) kincr() if(thisBexcess(jderef()) gt 0) if(thisBpush(jderef())) thismtf_mb(j) thisBpop() if(thissupport_endget()==jget()) thissupport_endincr() thisLmove_to_front(j) Miniballprototypecheck_in=function(b) thisLpush_back(b)Miniballprototypebuild=function() thisBreset() thissupport_endset(thisLbegin()) thismtf_mb(thisLend())Miniballprototypecenter=function() return(thisBcenter())Miniballprototyperadius=function() return(Mathsqrt(thisBcurrent_sqr_r))functions called by menu itemsfunction calc3Dopts () create Miniball object var mb=new Miniball() auxiliary vector var corner=new Vector3() iterate over all visible mesh nodes in the scene for(i=0iltscenemeshescounti++) var mesh=scenemeshesgetByIndex(i) if(meshvisible) continue local to parent transformation matrix var trans=meshtransform build local to world transformation matrix by recursively multiplying the parents transf matrix on the right var parent=meshparent while(parenttransform) trans=transmultiply(parenttransform) parent=parentparent get the bbox of the mesh (local coordinates) var bbox=meshcomputeBoundingBox() transform the local bounding box corner coordinates to world coordinates for bounding sphere determination BBoxmin cornerset(bboxmin) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) BBoxmax cornerset(bboxmax) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) remaining six BBox corners cornerset(bboxminx bboxmaxy bboxmaxz) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) cornerset(bboxminx bboxminy bboxmaxz) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) cornerset(bboxminx bboxmaxy bboxminz) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) cornerset(bboxmaxx bboxminy bboxminz) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) cornerset(bboxmaxx bboxminy bboxmaxz) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) cornerset(bboxmaxx bboxmaxy bboxminz) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) compute the smallest enclosing bounding sphere mbbuild() current camera settings var camera=scenecamerasgetByIndex(0) var res= initialize result string aperture angle of the virtual camera (perspective projection) or orthographic scale (orthographic projection) if(cameraprojectionType==cameraTYPE_PERSPECTIVE) var aac=camerafov180MathPI if(hostutilprintf(4f aac)=30) res+=hostutilprintf(n3Daac=s aac) else cameraviewPlaneSize=2mbradius() res+=hostutilprintf(n3Dortho=s 1cameraviewPlaneSize) camera roll var roll = cameraroll180MathPI if(hostutilprintf(4f roll)=0) res+=hostutilprintf(n3Droll=sroll) target to camera vector var c2c=new Vector3() c2cset(cameraposition) c2csubtractInPlace(cameratargetPosition) c2cnormalize() if((c2cx==0 ampamp c2cy==-1 ampamp c2cz==0)) res+=hostutilprintf(n3Dc2c=s s s c2cx c2cy c2cz) new camera settings bounding sphere centre --gt new camera target var coo=new Vector3() cooset((mbcenter())[0] (mbcenter())[1] (mbcenter())[2]) if(coolength) res+=hostutilprintf(n3Dcoo=s s s coox cooy cooz) radius of orbit if(cameraprojectionType==cameraTYPE_PERSPECTIVE) var roo=mbradius() Mathsin(aac MathPI 360) else orthographic projection var roo=mbradius() res+=hostutilprintf(n3Droo=s roo) update camera settings in the viewer var currol=cameraroll cameratargetPositionset(coo) camerapositionset(cooadd(c2cscale(roo))) cameraroll=currol determine background colour rgb=scenebackgroundgetColor() if((rgbr==1 ampamp rgbg==1 ampamp rgbb==1)) res+=hostutilprintf(n3Dbg=s s s rgbr rgbg rgbb) determine lighting scheme switch(scenelightScheme) case sceneLIGHT_MODE_FILE curlights=Artworkbreak case sceneLIGHT_MODE_NONE curlights=Nonebreak case sceneLIGHT_MODE_WHITE curlights=Whitebreak case sceneLIGHT_MODE_DAY curlights=Daybreak case sceneLIGHT_MODE_NIGHT curlights=Nightbreak case sceneLIGHT_MODE_BRIGHT curlights=Hardbreak case sceneLIGHT_MODE_RGB curlights=Primarybreak case sceneLIGHT_MODE_BLUE curlights=Bluebreak case sceneLIGHT_MODE_RED curlights=Redbreak case sceneLIGHT_MODE_CUBE curlights=Cubebreak case sceneLIGHT_MODE_CAD curlights=CADbreak case sceneLIGHT_MODE_HEADLAMP curlights=Headlampbreak if(curlights=Artwork) res+=hostutilprintf(n3Dlights=s curlights) determine global render mode switch(scenerenderMode) case sceneRENDER_MODE_BOUNDING_BOX currender=BoundingBoxbreak case sceneRENDER_MODE_TRANSPARENT_BOUNDING_BOX currender=TransparentBoundingBoxbreak case sceneRENDER_MODE_TRANSPARENT_BOUNDING_BOX_OUTLINE currender=TransparentBoundingBoxOutlinebreak case sceneRENDER_MODE_VERTICES currender=Verticesbreak case sceneRENDER_MODE_SHADED_VERTICES currender=ShadedVerticesbreak case sceneRENDER_MODE_WIREFRAME currender=Wireframebreak case sceneRENDER_MODE_SHADED_WIREFRAME currender=ShadedWireframebreak case sceneRENDER_MODE_SOLID currender=Solidbreak case sceneRENDER_MODE_TRANSPARENT currender=Transparentbreak case sceneRENDER_MODE_SOLID_WIREFRAME currender=SolidWireframebreak case sceneRENDER_MODE_TRANSPARENT_WIREFRAME currender=TransparentWireframebreak case sceneRENDER_MODE_ILLUSTRATION currender=Illustrationbreak case sceneRENDER_MODE_SOLID_OUTLINE currender=SolidOutlinebreak case sceneRENDER_MODE_SHADED_ILLUSTRATION currender=ShadedIllustrationbreak case sceneRENDER_MODE_HIDDEN_WIREFRAME currender=HiddenWireframebreak if(currender=Solid) res+=hostutilprintf(n3Drender=s currender) write result string to the console hostconsoleshow() hostconsoleclear() hostconsoleprintln(n Copy and paste the following text to then+ option list of includemedian + res + n)function get3Dview () var camera=scenecamerasgetByIndex(0) var coo=cameratargetPosition var c2c=camerapositionsubtract(coo) var roo=c2clength c2cnormalize() var res=VIEW=insert optional name heren if((coox==0 ampamp cooy==0 ampamp cooz==0)) res+=hostutilprintf( COO=s s sn coox cooy cooz) if((c2cx==0 ampamp c2cy==-1 ampamp c2cz==0)) res+=hostutilprintf( C2C=s s sn c2cx c2cy c2cz) if(roo gt 1e-9) res+=hostutilprintf( ROO=sn roo) var roll = cameraroll180MathPI if(hostutilprintf(4f roll)=0) res+=hostutilprintf( ROLL=sn roll) if(cameraprojectionType==cameraTYPE_PERSPECTIVE) var aac=camerafov 180MathPI if(hostutilprintf(4f aac)=30) res+=hostutilprintf( AAC=sn aac) else if(hostutilprintf(4f cameraviewPlaneSize)=1) res+=hostutilprintf( ORTHO=sn 1cameraviewPlaneSize) rgb=scenebackgroundgetColor() if((rgbr==1 ampamp rgbg==1 ampamp rgbb==1)) res+=hostutilprintf( BGCOLOR=s s sn rgbr rgbg rgbb) switch(scenelightScheme) case sceneLIGHT_MODE_FILE curlights=Artworkbreak case sceneLIGHT_MODE_NONE curlights=Nonebreak case sceneLIGHT_MODE_WHITE curlights=Whitebreak case sceneLIGHT_MODE_DAY curlights=Daybreak case sceneLIGHT_MODE_NIGHT curlights=Nightbreak case sceneLIGHT_MODE_BRIGHT curlights=Hardbreak case sceneLIGHT_MODE_RGB curlights=Primarybreak case sceneLIGHT_MODE_BLUE curlights=Bluebreak case sceneLIGHT_MODE_RED curlights=Redbreak case sceneLIGHT_MODE_CUBE curlights=Cubebreak case sceneLIGHT_MODE_CAD curlights=CADbreak case sceneLIGHT_MODE_HEADLAMP curlights=Headlampbreak if(curlights=Artwork) res+= LIGHTS=+curlights+n switch(scenerenderMode) case sceneRENDER_MODE_BOUNDING_BOX defaultrender=BoundingBoxbreak case sceneRENDER_MODE_TRANSPARENT_BOUNDING_BOX defaultrender=TransparentBoundingBoxbreak case sceneRENDER_MODE_TRANSPARENT_BOUNDING_BOX_OUTLINE defaultrender=TransparentBoundingBoxOutlinebreak case sceneRENDER_MODE_VERTICES defaultrender=Verticesbreak case sceneRENDER_MODE_SHADED_VERTICES defaultrender=ShadedVerticesbreak case sceneRENDER_MODE_WIREFRAME defaultrender=Wireframebreak case sceneRENDER_MODE_SHADED_WIREFRAME defaultrender=ShadedWireframebreak case sceneRENDER_MODE_SOLID defaultrender=Solidbreak case sceneRENDER_MODE_TRANSPARENT defaultrender=Transparentbreak case sceneRENDER_MODE_SOLID_WIREFRAME defaultrender=SolidWireframebreak case sceneRENDER_MODE_TRANSPARENT_WIREFRAME defaultrender=TransparentWireframebreak case sceneRENDER_MODE_ILLUSTRATION defaultrender=Illustrationbreak case sceneRENDER_MODE_SOLID_OUTLINE defaultrender=SolidOutlinebreak case sceneRENDER_MODE_SHADED_ILLUSTRATION defaultrender=ShadedIllustrationbreak case sceneRENDER_MODE_HIDDEN_WIREFRAME defaultrender=HiddenWireframebreak if(defaultrender=Solid) res+= RENDERMODE=+defaultrender+n detect existing Clipping Plane (3D Cross Section) var clip=null if( clip=scenenodesgetByName($$$$$$)|| clip=scenenodesgetByName(Clipping Plane) ) for(var i=0iltscenenodescounti++) var nd=scenenodesgetByIndex(i) if(nd==clip||ndname==) continue var ndUTFName= for (var j=0 jltndnamelength j++) var theUnicode = ndnamecharCodeAt(j)toString(16) while (theUnicodelengthlt4) theUnicode = 0 + theUnicode ndUTFName += theUnicode var end=ndnamelastIndexOf() if(endgt0) var ndUserName=ndnamesubstr(0end) else var ndUserName=ndname respart= PART=+ndUserName+n respart+= UTF16NAME=+ndUTFName+n defaultvals=true if(ndvisible) respart+= VISIBLE=falsen defaultvals=false if(ndopacitylt10) respart+= OPACITY=+ndopacity+n defaultvals=false if(ndconstructorname==Mesh) currender=defaultrender switch(ndrenderMode) case sceneRENDER_MODE_BOUNDING_BOX currender=BoundingBoxbreak case sceneRENDER_MODE_TRANSPARENT_BOUNDING_BOX currender=TransparentBoundingBoxbreak case sceneRENDER_MODE_TRANSPARENT_BOUNDING_BOX_OUTLINE currender=TransparentBoundingBoxOutlinebreak case sceneRENDER_MODE_VERTICES currender=Verticesbreak case sceneRENDER_MODE_SHADED_VERTICES currender=ShadedVerticesbreak case sceneRENDER_MODE_WIREFRAME currender=Wireframebreak case sceneRENDER_MODE_SHADED_WIREFRAME currender=ShadedWireframebreak case sceneRENDER_MODE_SOLID currender=Solidbreak case sceneRENDER_MODE_TRANSPARENT currender=Transparentbreak case sceneRENDER_MODE_SOLID_WIREFRAME currender=SolidWireframebreak case sceneRENDER_MODE_TRANSPARENT_WIREFRAME currender=TransparentWireframebreak case sceneRENDER_MODE_ILLUSTRATION currender=Illustrationbreak case sceneRENDER_MODE_SOLID_OUTLINE currender=SolidOutlinebreak case sceneRENDER_MODE_SHADED_ILLUSTRATION currender=ShadedIllustrationbreak case sceneRENDER_MODE_HIDDEN_WIREFRAME currender=HiddenWireframebreak case sceneRENDER_MODE_DEFAULT currender=Defaultbreak if(currender=defaultrender) respart+= RENDERMODE=+currender+n defaultvals=false if(origtrans[ndname]ampampndtransformisEqual(origtrans[ndname])) var lvec=ndtransformtransformDirection(new Vector3(100)) var uvec=ndtransformtransformDirection(new Vector3(010)) var vvec=ndtransformtransformDirection(new Vector3(001)) respart+= TRANSFORM= +lvecx+ +lvecy+ +lvecz+ +uvecx+ +uvecy+ +uvecz+ +vvecx+ +vvecy+ +vvecz+ +ndtransformtranslationx+ +ndtransformtranslationy+ +ndtransformtranslationz+n defaultvals=false respart+= ENDn if(defaultvals) res+=respart if(clip) var centre=cliptransformtranslation var normal=cliptransformtransformDirection(new Vector3(001)) res+= CROSSSECTn if((centrex==0 ampamp centrey==0 ampamp centrez==0)) res+=hostutilprintf( CENTER=s s sn centrex centrey centrez) if((normalx==1 ampamp normaly==0 ampamp normalz==0)) res+=hostutilprintf( NORMAL=s s sn normalx normaly normalz) res+=hostutilprintf( VISIBLE=sn clipvisible) res+=hostutilprintf( PLANECOLOR=s s sn clipmaterialemissiveColorr clipmaterialemissiveColorg clipmaterialemissiveColorb) res+=hostutilprintf( OPACITY=sn clipopacity) res+=hostutilprintf( INTERSECTIONCOLOR=s s sn clipwireframeColorr clipwireframeColorg clipwireframeColorb) res+= ENDn for(var propt in clip) consoleprintln(propt++clip[propt]) res+=ENDn hostconsoleshow() hostconsoleclear() hostconsoleprintln(n Add the following VIEW section to a file ofn+ predefined views (See option 3Dviews)nn + The view may be given a name after VIEW=n + (Remove in front of =)n) hostconsoleprintln(res + n)add items to 3D context menuruntimeaddCustomMenuItem(dfltview Generate Default View default 0)runtimeaddCustomMenuItem(currview Get Current View default 0)runtimeaddCustomMenuItem(csection Cross Section checked 0)menu event handlersmenuEventHandler = new MenuEventHandler()menuEventHandleronEvent = function(e) switch(emenuItemName) case dfltview calc3Dopts() break case currview get3Dview() break case csection addremoveClipPlane(emenuItemChecked) break runtimeaddEventHandler(menuEventHandler)global variable taking reference to currently selected nodevar target=nullselectionEventHandler=new SelectionEventHandler()selectionEventHandleronEvent=function(e) if(eselectedampampenodename=) target=enode else target=null runtimeaddEventHandler(selectionEventHandler)cameraEventHandler=new CameraEventHandler()cameraEventHandleronEvent=function(e) var clip=null runtimeremoveCustomMenuItem(csection) runtimeaddCustomMenuItem(csection Cross Section checked 0) if(clip=scenenodesgetByName($$$$$$)|| predefined scenenodesgetByName(Clipping Plane)) added via context menu runtimeremoveCustomMenuItem(csection) runtimeaddCustomMenuItem(csection Cross Section checked 1) if(clip)plane in predefined views must be rotated by 90 deg around normal cliptransformrotateAboutLineInPlace( MathPI2cliptransformtranslation cliptransformtransformDirection(new Vector3(001)) ) for(var i=0 iltrot4x4length i++)rot4x4[i]setIdentity() target=nullruntimeaddEventHandler(cameraEventHandler)var rot4x4=new Array() keeps track of spin and tilt axes transformationskey event handler for scaling moving spinning and tilting objectskeyEventHandler=new KeyEventHandler()keyEventHandleronEvent=function(e) var backtrans=new Matrix4x4() var trgt=null if(target) trgt=target var backtrans=new Matrix4x4() var trans=trgttransform var parent=trgtparent while(parenttransform) build local to world transformation matrix transmultiplyInPlace(parenttransform) also build world to local back-transformation matrix backtransmultiplyInPlace(parenttransforminversetranspose) parent=parentparent backtranstransposeInPlace() else if( trgt=scenenodesgetByName($$$$$$)|| trgt=scenenodesgetByName(Clipping Plane) ) var trans=trgttransform if(trgt) return var tname=trgtname if(typeof(rot4x4[tname])==undefined) rot4x4[tname]=new Matrix4x4() if(target) var tiltAxis=rot4x4[tname]transformDirection(new Vector3(010)) else var tiltAxis=transtransformDirection(new Vector3(010)) var spinAxis=rot4x4[tname]transformDirection(new Vector3(001)) get the centre of the mesh if(targetampamptrgtconstructorname==Mesh) var centre=transtransformPosition(trgtcomputeBoundingBox()center) else part group (Node3 parent node clipping plane) var centre=new Vector3(transtranslation) switch(echaracterCode) case 30tilt up rot4x4[tname]rotateAboutLineInPlace( -MathPI900rot4x4[tname]translationtiltAxis) transrotateAboutLineInPlace(-MathPI900centretiltAxis) break case 31tilt down rot4x4[tname]rotateAboutLineInPlace( MathPI900rot4x4[tname]translationtiltAxis) transrotateAboutLineInPlace(MathPI900centretiltAxis) break case 28spin right if(ectrlKeyDownampamptarget) transrotateAboutLineInPlace(-MathPI900centrespinAxis) else rot4x4[tname]rotateAboutLineInPlace( -MathPI900rot4x4[tname]translationnew Vector3(001)) transrotateAboutLineInPlace(-MathPI900centrenew Vector3(001)) break case 29spin left if(ectrlKeyDownampamptarget) transrotateAboutLineInPlace(MathPI900centrespinAxis) else rot4x4[tname]rotateAboutLineInPlace( MathPI900rot4x4[tname]translationnew Vector3(001)) transrotateAboutLineInPlace(MathPI900centrenew Vector3(001)) break case 120 x translateTarget(trans new Vector3(100) e) break case 121 y translateTarget(trans new Vector3(010) e) break case 122 z translateTarget(trans new Vector3(001) e) break case 88 shift + x translateTarget(trans new Vector3(-100) e) break case 89 shift + y translateTarget(trans new Vector3(0-10) e) break case 90 shift + z translateTarget(trans new Vector3(00-1) e) break case 115 s transtranslateInPlace(centrescale(-1)) transscaleInPlace(101) transtranslateInPlace(centrescale(1)) break case 83 shift + s transtranslateInPlace(centrescale(-1)) transscaleInPlace(1101) transtranslateInPlace(centrescale(1)) break transmultiplyInPlace(backtrans)runtimeaddEventHandler(keyEventHandler)translates object by amount calculated from Canvas sizefunction translateTarget(t d e) var cam=scenecamerasgetByIndex(0) if(camprojectionType==camTYPE_PERSPECTIVE) var scale=Mathtan(camfov2) camtargetPositionsubtract(camposition)length Mathmin(ecanvasPixelWidthecanvasPixelHeight) else var scale=camviewPlaneSize2 Mathmin(ecanvasPixelWidthecanvasPixelHeight) ttranslateInPlace(dscale(scale))function addremoveClipPlane(chk) var curTrans=getCurTrans() var clip=scenecreateClippingPlane() if(chk) add Clipping Plane and place its center either into the camera target position or into the centre of the currently selected mesh node var centre=new Vector3() if(target) var trans=targettransform var parent=targetparent while(parenttransform) trans=transmultiply(parenttransform) parent=parentparent if(targetconstructorname==Mesh) var centre=transtransformPosition(targetcomputeBoundingBox()center) else var centre=new Vector3(transtranslation) target=null else centreset(scenecamerasgetByIndex(0)targetPosition) cliptransformsetView( new Vector3(000) new Vector3(100) new Vector3(010)) cliptransformtranslateInPlace(centre) else if( scenenodesgetByName($$$$$$)|| scenenodesgetByName(Clipping Plane) ) clipremove()clip=null restoreTrans(curTrans) return clipfunction to store current transformation matrix of all nodes in the scenefunction getCurTrans() var tA=new Array() for(var i=0 iltscenenodescount i++) var nd=scenenodesgetByIndex(i) if(ndname==) continue tA[ndname]=new Matrix4x4(ndtransform) return tAfunction to restore transformation matrices given as argfunction restoreTrans(tA) for(var i=0 iltscenenodescount i++) var nd=scenenodesgetByIndex(i) if(tA[ndname]) ndtransformset(tA[ndname]) store original transformation matrix of all mesh nodes in the scenevar origtrans=getCurTrans()set initial state of Cross Section menu entrycameraEventHandleronEvent(1)hostconsoleclear()

var ocgs=hostgetOCGs(hostpageNum)for(var i=0iltocgslengthi++)if(ocgs[i]name==MediaPlayButton1)ocgs[i]state=false

(C) 2012 Michail Vidiassov John C Bowman Alexander Grahn asylabelsjs version 20120912 3D JavaScript to be used with media9sty (option `add3Djscript) for Asymptote generated PRC files adds billboard behaviour to text labels in Asymptote PRC files so that they always face the camera under 3D rotation This work may be distributed andor modified under the conditions of the LaTeX Project Public License The latest version of this license is in httpmirrorsctanorgmacroslatexbaselppltxt This work has the LPPL maintenance status `maintained The Current Maintainer of this work is A Grahnvar bbnodes=new Array() billboard meshesvar bbtrans=new Array() billboard transformsfunction fulltransform(mesh) var t=new Matrix4x4(meshtransform) if(meshparentname = ) var parentTransform=fulltransform(meshparent) tmultiplyInPlace(parentTransform) return t else return t find all text labels in the scene and determine pivoting pointsvar nodes=scenenodesvar nodescount=nodescountvar third=1030for(var i=0 i lt nodescount i++) var node=nodesgetByIndex(i) var name=nodename var end=namelastIndexOf()-1 if(end gt 0) if(namecharAt(end) == 001) var start=namelastIndexOf(-)+1 if(end gt start) nodename=namesubstr(0start-1) var nodeMatrix=fulltransform(nodeparent) var c=nodeMatrixtranslation position var d=Mathpow(Mathabs(nodeMatrixdeterminant)third) scale bbnodespush(node) bbtranspush(Matrix4x4()scale(ddd)translate(c)multiply(nodeMatrixinverse)) var camera=scenecamerasgetByIndex(0) var zero=new Vector3(000)var bbcount=bbnodeslength event handler to maintain camera-facing text labelsbillboardHandler=new RenderEventHandler()billboardHandleronEvent=function(event) var T=new Matrix4x4() TsetView(zerocamerapositionsubtract(cameratargetPosition) cameraupsubtract(cameraposition)) for(var j=0 j lt bbcount j++) bbnodes[j]transformset(Tmultiply(bbtrans[j])) runtimerefresh() runtimeaddEventHandler(billboardHandler)runtimerefresh()

(C) 2012 Alexander Grahn 3Dspintooljs version 20120301 3D JavaScript to be used with media9sty (option `add3Djscript) enables the Spin tool (also accessible via 3D toolbar or context menu) upon activation of the 3D scene the scene then rotates around the upright axis while dragging with the mouse This work may be distributed andor modified under the conditions of the LaTeX Project Public License The latest version of this license is in httpmirrorsctanorgmacroslatexbaselppltxt This work has the LPPL maintenance status `maintained The Current Maintainer of this work is A GrahnruntimesetCurrentTool(runtimeTOOL_NAME_SPIN)

cells [ cell_type code execution_count null metadata outputs [] source [ from IPythoncoredisplay import display HTMLn display(HTML( )) ] cell_type code execution_count null metadata collapsed true outputs [] source [ import numpy as npn import scipystats as ssn import time n n Black and Scholesn def d1(S0 K r sigma T)n return (nplog(S0K) + (r + sigma2 2) T)(sigma npsqrt(T))n n def d2(S0 K r sigma T)n return (nplog(S0 K) + (r - sigma2 2) T) (sigma npsqrt(T))n n def BlackScholes(typeS0 K r sigma T)n if type==Cn return S0 ssnormcdf(d1(S0 K r sigma T)) - K npexp(-r T) ssnormcdf(d2(S0 K r sigma T))n elsen return K npexp(-r T) ssnormcdf(-d2(S0 K r sigma T)) - S0 ssnormcdf(-d1(S0 K r sigma T)) ] cell_type code execution_count null metadata outputs [] source [ BlackScholes(C100 120 002 02 10) ] ] metadata anaconda-cloud kernelspec display_name Python 3 language python name python3 language_info codemirror_mode name ipython version 3 file_extension py mimetype textx-python name python nbconvert_exporter python pygments_lexer ipython3 version 375rc1 nbformat 4 nbformat_minor 1

Black-Scholes Pricing and Hedging

Fig 65 Time-dependent solution of the Black-Scholes PDE (call option)lowast

The next proposition is proved by a direct differentiation of the Black-Scholesfunction and will be recovered later using a probabilistic argument in Propo-sition 714 below

Proposition 64 The Black-Scholes Delta of the European call option isgiven by

ξt = ξt(St) =partgcpartx

(tSt) = Φ(d+(T minus t)

)isin [0 1] (615)

where d+(T minus t) is given by (611)

Proof From Relation (613) we note that the standard normal probabilitydensity function

ϕ(x) = Φprime(x) =1radic2π

eminusx22 x isin R

satisfies

ϕ(d+(T minus t)) = ϕ

(log(xK) + (r+ σ22)(T minus t)

|σ|radicT minus t

)=

1radic2π

exp(minus1

2

(log(xK) + (r+ σ22)(T minus t)

|σ|radicT minus t

)2)

=1radic2π

exp(minus1

2

(log(xK) + (rminus σ22)(T minus t)

|σ|radicT minus t

+ |σ|radicT minus t

)2)

=1radic2π

exp(minus1

2 (dminus(T minus t))2 minus (T minus t)rminus log x

K

)=

K

xradic

2πeminus(Tminust)r exp

(minus1

2 (dminus(T minus t))2)

lowast The animation works in Acrobat Reader on the entire pdf file

209

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

=K

xeminus(Tminust)rϕ(dminus(T minus t))

hence by (610) we have

partgcpartx

(tx) = part

partx

(xΦ(

log(xK) + (r+ σ22)(T minus t)|σ|radicT minus t

))(616)

minusK eminus(Tminust)r partpartx

(Φ(

log(xK) + (rminus σ22)(T minus t)|σ|radicT minus t

))= Φ

(log(xK) + (r+ σ22)(T minus t)

|σ|radicT minus t

)+x

part

partxΦ(

log(xK) + (r+ σ22)(T minus t)|σ|radicT minus t

)minusK eminus(Tminust)r part

partxΦ(

log(xK) + (rminus σ22)(T minus t)|σ|radicT minus t

)= Φ

(log(xK) + (r+ σ22)(T minus t)

|σ|radicT minus t

)+

x

|σ|radicT minus t

ϕ

(log(xK) + (r+ σ22)(T minus t)

|σ|radicT minus t

)minusK eminus(Tminust)r

|σ|radicT minus t

ϕ

(log(xK) + (rminus σ22)(T minus t)

|σ|radicT minus t

)= Φ(d+(T minus t)) +

x

|σ|radicT minus t

ϕ(d+(T minus t))minusK eminus(Tminust)r

|σ|radicT minus t

ϕ(dminus(T minus t))

= Φ(d+(T minus t))

As a consequence of Proposition 64 the Black-Scholes call price splits into arisky component StΦ

(d+(T minus t)

)and a riskless componentminusK eminus(Tminust)rΦ

(dminus(T minus

t)) as follows

gc(tSt) = StΦ(d+(T minus t)

)︸ ︷︷ ︸risky investment (held)

minus K eminus(Tminust)rΦ(dminus(T minus t)

)︸ ︷︷ ︸

riskminusfree investment (borrowed)

0 6 t 6 T

See Exercise 64 for a computation of the boundary values of gc(tx) t isin[0T ) x gt 0 The following R script is an implementation of the Black-ScholesDelta for European call options in R

1 Delta lt- function(S K r T sigma)d1 lt- (log(SK)+(r+sigma^22)T)(sigmasqrt(T))

3 Delta = pnorm(d1)Delta

210

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

In Figure 66 we plot the Delta of the European call option as a function ofthe underlying asset price and of the time remaining until maturity

Payoff function (x-K)+

0

50

100

150

200

Underlying

0

5

10

15

Time to maturity T-t

0

025

05

075

1

Fig 66 Delta of a European call option with strike price K = 100 r = 3 σ = 10

The Gamma of the European call option is defined as the first derivative ofDelta or second derivative of the option price with respect to the underlyingasset price This gives

γt =1

St|σ|radicT minus t

Φprime(d+(T minus t)

)=

1St|σ|

radic2(T minus t)π

exp(minus1

2

(log(StK) + (r+ σ22)(T minus t)

|σ|radicT minus t

)2)gt 0

In particular a positive value of γt implies that the Delta ξt = ξt(St) shouldincrease when the underlying asset price St increases In other words the po-sition ξt in the underlying asset should be increased by additional purchasesif the underlying asset price St increases

In Figure 67 we plot the (truncated) value of the Gamma of a European calloption as a function of the underlying asset price and of time to maturity

211

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

Fig 67 Gamma of a European call option with strike price K = 100

As Gamma is always nonnegative the Black-Scholes hedging strategy is tokeep buying the risky underlying asset when its price increases and to sell itwhen its price decreases as can be checked from Figure 67

Numerical example - hedging of a call option

In Figure 68 we consider the historical stock price of HSBC Holdings(0005HK) over one year

Fig 68 Graph of the stock price of HSBC Holdings

Consider the call option issued by Societe Generale on 31 December 2008 withstrike price K=$63704 maturity T = October 05 2009 and an entitlementratio of 100 meaning that one option contract is divided into 100 warrants cfpage 9 The next graph gives the time evolution of the Black-Scholes portfoliovalue

t 7minusrarr gc(tSt)

driven by the market price t 7minusrarr St of the risky underlying asset as given inFigure 68 in which the number of days is counted from the origin and notfrom maturity

212

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

40 50 60 70 80 90 0 50 100 150 200

0

5

10

15

20

25

30

35

40

Underlying (HK$) Time in days

Fig 69 Path of the Black-Scholes price for a call option on HSBC

As a consequence of Proposition 64 in the Black-Scholes call option hedgingmodel the amount invested in the risky asset is

Stξt = StΦ(d+(T minus t)

)= StΦ

(log(StK) + (r+ σ22)(T minus t)

|σ|radicT minus t

)gt 0

which is always nonnegative ie there is no short selling and the amountinvested on the riskless asset is

ηtAt = minusK eminus(Tminust)rΦ(dminus(T minus t)

)= minusK eminus(Tminust)rΦ

(log(StK) + (rminus σ22)(T minus t)

|σ|radicT minus t

)6 0

which is always nonpositive ie we are constantly borrowing money on theriskless asset as noted in Figure 610

-60

-40

-20

0

20

40

60

80

100

0 50 100 150 200

K

HK$

Black-Scholes priceRisky investment ξtSt

Riskless investment ηtAtUnderlying asset price

Fig 610 Time evolution of a hedging portfolio for a call option on HSBC

213

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

A comparison of Figure 610 with market data can be found in Figures 911and 912 below

Cash settlement In the case of a cash settlement the option issuer will sat-isfy the option contract by selling ξT = 1 stock at the price ST = $83refund the K = $63 risk-free investment and hand in the remaining amountC = (ST minusK)+ = 83minus 63 = $20 to the option holder

Physical delivery In the case of physical delivery of the underlying asset theoption issuer will deliver ξT = 1 stock to the option holder in exchange forK = $63 which will be used together with the portfolio value to refund therisk-free loan

63 European Put Options

Similarly in the case of the European put option with strike price K thepayoff function is given by h(x) = (Kminusx)+ and the Black-Scholes PDE (67)reads

rgp(tx) =partgppartt

(tx) + rxpartgppartx

(tx) + 12σ

2x2 part2gppartx2 (tx)

gp(T x) = (K minus x)+(617)

The next proposition can be proved as in Sections 65 and 66 see Proposi-tion 611

Proposition 65 The solution of the PDE (617) is given by the Black-Scholes formula for put options

gp(tx) = K eminus(Tminust)rΦ(minus dminus(T minus t)

)minus xΦ

(minus d+(T minus t)

) (618)

withd+(T minus t) =

log(xK) + (r+ σ22)(T minus t)|σ|radicT minus t

(619)

dminus(T minus t) =log(xK) + (rminus σ22)(T minus t)

|σ|radicT minus t

(620)

as illustrated in Figure 611

214

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

Fig 611 Graph of the Black-Scholes put price function with strike price K = 100lowast

In other words the European put option with strike price K and maturityT is priced at time t isin [0T ] as

gp(tSt) = K eminus(Tminust)rΦ(minus dminus(T minus t)

)minus StΦ

(minus d+(T minus t)

) 0 6 t 6 T

Fig 612 Time-dependent solution of the Black-Scholes PDE (put option)dagger

The following R script is an implementation of the Black-Scholes formula forEuropean put options in R

1 BSPut lt- function(S K r T sigma)d1 = (log(SK)+(r+sigma^22)T)(sigmasqrt(T))

3 d2 = d1 - sigma sqrt(T)BSPut = Kexp(-rT) pnorm(-d2) - Spnorm(-d1)

5 BSPut

Call-put parity

lowast Right-click on the figure for interaction and ldquoFull Screen Multimediardquo viewdagger The animation works in Acrobat Reader on the entire pdf file

215

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

(C) 2012--today Alexander Grahn 3Dmenujs version 20140923 3D JavaScript used by media9sty Extended functionality of the (right click) context menu of 3D annotations 1) Adds the following items to the 3D context menu `Generate Default View Finds good default camera settings returned as options for use with the includemedia command `Get Current View Determines camera cross section and part settings of the current view returned as `VIEW section that can be copied into a views file of additional views The views file is inserted using the `3Dviews option of includemedia `Cross Section Toggle switch to add or remove a cross section into or from the current view The cross section can be moved in the x y z directions using x y z and X Y Z keys on the keyboard be tilted against and spun around the upright Z axis using the UpDown and LeftRight arrow keys and caled using the s and S keys 2) Enables manipulation of position and orientation of indiviual parts and groups of parts in the 3D scene Parts which have been selected with the mouse can be scaled moved around and rotated like the cross section as described above To spin the parts around their local up-axis keep Control key pressed while using the UpDown and LeftRight arrow keys This work may be distributed andor modified under the conditions of the LaTeX Project Public License The latest version of this license is in httpmirrorsctanorgmacroslatexbaselppltxt This work has the LPPL maintenance status `maintained The Current Maintainer of this work is A Grahn The code borrows heavily from Bernd Gaertners `Miniball software originally written in C++ for computing the smallest enclosing ball of a set of points see httpwwwinfethzchpersonalgaertnerminiballhtmlhostconsoleshow()constructor for doubly linked listfunction List() thisfirst_node=null thislast_node=new Node(undefined)Listprototypepush_back=function(x) var new_node=new Node(x) if(thisfirst_node==null) thisfirst_node=new_node new_nodeprev=null else new_nodeprev=thislast_nodeprev new_nodeprevnext=new_node new_nodenext=thislast_node thislast_nodeprev=new_nodeListprototypemove_to_front=function(it) var node=itget() if(nodenext=null ampamp nodeprev=null) nodenextprev=nodeprev nodeprevnext=nodenext nodeprev=null nodenext=thisfirst_node thisfirst_nodeprev=node thisfirst_node=node Listprototypebegin=function() var i=new Iterator() itarget=thisfirst_node return(i)Listprototypeend=function() var i=new Iterator() itarget=thislast_node return(i)function Iterator(it) if( it=undefined ) thistarget=ittarget else thistarget=null Iteratorprototypeset=function(it)thistarget=ittargetIteratorprototypeget=function()return(thistarget)Iteratorprototypederef=function()return(thistargetdata)Iteratorprototypeincr=function() if(thistargetnext=null) thistarget=thistargetnextconstructor for node objects that populate the linked listfunction Node(x) thisprev=null thisnext=null thisdata=xfunction sqr(r)return(rr)helper functionMiniball algorithm by B Gaertnerfunction Basis() thism=0 thisq0=new Array(3) thisz=new Array(4) thisf=new Array(4) thisv=new Array(new Array(3) new Array(3) new Array(3) new Array(3)) thisa=new Array(new Array(3) new Array(3) new Array(3) new Array(3)) thisc=new Array(new Array(3) new Array(3) new Array(3) new Array(3)) thissqr_r=new Array(4) thiscurrent_c=thisc[0] thiscurrent_sqr_r=0 thisreset()Basisprototypecenter=function()return(thiscurrent_c)Basisprototypesize=function()return(thism)Basisprototypepop=function()--thismBasisprototypeexcess=function(p) var e=-thiscurrent_sqr_r for(var k=0klt3++k) e+=sqr(p[k]-thiscurrent_c[k]) return(e)Basisprototypereset=function() thism=0 for(var j=0jlt3++j) thisc[0][j]=0 thiscurrent_c=thisc[0] thiscurrent_sqr_r=-1Basisprototypepush=function(p) var i j var eps=1e-32 if(thism==0) for(i=0ilt3++i) thisq0[i]=p[i] for(i=0ilt3++i) thisc[0][i]=thisq0[i] thissqr_r[0]=0 else for(i=0ilt3++i) thisv[thism][i]=p[i]-thisq0[i] for(i=1iltthism++i) thisa[thism][i]=0 for(j=0jlt3++j) thisa[thism][i]+=thisv[i][j]thisv[thism][j] thisa[thism][i]=(2thisz[i]) for(i=1iltthism++i) for(j=0jlt3++j) thisv[thism][j]-=thisa[thism][i]thisv[i][j] thisz[thism]=0 for(j=0jlt3++j) thisz[thism]+=sqr(thisv[thism][j]) thisz[thism]=2 if(thisz[thism]ltepsthiscurrent_sqr_r) return(false) var e=-thissqr_r[thism-1] for(i=0ilt3++i) e+=sqr(p[i]-thisc[thism-1][i]) thisf[thism]=ethisz[thism] for(i=0ilt3++i) thisc[thism][i]=thisc[thism-1][i]+thisf[thism]thisv[thism][i] thissqr_r[thism]=thissqr_r[thism-1]+ethisf[thism]2 thiscurrent_c=thisc[thism] thiscurrent_sqr_r=thissqr_r[thism] ++thism return(true)function Miniball() thisL=new List() thisB=new Basis() thissupport_end=new Iterator()Miniballprototypemtf_mb=function(it) var i=new Iterator(it) thissupport_endset(thisLbegin()) if((thisBsize())==4) return for(var k=new Iterator(thisLbegin())kget()=iget()) var j=new Iterator(k) kincr() if(thisBexcess(jderef()) gt 0) if(thisBpush(jderef())) thismtf_mb(j) thisBpop() if(thissupport_endget()==jget()) thissupport_endincr() thisLmove_to_front(j) Miniballprototypecheck_in=function(b) thisLpush_back(b)Miniballprototypebuild=function() thisBreset() thissupport_endset(thisLbegin()) thismtf_mb(thisLend())Miniballprototypecenter=function() return(thisBcenter())Miniballprototyperadius=function() return(Mathsqrt(thisBcurrent_sqr_r))functions called by menu itemsfunction calc3Dopts () create Miniball object var mb=new Miniball() auxiliary vector var corner=new Vector3() iterate over all visible mesh nodes in the scene for(i=0iltscenemeshescounti++) var mesh=scenemeshesgetByIndex(i) if(meshvisible) continue local to parent transformation matrix var trans=meshtransform build local to world transformation matrix by recursively multiplying the parents transf matrix on the right var parent=meshparent while(parenttransform) trans=transmultiply(parenttransform) parent=parentparent get the bbox of the mesh (local coordinates) var bbox=meshcomputeBoundingBox() transform the local bounding box corner coordinates to world coordinates for bounding sphere determination BBoxmin cornerset(bboxmin) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) BBoxmax cornerset(bboxmax) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) remaining six BBox corners cornerset(bboxminx bboxmaxy bboxmaxz) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) cornerset(bboxminx bboxminy bboxmaxz) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) cornerset(bboxminx bboxmaxy bboxminz) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) cornerset(bboxmaxx bboxminy bboxminz) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) cornerset(bboxmaxx bboxminy bboxmaxz) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) cornerset(bboxmaxx bboxmaxy bboxminz) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) compute the smallest enclosing bounding sphere mbbuild() current camera settings var camera=scenecamerasgetByIndex(0) var res= initialize result string aperture angle of the virtual camera (perspective projection) or orthographic scale (orthographic projection) if(cameraprojectionType==cameraTYPE_PERSPECTIVE) var aac=camerafov180MathPI if(hostutilprintf(4f aac)=30) res+=hostutilprintf(n3Daac=s aac) else cameraviewPlaneSize=2mbradius() res+=hostutilprintf(n3Dortho=s 1cameraviewPlaneSize) camera roll var roll = cameraroll180MathPI if(hostutilprintf(4f roll)=0) res+=hostutilprintf(n3Droll=sroll) target to camera vector var c2c=new Vector3() c2cset(cameraposition) c2csubtractInPlace(cameratargetPosition) c2cnormalize() if((c2cx==0 ampamp c2cy==-1 ampamp c2cz==0)) res+=hostutilprintf(n3Dc2c=s s s c2cx c2cy c2cz) new camera settings bounding sphere centre --gt new camera target var coo=new Vector3() cooset((mbcenter())[0] (mbcenter())[1] (mbcenter())[2]) if(coolength) res+=hostutilprintf(n3Dcoo=s s s coox cooy cooz) radius of orbit if(cameraprojectionType==cameraTYPE_PERSPECTIVE) var roo=mbradius() Mathsin(aac MathPI 360) else orthographic projection var roo=mbradius() res+=hostutilprintf(n3Droo=s roo) update camera settings in the viewer var currol=cameraroll cameratargetPositionset(coo) camerapositionset(cooadd(c2cscale(roo))) cameraroll=currol determine background colour rgb=scenebackgroundgetColor() if((rgbr==1 ampamp rgbg==1 ampamp rgbb==1)) res+=hostutilprintf(n3Dbg=s s s rgbr rgbg rgbb) determine lighting scheme switch(scenelightScheme) case sceneLIGHT_MODE_FILE curlights=Artworkbreak case sceneLIGHT_MODE_NONE curlights=Nonebreak case sceneLIGHT_MODE_WHITE curlights=Whitebreak case sceneLIGHT_MODE_DAY curlights=Daybreak case sceneLIGHT_MODE_NIGHT curlights=Nightbreak case sceneLIGHT_MODE_BRIGHT curlights=Hardbreak case sceneLIGHT_MODE_RGB curlights=Primarybreak case sceneLIGHT_MODE_BLUE curlights=Bluebreak case sceneLIGHT_MODE_RED curlights=Redbreak case sceneLIGHT_MODE_CUBE curlights=Cubebreak case sceneLIGHT_MODE_CAD curlights=CADbreak case sceneLIGHT_MODE_HEADLAMP curlights=Headlampbreak if(curlights=Artwork) res+=hostutilprintf(n3Dlights=s curlights) determine global render mode switch(scenerenderMode) case sceneRENDER_MODE_BOUNDING_BOX currender=BoundingBoxbreak case sceneRENDER_MODE_TRANSPARENT_BOUNDING_BOX currender=TransparentBoundingBoxbreak case sceneRENDER_MODE_TRANSPARENT_BOUNDING_BOX_OUTLINE currender=TransparentBoundingBoxOutlinebreak case sceneRENDER_MODE_VERTICES currender=Verticesbreak case sceneRENDER_MODE_SHADED_VERTICES currender=ShadedVerticesbreak case sceneRENDER_MODE_WIREFRAME currender=Wireframebreak case sceneRENDER_MODE_SHADED_WIREFRAME currender=ShadedWireframebreak case sceneRENDER_MODE_SOLID currender=Solidbreak case sceneRENDER_MODE_TRANSPARENT currender=Transparentbreak case sceneRENDER_MODE_SOLID_WIREFRAME currender=SolidWireframebreak case sceneRENDER_MODE_TRANSPARENT_WIREFRAME currender=TransparentWireframebreak case sceneRENDER_MODE_ILLUSTRATION currender=Illustrationbreak case sceneRENDER_MODE_SOLID_OUTLINE currender=SolidOutlinebreak case sceneRENDER_MODE_SHADED_ILLUSTRATION currender=ShadedIllustrationbreak case sceneRENDER_MODE_HIDDEN_WIREFRAME currender=HiddenWireframebreak if(currender=Solid) res+=hostutilprintf(n3Drender=s currender) write result string to the console hostconsoleshow() hostconsoleclear() hostconsoleprintln(n Copy and paste the following text to then+ option list of includemedian + res + n)function get3Dview () var camera=scenecamerasgetByIndex(0) var coo=cameratargetPosition var c2c=camerapositionsubtract(coo) var roo=c2clength c2cnormalize() var res=VIEW=insert optional name heren if((coox==0 ampamp cooy==0 ampamp cooz==0)) res+=hostutilprintf( COO=s s sn coox cooy cooz) if((c2cx==0 ampamp c2cy==-1 ampamp c2cz==0)) res+=hostutilprintf( C2C=s s sn c2cx c2cy c2cz) if(roo gt 1e-9) res+=hostutilprintf( ROO=sn roo) var roll = cameraroll180MathPI if(hostutilprintf(4f roll)=0) res+=hostutilprintf( ROLL=sn roll) if(cameraprojectionType==cameraTYPE_PERSPECTIVE) var aac=camerafov 180MathPI if(hostutilprintf(4f aac)=30) res+=hostutilprintf( AAC=sn aac) else if(hostutilprintf(4f cameraviewPlaneSize)=1) res+=hostutilprintf( ORTHO=sn 1cameraviewPlaneSize) rgb=scenebackgroundgetColor() if((rgbr==1 ampamp rgbg==1 ampamp rgbb==1)) res+=hostutilprintf( BGCOLOR=s s sn rgbr rgbg rgbb) switch(scenelightScheme) case sceneLIGHT_MODE_FILE curlights=Artworkbreak case sceneLIGHT_MODE_NONE curlights=Nonebreak case sceneLIGHT_MODE_WHITE curlights=Whitebreak case sceneLIGHT_MODE_DAY curlights=Daybreak case sceneLIGHT_MODE_NIGHT curlights=Nightbreak case sceneLIGHT_MODE_BRIGHT curlights=Hardbreak case sceneLIGHT_MODE_RGB curlights=Primarybreak case sceneLIGHT_MODE_BLUE curlights=Bluebreak case sceneLIGHT_MODE_RED curlights=Redbreak case sceneLIGHT_MODE_CUBE curlights=Cubebreak case sceneLIGHT_MODE_CAD curlights=CADbreak case sceneLIGHT_MODE_HEADLAMP curlights=Headlampbreak if(curlights=Artwork) res+= LIGHTS=+curlights+n switch(scenerenderMode) case sceneRENDER_MODE_BOUNDING_BOX defaultrender=BoundingBoxbreak case sceneRENDER_MODE_TRANSPARENT_BOUNDING_BOX defaultrender=TransparentBoundingBoxbreak case sceneRENDER_MODE_TRANSPARENT_BOUNDING_BOX_OUTLINE defaultrender=TransparentBoundingBoxOutlinebreak case sceneRENDER_MODE_VERTICES defaultrender=Verticesbreak case sceneRENDER_MODE_SHADED_VERTICES defaultrender=ShadedVerticesbreak case sceneRENDER_MODE_WIREFRAME defaultrender=Wireframebreak case sceneRENDER_MODE_SHADED_WIREFRAME defaultrender=ShadedWireframebreak case sceneRENDER_MODE_SOLID defaultrender=Solidbreak case sceneRENDER_MODE_TRANSPARENT defaultrender=Transparentbreak case sceneRENDER_MODE_SOLID_WIREFRAME defaultrender=SolidWireframebreak case sceneRENDER_MODE_TRANSPARENT_WIREFRAME defaultrender=TransparentWireframebreak case sceneRENDER_MODE_ILLUSTRATION defaultrender=Illustrationbreak case sceneRENDER_MODE_SOLID_OUTLINE defaultrender=SolidOutlinebreak case sceneRENDER_MODE_SHADED_ILLUSTRATION defaultrender=ShadedIllustrationbreak case sceneRENDER_MODE_HIDDEN_WIREFRAME defaultrender=HiddenWireframebreak if(defaultrender=Solid) res+= RENDERMODE=+defaultrender+n detect existing Clipping Plane (3D Cross Section) var clip=null if( clip=scenenodesgetByName($$$$$$)|| clip=scenenodesgetByName(Clipping Plane) ) for(var i=0iltscenenodescounti++) var nd=scenenodesgetByIndex(i) if(nd==clip||ndname==) continue var ndUTFName= for (var j=0 jltndnamelength j++) var theUnicode = ndnamecharCodeAt(j)toString(16) while (theUnicodelengthlt4) theUnicode = 0 + theUnicode ndUTFName += theUnicode var end=ndnamelastIndexOf() if(endgt0) var ndUserName=ndnamesubstr(0end) else var ndUserName=ndname respart= PART=+ndUserName+n respart+= UTF16NAME=+ndUTFName+n defaultvals=true if(ndvisible) respart+= VISIBLE=falsen defaultvals=false if(ndopacitylt10) respart+= OPACITY=+ndopacity+n defaultvals=false if(ndconstructorname==Mesh) currender=defaultrender switch(ndrenderMode) case sceneRENDER_MODE_BOUNDING_BOX currender=BoundingBoxbreak case sceneRENDER_MODE_TRANSPARENT_BOUNDING_BOX currender=TransparentBoundingBoxbreak case sceneRENDER_MODE_TRANSPARENT_BOUNDING_BOX_OUTLINE currender=TransparentBoundingBoxOutlinebreak case sceneRENDER_MODE_VERTICES currender=Verticesbreak case sceneRENDER_MODE_SHADED_VERTICES currender=ShadedVerticesbreak case sceneRENDER_MODE_WIREFRAME currender=Wireframebreak case sceneRENDER_MODE_SHADED_WIREFRAME currender=ShadedWireframebreak case sceneRENDER_MODE_SOLID currender=Solidbreak case sceneRENDER_MODE_TRANSPARENT currender=Transparentbreak case sceneRENDER_MODE_SOLID_WIREFRAME currender=SolidWireframebreak case sceneRENDER_MODE_TRANSPARENT_WIREFRAME currender=TransparentWireframebreak case sceneRENDER_MODE_ILLUSTRATION currender=Illustrationbreak case sceneRENDER_MODE_SOLID_OUTLINE currender=SolidOutlinebreak case sceneRENDER_MODE_SHADED_ILLUSTRATION currender=ShadedIllustrationbreak case sceneRENDER_MODE_HIDDEN_WIREFRAME currender=HiddenWireframebreak case sceneRENDER_MODE_DEFAULT currender=Defaultbreak if(currender=defaultrender) respart+= RENDERMODE=+currender+n defaultvals=false if(origtrans[ndname]ampampndtransformisEqual(origtrans[ndname])) var lvec=ndtransformtransformDirection(new Vector3(100)) var uvec=ndtransformtransformDirection(new Vector3(010)) var vvec=ndtransformtransformDirection(new Vector3(001)) respart+= TRANSFORM= +lvecx+ +lvecy+ +lvecz+ +uvecx+ +uvecy+ +uvecz+ +vvecx+ +vvecy+ +vvecz+ +ndtransformtranslationx+ +ndtransformtranslationy+ +ndtransformtranslationz+n defaultvals=false respart+= ENDn if(defaultvals) res+=respart if(clip) var centre=cliptransformtranslation var normal=cliptransformtransformDirection(new Vector3(001)) res+= CROSSSECTn if((centrex==0 ampamp centrey==0 ampamp centrez==0)) res+=hostutilprintf( CENTER=s s sn centrex centrey centrez) if((normalx==1 ampamp normaly==0 ampamp normalz==0)) res+=hostutilprintf( NORMAL=s s sn normalx normaly normalz) res+=hostutilprintf( VISIBLE=sn clipvisible) res+=hostutilprintf( PLANECOLOR=s s sn clipmaterialemissiveColorr clipmaterialemissiveColorg clipmaterialemissiveColorb) res+=hostutilprintf( OPACITY=sn clipopacity) res+=hostutilprintf( INTERSECTIONCOLOR=s s sn clipwireframeColorr clipwireframeColorg clipwireframeColorb) res+= ENDn for(var propt in clip) consoleprintln(propt++clip[propt]) res+=ENDn hostconsoleshow() hostconsoleclear() hostconsoleprintln(n Add the following VIEW section to a file ofn+ predefined views (See option 3Dviews)nn + The view may be given a name after VIEW=n + (Remove in front of =)n) hostconsoleprintln(res + n)add items to 3D context menuruntimeaddCustomMenuItem(dfltview Generate Default View default 0)runtimeaddCustomMenuItem(currview Get Current View default 0)runtimeaddCustomMenuItem(csection Cross Section checked 0)menu event handlersmenuEventHandler = new MenuEventHandler()menuEventHandleronEvent = function(e) switch(emenuItemName) case dfltview calc3Dopts() break case currview get3Dview() break case csection addremoveClipPlane(emenuItemChecked) break runtimeaddEventHandler(menuEventHandler)global variable taking reference to currently selected nodevar target=nullselectionEventHandler=new SelectionEventHandler()selectionEventHandleronEvent=function(e) if(eselectedampampenodename=) target=enode else target=null runtimeaddEventHandler(selectionEventHandler)cameraEventHandler=new CameraEventHandler()cameraEventHandleronEvent=function(e) var clip=null runtimeremoveCustomMenuItem(csection) runtimeaddCustomMenuItem(csection Cross Section checked 0) if(clip=scenenodesgetByName($$$$$$)|| predefined scenenodesgetByName(Clipping Plane)) added via context menu runtimeremoveCustomMenuItem(csection) runtimeaddCustomMenuItem(csection Cross Section checked 1) if(clip)plane in predefined views must be rotated by 90 deg around normal cliptransformrotateAboutLineInPlace( MathPI2cliptransformtranslation cliptransformtransformDirection(new Vector3(001)) ) for(var i=0 iltrot4x4length i++)rot4x4[i]setIdentity() target=nullruntimeaddEventHandler(cameraEventHandler)var rot4x4=new Array() keeps track of spin and tilt axes transformationskey event handler for scaling moving spinning and tilting objectskeyEventHandler=new KeyEventHandler()keyEventHandleronEvent=function(e) var backtrans=new Matrix4x4() var trgt=null if(target) trgt=target var backtrans=new Matrix4x4() var trans=trgttransform var parent=trgtparent while(parenttransform) build local to world transformation matrix transmultiplyInPlace(parenttransform) also build world to local back-transformation matrix backtransmultiplyInPlace(parenttransforminversetranspose) parent=parentparent backtranstransposeInPlace() else if( trgt=scenenodesgetByName($$$$$$)|| trgt=scenenodesgetByName(Clipping Plane) ) var trans=trgttransform if(trgt) return var tname=trgtname if(typeof(rot4x4[tname])==undefined) rot4x4[tname]=new Matrix4x4() if(target) var tiltAxis=rot4x4[tname]transformDirection(new Vector3(010)) else var tiltAxis=transtransformDirection(new Vector3(010)) var spinAxis=rot4x4[tname]transformDirection(new Vector3(001)) get the centre of the mesh if(targetampamptrgtconstructorname==Mesh) var centre=transtransformPosition(trgtcomputeBoundingBox()center) else part group (Node3 parent node clipping plane) var centre=new Vector3(transtranslation) switch(echaracterCode) case 30tilt up rot4x4[tname]rotateAboutLineInPlace( -MathPI900rot4x4[tname]translationtiltAxis) transrotateAboutLineInPlace(-MathPI900centretiltAxis) break case 31tilt down rot4x4[tname]rotateAboutLineInPlace( MathPI900rot4x4[tname]translationtiltAxis) transrotateAboutLineInPlace(MathPI900centretiltAxis) break case 28spin right if(ectrlKeyDownampamptarget) transrotateAboutLineInPlace(-MathPI900centrespinAxis) else rot4x4[tname]rotateAboutLineInPlace( -MathPI900rot4x4[tname]translationnew Vector3(001)) transrotateAboutLineInPlace(-MathPI900centrenew Vector3(001)) break case 29spin left if(ectrlKeyDownampamptarget) transrotateAboutLineInPlace(MathPI900centrespinAxis) else rot4x4[tname]rotateAboutLineInPlace( MathPI900rot4x4[tname]translationnew Vector3(001)) transrotateAboutLineInPlace(MathPI900centrenew Vector3(001)) break case 120 x translateTarget(trans new Vector3(100) e) break case 121 y translateTarget(trans new Vector3(010) e) break case 122 z translateTarget(trans new Vector3(001) e) break case 88 shift + x translateTarget(trans new Vector3(-100) e) break case 89 shift + y translateTarget(trans new Vector3(0-10) e) break case 90 shift + z translateTarget(trans new Vector3(00-1) e) break case 115 s transtranslateInPlace(centrescale(-1)) transscaleInPlace(101) transtranslateInPlace(centrescale(1)) break case 83 shift + s transtranslateInPlace(centrescale(-1)) transscaleInPlace(1101) transtranslateInPlace(centrescale(1)) break transmultiplyInPlace(backtrans)runtimeaddEventHandler(keyEventHandler)translates object by amount calculated from Canvas sizefunction translateTarget(t d e) var cam=scenecamerasgetByIndex(0) if(camprojectionType==camTYPE_PERSPECTIVE) var scale=Mathtan(camfov2) camtargetPositionsubtract(camposition)length Mathmin(ecanvasPixelWidthecanvasPixelHeight) else var scale=camviewPlaneSize2 Mathmin(ecanvasPixelWidthecanvasPixelHeight) ttranslateInPlace(dscale(scale))function addremoveClipPlane(chk) var curTrans=getCurTrans() var clip=scenecreateClippingPlane() if(chk) add Clipping Plane and place its center either into the camera target position or into the centre of the currently selected mesh node var centre=new Vector3() if(target) var trans=targettransform var parent=targetparent while(parenttransform) trans=transmultiply(parenttransform) parent=parentparent if(targetconstructorname==Mesh) var centre=transtransformPosition(targetcomputeBoundingBox()center) else var centre=new Vector3(transtranslation) target=null else centreset(scenecamerasgetByIndex(0)targetPosition) cliptransformsetView( new Vector3(000) new Vector3(100) new Vector3(010)) cliptransformtranslateInPlace(centre) else if( scenenodesgetByName($$$$$$)|| scenenodesgetByName(Clipping Plane) ) clipremove()clip=null restoreTrans(curTrans) return clipfunction to store current transformation matrix of all nodes in the scenefunction getCurTrans() var tA=new Array() for(var i=0 iltscenenodescount i++) var nd=scenenodesgetByIndex(i) if(ndname==) continue tA[ndname]=new Matrix4x4(ndtransform) return tAfunction to restore transformation matrices given as argfunction restoreTrans(tA) for(var i=0 iltscenenodescount i++) var nd=scenenodesgetByIndex(i) if(tA[ndname]) ndtransformset(tA[ndname]) store original transformation matrix of all mesh nodes in the scenevar origtrans=getCurTrans()set initial state of Cross Section menu entrycameraEventHandleronEvent(1)hostconsoleclear()

var ocgs=hostgetOCGs(hostpageNum)for(var i=0iltocgslengthi++)if(ocgs[i]name==MediaPlayButton2)ocgs[i]state=false

(C) 2012 Michail Vidiassov John C Bowman Alexander Grahn asylabelsjs version 20120912 3D JavaScript to be used with media9sty (option `add3Djscript) for Asymptote generated PRC files adds billboard behaviour to text labels in Asymptote PRC files so that they always face the camera under 3D rotation This work may be distributed andor modified under the conditions of the LaTeX Project Public License The latest version of this license is in httpmirrorsctanorgmacroslatexbaselppltxt This work has the LPPL maintenance status `maintained The Current Maintainer of this work is A Grahnvar bbnodes=new Array() billboard meshesvar bbtrans=new Array() billboard transformsfunction fulltransform(mesh) var t=new Matrix4x4(meshtransform) if(meshparentname = ) var parentTransform=fulltransform(meshparent) tmultiplyInPlace(parentTransform) return t else return t find all text labels in the scene and determine pivoting pointsvar nodes=scenenodesvar nodescount=nodescountvar third=1030for(var i=0 i lt nodescount i++) var node=nodesgetByIndex(i) var name=nodename var end=namelastIndexOf()-1 if(end gt 0) if(namecharAt(end) == 001) var start=namelastIndexOf(-)+1 if(end gt start) nodename=namesubstr(0start-1) var nodeMatrix=fulltransform(nodeparent) var c=nodeMatrixtranslation position var d=Mathpow(Mathabs(nodeMatrixdeterminant)third) scale bbnodespush(node) bbtranspush(Matrix4x4()scale(ddd)translate(c)multiply(nodeMatrixinverse)) var camera=scenecamerasgetByIndex(0) var zero=new Vector3(000)var bbcount=bbnodeslength event handler to maintain camera-facing text labelsbillboardHandler=new RenderEventHandler()billboardHandleronEvent=function(event) var T=new Matrix4x4() TsetView(zerocamerapositionsubtract(cameratargetPosition) cameraupsubtract(cameraposition)) for(var j=0 j lt bbcount j++) bbnodes[j]transformset(Tmultiply(bbtrans[j])) runtimerefresh() runtimeaddEventHandler(billboardHandler)runtimerefresh()

(C) 2012 Alexander Grahn 3Dspintooljs version 20120301 3D JavaScript to be used with media9sty (option `add3Djscript) enables the Spin tool (also accessible via 3D toolbar or context menu) upon activation of the 3D scene the scene then rotates around the upright axis while dragging with the mouse This work may be distributed andor modified under the conditions of the LaTeX Project Public License The latest version of this license is in httpmirrorsctanorgmacroslatexbaselppltxt This work has the LPPL maintenance status `maintained The Current Maintainer of this work is A GrahnruntimesetCurrentTool(runtimeTOOL_NAME_SPIN)

N Privault

Proposition 66 Call-put parity We have the call-put parity relation

gc(tSt)minus gp(tSt) = St minusK eminus(Tminust)r 0 6 t 6 T (621)

between the Black-Scholes prices of call and put options in terms of theforward contract price St minusK eminus(Tminust)r

Proof The call-put parity (621) is a consequence of the relation

xminusK = (xminusK)+ minus (K minus x)+

satisfied by the terminal call and put payoff functions in the Black-ScholesPDE (67) It can also be verified directly from (610) and (618) as

gc(tx)minus gp(tx) = xΦ(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)minus(K eminus(Tminust)rΦ

(minus dminus(T minus t)

)minus xΦ

(minus d+(T minus t)

))= xΦ

(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)minusK eminus(Tminust)r

(1minusΦ

(dminus(T minus t)

))+ x

(1minusΦ

(d+(T minus t)

))= xminusK

The Delta of the Black-Scholes put option can be obtained by differentiationof the call-put parity relation (621) and Proposition 64

Proposition 67 The Delta of the Black-Scholes put option is given by

ξt = minus(1minusΦ(d+(T minus t)

)) = minusΦ

(minus d+(T minus t)

)isin [minus1 0] 0 6 t 6 T

Proof By the call-put parity relation (621) and Proposition 64 we have

partgppartx

(tSt) =partgcpartx

(tSt)minus 1

= Φ(d+(T minus t))minus 1= minusΦ(minusd+(T minus t)) 0 6 t 6 T

where we applied (614)

As a consequence of Proposition 67 the Black-Scholes put price splitsinto a risky component minusStΦ

(minus d+(T minus t)

)and a riskless component

K eminus(Tminust)rΦ(minus dminus(T minus t)

) as follows

gp(tSt) = K eminus(Tminust)rΦ(minus dminus(T minus t)

)︸ ︷︷ ︸riskminusfree investment (savings)

minus StΦ(minus d+(T minus t)

)︸ ︷︷ ︸

risky investment (short)

0 6 t 6 T

216

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

In Figure 613 we plot the Delta of the European put option as a function ofthe underlying asset price and of the time remaining until maturity

Payoff function (x-K)+

0

50

100

150

200

Underlying

0

5

10

15 Time to maturity T-t

-1

-075

-05

-025

0

Fig 613 Delta of a European put option with strike price K = 100 r = 3 σ = 10

Numerical example - hedging of a put option

For one more example we consider a put option issued by BNP Paribas on04 November 2008 with strike price K=$77667 maturity T = October 052009 and entitlement ratio 92593 cf page 9 In the next Figure 614 thenumber of days is counted from the origin not from maturity

40 50 60 70 80 90 100

0 50 100 150 200

0 5

10 15 20 25 30 35 40 45

Underlying (HK$)Time in days

Fig 614 Path of the Black-Scholes price for a put option on HSBC

As a consequence of Proposition 67 the amount invested on the risky assetfor the hedging of a put option is

minusStΦ(minus d+(T minus t)

)= minusStΦ

(minus log(StK) + (r+ σ22)(T minus t)

|σ|radicT minus t

)6 0

217

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

ie there is always short selling and the amount invested on the riskless assetpriced At = ert t isin [0T ] is

ηtAt = K eminus(Tminust)rΦ(minus dminus(T minus t)

)= K eminus(Tminust)rΦ

(minus log(StK) + (rminus σ22)(T minus t)

|σ|radicT minus t

)gt 0

which is always nonnegative ie we are constantly saving money on theriskless asset as noted in Figure 615

-60

-40

-20

0

20

40

60

80

100

0 50 100 150 200

K

HK$

Black-Scholes priceRisky investment ξtSt

Riskless investment ηtAtUnderlying asset price

Fig 615 Time evolution of the hedging portfolio for a put option on HSBC

In the above example the put option finished out of the money (OTM) so thatno cash settlement or physical delivery occurs A comparison of Figure 610with market data can be found in Figures 913 and 914 below

64 Market Terms and Data

The following Table 61 provides a summary of formulas for the computationof Black-Scholes sensitivities also called Greekslowast

lowast ldquoEvery class feels like attending a Greek lessonrdquo (AY2018-2019 student feedback)

218

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

Call option Put option

Option price g(tSt) StΦ(d+(T minus t))minusK eminus(Tminust)rΦ(dminus(T minus t)) K eminus(Tminust)rΦ(minusdminus(T minus t))minus StΦ(minusd+(T minus t))

Delta (∆) partg

partx(tSt) Φ(d+(T minus t)) gt 0 minusΦ(minusd+(T minus t)) 6 0

Gamma (Γ) part2g

partx2 (tSt)Φprime(d+(T minus t))St|σ|

radicT minus t

gt 0

Vega partg

partσ(tSt) St

radicT minus tΦprime(d+(T minus t)) gt 0

Theta (Θ) partg

partt(tSt) minusSt|σ|Φ

prime(d+(T minus t))2radicT minus t

minus rK eminus(Tminust)rΦ(dminus(T minus t)) 6 0 minusSt|σ|Φprime(d+(T minus t))

2radicT minus t

+ rK eminus(Tminust)rΦ(minusdminus(T minus t))

Rho (ρ) partg

partr(tSt) K(T minus t) eminus(Tminust)rΦ(dminus(T minus t)) minusK(T minus t) eminus(Tminust)rΦ(minusdminus(T minus t))

Table 61 Black-Scholes Greeks (Wikipedia)

From Table 61 we can conclude that call option prices are increasing func-tions of the underlying asset price St of the interest rate r and of the volatil-ity parameter σ Similarly put option prices are decreasing functions of theunderlying asset price St of the interest rate r and increasing functions ofthe volatility parameter σ

Parameter Variation of call option prices Variation of put option prices

Underlying St increasing decreasing

Volatility σ increasing increasing

Time t decreasing depends on the underlying price level

Interest rate r increasing decreasing

Table 62 Variations of Black-Scholes prices

The change of sign of the sensitivity Theta (Θ) with respect to time t can beverified in the following Figure 616

219

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

(a) Black-Scholes call price maps (b) Black-Scholes put price maps

Fig 616 Time-dependent solutions of the Black-Scholes PDElowast

Intrinsic value The intrinsic value at time t isin [0T ] of the option withpayoff C = h

(S(1)T

)is given by the immediate exercise payoff h

(S(1)t

) The

extrinsic value at time t isin [0T ] of the option is the remaining differenceπt(C) minus h

(S(1)t

)between the option price πt(C) and the immediate ex-

ercise payoff h(S(1)t

) In general the option price πt(C) decomposes as

πt(C) = h(S(1)t

)︸ ︷︷ ︸intrinsic value

+ πt(C)minus h(S(1)t

)︸ ︷︷ ︸

extrinsic value

0 6 t 6 T ]

Gearing The gearing at time t isin [0T ] of the option with payoff C = h(ST )is defined as the ratio

Gt =St

πt(C)=

Stg(tSt)

0 6 t 6 T

Effective gearing The effective gearing at time t isin [0T ] of the option withpayoff C = h(ST ) is defined as the ratio

Get = Gtξt

=ξtStπt(C)

=St

πt(C)

partg

partx(tSt)

=St

g(tSt)partg

partx(tSt)

= Stpart

partxlog g(tSt) 0 6 t 6 T

lowast The animation works in Acrobat Reader on the entire pdf file

220

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

The effective gearingGet =

ξtStπt(C)

can be interpreted as the hedge ratio ie the percentage of the portfoliowhich is invested on the risky asset When written as

∆g(tSt)g(tSt)

= Get times

∆StSt

the effective gearing gives the relative variation or percentage change∆g(tSt)g(tSt) of the option price g(tSt) from the relative variation∆StSt in the underlying asset price

The ratio Get = Stpart log g(tSt)partx can also be interpreted as an elasticity

coefficient

Break-even price The break-even price BEPt of the underlying asset is thevalue of S for which the intrinsic option value h(S) equals the option priceπt(C) at time t isin [0T ] For European call options it is given by

BEPt = K + πt(C) = K + g(tSt) t = 0 1 N

whereas for European put options it is given by

BEPt = K minus πt(C) = K minus g(tSt) 0 6 t 6 T

Premium The option premium OPt can be defined as the variation requiredfrom the underlying asset price in order to reach the break-even price iewe have

OPt =BEPt minus St

St=K + g(tSt)minus St

St 0 6 t 6 T

for European call options and

OPt =St minusBEPt

St=St + g(tSt)minusK

St 0 6 t 6 T

for European put options see Figure 617 below The term ldquopremiumrdquo issometimes also used to denote the arbitrage price g(tSt) of the option

221

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

f (tx σ)100

=

x =

K =

xpart log f

partx=

σ =

partf

partt(tx σ)=

T=

=(xminusK)x

∆ = = partf

partx(tx σ)

= partf

partσ(tx σ)

=K+f (txσ)minusx

x

=K+f (tx σ)

rf=

partf

partt+rxpartf

partx+

σ2 2x2part2f

partx2

Fig 617 Warrant terms and data

The R package bizdays (requires to install QuantLib) can be used to computecalendar time vs business time to maturity1 installpackages(bizdays)

library(bizdays)3 load_quantlib_calendars(HongKong from=2018-01-01 to=2018-12-31)

load_quantlib_calendars(Singapore from=2018-01-01 to=2018-12-31)5 bizdays(2018-03-10 2018-04-03 QuantLibHongKong)

bizdays(2018-03-10 2018-04-03 QuantLibSingapore)

65 The Heat Equation

In the next proposition we notice that the solution f(tx) of the Black-Scholes PDE (67) can be transformed into a solution g(t y) of the simplerheat equation by a change of variable and a time inversion t 7minusrarr T minus t onthe interval [0T ] so that the terminal condition at time T in the Black-Scholes equation (622) becomes an initial condition at time t = 0 in theheat equation (625) See also here for a related discussion on changes ofvariables for the Black-Scholes PDE

222

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

Proposition 68 Assume that f(tx) solves the Black-Scholes PDErf(tx) = partf

partt(tx) + rx

partf

partx(tx) + 1

2σ2x2 part

2f

partx2 (tx)

f(T x) = (xminusK)+(622)

with terminal condition h(x) = (xminusK)+ x gt 0 Then the function g(t y)defined by

g(t y) = ertf(T minus t e|σ|y+(σ22minusr)t) (623)

solves the heat equation (625) with initial condition

ψ(y) = h(

e|σ|y) y isin R (624)

ie we have partg

partt(t y) = 1

2part2g

party2 (t y)

g(0 y) = h(

e|σ|y)

(625)

Proposition 68 will be proved in Section 66 It will allow us to solve theBlack-Scholes PDE (622) based on the solution of the heat equation (625)with initial condition ψ(y) = h

(e|σ|y

) y isin R by inversion of Relation (623)

with s = T minus t x = e|σ|y+(σ22minusr)t ie

f(sx) = eminus(Tminuss)rg(T minus s minus(σ

22minus r)(T minus s) + log x|σ|

)

Next we focus on the heat equation

partϕ

partt(t y) = 1

2part2ϕ

party2 (t y) (626)

which is used to model the diffusion of heat over time through solids Herethe data of g(x t) represents the temperature measured at time t and pointx We refer the reader to Widder (1975) for a complete treatment of thistopic

223

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

Fig 618 Time-dependent solution of the heat equationlowast

Proposition 69 The fundamental solution of the heat equation (626) isgiven by the Gaussian probability density function

ϕ(t y) =1radic2πt

eminusy2(2t) y isin R

with variance t gt 0

Proof The proof is done by a direct calculation as follows

partϕ

partt(t y) = part

partt

(eminusy2(2t)radic

2πt

)

= minus eminusy2(2t)

2t32radic

2π+

y2

2t2eminusy2(2t)radic

2πt

=

(minus 1

2t +y2

2t2

)ϕ(t y)

and

12part2ϕ

party2 (t y) = minus12part

party

(y

t

eminusy2(2t)radic

2πt

)

= minus eminusy2(2t)

2tradic

2πt+

y2

2t2eminusy2(2t)radic

2πt

=

(minus 1

2t +y2

2t2

)ϕ(t y) t gt 0 y isin R

lowast The animation works in Acrobat Reader on the entire pdf file

224

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

In Section 66 the heat equation (626) will be shown to be equivalent to theBlack-Scholes PDE after a change of variables In particular this will lead tothe explicit solution of the Black-Scholes PDE

Proposition 610 The heat equationpartg

partt(t y) = 1

2part2g

party2 (t y)

g(0 y) = ψ(y)

(627)

with continuous initial condition

g(0 y) = ψ(y)

has the solution

g(t y) =winfinminusinfin

ψ(z) eminus(yminusz)2(2t) dzradic2πt

y isin R t gt 0 (628)

Proof We have

partg

partt(t y) = part

partt

winfinminusinfin

ψ(z) eminus(yminusz)2(2t) dzradic2πt

=winfinminusinfin

ψ(z)part

partt

(eminus(yminusz)2(2t)radic

2πt

)dz

=12winfinminusinfin

ψ(z)

((yminus z)2

t2minus 1t

)eminus(yminusz)2(2t) dzradic

2πt

=12winfinminusinfin

ψ(z)part2

partz2 eminus(yminusz)2(2t) dzradic2πt

=12winfinminusinfin

ψ(z)part2

party2 eminus(yminusz)2(2t) dzradic2πt

=12part2

party2

winfinminusinfin

ψ(z) eminus(yminusz)2(2t) dzradic2πt

=12part2g

party2 (t y)

On the other hand it can be checked that at time t = 0 we have

limtrarr0

winfinminusinfin

ψ(z) eminus(yminusz)2(2t) dzradic2πt

= limtrarr0

winfinminusinfin

ψ(y+ z) eminusz2(2t) dzradic2πt

= ψ(y) y isin R

225

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

The next Figure 619 shows the evolution of g(tx) with initial conditionbased on the European call payoff function h(x) = (xminusK)+ ie

g(0 y) = ψ(y) = h(

e|σ|y)=(

e|σ|y minusK)+ y isin R

Fig 619 Time-dependent solution of the heat equationlowast

Let us provide a second proof of Proposition 610 this time using Brownianmotion and stochastic calculus

Proof of Proposition 610 First note that under the change of variable x =z minus y we have

g(t y) =winfinminusinfin

ψ(z) eminus(yminusz)2(2t) dzradic2πt

=winfinminusinfin

ψ(y+ x) eminusx2(2t) dxradic2πt

= IE[ψ(y+Bt)]

= IE[ψ(yminusBt)]

where (Bt)tisinR+ is a standard Brownian motion and Bt N (0 t) t isin R+Applying Itocircrsquos formula and using the fact that the expectation of the stochas-tic integral with respect to Brownian motion is zero see Relation (417) inProposition 420 we find

g(t y) = IE[ψ(yminusBt)]

= ψ(y)minus IE[w t

0ψprime(yminusBs)dBs

]+

12 IE

[w t0ψprimeprime(yminusBs)ds

]= ψ(y) +

12w t

0IE[ψprimeprime(yminusBs)

]ds

lowast The animation works in Acrobat Reader on the entire pdf file

226

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

= ψ(y) +12w t

0part2

party2 IE [ψ(yminusBs)] ds

= ψ(y) +12w t

0part2g

party2 (s y)ds

Hence we have

partg

partt(t y) = part

parttIE[ψ(yminusBt)]

=12part2

party2 IE [ψ(yminusBt)]

=12part2g

party2 (t y)

Regarding the initial condition we check that

g(0 y) = IE[ψ(yminusB0)] = IE[ψ(y)] = ψ(y)

The expression g(t y) = IE[ψ(yminusBt)] provides a probabilistic interpreta-tion of the heat diffusion phenomenon based on Brownian motion Namelywhen ψε(y) = 1[minusεε](y) we find that

gε(t y) = IE[ψε(yminusBt)]= IE[1[minusεε](yminusBt)]= P

(yminusBt isin [minusε ε]

)= P

(yminus ε 6 Bt 6 y+ ε

)represents the probability of finding Bt within a neighborhood [y minus ε y + ε]of the point y isin R

66 Solution of the Black-Scholes PDE

In this section we solve the Black-Scholes PDE by the kernel method of Sec-tion 65 and a change of variables This solution method uses the change ofvariables (623) of Proposition 68 and a time inversion from which the ter-minal condition at time T in the Black-Scholes equation becomes an initialcondition at time t = 0 in the heat equation

Next we state the proof Proposition 68

Proof Letting s = T minus t and x = e|σ|y+(σ22minusr)t and using Relation (623)ie

g(t y) = ertf(T minus t e|σ|y+(σ22minusr)t)

227

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

we have

partg

partt(t y) = r ertf

(T minus t e|σ|y+(σ22minusr)t)minus ert partf

parts

(T minus t e|σ|y+(σ22minusr)t)

+

(σ2

2 minus r)

ert e|σ|y+(σ22minusr)t partf

partx

(T minus t e|σ|y+(σ22minusr)t)

= r ertf(T minus tx)minus ert partfparts

(T minus tx) +(σ2

2 minus r)

ertxpartfpartx

(T minus tx)

=12 ertx2σ2 part

2f

partx2 (T minus tx) +σ2

2 ertxpartfpartx

(T minus tx) (629)

where on the last step we used the Black-Scholes PDE On the other handwe have

partg

party(t y) = |σ| ert e|σ|y+(σ22minusr)t partf

partx

(T minus t e|σ|y+(σ22minusr)t)

and

12partg2

party2 (t y) =σ2

2 ert e|σ|y+(σ22minusr)t partf

partx

(T minus t e|σ|y+(σ22minusr)t)

+σ2

2 ert e2|σ|y+2(σ22minusr)t part2f

partx2(T minus t e|σ|y+(σ22minusr)t)

=σ2

2 ertxpartfpartx

(T minus tx) + σ2

2 ertx2 part2f

partx2 (T minus tx) (630)

We conclude by comparing (629) with (630) which shows that g(tx) solvesthe heat equation (627) with initial condition

g(0 y) = f(T e|σ|y

)= h

(e|σ|y

)

In the next proposition we derive the Black-Scholes formula (610) by solv-ing the PDE (622) The Black-Scholes formula will also be recovered by aprobabilistic argument via the computation of an expected value in Proposi-tion 77

Proposition 611 When h(x) = (x minusK)+ the solution of the Black-Scholes PDE (622) is given by

f(tx) = xΦ(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

) x gt 0

whereΦ(x) =

1radic2π

w xminusinfin

eminusy22dy x isin R

and

228

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

d+(T minus t) =

log(xK) + (r+ σ22)(T minus t)|σ|radicT minus t

dminus(T minus t) =log(xK) + (rminus σ22)(T minus t)

|σ|radicT minus t

x gt 0 t isin [0T )

Proof By inversion of Relation (623) with s = T minus t and x = e|σ|y+(σ22minusr)twe get

f(sx) = eminus(Tminuss)rg(T minus s minus(σ

22minus r)(T minus s) + log x|σ|

)and

h(x) = ψ

(log x|σ|

) x gt 0 or ψ(y) = h

(e|σ|y

) y isin R

Hence using the solution (628) and Relation (624) we get

f(tx) = eminus(Tminust)rg(T minus t minus(σ

22minus r)(T minus t) + log x|σ|

)= eminus(Tminust)r

winfinminusinfin

ψ

(minus(σ22minus r)(T minus t) + log x

|σ|+ z

)eminusz2(2(Tminust)) dzradic

2(T minus t)π

= eminus(Tminust)rwinfinminusinfin

h(x e|σ|zminus(σ22minusr)(Tminust)) eminusz2(2(Tminust)) dzradic

2(T minus t)π

= eminus(Tminust)rwinfinminusinfin

(x e|σ|zminus(σ22minusr)(Tminust) minusK

)+ eminusz2(2(Tminust)) dzradic2(T minus t)π

= eminus(Tminust)r

timeswinfin

(minusr+σ22)(Tminust)+log(Kx)|σ|

(x e|σ|zminus(σ22minusr)(Tminust) minusK

)eminusz2(2(Tminust)) dzradic

2(T minus t)π

= x eminus(Tminust)rwinfinminusdminus(Tminust)

radicTminust

e|σ|zminus(σ22minusr)(Tminust) eminusz2(2(Tminust)) dzradic2(T minus t)π

minusK eminus(Tminust)rwinfinminusdminus(Tminust)

radicTminust

eminusz2(2(Tminust)) dzradic2(T minus t)π

= xwinfinminusdminus(Tminust)

radicTminust

e|σ|zminus(Tminust)σ22minusz2(2(Tminust)) dzradic2(T minus t)π

minusK eminus(Tminust)rwinfinminusdminus(Tminust)

radicTminust

eminusz2(2(Tminust)) dzradic2(T minus t)π

= xwinfinminusdminus(Tminust)

radicTminust

eminus(zminus(Tminust)|σ|)2(2(Tminust)) dzradic2(T minus t)π

229

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

minusK eminus(Tminust)rwinfinminusdminus(Tminust)

radicTminust

eminusz2(2(Tminust)) dzradic2(T minus t)π

= xwinfinminusdminus(Tminust)

radicTminustminus(Tminust)|σ|

eminusz2(2(Tminust)) dzradic2(T minus t)π

minusK eminus(Tminust)rwinfinminusdminus(Tminust)

radicTminust

eminusz2(2(Tminust)) dzradic2(T minus t)π

= xwinfinminusdminus(Tminust)minus|σ|

radicTminust

eminusz22 dzradic2πminusK eminus(Tminust)r

winfinminusdminus(Tminust)

eminusz22 dzradic2π

= x(1minusΦ

(minus d+(T minus t)

))minusK eminus(Tminust)r

(1minusΦ

(minus dminus(T minus t)

))= xΦ

(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)

where we used the relation (614) ie

1minusΦ(a) = Φ(minusa) a isin R

Exercises

Exercise 61 Bachelier (1900) model Consider a market made of a risklessasset valued At = A0 with zero interest rate t isin R+ and a risky asset whoseprice St is modeled by a standard Brownian motion as St = Bt t isin R+

a) Show that the price g(tBt) of the option with payoff C = B2T satisfies

the heat equationpartϕ

partt(t y) = minus1

2part2ϕ

party2 (t y)

with terminal condition g(T x) = x2b) Find the function g(tx) by solving the PDE of Question (a)

Hint Try a solution of the form g(tx) = x2 + f(t)

See Exercises 611 713 and 714 for extensions to nonzero interest rates

Exercise 62 Consider a risky asset price (St)tisinR modeled in the Cox et al(1985) (CIR) model as

dSt = β(αminus St)dt+ σradicStdBt αβσ gt 0 (631)

and let (ηt ξt)tisinR+ be a portfolio strategy whose value Vt = ηtAt + ξtSttakes the form Vt = g(tSt) t isin R+ Figure 620 presents a random simula-tion of the solution to (631) with α = 0025 β = 1 and σ = 13230

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

0

1

2

3

4

5

6

7

8

0 01 02 03 04 05 06 07 08 09 1

St

t

Fig 620 Graph of the CIR short rate t 7rarr rt with α = 25 β = 1 and σ = 13

N=10000 t lt- 0(N-1) dt lt- 10Na=0025 b=2 sigma=0052 X lt- rnorm(Nmean=0sd=sqrt(dt))R lt- rep(0N)R[1]=001

for (j in 2N)R[j]=max(0R[j-1]+(a-bR[j-1])dt+sigmasqrt(R[j-1])X[j])4 plot(t R xlab = t ylab = type = l ylim = c(0002) col = blue)

Based on the self-financing condition written as

dVt = rVtdtminus rξtStdt+ ξtdSt

= rVtdtminus rξtStdt+ β(αminus St)ξtdt+ σξtradicStdBt t isin R+ (632)

derive the PDE satisfied by the function g(tx) using the Itocirc formula

Exercise 63 Black-Scholes PDE with dividends Consider a riskless as-set with price At = A0 ert t isin R+ and an underlying asset price process(St)tisinR+ modeled as

dSt = (microminus δ)Stdt+ σStdBt

where (Bt)tisinR+ is a standard Brownian motion and δ gt 0 is a continuous-time dividend rate By absence of arbitrage the payment of a dividend entailsa drop in the stock price by the same amount occuring generally on the ex-dividend date on which the purchase of the security no longer entitles theinvestor to the dividend amount The list of investors entitled to dividendpayment is consolidated on the date of record and payment is made on thepayable date

library(quantmod)2 getSymbols(0005HKfrom=2010-01-01to=SysDate()src=yahoo)

getDividends(0005HKfrom=2010-01-01to=SysDate()src=yahoo)

a) Assuming that the portfolio with value Vt = ξtSt + ηtAt at time t is self-financing and that dividends are continuously reinvested write down theportfolio variation dVt

231

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

b) Assuming that the portfolio value Vt takes the form Vt = g(tSt) at timet derive the Black-Scholes PDE for the function g(tx) with its terminalcondition

c) Compute the price at time t isin [0T ] of the European call option withstrike price K by solving the corresponding Black-Scholes PDE

d) Compute the Delta of the option

Exercise 64

a) Check that the Black-Scholes formula (610) for European call options

gc(tx) = xΦ(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)

satisfies the following boundary conditions

i) at x = 0 gc(t 0) = 0ii) at maturity t = T

gc(T x) = (xminusK)+ =

xminusK x gt K

0 x 6 K

iii) as time to maturity tends to infinity

limTrarrinfin

Bl(Kxσ rT minus t) = x t isin R+

b) Check that the Black-Scholes formula (618) for European put options

gp(tx) = K eminus(Tminust)rΦ(minus dminus(T minus t)

)minus xΦ

(minus d+(T minus t)

)satisfies the following boundary conditions

i) at x = 0 gp(t 0) = K eminus(Tminust)rii) as x tends to infinity gp(tinfin) = 0 for all t isin [0T )iii) at maturity t = T

gp(T x) = (K minus x)+ =

0 x gt K

K minus x x 6 K

iv) as time to maturity tends to infinity

limTrarrinfin

Blp(KStσ rT minus t) = 0 t isin R+

Exercise 65 Power option (Exercise 314 continued)

232

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

a) Solve the Black-Scholes PDE

rg(x t) = partg

partt(x t) + rx

partg

partx(x t) + σ2

2 x2 part2g

partx2 (x t) (633)

with terminal condition g(xT ) = x2 x gt 0 t isin [0T ]

Hint Try a solution of the form g(x t) = x2f(t) and find f(t)b) Find the respective quantities ξt and ηt of the risky asset St and riskless

asset At = ert in the portfolio with value

Vt = g(St t) = ξtSt + ηtAt 0 6 t 6 T

hedging the contract with payoff S2T at maturity

Exercise 66 On December 18 2007 a call warrant has been issued byFortis Bank on the stock price S of the MTR Corporation with maturityT = 23122008 strike price K = HK$ 3608 and entitlement ratio=10Recall that in the Black-Scholes model the price at time t of the Europeanclaim on the underlying asset priced St with strike price K maturity T interest rate r and volatility σ gt 0 is given by the Black-Scholes formula as

f(tSt) = StΦ(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)

wheredminus(T minus t) =

(rminus σ22)(T minus t) + log(StK)

|σ|radicT minus t

d+(T minus t) = dminus(T minus t) + |σ|radicT minus t = (r+ σ22)(T minus t) + log(StK)

|σ|radicT minus t

Recall that by Proposition 64 we have

partf

partx(tSt) = Φ

(d+(T minus t)

) 0 6 t 6 T

a) Using the values of the Gaussian cumulative distribution function com-pute the Black-Scholes price of the corresponding call option at timet =November 07 2008 with St = HK$ 17200 assuming a volatility σ =90 = 090 and an annual risk-free interest rate r = 4377 = 004377

b) Still using the Gaussian cumulative distribution function compute thequantity of the risky asset required in your portfolio at time t =November07 2008 in order to hedge one such option at maturity T = 23122008

c) Figure 1 represents the Black-Scholes price of the call option as a functionof σ isin [05 15] = [50 150]

233

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

0

01

02

03

04

05

06

05 06 07 08 09 1 11 12 13 14 15σimp

Optio

n pr

ice

σ

Market price

Fig 621 Option price as a function of the volatility σ gt 0

1 BSCall lt- function(S K r T sigma)d1 lt- (log(SK)+(r+sigma^22)T)(sigmasqrt(T))d2 lt- d1 - sigma sqrt(T)

3 BSCall = Spnorm(d1) - Kexp(-rT)pnorm(d2)BSCallsigma lt- seq(0515 length=100)

5 plot(sigmaBSCall(172360800437746365sigma) type=llty=1 xlab=Sigmaylab=Black-Scholes Call Price ylim = c(006)col=bluelwd=3)grid()

abline(h=023col=redlwd=3)

Knowing that the closing price of the warrant on November 07 2008 wasHK$ 0023 which value can you infer for the implied volatility σ at thisdatelowast

Exercise 67 Forward contracts Recall that the price πt(C) of a claimpayoff C = h(ST ) of maturity T can be written as πt(C) = g(tSt) wherethe function g(tx) satisfies the Black-Scholes PDE

rg(tx) = partg

partt(tx) + rx

partg

partx(tx) + 1

2σ2x2 part

2g

partx2 (tx)

g(T x) = h(x) (1)

with terminal condition g(T x) = h(x) x gt 0

a) Assume that C is a forward contract with payoff

C = ST minusK

at time T Find the function h(x) in (1)b) Find the solution g(tx) of the above PDE and compute the price πt(C)

at time t isin [0T ]Hint search for a solution of the form g(tx) = xminus α(t) where α(t) is afunction of t to be determined

lowast Download the corresponding or the that can be runhere

234

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

BS lt- function(S K T r sig)d1 lt- (log(SK) + (r + sig^22)T) (sigsqrt(T))d2 lt- d1 - sigsqrt(T)return(Spnorm(d1) - Kexp(-rT)pnorm(d2))impliedvol lt- function(S K T r market)sig lt- 020sigup lt- 1sigdown lt- 0001count lt- 0err lt- BS(S K T r sig) - marketwhile(abs(err) gt 000001 ampamp countlt1000)if(err lt 0)sigdown lt- sigsig lt- (sigup + sig)2elsesigup lt- sigsig lt- (sigdown + sig)2err lt- BS(S K T r sig) - marketcount lt- count + 1if(count==2000)return(NA)elsereturn(sig)market = 083K = 628T = 7 365S = 634r = 002impliedvol(S K T r market)

cells [ cell_type code execution_count null metadata outputs [] source [ from IPythoncoredisplay import display HTMLn display(HTML( )) ] cell_type code execution_count null metadata collapsed true outputs [] source [ import numpy as npn import scipystats as ssn import time n n Black and Scholesn def d1(S0 K r sigma T)n return (nplog(S0K) + (r + sigma2 2) T)(sigma npsqrt(T))n n def d2(S0 K r sigma T)n return (nplog(S0 K) + (r - sigma2 2) T) (sigma npsqrt(T))n n def BlackScholes(typeS0 K r sigma T)n if type==Cn return S0 ssnormcdf(d1(S0 K r sigma T)) - K npexp(-r T) ssnormcdf(d2(S0 K r sigma T))n elsen return K npexp(-r T) ssnormcdf(-d2(S0 K r sigma T)) - S0 ssnormcdf(-d1(S0 K r sigma T)) ] cell_type code execution_count null metadata outputs [] source [ BlackScholes(C1000 1200 002 015 10) ] cell_type code execution_count null metadata outputs [] source [ def difference(x p S K r t)n return BlackScholes(CS K r x t) - p ] cell_type code execution_count null metadata outputs [] source [ from scipyoptimize import bisectn bisect(difference00011args=(11541763731112766 1000 1200 002 10)) ] ] metadata anaconda-cloud kernelspec display_name Python 3 language python name python3 language_info codemirror_mode name ipython version 3 file_extension py mimetype textx-python name python nbconvert_exporter python pygments_lexer ipython3 version 375rc1 nbformat 4 nbformat_minor 1

Black-Scholes Pricing and Hedging

c) Compute the quantityξt =

partg

partx(tSt)

of risky assets in a self-financing portfolio hedging Cd) Repeat the above questions with the terminal condition g(T x) = x

Exercise 68a) Solve the Black-Scholes PDE

rg(tx) = partg

partt(tx) + rx

partg

partx(tx) + σ2

2 x2 part2g

partx2 (tx) (634)

with terminal condition g(T x) = 1 x gt 0

Hint Try a solution of the form g(tx) = f(t) and find f(t)

b) Find the respective quantities ξt and ηt of the risky asset St and risklessasset At = ert in the portfolio with value

Vt = g(tSt) = ξtSt + ηtAt

hedging the contract with payoff $1 at maturity

Exercise 69 Log-contracts see also Exercise 84a) Solve the PDE

0 =partg

partt(x t) + rx

partg

partx(x t) + σ2

2 x2 part2g

partx2 (x t)

with the terminal condition g(xT ) = log x x gt 0

Hint Try a solution of the form g(x t) = f(t) + log x and find f(t)b) Solve the Black-Scholes PDE

rh(x t) = parth

partt(x t) + rx

parth

partx(x t) + σ2

2 x2 part2h

partx2 (x t) (635)

with the terminal condition h(xT ) = log x x gt 0

Hint Try a solution of the form h(x t) = u(t)g(x t) and find u(t)c) Find the respective quantities ξt and ηt of the risky asset St and riskless

asset At = ert in the portfolio with value

Vt = g(St t) = ξtSt + ηtAt

hedging a log-contract with payoff logST at maturity 235

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

Exercise 610 Binary options Consider a price process (St)tisinR+ given by

dStSt

= rdt+ σdBt S0 = 1

under the risk-neutral probability measure Plowast The binary (or digital) calloption is a contract with maturity T strike price K and payoff

Cd = 1[Kinfin)(ST ) =

$1 if ST gt K

0 if ST lt K

a) Derive the Black-Schole PDE satisfied by the pricing function Cd(tSt) ofthe binary call option together with its terminal condition

b) Show that the solution Cd(tx) of the Black-Scholes PDE of Question (a)is given by

Cd(tx) = eminus(Tminust)rΦ((rminus σ22)(T minus t) + log(xK)

|σ|radicT minus t

)= eminus(Tminust)rΦ

(dminus(T minus t)

)

where

dminus(T minus t) =(rminus σ22)(T minus t) + log(StK)

|σ|radicT minus t

0 6 t lt T

Exercise 611

a) Bachelier (1900) model Solve the stochastic differential equation

dSt = αStdt+ σdBt (636)

in terms of ασ isin R and the initial condition S0b) Write down the Bachelier PDE satisfied by the function C(tx) where

C(tSt) is the price at time t isin [0T ] of the contingent claim with payoffφ(ST ) = exp(ST ) and identify the process Delta (ξt)tisin[0T ] that hedgesthis claim

c) Solve the Black-Scholes PDE of Question (b) with the terminal conditionφ(x) = ex x isin R

Hint Search for a solution of the form

C(tx) = exp(minus(T minus t)r+ xh(t) +

σ2

4r (h2(t)minus 1)

) (637)

where h(t) is a function to be determined with h(T ) = 1

236

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

d) Compute the portfolio strategy (ξt ηt)tisin[0T ] that hedges the contingentclaim with payoff exp(ST )

Exercise 612

a) Show that for every fixed value of S the function

d 7minusrarr h(S d) = SΦ(d+ |σ|

radicT)minusK eminusrTΦ(d)

reaches its maximum at dlowast(S) =log(SK) + (rminus σ22)T

|σ|radicT

b) By the differentiation rule

d

dSh(S dlowast(S)) =

parth

partS(S dlowast(S)) + dprimelowast(S)

parth

partd(S dlowast(S))

recover the value of the Black-Scholes Delta

Exercise 613 Compute the Black-Scholes Vega by differentiation of theBlack-Scholes function

gc(tx) = Bl(Kxσ rT minus t) = xΦ(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)

with respect to the volatility parameter σ knowing that

minus12(dminus(T minus t)

)2= minus1

2

(log(xK) + (rminus σ22)(T minus t)

|σ|radicT minus t

)2

= minus12(d+(T minus t)

)2+ (T minus t)r+ log x

K (638)

Exercise 614 Consider the backward induction relation (313) ie

v(tx) = (1minus plowastN )v (t+ 1x(1 + aN )) + plowastN v (t+ 1x(1 + bN ))

using the renormalizations rN = rTN and

aN = (1 + rN )(1minus |σ|radicTN)minus 1 bN = (1 + rN )(1 + |σ|

radicTN)minus 1

of Section 36 N gt 1 with

plowastN =rN minus aNbN minus aN

and plowastN =bN minus rNbN minus aN

a) Show that the Black-Scholes PDE (62) of Proposition 61 can be recoveredfrom the induction relation (313) when the number N of time steps tendsto infinity

237

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

b) Show that the expression of the Delta ξt =partgcpartx

(tSt) can be similarlyrecovered from the finite difference relation (319) ie

ξ(1)t (Stminus1) =

v (t (1 + bN )Stminus1)minus v (t (1 + aN )Stminus1)

Stminus1(bN minus aN )

as N tends to infinity

Problem 615 (Leung and Sircar (2015)) ProShares Ultra SampP500 andProShares UltraShort SampP500 are leveraged investment funds that seek dailyinvestment results before fees and expenses that correspond to β times (βx)the daily performance of the SampP500reg with respectively β = 2 for ProSharesUltra and β = minus2 for ProShares UltraShort Here leveraging with a factorβ 1 aims at multiplying the potential return of an investment by a factorβ The following 10 questions are interdependent and should be treated insequence

a) Consider a risky asset priced S0 = $4 at time t = 0 and taking twopossible values S1 = $5 and S1 = $2 at time t = 1 Compute the twopossible returns (in ) achieved when investing $4 in one share of the assetS and the expected return under the risk-neutral probability measureassuming that the risk-free interest rate is zero

b) Leveraging Still based on an initial $4 investment we decide to leverageby a factor β = 3 by borrowing another (β minus 1) times $4 = 2times $4 at ratezero to purchase a total of β = 3 shares of the asset S Compute thetwo returns (in ) possibly achieved in this case and the expected returnunder the risk-neutral probability measure assuming that the risk-freeinterest rate is zero

c) Denoting by Ft the ProShares value at time t how much should the fundinvest in the underlying asset priced St and how much $ should it borrowor save on the risk-free market at any time t in order to leverage with afactor β 1

d) Find the portfolio allocation (ξt ηt) for the fund value

Ft = ξtSt + ηtAt t isin R+

according to Question (c) where At = A0 ert is the riskless money marketaccount

e) We choose to model the SampP500 index St as the geometric Brownianmotion

dSt = rStdt+ σStdBt t isin R+

under the risk-neutral probability measure Plowast Find the stochastic dif-ferential equation satisfied by (Ft)tisinR+ under the self-financing conditiondFt = ξtdSt + ηtdAt

238

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

f) Is the discounted fund value ( eminusrtFt)tisinR+ a martingale under the risk-neutral probability measure Plowast

g) Find the relation between the fund value Ft and the index St by solvingthe stochastic differential equation obtained for Ft in Question (e) Forsimplicity we normalize F0 = Sβ0

h) Write the price at time t = 0 of the call option with payoff (FT minusK)+ onthe ProShares index using the Black-Scholes formula

i) Show that when β gt 0 the Delta at time t isin [0T ) of the call optionwith payoff (FT minusK)+ on ProShares Ultra is equal to the Delta of thecall option with payoff (ST minusKβ(t))

+ on the SampP500 for a certain strikeprice Kβ(t) to be determined explicitly

j) When β lt 0 find the relation between the Delta at time t isin [0T ) ofthe call option with payoff (FT minusK)+ on ProShares UltraShort and theDelta of the put option with payoff (Kβ(t)minus ST )+ on the SampP500

239

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

  1. pbsARFix223
  2. pbsARFix224
  3. pbsARFix225
  4. pbsARFix226
  5. pbsARFix227
  6. pbsARFix228
  7. pbsARFix229
  8. pbsARFix230
  9. fdrm1
  10. pbsARFix231
  11. 100
  12. 101
  13. 102
  14. 103
  15. 104
  16. 105
  17. 106
  18. 107
  19. 108
  20. 109
  21. 1010
  22. 1011
  23. 1012
  24. 1013
  25. 1014
  26. 1015
  27. 1016
  28. 1017
  29. 1018
  30. 1019
  31. anm10
  32. 10EndLeft
  33. 10StepLeft
  34. 10PauseLeft
  35. 10PlayLeft
  36. 10PlayPauseLeft
  37. 10PauseRight
  38. 10PlayRight
  39. 10PlayPauseRight
  40. 10StepRight
  41. 10EndRight
  42. 10Minus
  43. 10Reset
  44. 10Plus
  45. pbsARFix232
  46. pbsARFix233
  47. pbsARFix234
  48. pbsARFix235
  49. pbsARFix236
  50. pbsARFix237
  51. fdrm2
  52. 110
  53. 111
  54. 112
  55. 113
  56. 114
  57. 115
  58. 116
  59. 117
  60. 118
  61. 119
  62. 1110
  63. 1111
  64. 1112
  65. 1113
  66. 1114
  67. 1115
  68. 1116
  69. 1117
  70. 1118
  71. 1119
  72. anm11
  73. 11EndLeft
  74. 11StepLeft
  75. 11PauseLeft
  76. 11PlayLeft
  77. 11PlayPauseLeft
  78. 11PauseRight
  79. 11PlayRight
  80. 11PlayPauseRight
  81. 11StepRight
  82. 11EndRight
  83. 11Minus
  84. 11Reset
  85. 11Plus
  86. pbsARFix238
  87. pbsARFix239
  88. pbsARFix240
  89. pbsARFix241
  90. pbsARFix242
  91. 120
  92. 121
  93. 122
  94. 123
  95. 124
  96. 125
  97. 126
  98. 127
  99. 128
  100. 129
  101. 1210
  102. anm12
  103. 12EndLeft
  104. 12StepLeft
  105. 12PauseLeft
  106. 12PlayLeft
  107. 12PlayPauseLeft
  108. 12PauseRight
  109. 12PlayRight
  110. 12PlayPauseRight
  111. 12StepRight
  112. 12EndRight
  113. 12Minus
  114. 12Reset
  115. 12Plus
  116. 130
  117. 131
  118. 132
  119. 133
  120. 134
  121. 135
  122. 136
  123. 137
  124. 138
  125. 139
  126. 1310
  127. anm13
  128. 13EndLeft
  129. 13StepLeft
  130. 13PauseLeft
  131. 13PlayLeft
  132. 13PlayPauseLeft
  133. 13PauseRight
  134. 13PlayRight
  135. 13PlayPauseRight
  136. 13StepRight
  137. 13EndRight
  138. 13Minus
  139. 13Reset
  140. 13Plus
  141. pbsARFix243
  142. pbsARFix244
  143. pbsARFix245
  144. pbsARFix246
  145. 140
  146. 141
  147. 142
  148. 143
  149. 144
  150. 145
  151. 146
  152. 147
  153. 148
  154. 149
  155. 1410
  156. 1411
  157. 1412
  158. 1413
  159. 1414
  160. 1415
  161. 1416
  162. 1417
  163. 1418
  164. 1419
  165. 1420
  166. 1421
  167. 1422
  168. 1423
  169. 1424
  170. 1425
  171. 1426
  172. 1427
  173. 1428
  174. 1429
  175. 1430
  176. 1431
  177. 1432
  178. 1433
  179. 1434
  180. 1435
  181. 1436
  182. 1437
  183. 1438
  184. 1439
  185. 1440
  186. 1441
  187. 1442
  188. 1443
  189. 1444
  190. 1445
  191. 1446
  192. 1447
  193. 1448
  194. 1449
  195. 1450
  196. 1451
  197. 1452
  198. 1453
  199. 1454
  200. 1455
  201. 1456
  202. 1457
  203. 1458
  204. 1459
  205. 1460
  206. 1461
  207. 1462
  208. 1463
  209. 1464
  210. 1465
  211. 1466
  212. 1467
  213. 1468
  214. 1469
  215. 1470
  216. 1471
  217. 1472
  218. 1473
  219. 1474
  220. 1475
  221. 1476
  222. 1477
  223. 1478
  224. 1479
  225. 1480
  226. 1481
  227. 1482
  228. 1483
  229. 1484
  230. 1485
  231. 1486
  232. 1487
  233. 1488
  234. 1489
  235. 1490
  236. 1491
  237. 1492
  238. 1493
  239. 1494
  240. 1495
  241. 1496
  242. 1497
  243. 1498
  244. 1499
  245. 14100
  246. 14101
  247. 14102
  248. 14103
  249. 14104
  250. 14105
  251. 14106
  252. 14107
  253. 14108
  254. 14109
  255. 14110
  256. 14111
  257. 14112
  258. 14113
  259. 14114
  260. 14115
  261. 14116
  262. 14117
  263. 14118
  264. 14119
  265. 14120
  266. 14121
  267. 14122
  268. 14123
  269. 14124
  270. 14125
  271. 14126
  272. 14127
  273. 14128
  274. 14129
  275. 14130
  276. 14131
  277. 14132
  278. 14133
  279. 14134
  280. 14135
  281. 14136
  282. 14137
  283. 14138
  284. 14139
  285. 14140
  286. 14141
  287. 14142
  288. 14143
  289. 14144
  290. 14145
  291. 14146
  292. 14147
  293. 14148
  294. 14149
  295. 14150
  296. 14151
  297. 14152
  298. 14153
  299. 14154
  300. 14155
  301. 14156
  302. 14157
  303. 14158
  304. 14159
  305. 14160
  306. 14161
  307. 14162
  308. 14163
  309. 14164
  310. 14165
  311. 14166
  312. 14167
  313. 14168
  314. 14169
  315. 14170
  316. 14171
  317. 14172
  318. 14173
  319. 14174
  320. 14175
  321. 14176
  322. 14177
  323. 14178
  324. 14179
  325. 14180
  326. 14181
  327. 14182
  328. 14183
  329. 14184
  330. 14185
  331. 14186
  332. 14187
  333. 14188
  334. 14189
  335. 14190
  336. 14191
  337. 14192
  338. 14193
  339. 14194
  340. 14195
  341. 14196
  342. 14197
  343. anm14
  344. 14EndLeft
  345. 14StepLeft
  346. 14PauseLeft
  347. 14PlayLeft
  348. 14PlayPauseLeft
  349. 14PauseRight
  350. 14PlayRight
  351. 14PlayPauseRight
  352. 14StepRight
  353. 14EndRight
  354. 14Minus
  355. 14Reset
  356. 14Plus
  357. pbsARFix247
  358. pbsARFix248
  359. 150
  360. 151
  361. 152
  362. 153
  363. 154
  364. 155
  365. 156
  366. 157
  367. 158
  368. 159
  369. 1510
  370. 1511
  371. 1512
  372. 1513
  373. 1514
  374. 1515
  375. 1516
  376. 1517
  377. 1518
  378. 1519
  379. anm15
  380. 15EndLeft
  381. 15StepLeft
  382. 15PauseLeft
  383. 15PlayLeft
  384. 15PlayPauseLeft
  385. 15PauseRight
  386. 15PlayRight
  387. 15PlayPauseRight
  388. 15StepRight
  389. 15EndRight
  390. 15Minus
  391. 15Reset
  392. 15Plus
  393. pbsARFix249
  394. pbsARFix250
  395. pbsARFix251
  396. pbsARFix252
  397. pbsARFix253
  398. pbsARFix254
  399. pbsARFix255
  400. pbsARFix256
  401. pbsARFix257
  402. pbsARFix258
  403. pbsARFix259
  404. pbsARFix260
  405. pbsARFix261
Page 6: Black-ScholesPricingandHedging - NTU · to the Black-Scholes PDE (6.2) in order to price a claim payoff Cof the formC= h(S T).Asinthediscrete-timecase,thearbitragepriceπt(C) at

N Privault

f) Use the amountK = e(Tminust)r eminus(Tminust)rK to refund the lender of eminus(Tminust)rKborrowed at time t

Another way to compute the option premium Vt is to state that the amountVtminusSt has to be borrowed at time t in order to purchase the asset and thatthe asset price K received at maturity T should be used to refund the loanwhich yields

(Vt minus St) eminus(Tminust)r = K 0 6 t 6 T

Forward contracts can be used for physical delivery eg for live cattle In thecase of European options the basic ldquohedge and forgetrdquo constant strategy

ξt = 1 ηt = η0 0 6 t 6 T

will hedge the option only if

ST + η0AT gt (ST minusK)+

ie if minusη0AT 6 K 6 ST

Future contracts

For a future contract expiring at time T we take K = S0 erT and the contractis usually quoted at time t in terms of the forward price

e(Tminust)r(St minusK eminus(Tminust)r

)= e(Tminust)rSt minusK = e(Tminust)rSt minus S0 erT

discounted at time T or simply using e(Tminust)rSt Future contracts are non-deliverable forward contracts which are ldquomarked to marketrdquo at each timestep via a cash flow exchange between the two parties ensuring that theabsolute difference | e(Tminust)rSt minusK| is being credited to the buyerrsquos accountif e(Tminust)rSt gt K or to the sellerrsquos account if e(Tminust)rSt lt K

62 European Call Options

Recall that in the case of the European call option with strike price K thepayoff function is given by h(x) = (xminusK)+ and the Black-Scholes PDE (67)reads

rgc(tx) =partgcpartt

(tx) + rxpartgcpartx

(tx) + 12σ

2x2 part2gcpartx2 (tx)

gc(T x) = (xminusK)+(69)

The next proposition will be proved in Sections 65 and 66 see Proposi-tion 611

206

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

Proposition 63 The solution of the PDE (69) is given by the Black-Scholes formula for call options

gc(tx) = Bl(Kxσ rT minus t) = xΦ(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)

(610)with

d+(T minus t) =log(xK) + (r+ σ22)(T minus t)

|σ|radicT minus t

(611)

dminus(T minus t) =log(xK) + (rminus σ22)(T minus t)

|σ|radicT minus t

0 6 t lt T (612)

We note the relation

d+(T minus t) = dminus(T minus t) + |σ|radicT minus t 0 6 t lt T (613)

Here ldquologrdquo denotes the natural logarithm ldquolnrdquo and

Φ(x) = P(X 6 x) =1radic2π

w xminusinfin

eminusy22dy x isin R

denotes the standard Gaussian Cumulative Distribution Function (CDF) ofa standard normal random variable X N (0 1) with the relation

Φ(minusx) = 1minusΦ(x) x isin R (614)

0

02

04

06

08

1

12

-4 -3 -2 -1 0 1 2 3 4

Φ(x)

x

1Gaussian CDF Φ(x)

Fig 63 Graph of the Gaussian CDF

In other words the European call option with strike price K and maturityT is priced at time t isin [0T ] as

gc(tSt) = Bl(KStσ rT minus t)= StΦ

(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

) 0 6 t 6 T

207

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

The following R script is an implementation of the Black-Scholes formula forEuropean call options in Rlowast

1 BSCall lt- function(S K r T sigma)d1 lt- (log(SK)+(r+sigma^22)T)(sigmasqrt(T))

3 d2 lt- d1 - sigma sqrt(T)BSCall = Spnorm(d1) - Kexp(-rT)pnorm(d2)

5 BSCall

In comparison with the discrete-time Cox-Ross-Rubinstein (CRR) model ofSection 26 the interest in the formula (610) is to provide an analytical so-lution that can be evaluated in a single step which is computationally muchmore efficient

Fig 64 Graph of the Black-Scholes call price map with strike price K = 100dagger

Figure 64 presents an interactive graph of the Black-Scholes call price mapie the solution

(tx) 7minusrarr gc(tx) = xΦ(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)of the Black-Scholes PDE (67) for a call optionlowast Download the corresponding that can be run heredagger Right-click on the figure for interaction and ldquoFull Screen Multimediardquo view

208

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

(C) 2012--today Alexander Grahn 3Dmenujs version 20140923 3D JavaScript used by media9sty Extended functionality of the (right click) context menu of 3D annotations 1) Adds the following items to the 3D context menu `Generate Default View Finds good default camera settings returned as options for use with the includemedia command `Get Current View Determines camera cross section and part settings of the current view returned as `VIEW section that can be copied into a views file of additional views The views file is inserted using the `3Dviews option of includemedia `Cross Section Toggle switch to add or remove a cross section into or from the current view The cross section can be moved in the x y z directions using x y z and X Y Z keys on the keyboard be tilted against and spun around the upright Z axis using the UpDown and LeftRight arrow keys and caled using the s and S keys 2) Enables manipulation of position and orientation of indiviual parts and groups of parts in the 3D scene Parts which have been selected with the mouse can be scaled moved around and rotated like the cross section as described above To spin the parts around their local up-axis keep Control key pressed while using the UpDown and LeftRight arrow keys This work may be distributed andor modified under the conditions of the LaTeX Project Public License The latest version of this license is in httpmirrorsctanorgmacroslatexbaselppltxt This work has the LPPL maintenance status `maintained The Current Maintainer of this work is A Grahn The code borrows heavily from Bernd Gaertners `Miniball software originally written in C++ for computing the smallest enclosing ball of a set of points see httpwwwinfethzchpersonalgaertnerminiballhtmlhostconsoleshow()constructor for doubly linked listfunction List() thisfirst_node=null thislast_node=new Node(undefined)Listprototypepush_back=function(x) var new_node=new Node(x) if(thisfirst_node==null) thisfirst_node=new_node new_nodeprev=null else new_nodeprev=thislast_nodeprev new_nodeprevnext=new_node new_nodenext=thislast_node thislast_nodeprev=new_nodeListprototypemove_to_front=function(it) var node=itget() if(nodenext=null ampamp nodeprev=null) nodenextprev=nodeprev nodeprevnext=nodenext nodeprev=null nodenext=thisfirst_node thisfirst_nodeprev=node thisfirst_node=node Listprototypebegin=function() var i=new Iterator() itarget=thisfirst_node return(i)Listprototypeend=function() var i=new Iterator() itarget=thislast_node return(i)function Iterator(it) if( it=undefined ) thistarget=ittarget else thistarget=null Iteratorprototypeset=function(it)thistarget=ittargetIteratorprototypeget=function()return(thistarget)Iteratorprototypederef=function()return(thistargetdata)Iteratorprototypeincr=function() if(thistargetnext=null) thistarget=thistargetnextconstructor for node objects that populate the linked listfunction Node(x) thisprev=null thisnext=null thisdata=xfunction sqr(r)return(rr)helper functionMiniball algorithm by B Gaertnerfunction Basis() thism=0 thisq0=new Array(3) thisz=new Array(4) thisf=new Array(4) thisv=new Array(new Array(3) new Array(3) new Array(3) new Array(3)) thisa=new Array(new Array(3) new Array(3) new Array(3) new Array(3)) thisc=new Array(new Array(3) new Array(3) new Array(3) new Array(3)) thissqr_r=new Array(4) thiscurrent_c=thisc[0] thiscurrent_sqr_r=0 thisreset()Basisprototypecenter=function()return(thiscurrent_c)Basisprototypesize=function()return(thism)Basisprototypepop=function()--thismBasisprototypeexcess=function(p) var e=-thiscurrent_sqr_r for(var k=0klt3++k) e+=sqr(p[k]-thiscurrent_c[k]) return(e)Basisprototypereset=function() thism=0 for(var j=0jlt3++j) thisc[0][j]=0 thiscurrent_c=thisc[0] thiscurrent_sqr_r=-1Basisprototypepush=function(p) var i j var eps=1e-32 if(thism==0) for(i=0ilt3++i) thisq0[i]=p[i] for(i=0ilt3++i) thisc[0][i]=thisq0[i] thissqr_r[0]=0 else for(i=0ilt3++i) thisv[thism][i]=p[i]-thisq0[i] for(i=1iltthism++i) thisa[thism][i]=0 for(j=0jlt3++j) thisa[thism][i]+=thisv[i][j]thisv[thism][j] thisa[thism][i]=(2thisz[i]) for(i=1iltthism++i) for(j=0jlt3++j) thisv[thism][j]-=thisa[thism][i]thisv[i][j] thisz[thism]=0 for(j=0jlt3++j) thisz[thism]+=sqr(thisv[thism][j]) thisz[thism]=2 if(thisz[thism]ltepsthiscurrent_sqr_r) return(false) var e=-thissqr_r[thism-1] for(i=0ilt3++i) e+=sqr(p[i]-thisc[thism-1][i]) thisf[thism]=ethisz[thism] for(i=0ilt3++i) thisc[thism][i]=thisc[thism-1][i]+thisf[thism]thisv[thism][i] thissqr_r[thism]=thissqr_r[thism-1]+ethisf[thism]2 thiscurrent_c=thisc[thism] thiscurrent_sqr_r=thissqr_r[thism] ++thism return(true)function Miniball() thisL=new List() thisB=new Basis() thissupport_end=new Iterator()Miniballprototypemtf_mb=function(it) var i=new Iterator(it) thissupport_endset(thisLbegin()) if((thisBsize())==4) return for(var k=new Iterator(thisLbegin())kget()=iget()) var j=new Iterator(k) kincr() if(thisBexcess(jderef()) gt 0) if(thisBpush(jderef())) thismtf_mb(j) thisBpop() if(thissupport_endget()==jget()) thissupport_endincr() thisLmove_to_front(j) Miniballprototypecheck_in=function(b) thisLpush_back(b)Miniballprototypebuild=function() thisBreset() thissupport_endset(thisLbegin()) thismtf_mb(thisLend())Miniballprototypecenter=function() return(thisBcenter())Miniballprototyperadius=function() return(Mathsqrt(thisBcurrent_sqr_r))functions called by menu itemsfunction calc3Dopts () create Miniball object var mb=new Miniball() auxiliary vector var corner=new Vector3() iterate over all visible mesh nodes in the scene for(i=0iltscenemeshescounti++) var mesh=scenemeshesgetByIndex(i) if(meshvisible) continue local to parent transformation matrix var trans=meshtransform build local to world transformation matrix by recursively multiplying the parents transf matrix on the right var parent=meshparent while(parenttransform) trans=transmultiply(parenttransform) parent=parentparent get the bbox of the mesh (local coordinates) var bbox=meshcomputeBoundingBox() transform the local bounding box corner coordinates to world coordinates for bounding sphere determination BBoxmin cornerset(bboxmin) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) BBoxmax cornerset(bboxmax) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) remaining six BBox corners cornerset(bboxminx bboxmaxy bboxmaxz) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) cornerset(bboxminx bboxminy bboxmaxz) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) cornerset(bboxminx bboxmaxy bboxminz) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) cornerset(bboxmaxx bboxminy bboxminz) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) cornerset(bboxmaxx bboxminy bboxmaxz) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) cornerset(bboxmaxx bboxmaxy bboxminz) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) compute the smallest enclosing bounding sphere mbbuild() current camera settings var camera=scenecamerasgetByIndex(0) var res= initialize result string aperture angle of the virtual camera (perspective projection) or orthographic scale (orthographic projection) if(cameraprojectionType==cameraTYPE_PERSPECTIVE) var aac=camerafov180MathPI if(hostutilprintf(4f aac)=30) res+=hostutilprintf(n3Daac=s aac) else cameraviewPlaneSize=2mbradius() res+=hostutilprintf(n3Dortho=s 1cameraviewPlaneSize) camera roll var roll = cameraroll180MathPI if(hostutilprintf(4f roll)=0) res+=hostutilprintf(n3Droll=sroll) target to camera vector var c2c=new Vector3() c2cset(cameraposition) c2csubtractInPlace(cameratargetPosition) c2cnormalize() if((c2cx==0 ampamp c2cy==-1 ampamp c2cz==0)) res+=hostutilprintf(n3Dc2c=s s s c2cx c2cy c2cz) new camera settings bounding sphere centre --gt new camera target var coo=new Vector3() cooset((mbcenter())[0] (mbcenter())[1] (mbcenter())[2]) if(coolength) res+=hostutilprintf(n3Dcoo=s s s coox cooy cooz) radius of orbit if(cameraprojectionType==cameraTYPE_PERSPECTIVE) var roo=mbradius() Mathsin(aac MathPI 360) else orthographic projection var roo=mbradius() res+=hostutilprintf(n3Droo=s roo) update camera settings in the viewer var currol=cameraroll cameratargetPositionset(coo) camerapositionset(cooadd(c2cscale(roo))) cameraroll=currol determine background colour rgb=scenebackgroundgetColor() if((rgbr==1 ampamp rgbg==1 ampamp rgbb==1)) res+=hostutilprintf(n3Dbg=s s s rgbr rgbg rgbb) determine lighting scheme switch(scenelightScheme) case sceneLIGHT_MODE_FILE curlights=Artworkbreak case sceneLIGHT_MODE_NONE curlights=Nonebreak case sceneLIGHT_MODE_WHITE curlights=Whitebreak case sceneLIGHT_MODE_DAY curlights=Daybreak case sceneLIGHT_MODE_NIGHT curlights=Nightbreak case sceneLIGHT_MODE_BRIGHT curlights=Hardbreak case sceneLIGHT_MODE_RGB curlights=Primarybreak case sceneLIGHT_MODE_BLUE curlights=Bluebreak case sceneLIGHT_MODE_RED curlights=Redbreak case sceneLIGHT_MODE_CUBE curlights=Cubebreak case sceneLIGHT_MODE_CAD curlights=CADbreak case sceneLIGHT_MODE_HEADLAMP curlights=Headlampbreak if(curlights=Artwork) res+=hostutilprintf(n3Dlights=s curlights) determine global render mode switch(scenerenderMode) case sceneRENDER_MODE_BOUNDING_BOX currender=BoundingBoxbreak case sceneRENDER_MODE_TRANSPARENT_BOUNDING_BOX currender=TransparentBoundingBoxbreak case sceneRENDER_MODE_TRANSPARENT_BOUNDING_BOX_OUTLINE currender=TransparentBoundingBoxOutlinebreak case sceneRENDER_MODE_VERTICES currender=Verticesbreak case sceneRENDER_MODE_SHADED_VERTICES currender=ShadedVerticesbreak case sceneRENDER_MODE_WIREFRAME currender=Wireframebreak case sceneRENDER_MODE_SHADED_WIREFRAME currender=ShadedWireframebreak case sceneRENDER_MODE_SOLID currender=Solidbreak case sceneRENDER_MODE_TRANSPARENT currender=Transparentbreak case sceneRENDER_MODE_SOLID_WIREFRAME currender=SolidWireframebreak case sceneRENDER_MODE_TRANSPARENT_WIREFRAME currender=TransparentWireframebreak case sceneRENDER_MODE_ILLUSTRATION currender=Illustrationbreak case sceneRENDER_MODE_SOLID_OUTLINE currender=SolidOutlinebreak case sceneRENDER_MODE_SHADED_ILLUSTRATION currender=ShadedIllustrationbreak case sceneRENDER_MODE_HIDDEN_WIREFRAME currender=HiddenWireframebreak if(currender=Solid) res+=hostutilprintf(n3Drender=s currender) write result string to the console hostconsoleshow() hostconsoleclear() hostconsoleprintln(n Copy and paste the following text to then+ option list of includemedian + res + n)function get3Dview () var camera=scenecamerasgetByIndex(0) var coo=cameratargetPosition var c2c=camerapositionsubtract(coo) var roo=c2clength c2cnormalize() var res=VIEW=insert optional name heren if((coox==0 ampamp cooy==0 ampamp cooz==0)) res+=hostutilprintf( COO=s s sn coox cooy cooz) if((c2cx==0 ampamp c2cy==-1 ampamp c2cz==0)) res+=hostutilprintf( C2C=s s sn c2cx c2cy c2cz) if(roo gt 1e-9) res+=hostutilprintf( ROO=sn roo) var roll = cameraroll180MathPI if(hostutilprintf(4f roll)=0) res+=hostutilprintf( ROLL=sn roll) if(cameraprojectionType==cameraTYPE_PERSPECTIVE) var aac=camerafov 180MathPI if(hostutilprintf(4f aac)=30) res+=hostutilprintf( AAC=sn aac) else if(hostutilprintf(4f cameraviewPlaneSize)=1) res+=hostutilprintf( ORTHO=sn 1cameraviewPlaneSize) rgb=scenebackgroundgetColor() if((rgbr==1 ampamp rgbg==1 ampamp rgbb==1)) res+=hostutilprintf( BGCOLOR=s s sn rgbr rgbg rgbb) switch(scenelightScheme) case sceneLIGHT_MODE_FILE curlights=Artworkbreak case sceneLIGHT_MODE_NONE curlights=Nonebreak case sceneLIGHT_MODE_WHITE curlights=Whitebreak case sceneLIGHT_MODE_DAY curlights=Daybreak case sceneLIGHT_MODE_NIGHT curlights=Nightbreak case sceneLIGHT_MODE_BRIGHT curlights=Hardbreak case sceneLIGHT_MODE_RGB curlights=Primarybreak case sceneLIGHT_MODE_BLUE curlights=Bluebreak case sceneLIGHT_MODE_RED curlights=Redbreak case sceneLIGHT_MODE_CUBE curlights=Cubebreak case sceneLIGHT_MODE_CAD curlights=CADbreak case sceneLIGHT_MODE_HEADLAMP curlights=Headlampbreak if(curlights=Artwork) res+= LIGHTS=+curlights+n switch(scenerenderMode) case sceneRENDER_MODE_BOUNDING_BOX defaultrender=BoundingBoxbreak case sceneRENDER_MODE_TRANSPARENT_BOUNDING_BOX defaultrender=TransparentBoundingBoxbreak case sceneRENDER_MODE_TRANSPARENT_BOUNDING_BOX_OUTLINE defaultrender=TransparentBoundingBoxOutlinebreak case sceneRENDER_MODE_VERTICES defaultrender=Verticesbreak case sceneRENDER_MODE_SHADED_VERTICES defaultrender=ShadedVerticesbreak case sceneRENDER_MODE_WIREFRAME defaultrender=Wireframebreak case sceneRENDER_MODE_SHADED_WIREFRAME defaultrender=ShadedWireframebreak case sceneRENDER_MODE_SOLID defaultrender=Solidbreak case sceneRENDER_MODE_TRANSPARENT defaultrender=Transparentbreak case sceneRENDER_MODE_SOLID_WIREFRAME defaultrender=SolidWireframebreak case sceneRENDER_MODE_TRANSPARENT_WIREFRAME defaultrender=TransparentWireframebreak case sceneRENDER_MODE_ILLUSTRATION defaultrender=Illustrationbreak case sceneRENDER_MODE_SOLID_OUTLINE defaultrender=SolidOutlinebreak case sceneRENDER_MODE_SHADED_ILLUSTRATION defaultrender=ShadedIllustrationbreak case sceneRENDER_MODE_HIDDEN_WIREFRAME defaultrender=HiddenWireframebreak if(defaultrender=Solid) res+= RENDERMODE=+defaultrender+n detect existing Clipping Plane (3D Cross Section) var clip=null if( clip=scenenodesgetByName($$$$$$)|| clip=scenenodesgetByName(Clipping Plane) ) for(var i=0iltscenenodescounti++) var nd=scenenodesgetByIndex(i) if(nd==clip||ndname==) continue var ndUTFName= for (var j=0 jltndnamelength j++) var theUnicode = ndnamecharCodeAt(j)toString(16) while (theUnicodelengthlt4) theUnicode = 0 + theUnicode ndUTFName += theUnicode var end=ndnamelastIndexOf() if(endgt0) var ndUserName=ndnamesubstr(0end) else var ndUserName=ndname respart= PART=+ndUserName+n respart+= UTF16NAME=+ndUTFName+n defaultvals=true if(ndvisible) respart+= VISIBLE=falsen defaultvals=false if(ndopacitylt10) respart+= OPACITY=+ndopacity+n defaultvals=false if(ndconstructorname==Mesh) currender=defaultrender switch(ndrenderMode) case sceneRENDER_MODE_BOUNDING_BOX currender=BoundingBoxbreak case sceneRENDER_MODE_TRANSPARENT_BOUNDING_BOX currender=TransparentBoundingBoxbreak case sceneRENDER_MODE_TRANSPARENT_BOUNDING_BOX_OUTLINE currender=TransparentBoundingBoxOutlinebreak case sceneRENDER_MODE_VERTICES currender=Verticesbreak case sceneRENDER_MODE_SHADED_VERTICES currender=ShadedVerticesbreak case sceneRENDER_MODE_WIREFRAME currender=Wireframebreak case sceneRENDER_MODE_SHADED_WIREFRAME currender=ShadedWireframebreak case sceneRENDER_MODE_SOLID currender=Solidbreak case sceneRENDER_MODE_TRANSPARENT currender=Transparentbreak case sceneRENDER_MODE_SOLID_WIREFRAME currender=SolidWireframebreak case sceneRENDER_MODE_TRANSPARENT_WIREFRAME currender=TransparentWireframebreak case sceneRENDER_MODE_ILLUSTRATION currender=Illustrationbreak case sceneRENDER_MODE_SOLID_OUTLINE currender=SolidOutlinebreak case sceneRENDER_MODE_SHADED_ILLUSTRATION currender=ShadedIllustrationbreak case sceneRENDER_MODE_HIDDEN_WIREFRAME currender=HiddenWireframebreak case sceneRENDER_MODE_DEFAULT currender=Defaultbreak if(currender=defaultrender) respart+= RENDERMODE=+currender+n defaultvals=false if(origtrans[ndname]ampampndtransformisEqual(origtrans[ndname])) var lvec=ndtransformtransformDirection(new Vector3(100)) var uvec=ndtransformtransformDirection(new Vector3(010)) var vvec=ndtransformtransformDirection(new Vector3(001)) respart+= TRANSFORM= +lvecx+ +lvecy+ +lvecz+ +uvecx+ +uvecy+ +uvecz+ +vvecx+ +vvecy+ +vvecz+ +ndtransformtranslationx+ +ndtransformtranslationy+ +ndtransformtranslationz+n defaultvals=false respart+= ENDn if(defaultvals) res+=respart if(clip) var centre=cliptransformtranslation var normal=cliptransformtransformDirection(new Vector3(001)) res+= CROSSSECTn if((centrex==0 ampamp centrey==0 ampamp centrez==0)) res+=hostutilprintf( CENTER=s s sn centrex centrey centrez) if((normalx==1 ampamp normaly==0 ampamp normalz==0)) res+=hostutilprintf( NORMAL=s s sn normalx normaly normalz) res+=hostutilprintf( VISIBLE=sn clipvisible) res+=hostutilprintf( PLANECOLOR=s s sn clipmaterialemissiveColorr clipmaterialemissiveColorg clipmaterialemissiveColorb) res+=hostutilprintf( OPACITY=sn clipopacity) res+=hostutilprintf( INTERSECTIONCOLOR=s s sn clipwireframeColorr clipwireframeColorg clipwireframeColorb) res+= ENDn for(var propt in clip) consoleprintln(propt++clip[propt]) res+=ENDn hostconsoleshow() hostconsoleclear() hostconsoleprintln(n Add the following VIEW section to a file ofn+ predefined views (See option 3Dviews)nn + The view may be given a name after VIEW=n + (Remove in front of =)n) hostconsoleprintln(res + n)add items to 3D context menuruntimeaddCustomMenuItem(dfltview Generate Default View default 0)runtimeaddCustomMenuItem(currview Get Current View default 0)runtimeaddCustomMenuItem(csection Cross Section checked 0)menu event handlersmenuEventHandler = new MenuEventHandler()menuEventHandleronEvent = function(e) switch(emenuItemName) case dfltview calc3Dopts() break case currview get3Dview() break case csection addremoveClipPlane(emenuItemChecked) break runtimeaddEventHandler(menuEventHandler)global variable taking reference to currently selected nodevar target=nullselectionEventHandler=new SelectionEventHandler()selectionEventHandleronEvent=function(e) if(eselectedampampenodename=) target=enode else target=null runtimeaddEventHandler(selectionEventHandler)cameraEventHandler=new CameraEventHandler()cameraEventHandleronEvent=function(e) var clip=null runtimeremoveCustomMenuItem(csection) runtimeaddCustomMenuItem(csection Cross Section checked 0) if(clip=scenenodesgetByName($$$$$$)|| predefined scenenodesgetByName(Clipping Plane)) added via context menu runtimeremoveCustomMenuItem(csection) runtimeaddCustomMenuItem(csection Cross Section checked 1) if(clip)plane in predefined views must be rotated by 90 deg around normal cliptransformrotateAboutLineInPlace( MathPI2cliptransformtranslation cliptransformtransformDirection(new Vector3(001)) ) for(var i=0 iltrot4x4length i++)rot4x4[i]setIdentity() target=nullruntimeaddEventHandler(cameraEventHandler)var rot4x4=new Array() keeps track of spin and tilt axes transformationskey event handler for scaling moving spinning and tilting objectskeyEventHandler=new KeyEventHandler()keyEventHandleronEvent=function(e) var backtrans=new Matrix4x4() var trgt=null if(target) trgt=target var backtrans=new Matrix4x4() var trans=trgttransform var parent=trgtparent while(parenttransform) build local to world transformation matrix transmultiplyInPlace(parenttransform) also build world to local back-transformation matrix backtransmultiplyInPlace(parenttransforminversetranspose) parent=parentparent backtranstransposeInPlace() else if( trgt=scenenodesgetByName($$$$$$)|| trgt=scenenodesgetByName(Clipping Plane) ) var trans=trgttransform if(trgt) return var tname=trgtname if(typeof(rot4x4[tname])==undefined) rot4x4[tname]=new Matrix4x4() if(target) var tiltAxis=rot4x4[tname]transformDirection(new Vector3(010)) else var tiltAxis=transtransformDirection(new Vector3(010)) var spinAxis=rot4x4[tname]transformDirection(new Vector3(001)) get the centre of the mesh if(targetampamptrgtconstructorname==Mesh) var centre=transtransformPosition(trgtcomputeBoundingBox()center) else part group (Node3 parent node clipping plane) var centre=new Vector3(transtranslation) switch(echaracterCode) case 30tilt up rot4x4[tname]rotateAboutLineInPlace( -MathPI900rot4x4[tname]translationtiltAxis) transrotateAboutLineInPlace(-MathPI900centretiltAxis) break case 31tilt down rot4x4[tname]rotateAboutLineInPlace( MathPI900rot4x4[tname]translationtiltAxis) transrotateAboutLineInPlace(MathPI900centretiltAxis) break case 28spin right if(ectrlKeyDownampamptarget) transrotateAboutLineInPlace(-MathPI900centrespinAxis) else rot4x4[tname]rotateAboutLineInPlace( -MathPI900rot4x4[tname]translationnew Vector3(001)) transrotateAboutLineInPlace(-MathPI900centrenew Vector3(001)) break case 29spin left if(ectrlKeyDownampamptarget) transrotateAboutLineInPlace(MathPI900centrespinAxis) else rot4x4[tname]rotateAboutLineInPlace( MathPI900rot4x4[tname]translationnew Vector3(001)) transrotateAboutLineInPlace(MathPI900centrenew Vector3(001)) break case 120 x translateTarget(trans new Vector3(100) e) break case 121 y translateTarget(trans new Vector3(010) e) break case 122 z translateTarget(trans new Vector3(001) e) break case 88 shift + x translateTarget(trans new Vector3(-100) e) break case 89 shift + y translateTarget(trans new Vector3(0-10) e) break case 90 shift + z translateTarget(trans new Vector3(00-1) e) break case 115 s transtranslateInPlace(centrescale(-1)) transscaleInPlace(101) transtranslateInPlace(centrescale(1)) break case 83 shift + s transtranslateInPlace(centrescale(-1)) transscaleInPlace(1101) transtranslateInPlace(centrescale(1)) break transmultiplyInPlace(backtrans)runtimeaddEventHandler(keyEventHandler)translates object by amount calculated from Canvas sizefunction translateTarget(t d e) var cam=scenecamerasgetByIndex(0) if(camprojectionType==camTYPE_PERSPECTIVE) var scale=Mathtan(camfov2) camtargetPositionsubtract(camposition)length Mathmin(ecanvasPixelWidthecanvasPixelHeight) else var scale=camviewPlaneSize2 Mathmin(ecanvasPixelWidthecanvasPixelHeight) ttranslateInPlace(dscale(scale))function addremoveClipPlane(chk) var curTrans=getCurTrans() var clip=scenecreateClippingPlane() if(chk) add Clipping Plane and place its center either into the camera target position or into the centre of the currently selected mesh node var centre=new Vector3() if(target) var trans=targettransform var parent=targetparent while(parenttransform) trans=transmultiply(parenttransform) parent=parentparent if(targetconstructorname==Mesh) var centre=transtransformPosition(targetcomputeBoundingBox()center) else var centre=new Vector3(transtranslation) target=null else centreset(scenecamerasgetByIndex(0)targetPosition) cliptransformsetView( new Vector3(000) new Vector3(100) new Vector3(010)) cliptransformtranslateInPlace(centre) else if( scenenodesgetByName($$$$$$)|| scenenodesgetByName(Clipping Plane) ) clipremove()clip=null restoreTrans(curTrans) return clipfunction to store current transformation matrix of all nodes in the scenefunction getCurTrans() var tA=new Array() for(var i=0 iltscenenodescount i++) var nd=scenenodesgetByIndex(i) if(ndname==) continue tA[ndname]=new Matrix4x4(ndtransform) return tAfunction to restore transformation matrices given as argfunction restoreTrans(tA) for(var i=0 iltscenenodescount i++) var nd=scenenodesgetByIndex(i) if(tA[ndname]) ndtransformset(tA[ndname]) store original transformation matrix of all mesh nodes in the scenevar origtrans=getCurTrans()set initial state of Cross Section menu entrycameraEventHandleronEvent(1)hostconsoleclear()

var ocgs=hostgetOCGs(hostpageNum)for(var i=0iltocgslengthi++)if(ocgs[i]name==MediaPlayButton1)ocgs[i]state=false

(C) 2012 Michail Vidiassov John C Bowman Alexander Grahn asylabelsjs version 20120912 3D JavaScript to be used with media9sty (option `add3Djscript) for Asymptote generated PRC files adds billboard behaviour to text labels in Asymptote PRC files so that they always face the camera under 3D rotation This work may be distributed andor modified under the conditions of the LaTeX Project Public License The latest version of this license is in httpmirrorsctanorgmacroslatexbaselppltxt This work has the LPPL maintenance status `maintained The Current Maintainer of this work is A Grahnvar bbnodes=new Array() billboard meshesvar bbtrans=new Array() billboard transformsfunction fulltransform(mesh) var t=new Matrix4x4(meshtransform) if(meshparentname = ) var parentTransform=fulltransform(meshparent) tmultiplyInPlace(parentTransform) return t else return t find all text labels in the scene and determine pivoting pointsvar nodes=scenenodesvar nodescount=nodescountvar third=1030for(var i=0 i lt nodescount i++) var node=nodesgetByIndex(i) var name=nodename var end=namelastIndexOf()-1 if(end gt 0) if(namecharAt(end) == 001) var start=namelastIndexOf(-)+1 if(end gt start) nodename=namesubstr(0start-1) var nodeMatrix=fulltransform(nodeparent) var c=nodeMatrixtranslation position var d=Mathpow(Mathabs(nodeMatrixdeterminant)third) scale bbnodespush(node) bbtranspush(Matrix4x4()scale(ddd)translate(c)multiply(nodeMatrixinverse)) var camera=scenecamerasgetByIndex(0) var zero=new Vector3(000)var bbcount=bbnodeslength event handler to maintain camera-facing text labelsbillboardHandler=new RenderEventHandler()billboardHandleronEvent=function(event) var T=new Matrix4x4() TsetView(zerocamerapositionsubtract(cameratargetPosition) cameraupsubtract(cameraposition)) for(var j=0 j lt bbcount j++) bbnodes[j]transformset(Tmultiply(bbtrans[j])) runtimerefresh() runtimeaddEventHandler(billboardHandler)runtimerefresh()

(C) 2012 Alexander Grahn 3Dspintooljs version 20120301 3D JavaScript to be used with media9sty (option `add3Djscript) enables the Spin tool (also accessible via 3D toolbar or context menu) upon activation of the 3D scene the scene then rotates around the upright axis while dragging with the mouse This work may be distributed andor modified under the conditions of the LaTeX Project Public License The latest version of this license is in httpmirrorsctanorgmacroslatexbaselppltxt This work has the LPPL maintenance status `maintained The Current Maintainer of this work is A GrahnruntimesetCurrentTool(runtimeTOOL_NAME_SPIN)

cells [ cell_type code execution_count null metadata outputs [] source [ from IPythoncoredisplay import display HTMLn display(HTML( )) ] cell_type code execution_count null metadata collapsed true outputs [] source [ import numpy as npn import scipystats as ssn import time n n Black and Scholesn def d1(S0 K r sigma T)n return (nplog(S0K) + (r + sigma2 2) T)(sigma npsqrt(T))n n def d2(S0 K r sigma T)n return (nplog(S0 K) + (r - sigma2 2) T) (sigma npsqrt(T))n n def BlackScholes(typeS0 K r sigma T)n if type==Cn return S0 ssnormcdf(d1(S0 K r sigma T)) - K npexp(-r T) ssnormcdf(d2(S0 K r sigma T))n elsen return K npexp(-r T) ssnormcdf(-d2(S0 K r sigma T)) - S0 ssnormcdf(-d1(S0 K r sigma T)) ] cell_type code execution_count null metadata outputs [] source [ BlackScholes(C100 120 002 02 10) ] ] metadata anaconda-cloud kernelspec display_name Python 3 language python name python3 language_info codemirror_mode name ipython version 3 file_extension py mimetype textx-python name python nbconvert_exporter python pygments_lexer ipython3 version 375rc1 nbformat 4 nbformat_minor 1

Black-Scholes Pricing and Hedging

Fig 65 Time-dependent solution of the Black-Scholes PDE (call option)lowast

The next proposition is proved by a direct differentiation of the Black-Scholesfunction and will be recovered later using a probabilistic argument in Propo-sition 714 below

Proposition 64 The Black-Scholes Delta of the European call option isgiven by

ξt = ξt(St) =partgcpartx

(tSt) = Φ(d+(T minus t)

)isin [0 1] (615)

where d+(T minus t) is given by (611)

Proof From Relation (613) we note that the standard normal probabilitydensity function

ϕ(x) = Φprime(x) =1radic2π

eminusx22 x isin R

satisfies

ϕ(d+(T minus t)) = ϕ

(log(xK) + (r+ σ22)(T minus t)

|σ|radicT minus t

)=

1radic2π

exp(minus1

2

(log(xK) + (r+ σ22)(T minus t)

|σ|radicT minus t

)2)

=1radic2π

exp(minus1

2

(log(xK) + (rminus σ22)(T minus t)

|σ|radicT minus t

+ |σ|radicT minus t

)2)

=1radic2π

exp(minus1

2 (dminus(T minus t))2 minus (T minus t)rminus log x

K

)=

K

xradic

2πeminus(Tminust)r exp

(minus1

2 (dminus(T minus t))2)

lowast The animation works in Acrobat Reader on the entire pdf file

209

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

=K

xeminus(Tminust)rϕ(dminus(T minus t))

hence by (610) we have

partgcpartx

(tx) = part

partx

(xΦ(

log(xK) + (r+ σ22)(T minus t)|σ|radicT minus t

))(616)

minusK eminus(Tminust)r partpartx

(Φ(

log(xK) + (rminus σ22)(T minus t)|σ|radicT minus t

))= Φ

(log(xK) + (r+ σ22)(T minus t)

|σ|radicT minus t

)+x

part

partxΦ(

log(xK) + (r+ σ22)(T minus t)|σ|radicT minus t

)minusK eminus(Tminust)r part

partxΦ(

log(xK) + (rminus σ22)(T minus t)|σ|radicT minus t

)= Φ

(log(xK) + (r+ σ22)(T minus t)

|σ|radicT minus t

)+

x

|σ|radicT minus t

ϕ

(log(xK) + (r+ σ22)(T minus t)

|σ|radicT minus t

)minusK eminus(Tminust)r

|σ|radicT minus t

ϕ

(log(xK) + (rminus σ22)(T minus t)

|σ|radicT minus t

)= Φ(d+(T minus t)) +

x

|σ|radicT minus t

ϕ(d+(T minus t))minusK eminus(Tminust)r

|σ|radicT minus t

ϕ(dminus(T minus t))

= Φ(d+(T minus t))

As a consequence of Proposition 64 the Black-Scholes call price splits into arisky component StΦ

(d+(T minus t)

)and a riskless componentminusK eminus(Tminust)rΦ

(dminus(T minus

t)) as follows

gc(tSt) = StΦ(d+(T minus t)

)︸ ︷︷ ︸risky investment (held)

minus K eminus(Tminust)rΦ(dminus(T minus t)

)︸ ︷︷ ︸

riskminusfree investment (borrowed)

0 6 t 6 T

See Exercise 64 for a computation of the boundary values of gc(tx) t isin[0T ) x gt 0 The following R script is an implementation of the Black-ScholesDelta for European call options in R

1 Delta lt- function(S K r T sigma)d1 lt- (log(SK)+(r+sigma^22)T)(sigmasqrt(T))

3 Delta = pnorm(d1)Delta

210

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

In Figure 66 we plot the Delta of the European call option as a function ofthe underlying asset price and of the time remaining until maturity

Payoff function (x-K)+

0

50

100

150

200

Underlying

0

5

10

15

Time to maturity T-t

0

025

05

075

1

Fig 66 Delta of a European call option with strike price K = 100 r = 3 σ = 10

The Gamma of the European call option is defined as the first derivative ofDelta or second derivative of the option price with respect to the underlyingasset price This gives

γt =1

St|σ|radicT minus t

Φprime(d+(T minus t)

)=

1St|σ|

radic2(T minus t)π

exp(minus1

2

(log(StK) + (r+ σ22)(T minus t)

|σ|radicT minus t

)2)gt 0

In particular a positive value of γt implies that the Delta ξt = ξt(St) shouldincrease when the underlying asset price St increases In other words the po-sition ξt in the underlying asset should be increased by additional purchasesif the underlying asset price St increases

In Figure 67 we plot the (truncated) value of the Gamma of a European calloption as a function of the underlying asset price and of time to maturity

211

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

Fig 67 Gamma of a European call option with strike price K = 100

As Gamma is always nonnegative the Black-Scholes hedging strategy is tokeep buying the risky underlying asset when its price increases and to sell itwhen its price decreases as can be checked from Figure 67

Numerical example - hedging of a call option

In Figure 68 we consider the historical stock price of HSBC Holdings(0005HK) over one year

Fig 68 Graph of the stock price of HSBC Holdings

Consider the call option issued by Societe Generale on 31 December 2008 withstrike price K=$63704 maturity T = October 05 2009 and an entitlementratio of 100 meaning that one option contract is divided into 100 warrants cfpage 9 The next graph gives the time evolution of the Black-Scholes portfoliovalue

t 7minusrarr gc(tSt)

driven by the market price t 7minusrarr St of the risky underlying asset as given inFigure 68 in which the number of days is counted from the origin and notfrom maturity

212

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

40 50 60 70 80 90 0 50 100 150 200

0

5

10

15

20

25

30

35

40

Underlying (HK$) Time in days

Fig 69 Path of the Black-Scholes price for a call option on HSBC

As a consequence of Proposition 64 in the Black-Scholes call option hedgingmodel the amount invested in the risky asset is

Stξt = StΦ(d+(T minus t)

)= StΦ

(log(StK) + (r+ σ22)(T minus t)

|σ|radicT minus t

)gt 0

which is always nonnegative ie there is no short selling and the amountinvested on the riskless asset is

ηtAt = minusK eminus(Tminust)rΦ(dminus(T minus t)

)= minusK eminus(Tminust)rΦ

(log(StK) + (rminus σ22)(T minus t)

|σ|radicT minus t

)6 0

which is always nonpositive ie we are constantly borrowing money on theriskless asset as noted in Figure 610

-60

-40

-20

0

20

40

60

80

100

0 50 100 150 200

K

HK$

Black-Scholes priceRisky investment ξtSt

Riskless investment ηtAtUnderlying asset price

Fig 610 Time evolution of a hedging portfolio for a call option on HSBC

213

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

A comparison of Figure 610 with market data can be found in Figures 911and 912 below

Cash settlement In the case of a cash settlement the option issuer will sat-isfy the option contract by selling ξT = 1 stock at the price ST = $83refund the K = $63 risk-free investment and hand in the remaining amountC = (ST minusK)+ = 83minus 63 = $20 to the option holder

Physical delivery In the case of physical delivery of the underlying asset theoption issuer will deliver ξT = 1 stock to the option holder in exchange forK = $63 which will be used together with the portfolio value to refund therisk-free loan

63 European Put Options

Similarly in the case of the European put option with strike price K thepayoff function is given by h(x) = (Kminusx)+ and the Black-Scholes PDE (67)reads

rgp(tx) =partgppartt

(tx) + rxpartgppartx

(tx) + 12σ

2x2 part2gppartx2 (tx)

gp(T x) = (K minus x)+(617)

The next proposition can be proved as in Sections 65 and 66 see Proposi-tion 611

Proposition 65 The solution of the PDE (617) is given by the Black-Scholes formula for put options

gp(tx) = K eminus(Tminust)rΦ(minus dminus(T minus t)

)minus xΦ

(minus d+(T minus t)

) (618)

withd+(T minus t) =

log(xK) + (r+ σ22)(T minus t)|σ|radicT minus t

(619)

dminus(T minus t) =log(xK) + (rminus σ22)(T minus t)

|σ|radicT minus t

(620)

as illustrated in Figure 611

214

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

Fig 611 Graph of the Black-Scholes put price function with strike price K = 100lowast

In other words the European put option with strike price K and maturityT is priced at time t isin [0T ] as

gp(tSt) = K eminus(Tminust)rΦ(minus dminus(T minus t)

)minus StΦ

(minus d+(T minus t)

) 0 6 t 6 T

Fig 612 Time-dependent solution of the Black-Scholes PDE (put option)dagger

The following R script is an implementation of the Black-Scholes formula forEuropean put options in R

1 BSPut lt- function(S K r T sigma)d1 = (log(SK)+(r+sigma^22)T)(sigmasqrt(T))

3 d2 = d1 - sigma sqrt(T)BSPut = Kexp(-rT) pnorm(-d2) - Spnorm(-d1)

5 BSPut

Call-put parity

lowast Right-click on the figure for interaction and ldquoFull Screen Multimediardquo viewdagger The animation works in Acrobat Reader on the entire pdf file

215

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

(C) 2012--today Alexander Grahn 3Dmenujs version 20140923 3D JavaScript used by media9sty Extended functionality of the (right click) context menu of 3D annotations 1) Adds the following items to the 3D context menu `Generate Default View Finds good default camera settings returned as options for use with the includemedia command `Get Current View Determines camera cross section and part settings of the current view returned as `VIEW section that can be copied into a views file of additional views The views file is inserted using the `3Dviews option of includemedia `Cross Section Toggle switch to add or remove a cross section into or from the current view The cross section can be moved in the x y z directions using x y z and X Y Z keys on the keyboard be tilted against and spun around the upright Z axis using the UpDown and LeftRight arrow keys and caled using the s and S keys 2) Enables manipulation of position and orientation of indiviual parts and groups of parts in the 3D scene Parts which have been selected with the mouse can be scaled moved around and rotated like the cross section as described above To spin the parts around their local up-axis keep Control key pressed while using the UpDown and LeftRight arrow keys This work may be distributed andor modified under the conditions of the LaTeX Project Public License The latest version of this license is in httpmirrorsctanorgmacroslatexbaselppltxt This work has the LPPL maintenance status `maintained The Current Maintainer of this work is A Grahn The code borrows heavily from Bernd Gaertners `Miniball software originally written in C++ for computing the smallest enclosing ball of a set of points see httpwwwinfethzchpersonalgaertnerminiballhtmlhostconsoleshow()constructor for doubly linked listfunction List() thisfirst_node=null thislast_node=new Node(undefined)Listprototypepush_back=function(x) var new_node=new Node(x) if(thisfirst_node==null) thisfirst_node=new_node new_nodeprev=null else new_nodeprev=thislast_nodeprev new_nodeprevnext=new_node new_nodenext=thislast_node thislast_nodeprev=new_nodeListprototypemove_to_front=function(it) var node=itget() if(nodenext=null ampamp nodeprev=null) nodenextprev=nodeprev nodeprevnext=nodenext nodeprev=null nodenext=thisfirst_node thisfirst_nodeprev=node thisfirst_node=node Listprototypebegin=function() var i=new Iterator() itarget=thisfirst_node return(i)Listprototypeend=function() var i=new Iterator() itarget=thislast_node return(i)function Iterator(it) if( it=undefined ) thistarget=ittarget else thistarget=null Iteratorprototypeset=function(it)thistarget=ittargetIteratorprototypeget=function()return(thistarget)Iteratorprototypederef=function()return(thistargetdata)Iteratorprototypeincr=function() if(thistargetnext=null) thistarget=thistargetnextconstructor for node objects that populate the linked listfunction Node(x) thisprev=null thisnext=null thisdata=xfunction sqr(r)return(rr)helper functionMiniball algorithm by B Gaertnerfunction Basis() thism=0 thisq0=new Array(3) thisz=new Array(4) thisf=new Array(4) thisv=new Array(new Array(3) new Array(3) new Array(3) new Array(3)) thisa=new Array(new Array(3) new Array(3) new Array(3) new Array(3)) thisc=new Array(new Array(3) new Array(3) new Array(3) new Array(3)) thissqr_r=new Array(4) thiscurrent_c=thisc[0] thiscurrent_sqr_r=0 thisreset()Basisprototypecenter=function()return(thiscurrent_c)Basisprototypesize=function()return(thism)Basisprototypepop=function()--thismBasisprototypeexcess=function(p) var e=-thiscurrent_sqr_r for(var k=0klt3++k) e+=sqr(p[k]-thiscurrent_c[k]) return(e)Basisprototypereset=function() thism=0 for(var j=0jlt3++j) thisc[0][j]=0 thiscurrent_c=thisc[0] thiscurrent_sqr_r=-1Basisprototypepush=function(p) var i j var eps=1e-32 if(thism==0) for(i=0ilt3++i) thisq0[i]=p[i] for(i=0ilt3++i) thisc[0][i]=thisq0[i] thissqr_r[0]=0 else for(i=0ilt3++i) thisv[thism][i]=p[i]-thisq0[i] for(i=1iltthism++i) thisa[thism][i]=0 for(j=0jlt3++j) thisa[thism][i]+=thisv[i][j]thisv[thism][j] thisa[thism][i]=(2thisz[i]) for(i=1iltthism++i) for(j=0jlt3++j) thisv[thism][j]-=thisa[thism][i]thisv[i][j] thisz[thism]=0 for(j=0jlt3++j) thisz[thism]+=sqr(thisv[thism][j]) thisz[thism]=2 if(thisz[thism]ltepsthiscurrent_sqr_r) return(false) var e=-thissqr_r[thism-1] for(i=0ilt3++i) e+=sqr(p[i]-thisc[thism-1][i]) thisf[thism]=ethisz[thism] for(i=0ilt3++i) thisc[thism][i]=thisc[thism-1][i]+thisf[thism]thisv[thism][i] thissqr_r[thism]=thissqr_r[thism-1]+ethisf[thism]2 thiscurrent_c=thisc[thism] thiscurrent_sqr_r=thissqr_r[thism] ++thism return(true)function Miniball() thisL=new List() thisB=new Basis() thissupport_end=new Iterator()Miniballprototypemtf_mb=function(it) var i=new Iterator(it) thissupport_endset(thisLbegin()) if((thisBsize())==4) return for(var k=new Iterator(thisLbegin())kget()=iget()) var j=new Iterator(k) kincr() if(thisBexcess(jderef()) gt 0) if(thisBpush(jderef())) thismtf_mb(j) thisBpop() if(thissupport_endget()==jget()) thissupport_endincr() thisLmove_to_front(j) Miniballprototypecheck_in=function(b) thisLpush_back(b)Miniballprototypebuild=function() thisBreset() thissupport_endset(thisLbegin()) thismtf_mb(thisLend())Miniballprototypecenter=function() return(thisBcenter())Miniballprototyperadius=function() return(Mathsqrt(thisBcurrent_sqr_r))functions called by menu itemsfunction calc3Dopts () create Miniball object var mb=new Miniball() auxiliary vector var corner=new Vector3() iterate over all visible mesh nodes in the scene for(i=0iltscenemeshescounti++) var mesh=scenemeshesgetByIndex(i) if(meshvisible) continue local to parent transformation matrix var trans=meshtransform build local to world transformation matrix by recursively multiplying the parents transf matrix on the right var parent=meshparent while(parenttransform) trans=transmultiply(parenttransform) parent=parentparent get the bbox of the mesh (local coordinates) var bbox=meshcomputeBoundingBox() transform the local bounding box corner coordinates to world coordinates for bounding sphere determination BBoxmin cornerset(bboxmin) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) BBoxmax cornerset(bboxmax) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) remaining six BBox corners cornerset(bboxminx bboxmaxy bboxmaxz) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) cornerset(bboxminx bboxminy bboxmaxz) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) cornerset(bboxminx bboxmaxy bboxminz) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) cornerset(bboxmaxx bboxminy bboxminz) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) cornerset(bboxmaxx bboxminy bboxmaxz) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) cornerset(bboxmaxx bboxmaxy bboxminz) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) compute the smallest enclosing bounding sphere mbbuild() current camera settings var camera=scenecamerasgetByIndex(0) var res= initialize result string aperture angle of the virtual camera (perspective projection) or orthographic scale (orthographic projection) if(cameraprojectionType==cameraTYPE_PERSPECTIVE) var aac=camerafov180MathPI if(hostutilprintf(4f aac)=30) res+=hostutilprintf(n3Daac=s aac) else cameraviewPlaneSize=2mbradius() res+=hostutilprintf(n3Dortho=s 1cameraviewPlaneSize) camera roll var roll = cameraroll180MathPI if(hostutilprintf(4f roll)=0) res+=hostutilprintf(n3Droll=sroll) target to camera vector var c2c=new Vector3() c2cset(cameraposition) c2csubtractInPlace(cameratargetPosition) c2cnormalize() if((c2cx==0 ampamp c2cy==-1 ampamp c2cz==0)) res+=hostutilprintf(n3Dc2c=s s s c2cx c2cy c2cz) new camera settings bounding sphere centre --gt new camera target var coo=new Vector3() cooset((mbcenter())[0] (mbcenter())[1] (mbcenter())[2]) if(coolength) res+=hostutilprintf(n3Dcoo=s s s coox cooy cooz) radius of orbit if(cameraprojectionType==cameraTYPE_PERSPECTIVE) var roo=mbradius() Mathsin(aac MathPI 360) else orthographic projection var roo=mbradius() res+=hostutilprintf(n3Droo=s roo) update camera settings in the viewer var currol=cameraroll cameratargetPositionset(coo) camerapositionset(cooadd(c2cscale(roo))) cameraroll=currol determine background colour rgb=scenebackgroundgetColor() if((rgbr==1 ampamp rgbg==1 ampamp rgbb==1)) res+=hostutilprintf(n3Dbg=s s s rgbr rgbg rgbb) determine lighting scheme switch(scenelightScheme) case sceneLIGHT_MODE_FILE curlights=Artworkbreak case sceneLIGHT_MODE_NONE curlights=Nonebreak case sceneLIGHT_MODE_WHITE curlights=Whitebreak case sceneLIGHT_MODE_DAY curlights=Daybreak case sceneLIGHT_MODE_NIGHT curlights=Nightbreak case sceneLIGHT_MODE_BRIGHT curlights=Hardbreak case sceneLIGHT_MODE_RGB curlights=Primarybreak case sceneLIGHT_MODE_BLUE curlights=Bluebreak case sceneLIGHT_MODE_RED curlights=Redbreak case sceneLIGHT_MODE_CUBE curlights=Cubebreak case sceneLIGHT_MODE_CAD curlights=CADbreak case sceneLIGHT_MODE_HEADLAMP curlights=Headlampbreak if(curlights=Artwork) res+=hostutilprintf(n3Dlights=s curlights) determine global render mode switch(scenerenderMode) case sceneRENDER_MODE_BOUNDING_BOX currender=BoundingBoxbreak case sceneRENDER_MODE_TRANSPARENT_BOUNDING_BOX currender=TransparentBoundingBoxbreak case sceneRENDER_MODE_TRANSPARENT_BOUNDING_BOX_OUTLINE currender=TransparentBoundingBoxOutlinebreak case sceneRENDER_MODE_VERTICES currender=Verticesbreak case sceneRENDER_MODE_SHADED_VERTICES currender=ShadedVerticesbreak case sceneRENDER_MODE_WIREFRAME currender=Wireframebreak case sceneRENDER_MODE_SHADED_WIREFRAME currender=ShadedWireframebreak case sceneRENDER_MODE_SOLID currender=Solidbreak case sceneRENDER_MODE_TRANSPARENT currender=Transparentbreak case sceneRENDER_MODE_SOLID_WIREFRAME currender=SolidWireframebreak case sceneRENDER_MODE_TRANSPARENT_WIREFRAME currender=TransparentWireframebreak case sceneRENDER_MODE_ILLUSTRATION currender=Illustrationbreak case sceneRENDER_MODE_SOLID_OUTLINE currender=SolidOutlinebreak case sceneRENDER_MODE_SHADED_ILLUSTRATION currender=ShadedIllustrationbreak case sceneRENDER_MODE_HIDDEN_WIREFRAME currender=HiddenWireframebreak if(currender=Solid) res+=hostutilprintf(n3Drender=s currender) write result string to the console hostconsoleshow() hostconsoleclear() hostconsoleprintln(n Copy and paste the following text to then+ option list of includemedian + res + n)function get3Dview () var camera=scenecamerasgetByIndex(0) var coo=cameratargetPosition var c2c=camerapositionsubtract(coo) var roo=c2clength c2cnormalize() var res=VIEW=insert optional name heren if((coox==0 ampamp cooy==0 ampamp cooz==0)) res+=hostutilprintf( COO=s s sn coox cooy cooz) if((c2cx==0 ampamp c2cy==-1 ampamp c2cz==0)) res+=hostutilprintf( C2C=s s sn c2cx c2cy c2cz) if(roo gt 1e-9) res+=hostutilprintf( ROO=sn roo) var roll = cameraroll180MathPI if(hostutilprintf(4f roll)=0) res+=hostutilprintf( ROLL=sn roll) if(cameraprojectionType==cameraTYPE_PERSPECTIVE) var aac=camerafov 180MathPI if(hostutilprintf(4f aac)=30) res+=hostutilprintf( AAC=sn aac) else if(hostutilprintf(4f cameraviewPlaneSize)=1) res+=hostutilprintf( ORTHO=sn 1cameraviewPlaneSize) rgb=scenebackgroundgetColor() if((rgbr==1 ampamp rgbg==1 ampamp rgbb==1)) res+=hostutilprintf( BGCOLOR=s s sn rgbr rgbg rgbb) switch(scenelightScheme) case sceneLIGHT_MODE_FILE curlights=Artworkbreak case sceneLIGHT_MODE_NONE curlights=Nonebreak case sceneLIGHT_MODE_WHITE curlights=Whitebreak case sceneLIGHT_MODE_DAY curlights=Daybreak case sceneLIGHT_MODE_NIGHT curlights=Nightbreak case sceneLIGHT_MODE_BRIGHT curlights=Hardbreak case sceneLIGHT_MODE_RGB curlights=Primarybreak case sceneLIGHT_MODE_BLUE curlights=Bluebreak case sceneLIGHT_MODE_RED curlights=Redbreak case sceneLIGHT_MODE_CUBE curlights=Cubebreak case sceneLIGHT_MODE_CAD curlights=CADbreak case sceneLIGHT_MODE_HEADLAMP curlights=Headlampbreak if(curlights=Artwork) res+= LIGHTS=+curlights+n switch(scenerenderMode) case sceneRENDER_MODE_BOUNDING_BOX defaultrender=BoundingBoxbreak case sceneRENDER_MODE_TRANSPARENT_BOUNDING_BOX defaultrender=TransparentBoundingBoxbreak case sceneRENDER_MODE_TRANSPARENT_BOUNDING_BOX_OUTLINE defaultrender=TransparentBoundingBoxOutlinebreak case sceneRENDER_MODE_VERTICES defaultrender=Verticesbreak case sceneRENDER_MODE_SHADED_VERTICES defaultrender=ShadedVerticesbreak case sceneRENDER_MODE_WIREFRAME defaultrender=Wireframebreak case sceneRENDER_MODE_SHADED_WIREFRAME defaultrender=ShadedWireframebreak case sceneRENDER_MODE_SOLID defaultrender=Solidbreak case sceneRENDER_MODE_TRANSPARENT defaultrender=Transparentbreak case sceneRENDER_MODE_SOLID_WIREFRAME defaultrender=SolidWireframebreak case sceneRENDER_MODE_TRANSPARENT_WIREFRAME defaultrender=TransparentWireframebreak case sceneRENDER_MODE_ILLUSTRATION defaultrender=Illustrationbreak case sceneRENDER_MODE_SOLID_OUTLINE defaultrender=SolidOutlinebreak case sceneRENDER_MODE_SHADED_ILLUSTRATION defaultrender=ShadedIllustrationbreak case sceneRENDER_MODE_HIDDEN_WIREFRAME defaultrender=HiddenWireframebreak if(defaultrender=Solid) res+= RENDERMODE=+defaultrender+n detect existing Clipping Plane (3D Cross Section) var clip=null if( clip=scenenodesgetByName($$$$$$)|| clip=scenenodesgetByName(Clipping Plane) ) for(var i=0iltscenenodescounti++) var nd=scenenodesgetByIndex(i) if(nd==clip||ndname==) continue var ndUTFName= for (var j=0 jltndnamelength j++) var theUnicode = ndnamecharCodeAt(j)toString(16) while (theUnicodelengthlt4) theUnicode = 0 + theUnicode ndUTFName += theUnicode var end=ndnamelastIndexOf() if(endgt0) var ndUserName=ndnamesubstr(0end) else var ndUserName=ndname respart= PART=+ndUserName+n respart+= UTF16NAME=+ndUTFName+n defaultvals=true if(ndvisible) respart+= VISIBLE=falsen defaultvals=false if(ndopacitylt10) respart+= OPACITY=+ndopacity+n defaultvals=false if(ndconstructorname==Mesh) currender=defaultrender switch(ndrenderMode) case sceneRENDER_MODE_BOUNDING_BOX currender=BoundingBoxbreak case sceneRENDER_MODE_TRANSPARENT_BOUNDING_BOX currender=TransparentBoundingBoxbreak case sceneRENDER_MODE_TRANSPARENT_BOUNDING_BOX_OUTLINE currender=TransparentBoundingBoxOutlinebreak case sceneRENDER_MODE_VERTICES currender=Verticesbreak case sceneRENDER_MODE_SHADED_VERTICES currender=ShadedVerticesbreak case sceneRENDER_MODE_WIREFRAME currender=Wireframebreak case sceneRENDER_MODE_SHADED_WIREFRAME currender=ShadedWireframebreak case sceneRENDER_MODE_SOLID currender=Solidbreak case sceneRENDER_MODE_TRANSPARENT currender=Transparentbreak case sceneRENDER_MODE_SOLID_WIREFRAME currender=SolidWireframebreak case sceneRENDER_MODE_TRANSPARENT_WIREFRAME currender=TransparentWireframebreak case sceneRENDER_MODE_ILLUSTRATION currender=Illustrationbreak case sceneRENDER_MODE_SOLID_OUTLINE currender=SolidOutlinebreak case sceneRENDER_MODE_SHADED_ILLUSTRATION currender=ShadedIllustrationbreak case sceneRENDER_MODE_HIDDEN_WIREFRAME currender=HiddenWireframebreak case sceneRENDER_MODE_DEFAULT currender=Defaultbreak if(currender=defaultrender) respart+= RENDERMODE=+currender+n defaultvals=false if(origtrans[ndname]ampampndtransformisEqual(origtrans[ndname])) var lvec=ndtransformtransformDirection(new Vector3(100)) var uvec=ndtransformtransformDirection(new Vector3(010)) var vvec=ndtransformtransformDirection(new Vector3(001)) respart+= TRANSFORM= +lvecx+ +lvecy+ +lvecz+ +uvecx+ +uvecy+ +uvecz+ +vvecx+ +vvecy+ +vvecz+ +ndtransformtranslationx+ +ndtransformtranslationy+ +ndtransformtranslationz+n defaultvals=false respart+= ENDn if(defaultvals) res+=respart if(clip) var centre=cliptransformtranslation var normal=cliptransformtransformDirection(new Vector3(001)) res+= CROSSSECTn if((centrex==0 ampamp centrey==0 ampamp centrez==0)) res+=hostutilprintf( CENTER=s s sn centrex centrey centrez) if((normalx==1 ampamp normaly==0 ampamp normalz==0)) res+=hostutilprintf( NORMAL=s s sn normalx normaly normalz) res+=hostutilprintf( VISIBLE=sn clipvisible) res+=hostutilprintf( PLANECOLOR=s s sn clipmaterialemissiveColorr clipmaterialemissiveColorg clipmaterialemissiveColorb) res+=hostutilprintf( OPACITY=sn clipopacity) res+=hostutilprintf( INTERSECTIONCOLOR=s s sn clipwireframeColorr clipwireframeColorg clipwireframeColorb) res+= ENDn for(var propt in clip) consoleprintln(propt++clip[propt]) res+=ENDn hostconsoleshow() hostconsoleclear() hostconsoleprintln(n Add the following VIEW section to a file ofn+ predefined views (See option 3Dviews)nn + The view may be given a name after VIEW=n + (Remove in front of =)n) hostconsoleprintln(res + n)add items to 3D context menuruntimeaddCustomMenuItem(dfltview Generate Default View default 0)runtimeaddCustomMenuItem(currview Get Current View default 0)runtimeaddCustomMenuItem(csection Cross Section checked 0)menu event handlersmenuEventHandler = new MenuEventHandler()menuEventHandleronEvent = function(e) switch(emenuItemName) case dfltview calc3Dopts() break case currview get3Dview() break case csection addremoveClipPlane(emenuItemChecked) break runtimeaddEventHandler(menuEventHandler)global variable taking reference to currently selected nodevar target=nullselectionEventHandler=new SelectionEventHandler()selectionEventHandleronEvent=function(e) if(eselectedampampenodename=) target=enode else target=null runtimeaddEventHandler(selectionEventHandler)cameraEventHandler=new CameraEventHandler()cameraEventHandleronEvent=function(e) var clip=null runtimeremoveCustomMenuItem(csection) runtimeaddCustomMenuItem(csection Cross Section checked 0) if(clip=scenenodesgetByName($$$$$$)|| predefined scenenodesgetByName(Clipping Plane)) added via context menu runtimeremoveCustomMenuItem(csection) runtimeaddCustomMenuItem(csection Cross Section checked 1) if(clip)plane in predefined views must be rotated by 90 deg around normal cliptransformrotateAboutLineInPlace( MathPI2cliptransformtranslation cliptransformtransformDirection(new Vector3(001)) ) for(var i=0 iltrot4x4length i++)rot4x4[i]setIdentity() target=nullruntimeaddEventHandler(cameraEventHandler)var rot4x4=new Array() keeps track of spin and tilt axes transformationskey event handler for scaling moving spinning and tilting objectskeyEventHandler=new KeyEventHandler()keyEventHandleronEvent=function(e) var backtrans=new Matrix4x4() var trgt=null if(target) trgt=target var backtrans=new Matrix4x4() var trans=trgttransform var parent=trgtparent while(parenttransform) build local to world transformation matrix transmultiplyInPlace(parenttransform) also build world to local back-transformation matrix backtransmultiplyInPlace(parenttransforminversetranspose) parent=parentparent backtranstransposeInPlace() else if( trgt=scenenodesgetByName($$$$$$)|| trgt=scenenodesgetByName(Clipping Plane) ) var trans=trgttransform if(trgt) return var tname=trgtname if(typeof(rot4x4[tname])==undefined) rot4x4[tname]=new Matrix4x4() if(target) var tiltAxis=rot4x4[tname]transformDirection(new Vector3(010)) else var tiltAxis=transtransformDirection(new Vector3(010)) var spinAxis=rot4x4[tname]transformDirection(new Vector3(001)) get the centre of the mesh if(targetampamptrgtconstructorname==Mesh) var centre=transtransformPosition(trgtcomputeBoundingBox()center) else part group (Node3 parent node clipping plane) var centre=new Vector3(transtranslation) switch(echaracterCode) case 30tilt up rot4x4[tname]rotateAboutLineInPlace( -MathPI900rot4x4[tname]translationtiltAxis) transrotateAboutLineInPlace(-MathPI900centretiltAxis) break case 31tilt down rot4x4[tname]rotateAboutLineInPlace( MathPI900rot4x4[tname]translationtiltAxis) transrotateAboutLineInPlace(MathPI900centretiltAxis) break case 28spin right if(ectrlKeyDownampamptarget) transrotateAboutLineInPlace(-MathPI900centrespinAxis) else rot4x4[tname]rotateAboutLineInPlace( -MathPI900rot4x4[tname]translationnew Vector3(001)) transrotateAboutLineInPlace(-MathPI900centrenew Vector3(001)) break case 29spin left if(ectrlKeyDownampamptarget) transrotateAboutLineInPlace(MathPI900centrespinAxis) else rot4x4[tname]rotateAboutLineInPlace( MathPI900rot4x4[tname]translationnew Vector3(001)) transrotateAboutLineInPlace(MathPI900centrenew Vector3(001)) break case 120 x translateTarget(trans new Vector3(100) e) break case 121 y translateTarget(trans new Vector3(010) e) break case 122 z translateTarget(trans new Vector3(001) e) break case 88 shift + x translateTarget(trans new Vector3(-100) e) break case 89 shift + y translateTarget(trans new Vector3(0-10) e) break case 90 shift + z translateTarget(trans new Vector3(00-1) e) break case 115 s transtranslateInPlace(centrescale(-1)) transscaleInPlace(101) transtranslateInPlace(centrescale(1)) break case 83 shift + s transtranslateInPlace(centrescale(-1)) transscaleInPlace(1101) transtranslateInPlace(centrescale(1)) break transmultiplyInPlace(backtrans)runtimeaddEventHandler(keyEventHandler)translates object by amount calculated from Canvas sizefunction translateTarget(t d e) var cam=scenecamerasgetByIndex(0) if(camprojectionType==camTYPE_PERSPECTIVE) var scale=Mathtan(camfov2) camtargetPositionsubtract(camposition)length Mathmin(ecanvasPixelWidthecanvasPixelHeight) else var scale=camviewPlaneSize2 Mathmin(ecanvasPixelWidthecanvasPixelHeight) ttranslateInPlace(dscale(scale))function addremoveClipPlane(chk) var curTrans=getCurTrans() var clip=scenecreateClippingPlane() if(chk) add Clipping Plane and place its center either into the camera target position or into the centre of the currently selected mesh node var centre=new Vector3() if(target) var trans=targettransform var parent=targetparent while(parenttransform) trans=transmultiply(parenttransform) parent=parentparent if(targetconstructorname==Mesh) var centre=transtransformPosition(targetcomputeBoundingBox()center) else var centre=new Vector3(transtranslation) target=null else centreset(scenecamerasgetByIndex(0)targetPosition) cliptransformsetView( new Vector3(000) new Vector3(100) new Vector3(010)) cliptransformtranslateInPlace(centre) else if( scenenodesgetByName($$$$$$)|| scenenodesgetByName(Clipping Plane) ) clipremove()clip=null restoreTrans(curTrans) return clipfunction to store current transformation matrix of all nodes in the scenefunction getCurTrans() var tA=new Array() for(var i=0 iltscenenodescount i++) var nd=scenenodesgetByIndex(i) if(ndname==) continue tA[ndname]=new Matrix4x4(ndtransform) return tAfunction to restore transformation matrices given as argfunction restoreTrans(tA) for(var i=0 iltscenenodescount i++) var nd=scenenodesgetByIndex(i) if(tA[ndname]) ndtransformset(tA[ndname]) store original transformation matrix of all mesh nodes in the scenevar origtrans=getCurTrans()set initial state of Cross Section menu entrycameraEventHandleronEvent(1)hostconsoleclear()

var ocgs=hostgetOCGs(hostpageNum)for(var i=0iltocgslengthi++)if(ocgs[i]name==MediaPlayButton2)ocgs[i]state=false

(C) 2012 Michail Vidiassov John C Bowman Alexander Grahn asylabelsjs version 20120912 3D JavaScript to be used with media9sty (option `add3Djscript) for Asymptote generated PRC files adds billboard behaviour to text labels in Asymptote PRC files so that they always face the camera under 3D rotation This work may be distributed andor modified under the conditions of the LaTeX Project Public License The latest version of this license is in httpmirrorsctanorgmacroslatexbaselppltxt This work has the LPPL maintenance status `maintained The Current Maintainer of this work is A Grahnvar bbnodes=new Array() billboard meshesvar bbtrans=new Array() billboard transformsfunction fulltransform(mesh) var t=new Matrix4x4(meshtransform) if(meshparentname = ) var parentTransform=fulltransform(meshparent) tmultiplyInPlace(parentTransform) return t else return t find all text labels in the scene and determine pivoting pointsvar nodes=scenenodesvar nodescount=nodescountvar third=1030for(var i=0 i lt nodescount i++) var node=nodesgetByIndex(i) var name=nodename var end=namelastIndexOf()-1 if(end gt 0) if(namecharAt(end) == 001) var start=namelastIndexOf(-)+1 if(end gt start) nodename=namesubstr(0start-1) var nodeMatrix=fulltransform(nodeparent) var c=nodeMatrixtranslation position var d=Mathpow(Mathabs(nodeMatrixdeterminant)third) scale bbnodespush(node) bbtranspush(Matrix4x4()scale(ddd)translate(c)multiply(nodeMatrixinverse)) var camera=scenecamerasgetByIndex(0) var zero=new Vector3(000)var bbcount=bbnodeslength event handler to maintain camera-facing text labelsbillboardHandler=new RenderEventHandler()billboardHandleronEvent=function(event) var T=new Matrix4x4() TsetView(zerocamerapositionsubtract(cameratargetPosition) cameraupsubtract(cameraposition)) for(var j=0 j lt bbcount j++) bbnodes[j]transformset(Tmultiply(bbtrans[j])) runtimerefresh() runtimeaddEventHandler(billboardHandler)runtimerefresh()

(C) 2012 Alexander Grahn 3Dspintooljs version 20120301 3D JavaScript to be used with media9sty (option `add3Djscript) enables the Spin tool (also accessible via 3D toolbar or context menu) upon activation of the 3D scene the scene then rotates around the upright axis while dragging with the mouse This work may be distributed andor modified under the conditions of the LaTeX Project Public License The latest version of this license is in httpmirrorsctanorgmacroslatexbaselppltxt This work has the LPPL maintenance status `maintained The Current Maintainer of this work is A GrahnruntimesetCurrentTool(runtimeTOOL_NAME_SPIN)

N Privault

Proposition 66 Call-put parity We have the call-put parity relation

gc(tSt)minus gp(tSt) = St minusK eminus(Tminust)r 0 6 t 6 T (621)

between the Black-Scholes prices of call and put options in terms of theforward contract price St minusK eminus(Tminust)r

Proof The call-put parity (621) is a consequence of the relation

xminusK = (xminusK)+ minus (K minus x)+

satisfied by the terminal call and put payoff functions in the Black-ScholesPDE (67) It can also be verified directly from (610) and (618) as

gc(tx)minus gp(tx) = xΦ(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)minus(K eminus(Tminust)rΦ

(minus dminus(T minus t)

)minus xΦ

(minus d+(T minus t)

))= xΦ

(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)minusK eminus(Tminust)r

(1minusΦ

(dminus(T minus t)

))+ x

(1minusΦ

(d+(T minus t)

))= xminusK

The Delta of the Black-Scholes put option can be obtained by differentiationof the call-put parity relation (621) and Proposition 64

Proposition 67 The Delta of the Black-Scholes put option is given by

ξt = minus(1minusΦ(d+(T minus t)

)) = minusΦ

(minus d+(T minus t)

)isin [minus1 0] 0 6 t 6 T

Proof By the call-put parity relation (621) and Proposition 64 we have

partgppartx

(tSt) =partgcpartx

(tSt)minus 1

= Φ(d+(T minus t))minus 1= minusΦ(minusd+(T minus t)) 0 6 t 6 T

where we applied (614)

As a consequence of Proposition 67 the Black-Scholes put price splitsinto a risky component minusStΦ

(minus d+(T minus t)

)and a riskless component

K eminus(Tminust)rΦ(minus dminus(T minus t)

) as follows

gp(tSt) = K eminus(Tminust)rΦ(minus dminus(T minus t)

)︸ ︷︷ ︸riskminusfree investment (savings)

minus StΦ(minus d+(T minus t)

)︸ ︷︷ ︸

risky investment (short)

0 6 t 6 T

216

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

In Figure 613 we plot the Delta of the European put option as a function ofthe underlying asset price and of the time remaining until maturity

Payoff function (x-K)+

0

50

100

150

200

Underlying

0

5

10

15 Time to maturity T-t

-1

-075

-05

-025

0

Fig 613 Delta of a European put option with strike price K = 100 r = 3 σ = 10

Numerical example - hedging of a put option

For one more example we consider a put option issued by BNP Paribas on04 November 2008 with strike price K=$77667 maturity T = October 052009 and entitlement ratio 92593 cf page 9 In the next Figure 614 thenumber of days is counted from the origin not from maturity

40 50 60 70 80 90 100

0 50 100 150 200

0 5

10 15 20 25 30 35 40 45

Underlying (HK$)Time in days

Fig 614 Path of the Black-Scholes price for a put option on HSBC

As a consequence of Proposition 67 the amount invested on the risky assetfor the hedging of a put option is

minusStΦ(minus d+(T minus t)

)= minusStΦ

(minus log(StK) + (r+ σ22)(T minus t)

|σ|radicT minus t

)6 0

217

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

ie there is always short selling and the amount invested on the riskless assetpriced At = ert t isin [0T ] is

ηtAt = K eminus(Tminust)rΦ(minus dminus(T minus t)

)= K eminus(Tminust)rΦ

(minus log(StK) + (rminus σ22)(T minus t)

|σ|radicT minus t

)gt 0

which is always nonnegative ie we are constantly saving money on theriskless asset as noted in Figure 615

-60

-40

-20

0

20

40

60

80

100

0 50 100 150 200

K

HK$

Black-Scholes priceRisky investment ξtSt

Riskless investment ηtAtUnderlying asset price

Fig 615 Time evolution of the hedging portfolio for a put option on HSBC

In the above example the put option finished out of the money (OTM) so thatno cash settlement or physical delivery occurs A comparison of Figure 610with market data can be found in Figures 913 and 914 below

64 Market Terms and Data

The following Table 61 provides a summary of formulas for the computationof Black-Scholes sensitivities also called Greekslowast

lowast ldquoEvery class feels like attending a Greek lessonrdquo (AY2018-2019 student feedback)

218

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

Call option Put option

Option price g(tSt) StΦ(d+(T minus t))minusK eminus(Tminust)rΦ(dminus(T minus t)) K eminus(Tminust)rΦ(minusdminus(T minus t))minus StΦ(minusd+(T minus t))

Delta (∆) partg

partx(tSt) Φ(d+(T minus t)) gt 0 minusΦ(minusd+(T minus t)) 6 0

Gamma (Γ) part2g

partx2 (tSt)Φprime(d+(T minus t))St|σ|

radicT minus t

gt 0

Vega partg

partσ(tSt) St

radicT minus tΦprime(d+(T minus t)) gt 0

Theta (Θ) partg

partt(tSt) minusSt|σ|Φ

prime(d+(T minus t))2radicT minus t

minus rK eminus(Tminust)rΦ(dminus(T minus t)) 6 0 minusSt|σ|Φprime(d+(T minus t))

2radicT minus t

+ rK eminus(Tminust)rΦ(minusdminus(T minus t))

Rho (ρ) partg

partr(tSt) K(T minus t) eminus(Tminust)rΦ(dminus(T minus t)) minusK(T minus t) eminus(Tminust)rΦ(minusdminus(T minus t))

Table 61 Black-Scholes Greeks (Wikipedia)

From Table 61 we can conclude that call option prices are increasing func-tions of the underlying asset price St of the interest rate r and of the volatil-ity parameter σ Similarly put option prices are decreasing functions of theunderlying asset price St of the interest rate r and increasing functions ofthe volatility parameter σ

Parameter Variation of call option prices Variation of put option prices

Underlying St increasing decreasing

Volatility σ increasing increasing

Time t decreasing depends on the underlying price level

Interest rate r increasing decreasing

Table 62 Variations of Black-Scholes prices

The change of sign of the sensitivity Theta (Θ) with respect to time t can beverified in the following Figure 616

219

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

(a) Black-Scholes call price maps (b) Black-Scholes put price maps

Fig 616 Time-dependent solutions of the Black-Scholes PDElowast

Intrinsic value The intrinsic value at time t isin [0T ] of the option withpayoff C = h

(S(1)T

)is given by the immediate exercise payoff h

(S(1)t

) The

extrinsic value at time t isin [0T ] of the option is the remaining differenceπt(C) minus h

(S(1)t

)between the option price πt(C) and the immediate ex-

ercise payoff h(S(1)t

) In general the option price πt(C) decomposes as

πt(C) = h(S(1)t

)︸ ︷︷ ︸intrinsic value

+ πt(C)minus h(S(1)t

)︸ ︷︷ ︸

extrinsic value

0 6 t 6 T ]

Gearing The gearing at time t isin [0T ] of the option with payoff C = h(ST )is defined as the ratio

Gt =St

πt(C)=

Stg(tSt)

0 6 t 6 T

Effective gearing The effective gearing at time t isin [0T ] of the option withpayoff C = h(ST ) is defined as the ratio

Get = Gtξt

=ξtStπt(C)

=St

πt(C)

partg

partx(tSt)

=St

g(tSt)partg

partx(tSt)

= Stpart

partxlog g(tSt) 0 6 t 6 T

lowast The animation works in Acrobat Reader on the entire pdf file

220

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

The effective gearingGet =

ξtStπt(C)

can be interpreted as the hedge ratio ie the percentage of the portfoliowhich is invested on the risky asset When written as

∆g(tSt)g(tSt)

= Get times

∆StSt

the effective gearing gives the relative variation or percentage change∆g(tSt)g(tSt) of the option price g(tSt) from the relative variation∆StSt in the underlying asset price

The ratio Get = Stpart log g(tSt)partx can also be interpreted as an elasticity

coefficient

Break-even price The break-even price BEPt of the underlying asset is thevalue of S for which the intrinsic option value h(S) equals the option priceπt(C) at time t isin [0T ] For European call options it is given by

BEPt = K + πt(C) = K + g(tSt) t = 0 1 N

whereas for European put options it is given by

BEPt = K minus πt(C) = K minus g(tSt) 0 6 t 6 T

Premium The option premium OPt can be defined as the variation requiredfrom the underlying asset price in order to reach the break-even price iewe have

OPt =BEPt minus St

St=K + g(tSt)minus St

St 0 6 t 6 T

for European call options and

OPt =St minusBEPt

St=St + g(tSt)minusK

St 0 6 t 6 T

for European put options see Figure 617 below The term ldquopremiumrdquo issometimes also used to denote the arbitrage price g(tSt) of the option

221

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

f (tx σ)100

=

x =

K =

xpart log f

partx=

σ =

partf

partt(tx σ)=

T=

=(xminusK)x

∆ = = partf

partx(tx σ)

= partf

partσ(tx σ)

=K+f (txσ)minusx

x

=K+f (tx σ)

rf=

partf

partt+rxpartf

partx+

σ2 2x2part2f

partx2

Fig 617 Warrant terms and data

The R package bizdays (requires to install QuantLib) can be used to computecalendar time vs business time to maturity1 installpackages(bizdays)

library(bizdays)3 load_quantlib_calendars(HongKong from=2018-01-01 to=2018-12-31)

load_quantlib_calendars(Singapore from=2018-01-01 to=2018-12-31)5 bizdays(2018-03-10 2018-04-03 QuantLibHongKong)

bizdays(2018-03-10 2018-04-03 QuantLibSingapore)

65 The Heat Equation

In the next proposition we notice that the solution f(tx) of the Black-Scholes PDE (67) can be transformed into a solution g(t y) of the simplerheat equation by a change of variable and a time inversion t 7minusrarr T minus t onthe interval [0T ] so that the terminal condition at time T in the Black-Scholes equation (622) becomes an initial condition at time t = 0 in theheat equation (625) See also here for a related discussion on changes ofvariables for the Black-Scholes PDE

222

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

Proposition 68 Assume that f(tx) solves the Black-Scholes PDErf(tx) = partf

partt(tx) + rx

partf

partx(tx) + 1

2σ2x2 part

2f

partx2 (tx)

f(T x) = (xminusK)+(622)

with terminal condition h(x) = (xminusK)+ x gt 0 Then the function g(t y)defined by

g(t y) = ertf(T minus t e|σ|y+(σ22minusr)t) (623)

solves the heat equation (625) with initial condition

ψ(y) = h(

e|σ|y) y isin R (624)

ie we have partg

partt(t y) = 1

2part2g

party2 (t y)

g(0 y) = h(

e|σ|y)

(625)

Proposition 68 will be proved in Section 66 It will allow us to solve theBlack-Scholes PDE (622) based on the solution of the heat equation (625)with initial condition ψ(y) = h

(e|σ|y

) y isin R by inversion of Relation (623)

with s = T minus t x = e|σ|y+(σ22minusr)t ie

f(sx) = eminus(Tminuss)rg(T minus s minus(σ

22minus r)(T minus s) + log x|σ|

)

Next we focus on the heat equation

partϕ

partt(t y) = 1

2part2ϕ

party2 (t y) (626)

which is used to model the diffusion of heat over time through solids Herethe data of g(x t) represents the temperature measured at time t and pointx We refer the reader to Widder (1975) for a complete treatment of thistopic

223

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

Fig 618 Time-dependent solution of the heat equationlowast

Proposition 69 The fundamental solution of the heat equation (626) isgiven by the Gaussian probability density function

ϕ(t y) =1radic2πt

eminusy2(2t) y isin R

with variance t gt 0

Proof The proof is done by a direct calculation as follows

partϕ

partt(t y) = part

partt

(eminusy2(2t)radic

2πt

)

= minus eminusy2(2t)

2t32radic

2π+

y2

2t2eminusy2(2t)radic

2πt

=

(minus 1

2t +y2

2t2

)ϕ(t y)

and

12part2ϕ

party2 (t y) = minus12part

party

(y

t

eminusy2(2t)radic

2πt

)

= minus eminusy2(2t)

2tradic

2πt+

y2

2t2eminusy2(2t)radic

2πt

=

(minus 1

2t +y2

2t2

)ϕ(t y) t gt 0 y isin R

lowast The animation works in Acrobat Reader on the entire pdf file

224

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

In Section 66 the heat equation (626) will be shown to be equivalent to theBlack-Scholes PDE after a change of variables In particular this will lead tothe explicit solution of the Black-Scholes PDE

Proposition 610 The heat equationpartg

partt(t y) = 1

2part2g

party2 (t y)

g(0 y) = ψ(y)

(627)

with continuous initial condition

g(0 y) = ψ(y)

has the solution

g(t y) =winfinminusinfin

ψ(z) eminus(yminusz)2(2t) dzradic2πt

y isin R t gt 0 (628)

Proof We have

partg

partt(t y) = part

partt

winfinminusinfin

ψ(z) eminus(yminusz)2(2t) dzradic2πt

=winfinminusinfin

ψ(z)part

partt

(eminus(yminusz)2(2t)radic

2πt

)dz

=12winfinminusinfin

ψ(z)

((yminus z)2

t2minus 1t

)eminus(yminusz)2(2t) dzradic

2πt

=12winfinminusinfin

ψ(z)part2

partz2 eminus(yminusz)2(2t) dzradic2πt

=12winfinminusinfin

ψ(z)part2

party2 eminus(yminusz)2(2t) dzradic2πt

=12part2

party2

winfinminusinfin

ψ(z) eminus(yminusz)2(2t) dzradic2πt

=12part2g

party2 (t y)

On the other hand it can be checked that at time t = 0 we have

limtrarr0

winfinminusinfin

ψ(z) eminus(yminusz)2(2t) dzradic2πt

= limtrarr0

winfinminusinfin

ψ(y+ z) eminusz2(2t) dzradic2πt

= ψ(y) y isin R

225

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

The next Figure 619 shows the evolution of g(tx) with initial conditionbased on the European call payoff function h(x) = (xminusK)+ ie

g(0 y) = ψ(y) = h(

e|σ|y)=(

e|σ|y minusK)+ y isin R

Fig 619 Time-dependent solution of the heat equationlowast

Let us provide a second proof of Proposition 610 this time using Brownianmotion and stochastic calculus

Proof of Proposition 610 First note that under the change of variable x =z minus y we have

g(t y) =winfinminusinfin

ψ(z) eminus(yminusz)2(2t) dzradic2πt

=winfinminusinfin

ψ(y+ x) eminusx2(2t) dxradic2πt

= IE[ψ(y+Bt)]

= IE[ψ(yminusBt)]

where (Bt)tisinR+ is a standard Brownian motion and Bt N (0 t) t isin R+Applying Itocircrsquos formula and using the fact that the expectation of the stochas-tic integral with respect to Brownian motion is zero see Relation (417) inProposition 420 we find

g(t y) = IE[ψ(yminusBt)]

= ψ(y)minus IE[w t

0ψprime(yminusBs)dBs

]+

12 IE

[w t0ψprimeprime(yminusBs)ds

]= ψ(y) +

12w t

0IE[ψprimeprime(yminusBs)

]ds

lowast The animation works in Acrobat Reader on the entire pdf file

226

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

= ψ(y) +12w t

0part2

party2 IE [ψ(yminusBs)] ds

= ψ(y) +12w t

0part2g

party2 (s y)ds

Hence we have

partg

partt(t y) = part

parttIE[ψ(yminusBt)]

=12part2

party2 IE [ψ(yminusBt)]

=12part2g

party2 (t y)

Regarding the initial condition we check that

g(0 y) = IE[ψ(yminusB0)] = IE[ψ(y)] = ψ(y)

The expression g(t y) = IE[ψ(yminusBt)] provides a probabilistic interpreta-tion of the heat diffusion phenomenon based on Brownian motion Namelywhen ψε(y) = 1[minusεε](y) we find that

gε(t y) = IE[ψε(yminusBt)]= IE[1[minusεε](yminusBt)]= P

(yminusBt isin [minusε ε]

)= P

(yminus ε 6 Bt 6 y+ ε

)represents the probability of finding Bt within a neighborhood [y minus ε y + ε]of the point y isin R

66 Solution of the Black-Scholes PDE

In this section we solve the Black-Scholes PDE by the kernel method of Sec-tion 65 and a change of variables This solution method uses the change ofvariables (623) of Proposition 68 and a time inversion from which the ter-minal condition at time T in the Black-Scholes equation becomes an initialcondition at time t = 0 in the heat equation

Next we state the proof Proposition 68

Proof Letting s = T minus t and x = e|σ|y+(σ22minusr)t and using Relation (623)ie

g(t y) = ertf(T minus t e|σ|y+(σ22minusr)t)

227

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

we have

partg

partt(t y) = r ertf

(T minus t e|σ|y+(σ22minusr)t)minus ert partf

parts

(T minus t e|σ|y+(σ22minusr)t)

+

(σ2

2 minus r)

ert e|σ|y+(σ22minusr)t partf

partx

(T minus t e|σ|y+(σ22minusr)t)

= r ertf(T minus tx)minus ert partfparts

(T minus tx) +(σ2

2 minus r)

ertxpartfpartx

(T minus tx)

=12 ertx2σ2 part

2f

partx2 (T minus tx) +σ2

2 ertxpartfpartx

(T minus tx) (629)

where on the last step we used the Black-Scholes PDE On the other handwe have

partg

party(t y) = |σ| ert e|σ|y+(σ22minusr)t partf

partx

(T minus t e|σ|y+(σ22minusr)t)

and

12partg2

party2 (t y) =σ2

2 ert e|σ|y+(σ22minusr)t partf

partx

(T minus t e|σ|y+(σ22minusr)t)

+σ2

2 ert e2|σ|y+2(σ22minusr)t part2f

partx2(T minus t e|σ|y+(σ22minusr)t)

=σ2

2 ertxpartfpartx

(T minus tx) + σ2

2 ertx2 part2f

partx2 (T minus tx) (630)

We conclude by comparing (629) with (630) which shows that g(tx) solvesthe heat equation (627) with initial condition

g(0 y) = f(T e|σ|y

)= h

(e|σ|y

)

In the next proposition we derive the Black-Scholes formula (610) by solv-ing the PDE (622) The Black-Scholes formula will also be recovered by aprobabilistic argument via the computation of an expected value in Proposi-tion 77

Proposition 611 When h(x) = (x minusK)+ the solution of the Black-Scholes PDE (622) is given by

f(tx) = xΦ(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

) x gt 0

whereΦ(x) =

1radic2π

w xminusinfin

eminusy22dy x isin R

and

228

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

d+(T minus t) =

log(xK) + (r+ σ22)(T minus t)|σ|radicT minus t

dminus(T minus t) =log(xK) + (rminus σ22)(T minus t)

|σ|radicT minus t

x gt 0 t isin [0T )

Proof By inversion of Relation (623) with s = T minus t and x = e|σ|y+(σ22minusr)twe get

f(sx) = eminus(Tminuss)rg(T minus s minus(σ

22minus r)(T minus s) + log x|σ|

)and

h(x) = ψ

(log x|σ|

) x gt 0 or ψ(y) = h

(e|σ|y

) y isin R

Hence using the solution (628) and Relation (624) we get

f(tx) = eminus(Tminust)rg(T minus t minus(σ

22minus r)(T minus t) + log x|σ|

)= eminus(Tminust)r

winfinminusinfin

ψ

(minus(σ22minus r)(T minus t) + log x

|σ|+ z

)eminusz2(2(Tminust)) dzradic

2(T minus t)π

= eminus(Tminust)rwinfinminusinfin

h(x e|σ|zminus(σ22minusr)(Tminust)) eminusz2(2(Tminust)) dzradic

2(T minus t)π

= eminus(Tminust)rwinfinminusinfin

(x e|σ|zminus(σ22minusr)(Tminust) minusK

)+ eminusz2(2(Tminust)) dzradic2(T minus t)π

= eminus(Tminust)r

timeswinfin

(minusr+σ22)(Tminust)+log(Kx)|σ|

(x e|σ|zminus(σ22minusr)(Tminust) minusK

)eminusz2(2(Tminust)) dzradic

2(T minus t)π

= x eminus(Tminust)rwinfinminusdminus(Tminust)

radicTminust

e|σ|zminus(σ22minusr)(Tminust) eminusz2(2(Tminust)) dzradic2(T minus t)π

minusK eminus(Tminust)rwinfinminusdminus(Tminust)

radicTminust

eminusz2(2(Tminust)) dzradic2(T minus t)π

= xwinfinminusdminus(Tminust)

radicTminust

e|σ|zminus(Tminust)σ22minusz2(2(Tminust)) dzradic2(T minus t)π

minusK eminus(Tminust)rwinfinminusdminus(Tminust)

radicTminust

eminusz2(2(Tminust)) dzradic2(T minus t)π

= xwinfinminusdminus(Tminust)

radicTminust

eminus(zminus(Tminust)|σ|)2(2(Tminust)) dzradic2(T minus t)π

229

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

minusK eminus(Tminust)rwinfinminusdminus(Tminust)

radicTminust

eminusz2(2(Tminust)) dzradic2(T minus t)π

= xwinfinminusdminus(Tminust)

radicTminustminus(Tminust)|σ|

eminusz2(2(Tminust)) dzradic2(T minus t)π

minusK eminus(Tminust)rwinfinminusdminus(Tminust)

radicTminust

eminusz2(2(Tminust)) dzradic2(T minus t)π

= xwinfinminusdminus(Tminust)minus|σ|

radicTminust

eminusz22 dzradic2πminusK eminus(Tminust)r

winfinminusdminus(Tminust)

eminusz22 dzradic2π

= x(1minusΦ

(minus d+(T minus t)

))minusK eminus(Tminust)r

(1minusΦ

(minus dminus(T minus t)

))= xΦ

(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)

where we used the relation (614) ie

1minusΦ(a) = Φ(minusa) a isin R

Exercises

Exercise 61 Bachelier (1900) model Consider a market made of a risklessasset valued At = A0 with zero interest rate t isin R+ and a risky asset whoseprice St is modeled by a standard Brownian motion as St = Bt t isin R+

a) Show that the price g(tBt) of the option with payoff C = B2T satisfies

the heat equationpartϕ

partt(t y) = minus1

2part2ϕ

party2 (t y)

with terminal condition g(T x) = x2b) Find the function g(tx) by solving the PDE of Question (a)

Hint Try a solution of the form g(tx) = x2 + f(t)

See Exercises 611 713 and 714 for extensions to nonzero interest rates

Exercise 62 Consider a risky asset price (St)tisinR modeled in the Cox et al(1985) (CIR) model as

dSt = β(αminus St)dt+ σradicStdBt αβσ gt 0 (631)

and let (ηt ξt)tisinR+ be a portfolio strategy whose value Vt = ηtAt + ξtSttakes the form Vt = g(tSt) t isin R+ Figure 620 presents a random simula-tion of the solution to (631) with α = 0025 β = 1 and σ = 13230

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

0

1

2

3

4

5

6

7

8

0 01 02 03 04 05 06 07 08 09 1

St

t

Fig 620 Graph of the CIR short rate t 7rarr rt with α = 25 β = 1 and σ = 13

N=10000 t lt- 0(N-1) dt lt- 10Na=0025 b=2 sigma=0052 X lt- rnorm(Nmean=0sd=sqrt(dt))R lt- rep(0N)R[1]=001

for (j in 2N)R[j]=max(0R[j-1]+(a-bR[j-1])dt+sigmasqrt(R[j-1])X[j])4 plot(t R xlab = t ylab = type = l ylim = c(0002) col = blue)

Based on the self-financing condition written as

dVt = rVtdtminus rξtStdt+ ξtdSt

= rVtdtminus rξtStdt+ β(αminus St)ξtdt+ σξtradicStdBt t isin R+ (632)

derive the PDE satisfied by the function g(tx) using the Itocirc formula

Exercise 63 Black-Scholes PDE with dividends Consider a riskless as-set with price At = A0 ert t isin R+ and an underlying asset price process(St)tisinR+ modeled as

dSt = (microminus δ)Stdt+ σStdBt

where (Bt)tisinR+ is a standard Brownian motion and δ gt 0 is a continuous-time dividend rate By absence of arbitrage the payment of a dividend entailsa drop in the stock price by the same amount occuring generally on the ex-dividend date on which the purchase of the security no longer entitles theinvestor to the dividend amount The list of investors entitled to dividendpayment is consolidated on the date of record and payment is made on thepayable date

library(quantmod)2 getSymbols(0005HKfrom=2010-01-01to=SysDate()src=yahoo)

getDividends(0005HKfrom=2010-01-01to=SysDate()src=yahoo)

a) Assuming that the portfolio with value Vt = ξtSt + ηtAt at time t is self-financing and that dividends are continuously reinvested write down theportfolio variation dVt

231

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

b) Assuming that the portfolio value Vt takes the form Vt = g(tSt) at timet derive the Black-Scholes PDE for the function g(tx) with its terminalcondition

c) Compute the price at time t isin [0T ] of the European call option withstrike price K by solving the corresponding Black-Scholes PDE

d) Compute the Delta of the option

Exercise 64

a) Check that the Black-Scholes formula (610) for European call options

gc(tx) = xΦ(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)

satisfies the following boundary conditions

i) at x = 0 gc(t 0) = 0ii) at maturity t = T

gc(T x) = (xminusK)+ =

xminusK x gt K

0 x 6 K

iii) as time to maturity tends to infinity

limTrarrinfin

Bl(Kxσ rT minus t) = x t isin R+

b) Check that the Black-Scholes formula (618) for European put options

gp(tx) = K eminus(Tminust)rΦ(minus dminus(T minus t)

)minus xΦ

(minus d+(T minus t)

)satisfies the following boundary conditions

i) at x = 0 gp(t 0) = K eminus(Tminust)rii) as x tends to infinity gp(tinfin) = 0 for all t isin [0T )iii) at maturity t = T

gp(T x) = (K minus x)+ =

0 x gt K

K minus x x 6 K

iv) as time to maturity tends to infinity

limTrarrinfin

Blp(KStσ rT minus t) = 0 t isin R+

Exercise 65 Power option (Exercise 314 continued)

232

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

a) Solve the Black-Scholes PDE

rg(x t) = partg

partt(x t) + rx

partg

partx(x t) + σ2

2 x2 part2g

partx2 (x t) (633)

with terminal condition g(xT ) = x2 x gt 0 t isin [0T ]

Hint Try a solution of the form g(x t) = x2f(t) and find f(t)b) Find the respective quantities ξt and ηt of the risky asset St and riskless

asset At = ert in the portfolio with value

Vt = g(St t) = ξtSt + ηtAt 0 6 t 6 T

hedging the contract with payoff S2T at maturity

Exercise 66 On December 18 2007 a call warrant has been issued byFortis Bank on the stock price S of the MTR Corporation with maturityT = 23122008 strike price K = HK$ 3608 and entitlement ratio=10Recall that in the Black-Scholes model the price at time t of the Europeanclaim on the underlying asset priced St with strike price K maturity T interest rate r and volatility σ gt 0 is given by the Black-Scholes formula as

f(tSt) = StΦ(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)

wheredminus(T minus t) =

(rminus σ22)(T minus t) + log(StK)

|σ|radicT minus t

d+(T minus t) = dminus(T minus t) + |σ|radicT minus t = (r+ σ22)(T minus t) + log(StK)

|σ|radicT minus t

Recall that by Proposition 64 we have

partf

partx(tSt) = Φ

(d+(T minus t)

) 0 6 t 6 T

a) Using the values of the Gaussian cumulative distribution function com-pute the Black-Scholes price of the corresponding call option at timet =November 07 2008 with St = HK$ 17200 assuming a volatility σ =90 = 090 and an annual risk-free interest rate r = 4377 = 004377

b) Still using the Gaussian cumulative distribution function compute thequantity of the risky asset required in your portfolio at time t =November07 2008 in order to hedge one such option at maturity T = 23122008

c) Figure 1 represents the Black-Scholes price of the call option as a functionof σ isin [05 15] = [50 150]

233

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

0

01

02

03

04

05

06

05 06 07 08 09 1 11 12 13 14 15σimp

Optio

n pr

ice

σ

Market price

Fig 621 Option price as a function of the volatility σ gt 0

1 BSCall lt- function(S K r T sigma)d1 lt- (log(SK)+(r+sigma^22)T)(sigmasqrt(T))d2 lt- d1 - sigma sqrt(T)

3 BSCall = Spnorm(d1) - Kexp(-rT)pnorm(d2)BSCallsigma lt- seq(0515 length=100)

5 plot(sigmaBSCall(172360800437746365sigma) type=llty=1 xlab=Sigmaylab=Black-Scholes Call Price ylim = c(006)col=bluelwd=3)grid()

abline(h=023col=redlwd=3)

Knowing that the closing price of the warrant on November 07 2008 wasHK$ 0023 which value can you infer for the implied volatility σ at thisdatelowast

Exercise 67 Forward contracts Recall that the price πt(C) of a claimpayoff C = h(ST ) of maturity T can be written as πt(C) = g(tSt) wherethe function g(tx) satisfies the Black-Scholes PDE

rg(tx) = partg

partt(tx) + rx

partg

partx(tx) + 1

2σ2x2 part

2g

partx2 (tx)

g(T x) = h(x) (1)

with terminal condition g(T x) = h(x) x gt 0

a) Assume that C is a forward contract with payoff

C = ST minusK

at time T Find the function h(x) in (1)b) Find the solution g(tx) of the above PDE and compute the price πt(C)

at time t isin [0T ]Hint search for a solution of the form g(tx) = xminus α(t) where α(t) is afunction of t to be determined

lowast Download the corresponding or the that can be runhere

234

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

BS lt- function(S K T r sig)d1 lt- (log(SK) + (r + sig^22)T) (sigsqrt(T))d2 lt- d1 - sigsqrt(T)return(Spnorm(d1) - Kexp(-rT)pnorm(d2))impliedvol lt- function(S K T r market)sig lt- 020sigup lt- 1sigdown lt- 0001count lt- 0err lt- BS(S K T r sig) - marketwhile(abs(err) gt 000001 ampamp countlt1000)if(err lt 0)sigdown lt- sigsig lt- (sigup + sig)2elsesigup lt- sigsig lt- (sigdown + sig)2err lt- BS(S K T r sig) - marketcount lt- count + 1if(count==2000)return(NA)elsereturn(sig)market = 083K = 628T = 7 365S = 634r = 002impliedvol(S K T r market)

cells [ cell_type code execution_count null metadata outputs [] source [ from IPythoncoredisplay import display HTMLn display(HTML( )) ] cell_type code execution_count null metadata collapsed true outputs [] source [ import numpy as npn import scipystats as ssn import time n n Black and Scholesn def d1(S0 K r sigma T)n return (nplog(S0K) + (r + sigma2 2) T)(sigma npsqrt(T))n n def d2(S0 K r sigma T)n return (nplog(S0 K) + (r - sigma2 2) T) (sigma npsqrt(T))n n def BlackScholes(typeS0 K r sigma T)n if type==Cn return S0 ssnormcdf(d1(S0 K r sigma T)) - K npexp(-r T) ssnormcdf(d2(S0 K r sigma T))n elsen return K npexp(-r T) ssnormcdf(-d2(S0 K r sigma T)) - S0 ssnormcdf(-d1(S0 K r sigma T)) ] cell_type code execution_count null metadata outputs [] source [ BlackScholes(C1000 1200 002 015 10) ] cell_type code execution_count null metadata outputs [] source [ def difference(x p S K r t)n return BlackScholes(CS K r x t) - p ] cell_type code execution_count null metadata outputs [] source [ from scipyoptimize import bisectn bisect(difference00011args=(11541763731112766 1000 1200 002 10)) ] ] metadata anaconda-cloud kernelspec display_name Python 3 language python name python3 language_info codemirror_mode name ipython version 3 file_extension py mimetype textx-python name python nbconvert_exporter python pygments_lexer ipython3 version 375rc1 nbformat 4 nbformat_minor 1

Black-Scholes Pricing and Hedging

c) Compute the quantityξt =

partg

partx(tSt)

of risky assets in a self-financing portfolio hedging Cd) Repeat the above questions with the terminal condition g(T x) = x

Exercise 68a) Solve the Black-Scholes PDE

rg(tx) = partg

partt(tx) + rx

partg

partx(tx) + σ2

2 x2 part2g

partx2 (tx) (634)

with terminal condition g(T x) = 1 x gt 0

Hint Try a solution of the form g(tx) = f(t) and find f(t)

b) Find the respective quantities ξt and ηt of the risky asset St and risklessasset At = ert in the portfolio with value

Vt = g(tSt) = ξtSt + ηtAt

hedging the contract with payoff $1 at maturity

Exercise 69 Log-contracts see also Exercise 84a) Solve the PDE

0 =partg

partt(x t) + rx

partg

partx(x t) + σ2

2 x2 part2g

partx2 (x t)

with the terminal condition g(xT ) = log x x gt 0

Hint Try a solution of the form g(x t) = f(t) + log x and find f(t)b) Solve the Black-Scholes PDE

rh(x t) = parth

partt(x t) + rx

parth

partx(x t) + σ2

2 x2 part2h

partx2 (x t) (635)

with the terminal condition h(xT ) = log x x gt 0

Hint Try a solution of the form h(x t) = u(t)g(x t) and find u(t)c) Find the respective quantities ξt and ηt of the risky asset St and riskless

asset At = ert in the portfolio with value

Vt = g(St t) = ξtSt + ηtAt

hedging a log-contract with payoff logST at maturity 235

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

Exercise 610 Binary options Consider a price process (St)tisinR+ given by

dStSt

= rdt+ σdBt S0 = 1

under the risk-neutral probability measure Plowast The binary (or digital) calloption is a contract with maturity T strike price K and payoff

Cd = 1[Kinfin)(ST ) =

$1 if ST gt K

0 if ST lt K

a) Derive the Black-Schole PDE satisfied by the pricing function Cd(tSt) ofthe binary call option together with its terminal condition

b) Show that the solution Cd(tx) of the Black-Scholes PDE of Question (a)is given by

Cd(tx) = eminus(Tminust)rΦ((rminus σ22)(T minus t) + log(xK)

|σ|radicT minus t

)= eminus(Tminust)rΦ

(dminus(T minus t)

)

where

dminus(T minus t) =(rminus σ22)(T minus t) + log(StK)

|σ|radicT minus t

0 6 t lt T

Exercise 611

a) Bachelier (1900) model Solve the stochastic differential equation

dSt = αStdt+ σdBt (636)

in terms of ασ isin R and the initial condition S0b) Write down the Bachelier PDE satisfied by the function C(tx) where

C(tSt) is the price at time t isin [0T ] of the contingent claim with payoffφ(ST ) = exp(ST ) and identify the process Delta (ξt)tisin[0T ] that hedgesthis claim

c) Solve the Black-Scholes PDE of Question (b) with the terminal conditionφ(x) = ex x isin R

Hint Search for a solution of the form

C(tx) = exp(minus(T minus t)r+ xh(t) +

σ2

4r (h2(t)minus 1)

) (637)

where h(t) is a function to be determined with h(T ) = 1

236

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

d) Compute the portfolio strategy (ξt ηt)tisin[0T ] that hedges the contingentclaim with payoff exp(ST )

Exercise 612

a) Show that for every fixed value of S the function

d 7minusrarr h(S d) = SΦ(d+ |σ|

radicT)minusK eminusrTΦ(d)

reaches its maximum at dlowast(S) =log(SK) + (rminus σ22)T

|σ|radicT

b) By the differentiation rule

d

dSh(S dlowast(S)) =

parth

partS(S dlowast(S)) + dprimelowast(S)

parth

partd(S dlowast(S))

recover the value of the Black-Scholes Delta

Exercise 613 Compute the Black-Scholes Vega by differentiation of theBlack-Scholes function

gc(tx) = Bl(Kxσ rT minus t) = xΦ(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)

with respect to the volatility parameter σ knowing that

minus12(dminus(T minus t)

)2= minus1

2

(log(xK) + (rminus σ22)(T minus t)

|σ|radicT minus t

)2

= minus12(d+(T minus t)

)2+ (T minus t)r+ log x

K (638)

Exercise 614 Consider the backward induction relation (313) ie

v(tx) = (1minus plowastN )v (t+ 1x(1 + aN )) + plowastN v (t+ 1x(1 + bN ))

using the renormalizations rN = rTN and

aN = (1 + rN )(1minus |σ|radicTN)minus 1 bN = (1 + rN )(1 + |σ|

radicTN)minus 1

of Section 36 N gt 1 with

plowastN =rN minus aNbN minus aN

and plowastN =bN minus rNbN minus aN

a) Show that the Black-Scholes PDE (62) of Proposition 61 can be recoveredfrom the induction relation (313) when the number N of time steps tendsto infinity

237

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

b) Show that the expression of the Delta ξt =partgcpartx

(tSt) can be similarlyrecovered from the finite difference relation (319) ie

ξ(1)t (Stminus1) =

v (t (1 + bN )Stminus1)minus v (t (1 + aN )Stminus1)

Stminus1(bN minus aN )

as N tends to infinity

Problem 615 (Leung and Sircar (2015)) ProShares Ultra SampP500 andProShares UltraShort SampP500 are leveraged investment funds that seek dailyinvestment results before fees and expenses that correspond to β times (βx)the daily performance of the SampP500reg with respectively β = 2 for ProSharesUltra and β = minus2 for ProShares UltraShort Here leveraging with a factorβ 1 aims at multiplying the potential return of an investment by a factorβ The following 10 questions are interdependent and should be treated insequence

a) Consider a risky asset priced S0 = $4 at time t = 0 and taking twopossible values S1 = $5 and S1 = $2 at time t = 1 Compute the twopossible returns (in ) achieved when investing $4 in one share of the assetS and the expected return under the risk-neutral probability measureassuming that the risk-free interest rate is zero

b) Leveraging Still based on an initial $4 investment we decide to leverageby a factor β = 3 by borrowing another (β minus 1) times $4 = 2times $4 at ratezero to purchase a total of β = 3 shares of the asset S Compute thetwo returns (in ) possibly achieved in this case and the expected returnunder the risk-neutral probability measure assuming that the risk-freeinterest rate is zero

c) Denoting by Ft the ProShares value at time t how much should the fundinvest in the underlying asset priced St and how much $ should it borrowor save on the risk-free market at any time t in order to leverage with afactor β 1

d) Find the portfolio allocation (ξt ηt) for the fund value

Ft = ξtSt + ηtAt t isin R+

according to Question (c) where At = A0 ert is the riskless money marketaccount

e) We choose to model the SampP500 index St as the geometric Brownianmotion

dSt = rStdt+ σStdBt t isin R+

under the risk-neutral probability measure Plowast Find the stochastic dif-ferential equation satisfied by (Ft)tisinR+ under the self-financing conditiondFt = ξtdSt + ηtdAt

238

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

f) Is the discounted fund value ( eminusrtFt)tisinR+ a martingale under the risk-neutral probability measure Plowast

g) Find the relation between the fund value Ft and the index St by solvingthe stochastic differential equation obtained for Ft in Question (e) Forsimplicity we normalize F0 = Sβ0

h) Write the price at time t = 0 of the call option with payoff (FT minusK)+ onthe ProShares index using the Black-Scholes formula

i) Show that when β gt 0 the Delta at time t isin [0T ) of the call optionwith payoff (FT minusK)+ on ProShares Ultra is equal to the Delta of thecall option with payoff (ST minusKβ(t))

+ on the SampP500 for a certain strikeprice Kβ(t) to be determined explicitly

j) When β lt 0 find the relation between the Delta at time t isin [0T ) ofthe call option with payoff (FT minusK)+ on ProShares UltraShort and theDelta of the put option with payoff (Kβ(t)minus ST )+ on the SampP500

239

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

  1. pbsARFix223
  2. pbsARFix224
  3. pbsARFix225
  4. pbsARFix226
  5. pbsARFix227
  6. pbsARFix228
  7. pbsARFix229
  8. pbsARFix230
  9. fdrm1
  10. pbsARFix231
  11. 100
  12. 101
  13. 102
  14. 103
  15. 104
  16. 105
  17. 106
  18. 107
  19. 108
  20. 109
  21. 1010
  22. 1011
  23. 1012
  24. 1013
  25. 1014
  26. 1015
  27. 1016
  28. 1017
  29. 1018
  30. 1019
  31. anm10
  32. 10EndLeft
  33. 10StepLeft
  34. 10PauseLeft
  35. 10PlayLeft
  36. 10PlayPauseLeft
  37. 10PauseRight
  38. 10PlayRight
  39. 10PlayPauseRight
  40. 10StepRight
  41. 10EndRight
  42. 10Minus
  43. 10Reset
  44. 10Plus
  45. pbsARFix232
  46. pbsARFix233
  47. pbsARFix234
  48. pbsARFix235
  49. pbsARFix236
  50. pbsARFix237
  51. fdrm2
  52. 110
  53. 111
  54. 112
  55. 113
  56. 114
  57. 115
  58. 116
  59. 117
  60. 118
  61. 119
  62. 1110
  63. 1111
  64. 1112
  65. 1113
  66. 1114
  67. 1115
  68. 1116
  69. 1117
  70. 1118
  71. 1119
  72. anm11
  73. 11EndLeft
  74. 11StepLeft
  75. 11PauseLeft
  76. 11PlayLeft
  77. 11PlayPauseLeft
  78. 11PauseRight
  79. 11PlayRight
  80. 11PlayPauseRight
  81. 11StepRight
  82. 11EndRight
  83. 11Minus
  84. 11Reset
  85. 11Plus
  86. pbsARFix238
  87. pbsARFix239
  88. pbsARFix240
  89. pbsARFix241
  90. pbsARFix242
  91. 120
  92. 121
  93. 122
  94. 123
  95. 124
  96. 125
  97. 126
  98. 127
  99. 128
  100. 129
  101. 1210
  102. anm12
  103. 12EndLeft
  104. 12StepLeft
  105. 12PauseLeft
  106. 12PlayLeft
  107. 12PlayPauseLeft
  108. 12PauseRight
  109. 12PlayRight
  110. 12PlayPauseRight
  111. 12StepRight
  112. 12EndRight
  113. 12Minus
  114. 12Reset
  115. 12Plus
  116. 130
  117. 131
  118. 132
  119. 133
  120. 134
  121. 135
  122. 136
  123. 137
  124. 138
  125. 139
  126. 1310
  127. anm13
  128. 13EndLeft
  129. 13StepLeft
  130. 13PauseLeft
  131. 13PlayLeft
  132. 13PlayPauseLeft
  133. 13PauseRight
  134. 13PlayRight
  135. 13PlayPauseRight
  136. 13StepRight
  137. 13EndRight
  138. 13Minus
  139. 13Reset
  140. 13Plus
  141. pbsARFix243
  142. pbsARFix244
  143. pbsARFix245
  144. pbsARFix246
  145. 140
  146. 141
  147. 142
  148. 143
  149. 144
  150. 145
  151. 146
  152. 147
  153. 148
  154. 149
  155. 1410
  156. 1411
  157. 1412
  158. 1413
  159. 1414
  160. 1415
  161. 1416
  162. 1417
  163. 1418
  164. 1419
  165. 1420
  166. 1421
  167. 1422
  168. 1423
  169. 1424
  170. 1425
  171. 1426
  172. 1427
  173. 1428
  174. 1429
  175. 1430
  176. 1431
  177. 1432
  178. 1433
  179. 1434
  180. 1435
  181. 1436
  182. 1437
  183. 1438
  184. 1439
  185. 1440
  186. 1441
  187. 1442
  188. 1443
  189. 1444
  190. 1445
  191. 1446
  192. 1447
  193. 1448
  194. 1449
  195. 1450
  196. 1451
  197. 1452
  198. 1453
  199. 1454
  200. 1455
  201. 1456
  202. 1457
  203. 1458
  204. 1459
  205. 1460
  206. 1461
  207. 1462
  208. 1463
  209. 1464
  210. 1465
  211. 1466
  212. 1467
  213. 1468
  214. 1469
  215. 1470
  216. 1471
  217. 1472
  218. 1473
  219. 1474
  220. 1475
  221. 1476
  222. 1477
  223. 1478
  224. 1479
  225. 1480
  226. 1481
  227. 1482
  228. 1483
  229. 1484
  230. 1485
  231. 1486
  232. 1487
  233. 1488
  234. 1489
  235. 1490
  236. 1491
  237. 1492
  238. 1493
  239. 1494
  240. 1495
  241. 1496
  242. 1497
  243. 1498
  244. 1499
  245. 14100
  246. 14101
  247. 14102
  248. 14103
  249. 14104
  250. 14105
  251. 14106
  252. 14107
  253. 14108
  254. 14109
  255. 14110
  256. 14111
  257. 14112
  258. 14113
  259. 14114
  260. 14115
  261. 14116
  262. 14117
  263. 14118
  264. 14119
  265. 14120
  266. 14121
  267. 14122
  268. 14123
  269. 14124
  270. 14125
  271. 14126
  272. 14127
  273. 14128
  274. 14129
  275. 14130
  276. 14131
  277. 14132
  278. 14133
  279. 14134
  280. 14135
  281. 14136
  282. 14137
  283. 14138
  284. 14139
  285. 14140
  286. 14141
  287. 14142
  288. 14143
  289. 14144
  290. 14145
  291. 14146
  292. 14147
  293. 14148
  294. 14149
  295. 14150
  296. 14151
  297. 14152
  298. 14153
  299. 14154
  300. 14155
  301. 14156
  302. 14157
  303. 14158
  304. 14159
  305. 14160
  306. 14161
  307. 14162
  308. 14163
  309. 14164
  310. 14165
  311. 14166
  312. 14167
  313. 14168
  314. 14169
  315. 14170
  316. 14171
  317. 14172
  318. 14173
  319. 14174
  320. 14175
  321. 14176
  322. 14177
  323. 14178
  324. 14179
  325. 14180
  326. 14181
  327. 14182
  328. 14183
  329. 14184
  330. 14185
  331. 14186
  332. 14187
  333. 14188
  334. 14189
  335. 14190
  336. 14191
  337. 14192
  338. 14193
  339. 14194
  340. 14195
  341. 14196
  342. 14197
  343. anm14
  344. 14EndLeft
  345. 14StepLeft
  346. 14PauseLeft
  347. 14PlayLeft
  348. 14PlayPauseLeft
  349. 14PauseRight
  350. 14PlayRight
  351. 14PlayPauseRight
  352. 14StepRight
  353. 14EndRight
  354. 14Minus
  355. 14Reset
  356. 14Plus
  357. pbsARFix247
  358. pbsARFix248
  359. 150
  360. 151
  361. 152
  362. 153
  363. 154
  364. 155
  365. 156
  366. 157
  367. 158
  368. 159
  369. 1510
  370. 1511
  371. 1512
  372. 1513
  373. 1514
  374. 1515
  375. 1516
  376. 1517
  377. 1518
  378. 1519
  379. anm15
  380. 15EndLeft
  381. 15StepLeft
  382. 15PauseLeft
  383. 15PlayLeft
  384. 15PlayPauseLeft
  385. 15PauseRight
  386. 15PlayRight
  387. 15PlayPauseRight
  388. 15StepRight
  389. 15EndRight
  390. 15Minus
  391. 15Reset
  392. 15Plus
  393. pbsARFix249
  394. pbsARFix250
  395. pbsARFix251
  396. pbsARFix252
  397. pbsARFix253
  398. pbsARFix254
  399. pbsARFix255
  400. pbsARFix256
  401. pbsARFix257
  402. pbsARFix258
  403. pbsARFix259
  404. pbsARFix260
  405. pbsARFix261
Page 7: Black-ScholesPricingandHedging - NTU · to the Black-Scholes PDE (6.2) in order to price a claim payoff Cof the formC= h(S T).Asinthediscrete-timecase,thearbitragepriceπt(C) at

Black-Scholes Pricing and Hedging

Proposition 63 The solution of the PDE (69) is given by the Black-Scholes formula for call options

gc(tx) = Bl(Kxσ rT minus t) = xΦ(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)

(610)with

d+(T minus t) =log(xK) + (r+ σ22)(T minus t)

|σ|radicT minus t

(611)

dminus(T minus t) =log(xK) + (rminus σ22)(T minus t)

|σ|radicT minus t

0 6 t lt T (612)

We note the relation

d+(T minus t) = dminus(T minus t) + |σ|radicT minus t 0 6 t lt T (613)

Here ldquologrdquo denotes the natural logarithm ldquolnrdquo and

Φ(x) = P(X 6 x) =1radic2π

w xminusinfin

eminusy22dy x isin R

denotes the standard Gaussian Cumulative Distribution Function (CDF) ofa standard normal random variable X N (0 1) with the relation

Φ(minusx) = 1minusΦ(x) x isin R (614)

0

02

04

06

08

1

12

-4 -3 -2 -1 0 1 2 3 4

Φ(x)

x

1Gaussian CDF Φ(x)

Fig 63 Graph of the Gaussian CDF

In other words the European call option with strike price K and maturityT is priced at time t isin [0T ] as

gc(tSt) = Bl(KStσ rT minus t)= StΦ

(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

) 0 6 t 6 T

207

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

The following R script is an implementation of the Black-Scholes formula forEuropean call options in Rlowast

1 BSCall lt- function(S K r T sigma)d1 lt- (log(SK)+(r+sigma^22)T)(sigmasqrt(T))

3 d2 lt- d1 - sigma sqrt(T)BSCall = Spnorm(d1) - Kexp(-rT)pnorm(d2)

5 BSCall

In comparison with the discrete-time Cox-Ross-Rubinstein (CRR) model ofSection 26 the interest in the formula (610) is to provide an analytical so-lution that can be evaluated in a single step which is computationally muchmore efficient

Fig 64 Graph of the Black-Scholes call price map with strike price K = 100dagger

Figure 64 presents an interactive graph of the Black-Scholes call price mapie the solution

(tx) 7minusrarr gc(tx) = xΦ(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)of the Black-Scholes PDE (67) for a call optionlowast Download the corresponding that can be run heredagger Right-click on the figure for interaction and ldquoFull Screen Multimediardquo view

208

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

(C) 2012--today Alexander Grahn 3Dmenujs version 20140923 3D JavaScript used by media9sty Extended functionality of the (right click) context menu of 3D annotations 1) Adds the following items to the 3D context menu `Generate Default View Finds good default camera settings returned as options for use with the includemedia command `Get Current View Determines camera cross section and part settings of the current view returned as `VIEW section that can be copied into a views file of additional views The views file is inserted using the `3Dviews option of includemedia `Cross Section Toggle switch to add or remove a cross section into or from the current view The cross section can be moved in the x y z directions using x y z and X Y Z keys on the keyboard be tilted against and spun around the upright Z axis using the UpDown and LeftRight arrow keys and caled using the s and S keys 2) Enables manipulation of position and orientation of indiviual parts and groups of parts in the 3D scene Parts which have been selected with the mouse can be scaled moved around and rotated like the cross section as described above To spin the parts around their local up-axis keep Control key pressed while using the UpDown and LeftRight arrow keys This work may be distributed andor modified under the conditions of the LaTeX Project Public License The latest version of this license is in httpmirrorsctanorgmacroslatexbaselppltxt This work has the LPPL maintenance status `maintained The Current Maintainer of this work is A Grahn The code borrows heavily from Bernd Gaertners `Miniball software originally written in C++ for computing the smallest enclosing ball of a set of points see httpwwwinfethzchpersonalgaertnerminiballhtmlhostconsoleshow()constructor for doubly linked listfunction List() thisfirst_node=null thislast_node=new Node(undefined)Listprototypepush_back=function(x) var new_node=new Node(x) if(thisfirst_node==null) thisfirst_node=new_node new_nodeprev=null else new_nodeprev=thislast_nodeprev new_nodeprevnext=new_node new_nodenext=thislast_node thislast_nodeprev=new_nodeListprototypemove_to_front=function(it) var node=itget() if(nodenext=null ampamp nodeprev=null) nodenextprev=nodeprev nodeprevnext=nodenext nodeprev=null nodenext=thisfirst_node thisfirst_nodeprev=node thisfirst_node=node Listprototypebegin=function() var i=new Iterator() itarget=thisfirst_node return(i)Listprototypeend=function() var i=new Iterator() itarget=thislast_node return(i)function Iterator(it) if( it=undefined ) thistarget=ittarget else thistarget=null Iteratorprototypeset=function(it)thistarget=ittargetIteratorprototypeget=function()return(thistarget)Iteratorprototypederef=function()return(thistargetdata)Iteratorprototypeincr=function() if(thistargetnext=null) thistarget=thistargetnextconstructor for node objects that populate the linked listfunction Node(x) thisprev=null thisnext=null thisdata=xfunction sqr(r)return(rr)helper functionMiniball algorithm by B Gaertnerfunction Basis() thism=0 thisq0=new Array(3) thisz=new Array(4) thisf=new Array(4) thisv=new Array(new Array(3) new Array(3) new Array(3) new Array(3)) thisa=new Array(new Array(3) new Array(3) new Array(3) new Array(3)) thisc=new Array(new Array(3) new Array(3) new Array(3) new Array(3)) thissqr_r=new Array(4) thiscurrent_c=thisc[0] thiscurrent_sqr_r=0 thisreset()Basisprototypecenter=function()return(thiscurrent_c)Basisprototypesize=function()return(thism)Basisprototypepop=function()--thismBasisprototypeexcess=function(p) var e=-thiscurrent_sqr_r for(var k=0klt3++k) e+=sqr(p[k]-thiscurrent_c[k]) return(e)Basisprototypereset=function() thism=0 for(var j=0jlt3++j) thisc[0][j]=0 thiscurrent_c=thisc[0] thiscurrent_sqr_r=-1Basisprototypepush=function(p) var i j var eps=1e-32 if(thism==0) for(i=0ilt3++i) thisq0[i]=p[i] for(i=0ilt3++i) thisc[0][i]=thisq0[i] thissqr_r[0]=0 else for(i=0ilt3++i) thisv[thism][i]=p[i]-thisq0[i] for(i=1iltthism++i) thisa[thism][i]=0 for(j=0jlt3++j) thisa[thism][i]+=thisv[i][j]thisv[thism][j] thisa[thism][i]=(2thisz[i]) for(i=1iltthism++i) for(j=0jlt3++j) thisv[thism][j]-=thisa[thism][i]thisv[i][j] thisz[thism]=0 for(j=0jlt3++j) thisz[thism]+=sqr(thisv[thism][j]) thisz[thism]=2 if(thisz[thism]ltepsthiscurrent_sqr_r) return(false) var e=-thissqr_r[thism-1] for(i=0ilt3++i) e+=sqr(p[i]-thisc[thism-1][i]) thisf[thism]=ethisz[thism] for(i=0ilt3++i) thisc[thism][i]=thisc[thism-1][i]+thisf[thism]thisv[thism][i] thissqr_r[thism]=thissqr_r[thism-1]+ethisf[thism]2 thiscurrent_c=thisc[thism] thiscurrent_sqr_r=thissqr_r[thism] ++thism return(true)function Miniball() thisL=new List() thisB=new Basis() thissupport_end=new Iterator()Miniballprototypemtf_mb=function(it) var i=new Iterator(it) thissupport_endset(thisLbegin()) if((thisBsize())==4) return for(var k=new Iterator(thisLbegin())kget()=iget()) var j=new Iterator(k) kincr() if(thisBexcess(jderef()) gt 0) if(thisBpush(jderef())) thismtf_mb(j) thisBpop() if(thissupport_endget()==jget()) thissupport_endincr() thisLmove_to_front(j) Miniballprototypecheck_in=function(b) thisLpush_back(b)Miniballprototypebuild=function() thisBreset() thissupport_endset(thisLbegin()) thismtf_mb(thisLend())Miniballprototypecenter=function() return(thisBcenter())Miniballprototyperadius=function() return(Mathsqrt(thisBcurrent_sqr_r))functions called by menu itemsfunction calc3Dopts () create Miniball object var mb=new Miniball() auxiliary vector var corner=new Vector3() iterate over all visible mesh nodes in the scene for(i=0iltscenemeshescounti++) var mesh=scenemeshesgetByIndex(i) if(meshvisible) continue local to parent transformation matrix var trans=meshtransform build local to world transformation matrix by recursively multiplying the parents transf matrix on the right var parent=meshparent while(parenttransform) trans=transmultiply(parenttransform) parent=parentparent get the bbox of the mesh (local coordinates) var bbox=meshcomputeBoundingBox() transform the local bounding box corner coordinates to world coordinates for bounding sphere determination BBoxmin cornerset(bboxmin) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) BBoxmax cornerset(bboxmax) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) remaining six BBox corners cornerset(bboxminx bboxmaxy bboxmaxz) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) cornerset(bboxminx bboxminy bboxmaxz) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) cornerset(bboxminx bboxmaxy bboxminz) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) cornerset(bboxmaxx bboxminy bboxminz) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) cornerset(bboxmaxx bboxminy bboxmaxz) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) cornerset(bboxmaxx bboxmaxy bboxminz) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) compute the smallest enclosing bounding sphere mbbuild() current camera settings var camera=scenecamerasgetByIndex(0) var res= initialize result string aperture angle of the virtual camera (perspective projection) or orthographic scale (orthographic projection) if(cameraprojectionType==cameraTYPE_PERSPECTIVE) var aac=camerafov180MathPI if(hostutilprintf(4f aac)=30) res+=hostutilprintf(n3Daac=s aac) else cameraviewPlaneSize=2mbradius() res+=hostutilprintf(n3Dortho=s 1cameraviewPlaneSize) camera roll var roll = cameraroll180MathPI if(hostutilprintf(4f roll)=0) res+=hostutilprintf(n3Droll=sroll) target to camera vector var c2c=new Vector3() c2cset(cameraposition) c2csubtractInPlace(cameratargetPosition) c2cnormalize() if((c2cx==0 ampamp c2cy==-1 ampamp c2cz==0)) res+=hostutilprintf(n3Dc2c=s s s c2cx c2cy c2cz) new camera settings bounding sphere centre --gt new camera target var coo=new Vector3() cooset((mbcenter())[0] (mbcenter())[1] (mbcenter())[2]) if(coolength) res+=hostutilprintf(n3Dcoo=s s s coox cooy cooz) radius of orbit if(cameraprojectionType==cameraTYPE_PERSPECTIVE) var roo=mbradius() Mathsin(aac MathPI 360) else orthographic projection var roo=mbradius() res+=hostutilprintf(n3Droo=s roo) update camera settings in the viewer var currol=cameraroll cameratargetPositionset(coo) camerapositionset(cooadd(c2cscale(roo))) cameraroll=currol determine background colour rgb=scenebackgroundgetColor() if((rgbr==1 ampamp rgbg==1 ampamp rgbb==1)) res+=hostutilprintf(n3Dbg=s s s rgbr rgbg rgbb) determine lighting scheme switch(scenelightScheme) case sceneLIGHT_MODE_FILE curlights=Artworkbreak case sceneLIGHT_MODE_NONE curlights=Nonebreak case sceneLIGHT_MODE_WHITE curlights=Whitebreak case sceneLIGHT_MODE_DAY curlights=Daybreak case sceneLIGHT_MODE_NIGHT curlights=Nightbreak case sceneLIGHT_MODE_BRIGHT curlights=Hardbreak case sceneLIGHT_MODE_RGB curlights=Primarybreak case sceneLIGHT_MODE_BLUE curlights=Bluebreak case sceneLIGHT_MODE_RED curlights=Redbreak case sceneLIGHT_MODE_CUBE curlights=Cubebreak case sceneLIGHT_MODE_CAD curlights=CADbreak case sceneLIGHT_MODE_HEADLAMP curlights=Headlampbreak if(curlights=Artwork) res+=hostutilprintf(n3Dlights=s curlights) determine global render mode switch(scenerenderMode) case sceneRENDER_MODE_BOUNDING_BOX currender=BoundingBoxbreak case sceneRENDER_MODE_TRANSPARENT_BOUNDING_BOX currender=TransparentBoundingBoxbreak case sceneRENDER_MODE_TRANSPARENT_BOUNDING_BOX_OUTLINE currender=TransparentBoundingBoxOutlinebreak case sceneRENDER_MODE_VERTICES currender=Verticesbreak case sceneRENDER_MODE_SHADED_VERTICES currender=ShadedVerticesbreak case sceneRENDER_MODE_WIREFRAME currender=Wireframebreak case sceneRENDER_MODE_SHADED_WIREFRAME currender=ShadedWireframebreak case sceneRENDER_MODE_SOLID currender=Solidbreak case sceneRENDER_MODE_TRANSPARENT currender=Transparentbreak case sceneRENDER_MODE_SOLID_WIREFRAME currender=SolidWireframebreak case sceneRENDER_MODE_TRANSPARENT_WIREFRAME currender=TransparentWireframebreak case sceneRENDER_MODE_ILLUSTRATION currender=Illustrationbreak case sceneRENDER_MODE_SOLID_OUTLINE currender=SolidOutlinebreak case sceneRENDER_MODE_SHADED_ILLUSTRATION currender=ShadedIllustrationbreak case sceneRENDER_MODE_HIDDEN_WIREFRAME currender=HiddenWireframebreak if(currender=Solid) res+=hostutilprintf(n3Drender=s currender) write result string to the console hostconsoleshow() hostconsoleclear() hostconsoleprintln(n Copy and paste the following text to then+ option list of includemedian + res + n)function get3Dview () var camera=scenecamerasgetByIndex(0) var coo=cameratargetPosition var c2c=camerapositionsubtract(coo) var roo=c2clength c2cnormalize() var res=VIEW=insert optional name heren if((coox==0 ampamp cooy==0 ampamp cooz==0)) res+=hostutilprintf( COO=s s sn coox cooy cooz) if((c2cx==0 ampamp c2cy==-1 ampamp c2cz==0)) res+=hostutilprintf( C2C=s s sn c2cx c2cy c2cz) if(roo gt 1e-9) res+=hostutilprintf( ROO=sn roo) var roll = cameraroll180MathPI if(hostutilprintf(4f roll)=0) res+=hostutilprintf( ROLL=sn roll) if(cameraprojectionType==cameraTYPE_PERSPECTIVE) var aac=camerafov 180MathPI if(hostutilprintf(4f aac)=30) res+=hostutilprintf( AAC=sn aac) else if(hostutilprintf(4f cameraviewPlaneSize)=1) res+=hostutilprintf( ORTHO=sn 1cameraviewPlaneSize) rgb=scenebackgroundgetColor() if((rgbr==1 ampamp rgbg==1 ampamp rgbb==1)) res+=hostutilprintf( BGCOLOR=s s sn rgbr rgbg rgbb) switch(scenelightScheme) case sceneLIGHT_MODE_FILE curlights=Artworkbreak case sceneLIGHT_MODE_NONE curlights=Nonebreak case sceneLIGHT_MODE_WHITE curlights=Whitebreak case sceneLIGHT_MODE_DAY curlights=Daybreak case sceneLIGHT_MODE_NIGHT curlights=Nightbreak case sceneLIGHT_MODE_BRIGHT curlights=Hardbreak case sceneLIGHT_MODE_RGB curlights=Primarybreak case sceneLIGHT_MODE_BLUE curlights=Bluebreak case sceneLIGHT_MODE_RED curlights=Redbreak case sceneLIGHT_MODE_CUBE curlights=Cubebreak case sceneLIGHT_MODE_CAD curlights=CADbreak case sceneLIGHT_MODE_HEADLAMP curlights=Headlampbreak if(curlights=Artwork) res+= LIGHTS=+curlights+n switch(scenerenderMode) case sceneRENDER_MODE_BOUNDING_BOX defaultrender=BoundingBoxbreak case sceneRENDER_MODE_TRANSPARENT_BOUNDING_BOX defaultrender=TransparentBoundingBoxbreak case sceneRENDER_MODE_TRANSPARENT_BOUNDING_BOX_OUTLINE defaultrender=TransparentBoundingBoxOutlinebreak case sceneRENDER_MODE_VERTICES defaultrender=Verticesbreak case sceneRENDER_MODE_SHADED_VERTICES defaultrender=ShadedVerticesbreak case sceneRENDER_MODE_WIREFRAME defaultrender=Wireframebreak case sceneRENDER_MODE_SHADED_WIREFRAME defaultrender=ShadedWireframebreak case sceneRENDER_MODE_SOLID defaultrender=Solidbreak case sceneRENDER_MODE_TRANSPARENT defaultrender=Transparentbreak case sceneRENDER_MODE_SOLID_WIREFRAME defaultrender=SolidWireframebreak case sceneRENDER_MODE_TRANSPARENT_WIREFRAME defaultrender=TransparentWireframebreak case sceneRENDER_MODE_ILLUSTRATION defaultrender=Illustrationbreak case sceneRENDER_MODE_SOLID_OUTLINE defaultrender=SolidOutlinebreak case sceneRENDER_MODE_SHADED_ILLUSTRATION defaultrender=ShadedIllustrationbreak case sceneRENDER_MODE_HIDDEN_WIREFRAME defaultrender=HiddenWireframebreak if(defaultrender=Solid) res+= RENDERMODE=+defaultrender+n detect existing Clipping Plane (3D Cross Section) var clip=null if( clip=scenenodesgetByName($$$$$$)|| clip=scenenodesgetByName(Clipping Plane) ) for(var i=0iltscenenodescounti++) var nd=scenenodesgetByIndex(i) if(nd==clip||ndname==) continue var ndUTFName= for (var j=0 jltndnamelength j++) var theUnicode = ndnamecharCodeAt(j)toString(16) while (theUnicodelengthlt4) theUnicode = 0 + theUnicode ndUTFName += theUnicode var end=ndnamelastIndexOf() if(endgt0) var ndUserName=ndnamesubstr(0end) else var ndUserName=ndname respart= PART=+ndUserName+n respart+= UTF16NAME=+ndUTFName+n defaultvals=true if(ndvisible) respart+= VISIBLE=falsen defaultvals=false if(ndopacitylt10) respart+= OPACITY=+ndopacity+n defaultvals=false if(ndconstructorname==Mesh) currender=defaultrender switch(ndrenderMode) case sceneRENDER_MODE_BOUNDING_BOX currender=BoundingBoxbreak case sceneRENDER_MODE_TRANSPARENT_BOUNDING_BOX currender=TransparentBoundingBoxbreak case sceneRENDER_MODE_TRANSPARENT_BOUNDING_BOX_OUTLINE currender=TransparentBoundingBoxOutlinebreak case sceneRENDER_MODE_VERTICES currender=Verticesbreak case sceneRENDER_MODE_SHADED_VERTICES currender=ShadedVerticesbreak case sceneRENDER_MODE_WIREFRAME currender=Wireframebreak case sceneRENDER_MODE_SHADED_WIREFRAME currender=ShadedWireframebreak case sceneRENDER_MODE_SOLID currender=Solidbreak case sceneRENDER_MODE_TRANSPARENT currender=Transparentbreak case sceneRENDER_MODE_SOLID_WIREFRAME currender=SolidWireframebreak case sceneRENDER_MODE_TRANSPARENT_WIREFRAME currender=TransparentWireframebreak case sceneRENDER_MODE_ILLUSTRATION currender=Illustrationbreak case sceneRENDER_MODE_SOLID_OUTLINE currender=SolidOutlinebreak case sceneRENDER_MODE_SHADED_ILLUSTRATION currender=ShadedIllustrationbreak case sceneRENDER_MODE_HIDDEN_WIREFRAME currender=HiddenWireframebreak case sceneRENDER_MODE_DEFAULT currender=Defaultbreak if(currender=defaultrender) respart+= RENDERMODE=+currender+n defaultvals=false if(origtrans[ndname]ampampndtransformisEqual(origtrans[ndname])) var lvec=ndtransformtransformDirection(new Vector3(100)) var uvec=ndtransformtransformDirection(new Vector3(010)) var vvec=ndtransformtransformDirection(new Vector3(001)) respart+= TRANSFORM= +lvecx+ +lvecy+ +lvecz+ +uvecx+ +uvecy+ +uvecz+ +vvecx+ +vvecy+ +vvecz+ +ndtransformtranslationx+ +ndtransformtranslationy+ +ndtransformtranslationz+n defaultvals=false respart+= ENDn if(defaultvals) res+=respart if(clip) var centre=cliptransformtranslation var normal=cliptransformtransformDirection(new Vector3(001)) res+= CROSSSECTn if((centrex==0 ampamp centrey==0 ampamp centrez==0)) res+=hostutilprintf( CENTER=s s sn centrex centrey centrez) if((normalx==1 ampamp normaly==0 ampamp normalz==0)) res+=hostutilprintf( NORMAL=s s sn normalx normaly normalz) res+=hostutilprintf( VISIBLE=sn clipvisible) res+=hostutilprintf( PLANECOLOR=s s sn clipmaterialemissiveColorr clipmaterialemissiveColorg clipmaterialemissiveColorb) res+=hostutilprintf( OPACITY=sn clipopacity) res+=hostutilprintf( INTERSECTIONCOLOR=s s sn clipwireframeColorr clipwireframeColorg clipwireframeColorb) res+= ENDn for(var propt in clip) consoleprintln(propt++clip[propt]) res+=ENDn hostconsoleshow() hostconsoleclear() hostconsoleprintln(n Add the following VIEW section to a file ofn+ predefined views (See option 3Dviews)nn + The view may be given a name after VIEW=n + (Remove in front of =)n) hostconsoleprintln(res + n)add items to 3D context menuruntimeaddCustomMenuItem(dfltview Generate Default View default 0)runtimeaddCustomMenuItem(currview Get Current View default 0)runtimeaddCustomMenuItem(csection Cross Section checked 0)menu event handlersmenuEventHandler = new MenuEventHandler()menuEventHandleronEvent = function(e) switch(emenuItemName) case dfltview calc3Dopts() break case currview get3Dview() break case csection addremoveClipPlane(emenuItemChecked) break runtimeaddEventHandler(menuEventHandler)global variable taking reference to currently selected nodevar target=nullselectionEventHandler=new SelectionEventHandler()selectionEventHandleronEvent=function(e) if(eselectedampampenodename=) target=enode else target=null runtimeaddEventHandler(selectionEventHandler)cameraEventHandler=new CameraEventHandler()cameraEventHandleronEvent=function(e) var clip=null runtimeremoveCustomMenuItem(csection) runtimeaddCustomMenuItem(csection Cross Section checked 0) if(clip=scenenodesgetByName($$$$$$)|| predefined scenenodesgetByName(Clipping Plane)) added via context menu runtimeremoveCustomMenuItem(csection) runtimeaddCustomMenuItem(csection Cross Section checked 1) if(clip)plane in predefined views must be rotated by 90 deg around normal cliptransformrotateAboutLineInPlace( MathPI2cliptransformtranslation cliptransformtransformDirection(new Vector3(001)) ) for(var i=0 iltrot4x4length i++)rot4x4[i]setIdentity() target=nullruntimeaddEventHandler(cameraEventHandler)var rot4x4=new Array() keeps track of spin and tilt axes transformationskey event handler for scaling moving spinning and tilting objectskeyEventHandler=new KeyEventHandler()keyEventHandleronEvent=function(e) var backtrans=new Matrix4x4() var trgt=null if(target) trgt=target var backtrans=new Matrix4x4() var trans=trgttransform var parent=trgtparent while(parenttransform) build local to world transformation matrix transmultiplyInPlace(parenttransform) also build world to local back-transformation matrix backtransmultiplyInPlace(parenttransforminversetranspose) parent=parentparent backtranstransposeInPlace() else if( trgt=scenenodesgetByName($$$$$$)|| trgt=scenenodesgetByName(Clipping Plane) ) var trans=trgttransform if(trgt) return var tname=trgtname if(typeof(rot4x4[tname])==undefined) rot4x4[tname]=new Matrix4x4() if(target) var tiltAxis=rot4x4[tname]transformDirection(new Vector3(010)) else var tiltAxis=transtransformDirection(new Vector3(010)) var spinAxis=rot4x4[tname]transformDirection(new Vector3(001)) get the centre of the mesh if(targetampamptrgtconstructorname==Mesh) var centre=transtransformPosition(trgtcomputeBoundingBox()center) else part group (Node3 parent node clipping plane) var centre=new Vector3(transtranslation) switch(echaracterCode) case 30tilt up rot4x4[tname]rotateAboutLineInPlace( -MathPI900rot4x4[tname]translationtiltAxis) transrotateAboutLineInPlace(-MathPI900centretiltAxis) break case 31tilt down rot4x4[tname]rotateAboutLineInPlace( MathPI900rot4x4[tname]translationtiltAxis) transrotateAboutLineInPlace(MathPI900centretiltAxis) break case 28spin right if(ectrlKeyDownampamptarget) transrotateAboutLineInPlace(-MathPI900centrespinAxis) else rot4x4[tname]rotateAboutLineInPlace( -MathPI900rot4x4[tname]translationnew Vector3(001)) transrotateAboutLineInPlace(-MathPI900centrenew Vector3(001)) break case 29spin left if(ectrlKeyDownampamptarget) transrotateAboutLineInPlace(MathPI900centrespinAxis) else rot4x4[tname]rotateAboutLineInPlace( MathPI900rot4x4[tname]translationnew Vector3(001)) transrotateAboutLineInPlace(MathPI900centrenew Vector3(001)) break case 120 x translateTarget(trans new Vector3(100) e) break case 121 y translateTarget(trans new Vector3(010) e) break case 122 z translateTarget(trans new Vector3(001) e) break case 88 shift + x translateTarget(trans new Vector3(-100) e) break case 89 shift + y translateTarget(trans new Vector3(0-10) e) break case 90 shift + z translateTarget(trans new Vector3(00-1) e) break case 115 s transtranslateInPlace(centrescale(-1)) transscaleInPlace(101) transtranslateInPlace(centrescale(1)) break case 83 shift + s transtranslateInPlace(centrescale(-1)) transscaleInPlace(1101) transtranslateInPlace(centrescale(1)) break transmultiplyInPlace(backtrans)runtimeaddEventHandler(keyEventHandler)translates object by amount calculated from Canvas sizefunction translateTarget(t d e) var cam=scenecamerasgetByIndex(0) if(camprojectionType==camTYPE_PERSPECTIVE) var scale=Mathtan(camfov2) camtargetPositionsubtract(camposition)length Mathmin(ecanvasPixelWidthecanvasPixelHeight) else var scale=camviewPlaneSize2 Mathmin(ecanvasPixelWidthecanvasPixelHeight) ttranslateInPlace(dscale(scale))function addremoveClipPlane(chk) var curTrans=getCurTrans() var clip=scenecreateClippingPlane() if(chk) add Clipping Plane and place its center either into the camera target position or into the centre of the currently selected mesh node var centre=new Vector3() if(target) var trans=targettransform var parent=targetparent while(parenttransform) trans=transmultiply(parenttransform) parent=parentparent if(targetconstructorname==Mesh) var centre=transtransformPosition(targetcomputeBoundingBox()center) else var centre=new Vector3(transtranslation) target=null else centreset(scenecamerasgetByIndex(0)targetPosition) cliptransformsetView( new Vector3(000) new Vector3(100) new Vector3(010)) cliptransformtranslateInPlace(centre) else if( scenenodesgetByName($$$$$$)|| scenenodesgetByName(Clipping Plane) ) clipremove()clip=null restoreTrans(curTrans) return clipfunction to store current transformation matrix of all nodes in the scenefunction getCurTrans() var tA=new Array() for(var i=0 iltscenenodescount i++) var nd=scenenodesgetByIndex(i) if(ndname==) continue tA[ndname]=new Matrix4x4(ndtransform) return tAfunction to restore transformation matrices given as argfunction restoreTrans(tA) for(var i=0 iltscenenodescount i++) var nd=scenenodesgetByIndex(i) if(tA[ndname]) ndtransformset(tA[ndname]) store original transformation matrix of all mesh nodes in the scenevar origtrans=getCurTrans()set initial state of Cross Section menu entrycameraEventHandleronEvent(1)hostconsoleclear()

var ocgs=hostgetOCGs(hostpageNum)for(var i=0iltocgslengthi++)if(ocgs[i]name==MediaPlayButton1)ocgs[i]state=false

(C) 2012 Michail Vidiassov John C Bowman Alexander Grahn asylabelsjs version 20120912 3D JavaScript to be used with media9sty (option `add3Djscript) for Asymptote generated PRC files adds billboard behaviour to text labels in Asymptote PRC files so that they always face the camera under 3D rotation This work may be distributed andor modified under the conditions of the LaTeX Project Public License The latest version of this license is in httpmirrorsctanorgmacroslatexbaselppltxt This work has the LPPL maintenance status `maintained The Current Maintainer of this work is A Grahnvar bbnodes=new Array() billboard meshesvar bbtrans=new Array() billboard transformsfunction fulltransform(mesh) var t=new Matrix4x4(meshtransform) if(meshparentname = ) var parentTransform=fulltransform(meshparent) tmultiplyInPlace(parentTransform) return t else return t find all text labels in the scene and determine pivoting pointsvar nodes=scenenodesvar nodescount=nodescountvar third=1030for(var i=0 i lt nodescount i++) var node=nodesgetByIndex(i) var name=nodename var end=namelastIndexOf()-1 if(end gt 0) if(namecharAt(end) == 001) var start=namelastIndexOf(-)+1 if(end gt start) nodename=namesubstr(0start-1) var nodeMatrix=fulltransform(nodeparent) var c=nodeMatrixtranslation position var d=Mathpow(Mathabs(nodeMatrixdeterminant)third) scale bbnodespush(node) bbtranspush(Matrix4x4()scale(ddd)translate(c)multiply(nodeMatrixinverse)) var camera=scenecamerasgetByIndex(0) var zero=new Vector3(000)var bbcount=bbnodeslength event handler to maintain camera-facing text labelsbillboardHandler=new RenderEventHandler()billboardHandleronEvent=function(event) var T=new Matrix4x4() TsetView(zerocamerapositionsubtract(cameratargetPosition) cameraupsubtract(cameraposition)) for(var j=0 j lt bbcount j++) bbnodes[j]transformset(Tmultiply(bbtrans[j])) runtimerefresh() runtimeaddEventHandler(billboardHandler)runtimerefresh()

(C) 2012 Alexander Grahn 3Dspintooljs version 20120301 3D JavaScript to be used with media9sty (option `add3Djscript) enables the Spin tool (also accessible via 3D toolbar or context menu) upon activation of the 3D scene the scene then rotates around the upright axis while dragging with the mouse This work may be distributed andor modified under the conditions of the LaTeX Project Public License The latest version of this license is in httpmirrorsctanorgmacroslatexbaselppltxt This work has the LPPL maintenance status `maintained The Current Maintainer of this work is A GrahnruntimesetCurrentTool(runtimeTOOL_NAME_SPIN)

cells [ cell_type code execution_count null metadata outputs [] source [ from IPythoncoredisplay import display HTMLn display(HTML( )) ] cell_type code execution_count null metadata collapsed true outputs [] source [ import numpy as npn import scipystats as ssn import time n n Black and Scholesn def d1(S0 K r sigma T)n return (nplog(S0K) + (r + sigma2 2) T)(sigma npsqrt(T))n n def d2(S0 K r sigma T)n return (nplog(S0 K) + (r - sigma2 2) T) (sigma npsqrt(T))n n def BlackScholes(typeS0 K r sigma T)n if type==Cn return S0 ssnormcdf(d1(S0 K r sigma T)) - K npexp(-r T) ssnormcdf(d2(S0 K r sigma T))n elsen return K npexp(-r T) ssnormcdf(-d2(S0 K r sigma T)) - S0 ssnormcdf(-d1(S0 K r sigma T)) ] cell_type code execution_count null metadata outputs [] source [ BlackScholes(C100 120 002 02 10) ] ] metadata anaconda-cloud kernelspec display_name Python 3 language python name python3 language_info codemirror_mode name ipython version 3 file_extension py mimetype textx-python name python nbconvert_exporter python pygments_lexer ipython3 version 375rc1 nbformat 4 nbformat_minor 1

Black-Scholes Pricing and Hedging

Fig 65 Time-dependent solution of the Black-Scholes PDE (call option)lowast

The next proposition is proved by a direct differentiation of the Black-Scholesfunction and will be recovered later using a probabilistic argument in Propo-sition 714 below

Proposition 64 The Black-Scholes Delta of the European call option isgiven by

ξt = ξt(St) =partgcpartx

(tSt) = Φ(d+(T minus t)

)isin [0 1] (615)

where d+(T minus t) is given by (611)

Proof From Relation (613) we note that the standard normal probabilitydensity function

ϕ(x) = Φprime(x) =1radic2π

eminusx22 x isin R

satisfies

ϕ(d+(T minus t)) = ϕ

(log(xK) + (r+ σ22)(T minus t)

|σ|radicT minus t

)=

1radic2π

exp(minus1

2

(log(xK) + (r+ σ22)(T minus t)

|σ|radicT minus t

)2)

=1radic2π

exp(minus1

2

(log(xK) + (rminus σ22)(T minus t)

|σ|radicT minus t

+ |σ|radicT minus t

)2)

=1radic2π

exp(minus1

2 (dminus(T minus t))2 minus (T minus t)rminus log x

K

)=

K

xradic

2πeminus(Tminust)r exp

(minus1

2 (dminus(T minus t))2)

lowast The animation works in Acrobat Reader on the entire pdf file

209

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

=K

xeminus(Tminust)rϕ(dminus(T minus t))

hence by (610) we have

partgcpartx

(tx) = part

partx

(xΦ(

log(xK) + (r+ σ22)(T minus t)|σ|radicT minus t

))(616)

minusK eminus(Tminust)r partpartx

(Φ(

log(xK) + (rminus σ22)(T minus t)|σ|radicT minus t

))= Φ

(log(xK) + (r+ σ22)(T minus t)

|σ|radicT minus t

)+x

part

partxΦ(

log(xK) + (r+ σ22)(T minus t)|σ|radicT minus t

)minusK eminus(Tminust)r part

partxΦ(

log(xK) + (rminus σ22)(T minus t)|σ|radicT minus t

)= Φ

(log(xK) + (r+ σ22)(T minus t)

|σ|radicT minus t

)+

x

|σ|radicT minus t

ϕ

(log(xK) + (r+ σ22)(T minus t)

|σ|radicT minus t

)minusK eminus(Tminust)r

|σ|radicT minus t

ϕ

(log(xK) + (rminus σ22)(T minus t)

|σ|radicT minus t

)= Φ(d+(T minus t)) +

x

|σ|radicT minus t

ϕ(d+(T minus t))minusK eminus(Tminust)r

|σ|radicT minus t

ϕ(dminus(T minus t))

= Φ(d+(T minus t))

As a consequence of Proposition 64 the Black-Scholes call price splits into arisky component StΦ

(d+(T minus t)

)and a riskless componentminusK eminus(Tminust)rΦ

(dminus(T minus

t)) as follows

gc(tSt) = StΦ(d+(T minus t)

)︸ ︷︷ ︸risky investment (held)

minus K eminus(Tminust)rΦ(dminus(T minus t)

)︸ ︷︷ ︸

riskminusfree investment (borrowed)

0 6 t 6 T

See Exercise 64 for a computation of the boundary values of gc(tx) t isin[0T ) x gt 0 The following R script is an implementation of the Black-ScholesDelta for European call options in R

1 Delta lt- function(S K r T sigma)d1 lt- (log(SK)+(r+sigma^22)T)(sigmasqrt(T))

3 Delta = pnorm(d1)Delta

210

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

In Figure 66 we plot the Delta of the European call option as a function ofthe underlying asset price and of the time remaining until maturity

Payoff function (x-K)+

0

50

100

150

200

Underlying

0

5

10

15

Time to maturity T-t

0

025

05

075

1

Fig 66 Delta of a European call option with strike price K = 100 r = 3 σ = 10

The Gamma of the European call option is defined as the first derivative ofDelta or second derivative of the option price with respect to the underlyingasset price This gives

γt =1

St|σ|radicT minus t

Φprime(d+(T minus t)

)=

1St|σ|

radic2(T minus t)π

exp(minus1

2

(log(StK) + (r+ σ22)(T minus t)

|σ|radicT minus t

)2)gt 0

In particular a positive value of γt implies that the Delta ξt = ξt(St) shouldincrease when the underlying asset price St increases In other words the po-sition ξt in the underlying asset should be increased by additional purchasesif the underlying asset price St increases

In Figure 67 we plot the (truncated) value of the Gamma of a European calloption as a function of the underlying asset price and of time to maturity

211

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

Fig 67 Gamma of a European call option with strike price K = 100

As Gamma is always nonnegative the Black-Scholes hedging strategy is tokeep buying the risky underlying asset when its price increases and to sell itwhen its price decreases as can be checked from Figure 67

Numerical example - hedging of a call option

In Figure 68 we consider the historical stock price of HSBC Holdings(0005HK) over one year

Fig 68 Graph of the stock price of HSBC Holdings

Consider the call option issued by Societe Generale on 31 December 2008 withstrike price K=$63704 maturity T = October 05 2009 and an entitlementratio of 100 meaning that one option contract is divided into 100 warrants cfpage 9 The next graph gives the time evolution of the Black-Scholes portfoliovalue

t 7minusrarr gc(tSt)

driven by the market price t 7minusrarr St of the risky underlying asset as given inFigure 68 in which the number of days is counted from the origin and notfrom maturity

212

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

40 50 60 70 80 90 0 50 100 150 200

0

5

10

15

20

25

30

35

40

Underlying (HK$) Time in days

Fig 69 Path of the Black-Scholes price for a call option on HSBC

As a consequence of Proposition 64 in the Black-Scholes call option hedgingmodel the amount invested in the risky asset is

Stξt = StΦ(d+(T minus t)

)= StΦ

(log(StK) + (r+ σ22)(T minus t)

|σ|radicT minus t

)gt 0

which is always nonnegative ie there is no short selling and the amountinvested on the riskless asset is

ηtAt = minusK eminus(Tminust)rΦ(dminus(T minus t)

)= minusK eminus(Tminust)rΦ

(log(StK) + (rminus σ22)(T minus t)

|σ|radicT minus t

)6 0

which is always nonpositive ie we are constantly borrowing money on theriskless asset as noted in Figure 610

-60

-40

-20

0

20

40

60

80

100

0 50 100 150 200

K

HK$

Black-Scholes priceRisky investment ξtSt

Riskless investment ηtAtUnderlying asset price

Fig 610 Time evolution of a hedging portfolio for a call option on HSBC

213

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

A comparison of Figure 610 with market data can be found in Figures 911and 912 below

Cash settlement In the case of a cash settlement the option issuer will sat-isfy the option contract by selling ξT = 1 stock at the price ST = $83refund the K = $63 risk-free investment and hand in the remaining amountC = (ST minusK)+ = 83minus 63 = $20 to the option holder

Physical delivery In the case of physical delivery of the underlying asset theoption issuer will deliver ξT = 1 stock to the option holder in exchange forK = $63 which will be used together with the portfolio value to refund therisk-free loan

63 European Put Options

Similarly in the case of the European put option with strike price K thepayoff function is given by h(x) = (Kminusx)+ and the Black-Scholes PDE (67)reads

rgp(tx) =partgppartt

(tx) + rxpartgppartx

(tx) + 12σ

2x2 part2gppartx2 (tx)

gp(T x) = (K minus x)+(617)

The next proposition can be proved as in Sections 65 and 66 see Proposi-tion 611

Proposition 65 The solution of the PDE (617) is given by the Black-Scholes formula for put options

gp(tx) = K eminus(Tminust)rΦ(minus dminus(T minus t)

)minus xΦ

(minus d+(T minus t)

) (618)

withd+(T minus t) =

log(xK) + (r+ σ22)(T minus t)|σ|radicT minus t

(619)

dminus(T minus t) =log(xK) + (rminus σ22)(T minus t)

|σ|radicT minus t

(620)

as illustrated in Figure 611

214

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

Fig 611 Graph of the Black-Scholes put price function with strike price K = 100lowast

In other words the European put option with strike price K and maturityT is priced at time t isin [0T ] as

gp(tSt) = K eminus(Tminust)rΦ(minus dminus(T minus t)

)minus StΦ

(minus d+(T minus t)

) 0 6 t 6 T

Fig 612 Time-dependent solution of the Black-Scholes PDE (put option)dagger

The following R script is an implementation of the Black-Scholes formula forEuropean put options in R

1 BSPut lt- function(S K r T sigma)d1 = (log(SK)+(r+sigma^22)T)(sigmasqrt(T))

3 d2 = d1 - sigma sqrt(T)BSPut = Kexp(-rT) pnorm(-d2) - Spnorm(-d1)

5 BSPut

Call-put parity

lowast Right-click on the figure for interaction and ldquoFull Screen Multimediardquo viewdagger The animation works in Acrobat Reader on the entire pdf file

215

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

(C) 2012--today Alexander Grahn 3Dmenujs version 20140923 3D JavaScript used by media9sty Extended functionality of the (right click) context menu of 3D annotations 1) Adds the following items to the 3D context menu `Generate Default View Finds good default camera settings returned as options for use with the includemedia command `Get Current View Determines camera cross section and part settings of the current view returned as `VIEW section that can be copied into a views file of additional views The views file is inserted using the `3Dviews option of includemedia `Cross Section Toggle switch to add or remove a cross section into or from the current view The cross section can be moved in the x y z directions using x y z and X Y Z keys on the keyboard be tilted against and spun around the upright Z axis using the UpDown and LeftRight arrow keys and caled using the s and S keys 2) Enables manipulation of position and orientation of indiviual parts and groups of parts in the 3D scene Parts which have been selected with the mouse can be scaled moved around and rotated like the cross section as described above To spin the parts around their local up-axis keep Control key pressed while using the UpDown and LeftRight arrow keys This work may be distributed andor modified under the conditions of the LaTeX Project Public License The latest version of this license is in httpmirrorsctanorgmacroslatexbaselppltxt This work has the LPPL maintenance status `maintained The Current Maintainer of this work is A Grahn The code borrows heavily from Bernd Gaertners `Miniball software originally written in C++ for computing the smallest enclosing ball of a set of points see httpwwwinfethzchpersonalgaertnerminiballhtmlhostconsoleshow()constructor for doubly linked listfunction List() thisfirst_node=null thislast_node=new Node(undefined)Listprototypepush_back=function(x) var new_node=new Node(x) if(thisfirst_node==null) thisfirst_node=new_node new_nodeprev=null else new_nodeprev=thislast_nodeprev new_nodeprevnext=new_node new_nodenext=thislast_node thislast_nodeprev=new_nodeListprototypemove_to_front=function(it) var node=itget() if(nodenext=null ampamp nodeprev=null) nodenextprev=nodeprev nodeprevnext=nodenext nodeprev=null nodenext=thisfirst_node thisfirst_nodeprev=node thisfirst_node=node Listprototypebegin=function() var i=new Iterator() itarget=thisfirst_node return(i)Listprototypeend=function() var i=new Iterator() itarget=thislast_node return(i)function Iterator(it) if( it=undefined ) thistarget=ittarget else thistarget=null Iteratorprototypeset=function(it)thistarget=ittargetIteratorprototypeget=function()return(thistarget)Iteratorprototypederef=function()return(thistargetdata)Iteratorprototypeincr=function() if(thistargetnext=null) thistarget=thistargetnextconstructor for node objects that populate the linked listfunction Node(x) thisprev=null thisnext=null thisdata=xfunction sqr(r)return(rr)helper functionMiniball algorithm by B Gaertnerfunction Basis() thism=0 thisq0=new Array(3) thisz=new Array(4) thisf=new Array(4) thisv=new Array(new Array(3) new Array(3) new Array(3) new Array(3)) thisa=new Array(new Array(3) new Array(3) new Array(3) new Array(3)) thisc=new Array(new Array(3) new Array(3) new Array(3) new Array(3)) thissqr_r=new Array(4) thiscurrent_c=thisc[0] thiscurrent_sqr_r=0 thisreset()Basisprototypecenter=function()return(thiscurrent_c)Basisprototypesize=function()return(thism)Basisprototypepop=function()--thismBasisprototypeexcess=function(p) var e=-thiscurrent_sqr_r for(var k=0klt3++k) e+=sqr(p[k]-thiscurrent_c[k]) return(e)Basisprototypereset=function() thism=0 for(var j=0jlt3++j) thisc[0][j]=0 thiscurrent_c=thisc[0] thiscurrent_sqr_r=-1Basisprototypepush=function(p) var i j var eps=1e-32 if(thism==0) for(i=0ilt3++i) thisq0[i]=p[i] for(i=0ilt3++i) thisc[0][i]=thisq0[i] thissqr_r[0]=0 else for(i=0ilt3++i) thisv[thism][i]=p[i]-thisq0[i] for(i=1iltthism++i) thisa[thism][i]=0 for(j=0jlt3++j) thisa[thism][i]+=thisv[i][j]thisv[thism][j] thisa[thism][i]=(2thisz[i]) for(i=1iltthism++i) for(j=0jlt3++j) thisv[thism][j]-=thisa[thism][i]thisv[i][j] thisz[thism]=0 for(j=0jlt3++j) thisz[thism]+=sqr(thisv[thism][j]) thisz[thism]=2 if(thisz[thism]ltepsthiscurrent_sqr_r) return(false) var e=-thissqr_r[thism-1] for(i=0ilt3++i) e+=sqr(p[i]-thisc[thism-1][i]) thisf[thism]=ethisz[thism] for(i=0ilt3++i) thisc[thism][i]=thisc[thism-1][i]+thisf[thism]thisv[thism][i] thissqr_r[thism]=thissqr_r[thism-1]+ethisf[thism]2 thiscurrent_c=thisc[thism] thiscurrent_sqr_r=thissqr_r[thism] ++thism return(true)function Miniball() thisL=new List() thisB=new Basis() thissupport_end=new Iterator()Miniballprototypemtf_mb=function(it) var i=new Iterator(it) thissupport_endset(thisLbegin()) if((thisBsize())==4) return for(var k=new Iterator(thisLbegin())kget()=iget()) var j=new Iterator(k) kincr() if(thisBexcess(jderef()) gt 0) if(thisBpush(jderef())) thismtf_mb(j) thisBpop() if(thissupport_endget()==jget()) thissupport_endincr() thisLmove_to_front(j) Miniballprototypecheck_in=function(b) thisLpush_back(b)Miniballprototypebuild=function() thisBreset() thissupport_endset(thisLbegin()) thismtf_mb(thisLend())Miniballprototypecenter=function() return(thisBcenter())Miniballprototyperadius=function() return(Mathsqrt(thisBcurrent_sqr_r))functions called by menu itemsfunction calc3Dopts () create Miniball object var mb=new Miniball() auxiliary vector var corner=new Vector3() iterate over all visible mesh nodes in the scene for(i=0iltscenemeshescounti++) var mesh=scenemeshesgetByIndex(i) if(meshvisible) continue local to parent transformation matrix var trans=meshtransform build local to world transformation matrix by recursively multiplying the parents transf matrix on the right var parent=meshparent while(parenttransform) trans=transmultiply(parenttransform) parent=parentparent get the bbox of the mesh (local coordinates) var bbox=meshcomputeBoundingBox() transform the local bounding box corner coordinates to world coordinates for bounding sphere determination BBoxmin cornerset(bboxmin) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) BBoxmax cornerset(bboxmax) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) remaining six BBox corners cornerset(bboxminx bboxmaxy bboxmaxz) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) cornerset(bboxminx bboxminy bboxmaxz) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) cornerset(bboxminx bboxmaxy bboxminz) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) cornerset(bboxmaxx bboxminy bboxminz) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) cornerset(bboxmaxx bboxminy bboxmaxz) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) cornerset(bboxmaxx bboxmaxy bboxminz) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) compute the smallest enclosing bounding sphere mbbuild() current camera settings var camera=scenecamerasgetByIndex(0) var res= initialize result string aperture angle of the virtual camera (perspective projection) or orthographic scale (orthographic projection) if(cameraprojectionType==cameraTYPE_PERSPECTIVE) var aac=camerafov180MathPI if(hostutilprintf(4f aac)=30) res+=hostutilprintf(n3Daac=s aac) else cameraviewPlaneSize=2mbradius() res+=hostutilprintf(n3Dortho=s 1cameraviewPlaneSize) camera roll var roll = cameraroll180MathPI if(hostutilprintf(4f roll)=0) res+=hostutilprintf(n3Droll=sroll) target to camera vector var c2c=new Vector3() c2cset(cameraposition) c2csubtractInPlace(cameratargetPosition) c2cnormalize() if((c2cx==0 ampamp c2cy==-1 ampamp c2cz==0)) res+=hostutilprintf(n3Dc2c=s s s c2cx c2cy c2cz) new camera settings bounding sphere centre --gt new camera target var coo=new Vector3() cooset((mbcenter())[0] (mbcenter())[1] (mbcenter())[2]) if(coolength) res+=hostutilprintf(n3Dcoo=s s s coox cooy cooz) radius of orbit if(cameraprojectionType==cameraTYPE_PERSPECTIVE) var roo=mbradius() Mathsin(aac MathPI 360) else orthographic projection var roo=mbradius() res+=hostutilprintf(n3Droo=s roo) update camera settings in the viewer var currol=cameraroll cameratargetPositionset(coo) camerapositionset(cooadd(c2cscale(roo))) cameraroll=currol determine background colour rgb=scenebackgroundgetColor() if((rgbr==1 ampamp rgbg==1 ampamp rgbb==1)) res+=hostutilprintf(n3Dbg=s s s rgbr rgbg rgbb) determine lighting scheme switch(scenelightScheme) case sceneLIGHT_MODE_FILE curlights=Artworkbreak case sceneLIGHT_MODE_NONE curlights=Nonebreak case sceneLIGHT_MODE_WHITE curlights=Whitebreak case sceneLIGHT_MODE_DAY curlights=Daybreak case sceneLIGHT_MODE_NIGHT curlights=Nightbreak case sceneLIGHT_MODE_BRIGHT curlights=Hardbreak case sceneLIGHT_MODE_RGB curlights=Primarybreak case sceneLIGHT_MODE_BLUE curlights=Bluebreak case sceneLIGHT_MODE_RED curlights=Redbreak case sceneLIGHT_MODE_CUBE curlights=Cubebreak case sceneLIGHT_MODE_CAD curlights=CADbreak case sceneLIGHT_MODE_HEADLAMP curlights=Headlampbreak if(curlights=Artwork) res+=hostutilprintf(n3Dlights=s curlights) determine global render mode switch(scenerenderMode) case sceneRENDER_MODE_BOUNDING_BOX currender=BoundingBoxbreak case sceneRENDER_MODE_TRANSPARENT_BOUNDING_BOX currender=TransparentBoundingBoxbreak case sceneRENDER_MODE_TRANSPARENT_BOUNDING_BOX_OUTLINE currender=TransparentBoundingBoxOutlinebreak case sceneRENDER_MODE_VERTICES currender=Verticesbreak case sceneRENDER_MODE_SHADED_VERTICES currender=ShadedVerticesbreak case sceneRENDER_MODE_WIREFRAME currender=Wireframebreak case sceneRENDER_MODE_SHADED_WIREFRAME currender=ShadedWireframebreak case sceneRENDER_MODE_SOLID currender=Solidbreak case sceneRENDER_MODE_TRANSPARENT currender=Transparentbreak case sceneRENDER_MODE_SOLID_WIREFRAME currender=SolidWireframebreak case sceneRENDER_MODE_TRANSPARENT_WIREFRAME currender=TransparentWireframebreak case sceneRENDER_MODE_ILLUSTRATION currender=Illustrationbreak case sceneRENDER_MODE_SOLID_OUTLINE currender=SolidOutlinebreak case sceneRENDER_MODE_SHADED_ILLUSTRATION currender=ShadedIllustrationbreak case sceneRENDER_MODE_HIDDEN_WIREFRAME currender=HiddenWireframebreak if(currender=Solid) res+=hostutilprintf(n3Drender=s currender) write result string to the console hostconsoleshow() hostconsoleclear() hostconsoleprintln(n Copy and paste the following text to then+ option list of includemedian + res + n)function get3Dview () var camera=scenecamerasgetByIndex(0) var coo=cameratargetPosition var c2c=camerapositionsubtract(coo) var roo=c2clength c2cnormalize() var res=VIEW=insert optional name heren if((coox==0 ampamp cooy==0 ampamp cooz==0)) res+=hostutilprintf( COO=s s sn coox cooy cooz) if((c2cx==0 ampamp c2cy==-1 ampamp c2cz==0)) res+=hostutilprintf( C2C=s s sn c2cx c2cy c2cz) if(roo gt 1e-9) res+=hostutilprintf( ROO=sn roo) var roll = cameraroll180MathPI if(hostutilprintf(4f roll)=0) res+=hostutilprintf( ROLL=sn roll) if(cameraprojectionType==cameraTYPE_PERSPECTIVE) var aac=camerafov 180MathPI if(hostutilprintf(4f aac)=30) res+=hostutilprintf( AAC=sn aac) else if(hostutilprintf(4f cameraviewPlaneSize)=1) res+=hostutilprintf( ORTHO=sn 1cameraviewPlaneSize) rgb=scenebackgroundgetColor() if((rgbr==1 ampamp rgbg==1 ampamp rgbb==1)) res+=hostutilprintf( BGCOLOR=s s sn rgbr rgbg rgbb) switch(scenelightScheme) case sceneLIGHT_MODE_FILE curlights=Artworkbreak case sceneLIGHT_MODE_NONE curlights=Nonebreak case sceneLIGHT_MODE_WHITE curlights=Whitebreak case sceneLIGHT_MODE_DAY curlights=Daybreak case sceneLIGHT_MODE_NIGHT curlights=Nightbreak case sceneLIGHT_MODE_BRIGHT curlights=Hardbreak case sceneLIGHT_MODE_RGB curlights=Primarybreak case sceneLIGHT_MODE_BLUE curlights=Bluebreak case sceneLIGHT_MODE_RED curlights=Redbreak case sceneLIGHT_MODE_CUBE curlights=Cubebreak case sceneLIGHT_MODE_CAD curlights=CADbreak case sceneLIGHT_MODE_HEADLAMP curlights=Headlampbreak if(curlights=Artwork) res+= LIGHTS=+curlights+n switch(scenerenderMode) case sceneRENDER_MODE_BOUNDING_BOX defaultrender=BoundingBoxbreak case sceneRENDER_MODE_TRANSPARENT_BOUNDING_BOX defaultrender=TransparentBoundingBoxbreak case sceneRENDER_MODE_TRANSPARENT_BOUNDING_BOX_OUTLINE defaultrender=TransparentBoundingBoxOutlinebreak case sceneRENDER_MODE_VERTICES defaultrender=Verticesbreak case sceneRENDER_MODE_SHADED_VERTICES defaultrender=ShadedVerticesbreak case sceneRENDER_MODE_WIREFRAME defaultrender=Wireframebreak case sceneRENDER_MODE_SHADED_WIREFRAME defaultrender=ShadedWireframebreak case sceneRENDER_MODE_SOLID defaultrender=Solidbreak case sceneRENDER_MODE_TRANSPARENT defaultrender=Transparentbreak case sceneRENDER_MODE_SOLID_WIREFRAME defaultrender=SolidWireframebreak case sceneRENDER_MODE_TRANSPARENT_WIREFRAME defaultrender=TransparentWireframebreak case sceneRENDER_MODE_ILLUSTRATION defaultrender=Illustrationbreak case sceneRENDER_MODE_SOLID_OUTLINE defaultrender=SolidOutlinebreak case sceneRENDER_MODE_SHADED_ILLUSTRATION defaultrender=ShadedIllustrationbreak case sceneRENDER_MODE_HIDDEN_WIREFRAME defaultrender=HiddenWireframebreak if(defaultrender=Solid) res+= RENDERMODE=+defaultrender+n detect existing Clipping Plane (3D Cross Section) var clip=null if( clip=scenenodesgetByName($$$$$$)|| clip=scenenodesgetByName(Clipping Plane) ) for(var i=0iltscenenodescounti++) var nd=scenenodesgetByIndex(i) if(nd==clip||ndname==) continue var ndUTFName= for (var j=0 jltndnamelength j++) var theUnicode = ndnamecharCodeAt(j)toString(16) while (theUnicodelengthlt4) theUnicode = 0 + theUnicode ndUTFName += theUnicode var end=ndnamelastIndexOf() if(endgt0) var ndUserName=ndnamesubstr(0end) else var ndUserName=ndname respart= PART=+ndUserName+n respart+= UTF16NAME=+ndUTFName+n defaultvals=true if(ndvisible) respart+= VISIBLE=falsen defaultvals=false if(ndopacitylt10) respart+= OPACITY=+ndopacity+n defaultvals=false if(ndconstructorname==Mesh) currender=defaultrender switch(ndrenderMode) case sceneRENDER_MODE_BOUNDING_BOX currender=BoundingBoxbreak case sceneRENDER_MODE_TRANSPARENT_BOUNDING_BOX currender=TransparentBoundingBoxbreak case sceneRENDER_MODE_TRANSPARENT_BOUNDING_BOX_OUTLINE currender=TransparentBoundingBoxOutlinebreak case sceneRENDER_MODE_VERTICES currender=Verticesbreak case sceneRENDER_MODE_SHADED_VERTICES currender=ShadedVerticesbreak case sceneRENDER_MODE_WIREFRAME currender=Wireframebreak case sceneRENDER_MODE_SHADED_WIREFRAME currender=ShadedWireframebreak case sceneRENDER_MODE_SOLID currender=Solidbreak case sceneRENDER_MODE_TRANSPARENT currender=Transparentbreak case sceneRENDER_MODE_SOLID_WIREFRAME currender=SolidWireframebreak case sceneRENDER_MODE_TRANSPARENT_WIREFRAME currender=TransparentWireframebreak case sceneRENDER_MODE_ILLUSTRATION currender=Illustrationbreak case sceneRENDER_MODE_SOLID_OUTLINE currender=SolidOutlinebreak case sceneRENDER_MODE_SHADED_ILLUSTRATION currender=ShadedIllustrationbreak case sceneRENDER_MODE_HIDDEN_WIREFRAME currender=HiddenWireframebreak case sceneRENDER_MODE_DEFAULT currender=Defaultbreak if(currender=defaultrender) respart+= RENDERMODE=+currender+n defaultvals=false if(origtrans[ndname]ampampndtransformisEqual(origtrans[ndname])) var lvec=ndtransformtransformDirection(new Vector3(100)) var uvec=ndtransformtransformDirection(new Vector3(010)) var vvec=ndtransformtransformDirection(new Vector3(001)) respart+= TRANSFORM= +lvecx+ +lvecy+ +lvecz+ +uvecx+ +uvecy+ +uvecz+ +vvecx+ +vvecy+ +vvecz+ +ndtransformtranslationx+ +ndtransformtranslationy+ +ndtransformtranslationz+n defaultvals=false respart+= ENDn if(defaultvals) res+=respart if(clip) var centre=cliptransformtranslation var normal=cliptransformtransformDirection(new Vector3(001)) res+= CROSSSECTn if((centrex==0 ampamp centrey==0 ampamp centrez==0)) res+=hostutilprintf( CENTER=s s sn centrex centrey centrez) if((normalx==1 ampamp normaly==0 ampamp normalz==0)) res+=hostutilprintf( NORMAL=s s sn normalx normaly normalz) res+=hostutilprintf( VISIBLE=sn clipvisible) res+=hostutilprintf( PLANECOLOR=s s sn clipmaterialemissiveColorr clipmaterialemissiveColorg clipmaterialemissiveColorb) res+=hostutilprintf( OPACITY=sn clipopacity) res+=hostutilprintf( INTERSECTIONCOLOR=s s sn clipwireframeColorr clipwireframeColorg clipwireframeColorb) res+= ENDn for(var propt in clip) consoleprintln(propt++clip[propt]) res+=ENDn hostconsoleshow() hostconsoleclear() hostconsoleprintln(n Add the following VIEW section to a file ofn+ predefined views (See option 3Dviews)nn + The view may be given a name after VIEW=n + (Remove in front of =)n) hostconsoleprintln(res + n)add items to 3D context menuruntimeaddCustomMenuItem(dfltview Generate Default View default 0)runtimeaddCustomMenuItem(currview Get Current View default 0)runtimeaddCustomMenuItem(csection Cross Section checked 0)menu event handlersmenuEventHandler = new MenuEventHandler()menuEventHandleronEvent = function(e) switch(emenuItemName) case dfltview calc3Dopts() break case currview get3Dview() break case csection addremoveClipPlane(emenuItemChecked) break runtimeaddEventHandler(menuEventHandler)global variable taking reference to currently selected nodevar target=nullselectionEventHandler=new SelectionEventHandler()selectionEventHandleronEvent=function(e) if(eselectedampampenodename=) target=enode else target=null runtimeaddEventHandler(selectionEventHandler)cameraEventHandler=new CameraEventHandler()cameraEventHandleronEvent=function(e) var clip=null runtimeremoveCustomMenuItem(csection) runtimeaddCustomMenuItem(csection Cross Section checked 0) if(clip=scenenodesgetByName($$$$$$)|| predefined scenenodesgetByName(Clipping Plane)) added via context menu runtimeremoveCustomMenuItem(csection) runtimeaddCustomMenuItem(csection Cross Section checked 1) if(clip)plane in predefined views must be rotated by 90 deg around normal cliptransformrotateAboutLineInPlace( MathPI2cliptransformtranslation cliptransformtransformDirection(new Vector3(001)) ) for(var i=0 iltrot4x4length i++)rot4x4[i]setIdentity() target=nullruntimeaddEventHandler(cameraEventHandler)var rot4x4=new Array() keeps track of spin and tilt axes transformationskey event handler for scaling moving spinning and tilting objectskeyEventHandler=new KeyEventHandler()keyEventHandleronEvent=function(e) var backtrans=new Matrix4x4() var trgt=null if(target) trgt=target var backtrans=new Matrix4x4() var trans=trgttransform var parent=trgtparent while(parenttransform) build local to world transformation matrix transmultiplyInPlace(parenttransform) also build world to local back-transformation matrix backtransmultiplyInPlace(parenttransforminversetranspose) parent=parentparent backtranstransposeInPlace() else if( trgt=scenenodesgetByName($$$$$$)|| trgt=scenenodesgetByName(Clipping Plane) ) var trans=trgttransform if(trgt) return var tname=trgtname if(typeof(rot4x4[tname])==undefined) rot4x4[tname]=new Matrix4x4() if(target) var tiltAxis=rot4x4[tname]transformDirection(new Vector3(010)) else var tiltAxis=transtransformDirection(new Vector3(010)) var spinAxis=rot4x4[tname]transformDirection(new Vector3(001)) get the centre of the mesh if(targetampamptrgtconstructorname==Mesh) var centre=transtransformPosition(trgtcomputeBoundingBox()center) else part group (Node3 parent node clipping plane) var centre=new Vector3(transtranslation) switch(echaracterCode) case 30tilt up rot4x4[tname]rotateAboutLineInPlace( -MathPI900rot4x4[tname]translationtiltAxis) transrotateAboutLineInPlace(-MathPI900centretiltAxis) break case 31tilt down rot4x4[tname]rotateAboutLineInPlace( MathPI900rot4x4[tname]translationtiltAxis) transrotateAboutLineInPlace(MathPI900centretiltAxis) break case 28spin right if(ectrlKeyDownampamptarget) transrotateAboutLineInPlace(-MathPI900centrespinAxis) else rot4x4[tname]rotateAboutLineInPlace( -MathPI900rot4x4[tname]translationnew Vector3(001)) transrotateAboutLineInPlace(-MathPI900centrenew Vector3(001)) break case 29spin left if(ectrlKeyDownampamptarget) transrotateAboutLineInPlace(MathPI900centrespinAxis) else rot4x4[tname]rotateAboutLineInPlace( MathPI900rot4x4[tname]translationnew Vector3(001)) transrotateAboutLineInPlace(MathPI900centrenew Vector3(001)) break case 120 x translateTarget(trans new Vector3(100) e) break case 121 y translateTarget(trans new Vector3(010) e) break case 122 z translateTarget(trans new Vector3(001) e) break case 88 shift + x translateTarget(trans new Vector3(-100) e) break case 89 shift + y translateTarget(trans new Vector3(0-10) e) break case 90 shift + z translateTarget(trans new Vector3(00-1) e) break case 115 s transtranslateInPlace(centrescale(-1)) transscaleInPlace(101) transtranslateInPlace(centrescale(1)) break case 83 shift + s transtranslateInPlace(centrescale(-1)) transscaleInPlace(1101) transtranslateInPlace(centrescale(1)) break transmultiplyInPlace(backtrans)runtimeaddEventHandler(keyEventHandler)translates object by amount calculated from Canvas sizefunction translateTarget(t d e) var cam=scenecamerasgetByIndex(0) if(camprojectionType==camTYPE_PERSPECTIVE) var scale=Mathtan(camfov2) camtargetPositionsubtract(camposition)length Mathmin(ecanvasPixelWidthecanvasPixelHeight) else var scale=camviewPlaneSize2 Mathmin(ecanvasPixelWidthecanvasPixelHeight) ttranslateInPlace(dscale(scale))function addremoveClipPlane(chk) var curTrans=getCurTrans() var clip=scenecreateClippingPlane() if(chk) add Clipping Plane and place its center either into the camera target position or into the centre of the currently selected mesh node var centre=new Vector3() if(target) var trans=targettransform var parent=targetparent while(parenttransform) trans=transmultiply(parenttransform) parent=parentparent if(targetconstructorname==Mesh) var centre=transtransformPosition(targetcomputeBoundingBox()center) else var centre=new Vector3(transtranslation) target=null else centreset(scenecamerasgetByIndex(0)targetPosition) cliptransformsetView( new Vector3(000) new Vector3(100) new Vector3(010)) cliptransformtranslateInPlace(centre) else if( scenenodesgetByName($$$$$$)|| scenenodesgetByName(Clipping Plane) ) clipremove()clip=null restoreTrans(curTrans) return clipfunction to store current transformation matrix of all nodes in the scenefunction getCurTrans() var tA=new Array() for(var i=0 iltscenenodescount i++) var nd=scenenodesgetByIndex(i) if(ndname==) continue tA[ndname]=new Matrix4x4(ndtransform) return tAfunction to restore transformation matrices given as argfunction restoreTrans(tA) for(var i=0 iltscenenodescount i++) var nd=scenenodesgetByIndex(i) if(tA[ndname]) ndtransformset(tA[ndname]) store original transformation matrix of all mesh nodes in the scenevar origtrans=getCurTrans()set initial state of Cross Section menu entrycameraEventHandleronEvent(1)hostconsoleclear()

var ocgs=hostgetOCGs(hostpageNum)for(var i=0iltocgslengthi++)if(ocgs[i]name==MediaPlayButton2)ocgs[i]state=false

(C) 2012 Michail Vidiassov John C Bowman Alexander Grahn asylabelsjs version 20120912 3D JavaScript to be used with media9sty (option `add3Djscript) for Asymptote generated PRC files adds billboard behaviour to text labels in Asymptote PRC files so that they always face the camera under 3D rotation This work may be distributed andor modified under the conditions of the LaTeX Project Public License The latest version of this license is in httpmirrorsctanorgmacroslatexbaselppltxt This work has the LPPL maintenance status `maintained The Current Maintainer of this work is A Grahnvar bbnodes=new Array() billboard meshesvar bbtrans=new Array() billboard transformsfunction fulltransform(mesh) var t=new Matrix4x4(meshtransform) if(meshparentname = ) var parentTransform=fulltransform(meshparent) tmultiplyInPlace(parentTransform) return t else return t find all text labels in the scene and determine pivoting pointsvar nodes=scenenodesvar nodescount=nodescountvar third=1030for(var i=0 i lt nodescount i++) var node=nodesgetByIndex(i) var name=nodename var end=namelastIndexOf()-1 if(end gt 0) if(namecharAt(end) == 001) var start=namelastIndexOf(-)+1 if(end gt start) nodename=namesubstr(0start-1) var nodeMatrix=fulltransform(nodeparent) var c=nodeMatrixtranslation position var d=Mathpow(Mathabs(nodeMatrixdeterminant)third) scale bbnodespush(node) bbtranspush(Matrix4x4()scale(ddd)translate(c)multiply(nodeMatrixinverse)) var camera=scenecamerasgetByIndex(0) var zero=new Vector3(000)var bbcount=bbnodeslength event handler to maintain camera-facing text labelsbillboardHandler=new RenderEventHandler()billboardHandleronEvent=function(event) var T=new Matrix4x4() TsetView(zerocamerapositionsubtract(cameratargetPosition) cameraupsubtract(cameraposition)) for(var j=0 j lt bbcount j++) bbnodes[j]transformset(Tmultiply(bbtrans[j])) runtimerefresh() runtimeaddEventHandler(billboardHandler)runtimerefresh()

(C) 2012 Alexander Grahn 3Dspintooljs version 20120301 3D JavaScript to be used with media9sty (option `add3Djscript) enables the Spin tool (also accessible via 3D toolbar or context menu) upon activation of the 3D scene the scene then rotates around the upright axis while dragging with the mouse This work may be distributed andor modified under the conditions of the LaTeX Project Public License The latest version of this license is in httpmirrorsctanorgmacroslatexbaselppltxt This work has the LPPL maintenance status `maintained The Current Maintainer of this work is A GrahnruntimesetCurrentTool(runtimeTOOL_NAME_SPIN)

N Privault

Proposition 66 Call-put parity We have the call-put parity relation

gc(tSt)minus gp(tSt) = St minusK eminus(Tminust)r 0 6 t 6 T (621)

between the Black-Scholes prices of call and put options in terms of theforward contract price St minusK eminus(Tminust)r

Proof The call-put parity (621) is a consequence of the relation

xminusK = (xminusK)+ minus (K minus x)+

satisfied by the terminal call and put payoff functions in the Black-ScholesPDE (67) It can also be verified directly from (610) and (618) as

gc(tx)minus gp(tx) = xΦ(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)minus(K eminus(Tminust)rΦ

(minus dminus(T minus t)

)minus xΦ

(minus d+(T minus t)

))= xΦ

(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)minusK eminus(Tminust)r

(1minusΦ

(dminus(T minus t)

))+ x

(1minusΦ

(d+(T minus t)

))= xminusK

The Delta of the Black-Scholes put option can be obtained by differentiationof the call-put parity relation (621) and Proposition 64

Proposition 67 The Delta of the Black-Scholes put option is given by

ξt = minus(1minusΦ(d+(T minus t)

)) = minusΦ

(minus d+(T minus t)

)isin [minus1 0] 0 6 t 6 T

Proof By the call-put parity relation (621) and Proposition 64 we have

partgppartx

(tSt) =partgcpartx

(tSt)minus 1

= Φ(d+(T minus t))minus 1= minusΦ(minusd+(T minus t)) 0 6 t 6 T

where we applied (614)

As a consequence of Proposition 67 the Black-Scholes put price splitsinto a risky component minusStΦ

(minus d+(T minus t)

)and a riskless component

K eminus(Tminust)rΦ(minus dminus(T minus t)

) as follows

gp(tSt) = K eminus(Tminust)rΦ(minus dminus(T minus t)

)︸ ︷︷ ︸riskminusfree investment (savings)

minus StΦ(minus d+(T minus t)

)︸ ︷︷ ︸

risky investment (short)

0 6 t 6 T

216

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

In Figure 613 we plot the Delta of the European put option as a function ofthe underlying asset price and of the time remaining until maturity

Payoff function (x-K)+

0

50

100

150

200

Underlying

0

5

10

15 Time to maturity T-t

-1

-075

-05

-025

0

Fig 613 Delta of a European put option with strike price K = 100 r = 3 σ = 10

Numerical example - hedging of a put option

For one more example we consider a put option issued by BNP Paribas on04 November 2008 with strike price K=$77667 maturity T = October 052009 and entitlement ratio 92593 cf page 9 In the next Figure 614 thenumber of days is counted from the origin not from maturity

40 50 60 70 80 90 100

0 50 100 150 200

0 5

10 15 20 25 30 35 40 45

Underlying (HK$)Time in days

Fig 614 Path of the Black-Scholes price for a put option on HSBC

As a consequence of Proposition 67 the amount invested on the risky assetfor the hedging of a put option is

minusStΦ(minus d+(T minus t)

)= minusStΦ

(minus log(StK) + (r+ σ22)(T minus t)

|σ|radicT minus t

)6 0

217

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

ie there is always short selling and the amount invested on the riskless assetpriced At = ert t isin [0T ] is

ηtAt = K eminus(Tminust)rΦ(minus dminus(T minus t)

)= K eminus(Tminust)rΦ

(minus log(StK) + (rminus σ22)(T minus t)

|σ|radicT minus t

)gt 0

which is always nonnegative ie we are constantly saving money on theriskless asset as noted in Figure 615

-60

-40

-20

0

20

40

60

80

100

0 50 100 150 200

K

HK$

Black-Scholes priceRisky investment ξtSt

Riskless investment ηtAtUnderlying asset price

Fig 615 Time evolution of the hedging portfolio for a put option on HSBC

In the above example the put option finished out of the money (OTM) so thatno cash settlement or physical delivery occurs A comparison of Figure 610with market data can be found in Figures 913 and 914 below

64 Market Terms and Data

The following Table 61 provides a summary of formulas for the computationof Black-Scholes sensitivities also called Greekslowast

lowast ldquoEvery class feels like attending a Greek lessonrdquo (AY2018-2019 student feedback)

218

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

Call option Put option

Option price g(tSt) StΦ(d+(T minus t))minusK eminus(Tminust)rΦ(dminus(T minus t)) K eminus(Tminust)rΦ(minusdminus(T minus t))minus StΦ(minusd+(T minus t))

Delta (∆) partg

partx(tSt) Φ(d+(T minus t)) gt 0 minusΦ(minusd+(T minus t)) 6 0

Gamma (Γ) part2g

partx2 (tSt)Φprime(d+(T minus t))St|σ|

radicT minus t

gt 0

Vega partg

partσ(tSt) St

radicT minus tΦprime(d+(T minus t)) gt 0

Theta (Θ) partg

partt(tSt) minusSt|σ|Φ

prime(d+(T minus t))2radicT minus t

minus rK eminus(Tminust)rΦ(dminus(T minus t)) 6 0 minusSt|σ|Φprime(d+(T minus t))

2radicT minus t

+ rK eminus(Tminust)rΦ(minusdminus(T minus t))

Rho (ρ) partg

partr(tSt) K(T minus t) eminus(Tminust)rΦ(dminus(T minus t)) minusK(T minus t) eminus(Tminust)rΦ(minusdminus(T minus t))

Table 61 Black-Scholes Greeks (Wikipedia)

From Table 61 we can conclude that call option prices are increasing func-tions of the underlying asset price St of the interest rate r and of the volatil-ity parameter σ Similarly put option prices are decreasing functions of theunderlying asset price St of the interest rate r and increasing functions ofthe volatility parameter σ

Parameter Variation of call option prices Variation of put option prices

Underlying St increasing decreasing

Volatility σ increasing increasing

Time t decreasing depends on the underlying price level

Interest rate r increasing decreasing

Table 62 Variations of Black-Scholes prices

The change of sign of the sensitivity Theta (Θ) with respect to time t can beverified in the following Figure 616

219

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

(a) Black-Scholes call price maps (b) Black-Scholes put price maps

Fig 616 Time-dependent solutions of the Black-Scholes PDElowast

Intrinsic value The intrinsic value at time t isin [0T ] of the option withpayoff C = h

(S(1)T

)is given by the immediate exercise payoff h

(S(1)t

) The

extrinsic value at time t isin [0T ] of the option is the remaining differenceπt(C) minus h

(S(1)t

)between the option price πt(C) and the immediate ex-

ercise payoff h(S(1)t

) In general the option price πt(C) decomposes as

πt(C) = h(S(1)t

)︸ ︷︷ ︸intrinsic value

+ πt(C)minus h(S(1)t

)︸ ︷︷ ︸

extrinsic value

0 6 t 6 T ]

Gearing The gearing at time t isin [0T ] of the option with payoff C = h(ST )is defined as the ratio

Gt =St

πt(C)=

Stg(tSt)

0 6 t 6 T

Effective gearing The effective gearing at time t isin [0T ] of the option withpayoff C = h(ST ) is defined as the ratio

Get = Gtξt

=ξtStπt(C)

=St

πt(C)

partg

partx(tSt)

=St

g(tSt)partg

partx(tSt)

= Stpart

partxlog g(tSt) 0 6 t 6 T

lowast The animation works in Acrobat Reader on the entire pdf file

220

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

The effective gearingGet =

ξtStπt(C)

can be interpreted as the hedge ratio ie the percentage of the portfoliowhich is invested on the risky asset When written as

∆g(tSt)g(tSt)

= Get times

∆StSt

the effective gearing gives the relative variation or percentage change∆g(tSt)g(tSt) of the option price g(tSt) from the relative variation∆StSt in the underlying asset price

The ratio Get = Stpart log g(tSt)partx can also be interpreted as an elasticity

coefficient

Break-even price The break-even price BEPt of the underlying asset is thevalue of S for which the intrinsic option value h(S) equals the option priceπt(C) at time t isin [0T ] For European call options it is given by

BEPt = K + πt(C) = K + g(tSt) t = 0 1 N

whereas for European put options it is given by

BEPt = K minus πt(C) = K minus g(tSt) 0 6 t 6 T

Premium The option premium OPt can be defined as the variation requiredfrom the underlying asset price in order to reach the break-even price iewe have

OPt =BEPt minus St

St=K + g(tSt)minus St

St 0 6 t 6 T

for European call options and

OPt =St minusBEPt

St=St + g(tSt)minusK

St 0 6 t 6 T

for European put options see Figure 617 below The term ldquopremiumrdquo issometimes also used to denote the arbitrage price g(tSt) of the option

221

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

f (tx σ)100

=

x =

K =

xpart log f

partx=

σ =

partf

partt(tx σ)=

T=

=(xminusK)x

∆ = = partf

partx(tx σ)

= partf

partσ(tx σ)

=K+f (txσ)minusx

x

=K+f (tx σ)

rf=

partf

partt+rxpartf

partx+

σ2 2x2part2f

partx2

Fig 617 Warrant terms and data

The R package bizdays (requires to install QuantLib) can be used to computecalendar time vs business time to maturity1 installpackages(bizdays)

library(bizdays)3 load_quantlib_calendars(HongKong from=2018-01-01 to=2018-12-31)

load_quantlib_calendars(Singapore from=2018-01-01 to=2018-12-31)5 bizdays(2018-03-10 2018-04-03 QuantLibHongKong)

bizdays(2018-03-10 2018-04-03 QuantLibSingapore)

65 The Heat Equation

In the next proposition we notice that the solution f(tx) of the Black-Scholes PDE (67) can be transformed into a solution g(t y) of the simplerheat equation by a change of variable and a time inversion t 7minusrarr T minus t onthe interval [0T ] so that the terminal condition at time T in the Black-Scholes equation (622) becomes an initial condition at time t = 0 in theheat equation (625) See also here for a related discussion on changes ofvariables for the Black-Scholes PDE

222

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

Proposition 68 Assume that f(tx) solves the Black-Scholes PDErf(tx) = partf

partt(tx) + rx

partf

partx(tx) + 1

2σ2x2 part

2f

partx2 (tx)

f(T x) = (xminusK)+(622)

with terminal condition h(x) = (xminusK)+ x gt 0 Then the function g(t y)defined by

g(t y) = ertf(T minus t e|σ|y+(σ22minusr)t) (623)

solves the heat equation (625) with initial condition

ψ(y) = h(

e|σ|y) y isin R (624)

ie we have partg

partt(t y) = 1

2part2g

party2 (t y)

g(0 y) = h(

e|σ|y)

(625)

Proposition 68 will be proved in Section 66 It will allow us to solve theBlack-Scholes PDE (622) based on the solution of the heat equation (625)with initial condition ψ(y) = h

(e|σ|y

) y isin R by inversion of Relation (623)

with s = T minus t x = e|σ|y+(σ22minusr)t ie

f(sx) = eminus(Tminuss)rg(T minus s minus(σ

22minus r)(T minus s) + log x|σ|

)

Next we focus on the heat equation

partϕ

partt(t y) = 1

2part2ϕ

party2 (t y) (626)

which is used to model the diffusion of heat over time through solids Herethe data of g(x t) represents the temperature measured at time t and pointx We refer the reader to Widder (1975) for a complete treatment of thistopic

223

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

Fig 618 Time-dependent solution of the heat equationlowast

Proposition 69 The fundamental solution of the heat equation (626) isgiven by the Gaussian probability density function

ϕ(t y) =1radic2πt

eminusy2(2t) y isin R

with variance t gt 0

Proof The proof is done by a direct calculation as follows

partϕ

partt(t y) = part

partt

(eminusy2(2t)radic

2πt

)

= minus eminusy2(2t)

2t32radic

2π+

y2

2t2eminusy2(2t)radic

2πt

=

(minus 1

2t +y2

2t2

)ϕ(t y)

and

12part2ϕ

party2 (t y) = minus12part

party

(y

t

eminusy2(2t)radic

2πt

)

= minus eminusy2(2t)

2tradic

2πt+

y2

2t2eminusy2(2t)radic

2πt

=

(minus 1

2t +y2

2t2

)ϕ(t y) t gt 0 y isin R

lowast The animation works in Acrobat Reader on the entire pdf file

224

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

In Section 66 the heat equation (626) will be shown to be equivalent to theBlack-Scholes PDE after a change of variables In particular this will lead tothe explicit solution of the Black-Scholes PDE

Proposition 610 The heat equationpartg

partt(t y) = 1

2part2g

party2 (t y)

g(0 y) = ψ(y)

(627)

with continuous initial condition

g(0 y) = ψ(y)

has the solution

g(t y) =winfinminusinfin

ψ(z) eminus(yminusz)2(2t) dzradic2πt

y isin R t gt 0 (628)

Proof We have

partg

partt(t y) = part

partt

winfinminusinfin

ψ(z) eminus(yminusz)2(2t) dzradic2πt

=winfinminusinfin

ψ(z)part

partt

(eminus(yminusz)2(2t)radic

2πt

)dz

=12winfinminusinfin

ψ(z)

((yminus z)2

t2minus 1t

)eminus(yminusz)2(2t) dzradic

2πt

=12winfinminusinfin

ψ(z)part2

partz2 eminus(yminusz)2(2t) dzradic2πt

=12winfinminusinfin

ψ(z)part2

party2 eminus(yminusz)2(2t) dzradic2πt

=12part2

party2

winfinminusinfin

ψ(z) eminus(yminusz)2(2t) dzradic2πt

=12part2g

party2 (t y)

On the other hand it can be checked that at time t = 0 we have

limtrarr0

winfinminusinfin

ψ(z) eminus(yminusz)2(2t) dzradic2πt

= limtrarr0

winfinminusinfin

ψ(y+ z) eminusz2(2t) dzradic2πt

= ψ(y) y isin R

225

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

The next Figure 619 shows the evolution of g(tx) with initial conditionbased on the European call payoff function h(x) = (xminusK)+ ie

g(0 y) = ψ(y) = h(

e|σ|y)=(

e|σ|y minusK)+ y isin R

Fig 619 Time-dependent solution of the heat equationlowast

Let us provide a second proof of Proposition 610 this time using Brownianmotion and stochastic calculus

Proof of Proposition 610 First note that under the change of variable x =z minus y we have

g(t y) =winfinminusinfin

ψ(z) eminus(yminusz)2(2t) dzradic2πt

=winfinminusinfin

ψ(y+ x) eminusx2(2t) dxradic2πt

= IE[ψ(y+Bt)]

= IE[ψ(yminusBt)]

where (Bt)tisinR+ is a standard Brownian motion and Bt N (0 t) t isin R+Applying Itocircrsquos formula and using the fact that the expectation of the stochas-tic integral with respect to Brownian motion is zero see Relation (417) inProposition 420 we find

g(t y) = IE[ψ(yminusBt)]

= ψ(y)minus IE[w t

0ψprime(yminusBs)dBs

]+

12 IE

[w t0ψprimeprime(yminusBs)ds

]= ψ(y) +

12w t

0IE[ψprimeprime(yminusBs)

]ds

lowast The animation works in Acrobat Reader on the entire pdf file

226

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

= ψ(y) +12w t

0part2

party2 IE [ψ(yminusBs)] ds

= ψ(y) +12w t

0part2g

party2 (s y)ds

Hence we have

partg

partt(t y) = part

parttIE[ψ(yminusBt)]

=12part2

party2 IE [ψ(yminusBt)]

=12part2g

party2 (t y)

Regarding the initial condition we check that

g(0 y) = IE[ψ(yminusB0)] = IE[ψ(y)] = ψ(y)

The expression g(t y) = IE[ψ(yminusBt)] provides a probabilistic interpreta-tion of the heat diffusion phenomenon based on Brownian motion Namelywhen ψε(y) = 1[minusεε](y) we find that

gε(t y) = IE[ψε(yminusBt)]= IE[1[minusεε](yminusBt)]= P

(yminusBt isin [minusε ε]

)= P

(yminus ε 6 Bt 6 y+ ε

)represents the probability of finding Bt within a neighborhood [y minus ε y + ε]of the point y isin R

66 Solution of the Black-Scholes PDE

In this section we solve the Black-Scholes PDE by the kernel method of Sec-tion 65 and a change of variables This solution method uses the change ofvariables (623) of Proposition 68 and a time inversion from which the ter-minal condition at time T in the Black-Scholes equation becomes an initialcondition at time t = 0 in the heat equation

Next we state the proof Proposition 68

Proof Letting s = T minus t and x = e|σ|y+(σ22minusr)t and using Relation (623)ie

g(t y) = ertf(T minus t e|σ|y+(σ22minusr)t)

227

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

we have

partg

partt(t y) = r ertf

(T minus t e|σ|y+(σ22minusr)t)minus ert partf

parts

(T minus t e|σ|y+(σ22minusr)t)

+

(σ2

2 minus r)

ert e|σ|y+(σ22minusr)t partf

partx

(T minus t e|σ|y+(σ22minusr)t)

= r ertf(T minus tx)minus ert partfparts

(T minus tx) +(σ2

2 minus r)

ertxpartfpartx

(T minus tx)

=12 ertx2σ2 part

2f

partx2 (T minus tx) +σ2

2 ertxpartfpartx

(T minus tx) (629)

where on the last step we used the Black-Scholes PDE On the other handwe have

partg

party(t y) = |σ| ert e|σ|y+(σ22minusr)t partf

partx

(T minus t e|σ|y+(σ22minusr)t)

and

12partg2

party2 (t y) =σ2

2 ert e|σ|y+(σ22minusr)t partf

partx

(T minus t e|σ|y+(σ22minusr)t)

+σ2

2 ert e2|σ|y+2(σ22minusr)t part2f

partx2(T minus t e|σ|y+(σ22minusr)t)

=σ2

2 ertxpartfpartx

(T minus tx) + σ2

2 ertx2 part2f

partx2 (T minus tx) (630)

We conclude by comparing (629) with (630) which shows that g(tx) solvesthe heat equation (627) with initial condition

g(0 y) = f(T e|σ|y

)= h

(e|σ|y

)

In the next proposition we derive the Black-Scholes formula (610) by solv-ing the PDE (622) The Black-Scholes formula will also be recovered by aprobabilistic argument via the computation of an expected value in Proposi-tion 77

Proposition 611 When h(x) = (x minusK)+ the solution of the Black-Scholes PDE (622) is given by

f(tx) = xΦ(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

) x gt 0

whereΦ(x) =

1radic2π

w xminusinfin

eminusy22dy x isin R

and

228

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

d+(T minus t) =

log(xK) + (r+ σ22)(T minus t)|σ|radicT minus t

dminus(T minus t) =log(xK) + (rminus σ22)(T minus t)

|σ|radicT minus t

x gt 0 t isin [0T )

Proof By inversion of Relation (623) with s = T minus t and x = e|σ|y+(σ22minusr)twe get

f(sx) = eminus(Tminuss)rg(T minus s minus(σ

22minus r)(T minus s) + log x|σ|

)and

h(x) = ψ

(log x|σ|

) x gt 0 or ψ(y) = h

(e|σ|y

) y isin R

Hence using the solution (628) and Relation (624) we get

f(tx) = eminus(Tminust)rg(T minus t minus(σ

22minus r)(T minus t) + log x|σ|

)= eminus(Tminust)r

winfinminusinfin

ψ

(minus(σ22minus r)(T minus t) + log x

|σ|+ z

)eminusz2(2(Tminust)) dzradic

2(T minus t)π

= eminus(Tminust)rwinfinminusinfin

h(x e|σ|zminus(σ22minusr)(Tminust)) eminusz2(2(Tminust)) dzradic

2(T minus t)π

= eminus(Tminust)rwinfinminusinfin

(x e|σ|zminus(σ22minusr)(Tminust) minusK

)+ eminusz2(2(Tminust)) dzradic2(T minus t)π

= eminus(Tminust)r

timeswinfin

(minusr+σ22)(Tminust)+log(Kx)|σ|

(x e|σ|zminus(σ22minusr)(Tminust) minusK

)eminusz2(2(Tminust)) dzradic

2(T minus t)π

= x eminus(Tminust)rwinfinminusdminus(Tminust)

radicTminust

e|σ|zminus(σ22minusr)(Tminust) eminusz2(2(Tminust)) dzradic2(T minus t)π

minusK eminus(Tminust)rwinfinminusdminus(Tminust)

radicTminust

eminusz2(2(Tminust)) dzradic2(T minus t)π

= xwinfinminusdminus(Tminust)

radicTminust

e|σ|zminus(Tminust)σ22minusz2(2(Tminust)) dzradic2(T minus t)π

minusK eminus(Tminust)rwinfinminusdminus(Tminust)

radicTminust

eminusz2(2(Tminust)) dzradic2(T minus t)π

= xwinfinminusdminus(Tminust)

radicTminust

eminus(zminus(Tminust)|σ|)2(2(Tminust)) dzradic2(T minus t)π

229

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

minusK eminus(Tminust)rwinfinminusdminus(Tminust)

radicTminust

eminusz2(2(Tminust)) dzradic2(T minus t)π

= xwinfinminusdminus(Tminust)

radicTminustminus(Tminust)|σ|

eminusz2(2(Tminust)) dzradic2(T minus t)π

minusK eminus(Tminust)rwinfinminusdminus(Tminust)

radicTminust

eminusz2(2(Tminust)) dzradic2(T minus t)π

= xwinfinminusdminus(Tminust)minus|σ|

radicTminust

eminusz22 dzradic2πminusK eminus(Tminust)r

winfinminusdminus(Tminust)

eminusz22 dzradic2π

= x(1minusΦ

(minus d+(T minus t)

))minusK eminus(Tminust)r

(1minusΦ

(minus dminus(T minus t)

))= xΦ

(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)

where we used the relation (614) ie

1minusΦ(a) = Φ(minusa) a isin R

Exercises

Exercise 61 Bachelier (1900) model Consider a market made of a risklessasset valued At = A0 with zero interest rate t isin R+ and a risky asset whoseprice St is modeled by a standard Brownian motion as St = Bt t isin R+

a) Show that the price g(tBt) of the option with payoff C = B2T satisfies

the heat equationpartϕ

partt(t y) = minus1

2part2ϕ

party2 (t y)

with terminal condition g(T x) = x2b) Find the function g(tx) by solving the PDE of Question (a)

Hint Try a solution of the form g(tx) = x2 + f(t)

See Exercises 611 713 and 714 for extensions to nonzero interest rates

Exercise 62 Consider a risky asset price (St)tisinR modeled in the Cox et al(1985) (CIR) model as

dSt = β(αminus St)dt+ σradicStdBt αβσ gt 0 (631)

and let (ηt ξt)tisinR+ be a portfolio strategy whose value Vt = ηtAt + ξtSttakes the form Vt = g(tSt) t isin R+ Figure 620 presents a random simula-tion of the solution to (631) with α = 0025 β = 1 and σ = 13230

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

0

1

2

3

4

5

6

7

8

0 01 02 03 04 05 06 07 08 09 1

St

t

Fig 620 Graph of the CIR short rate t 7rarr rt with α = 25 β = 1 and σ = 13

N=10000 t lt- 0(N-1) dt lt- 10Na=0025 b=2 sigma=0052 X lt- rnorm(Nmean=0sd=sqrt(dt))R lt- rep(0N)R[1]=001

for (j in 2N)R[j]=max(0R[j-1]+(a-bR[j-1])dt+sigmasqrt(R[j-1])X[j])4 plot(t R xlab = t ylab = type = l ylim = c(0002) col = blue)

Based on the self-financing condition written as

dVt = rVtdtminus rξtStdt+ ξtdSt

= rVtdtminus rξtStdt+ β(αminus St)ξtdt+ σξtradicStdBt t isin R+ (632)

derive the PDE satisfied by the function g(tx) using the Itocirc formula

Exercise 63 Black-Scholes PDE with dividends Consider a riskless as-set with price At = A0 ert t isin R+ and an underlying asset price process(St)tisinR+ modeled as

dSt = (microminus δ)Stdt+ σStdBt

where (Bt)tisinR+ is a standard Brownian motion and δ gt 0 is a continuous-time dividend rate By absence of arbitrage the payment of a dividend entailsa drop in the stock price by the same amount occuring generally on the ex-dividend date on which the purchase of the security no longer entitles theinvestor to the dividend amount The list of investors entitled to dividendpayment is consolidated on the date of record and payment is made on thepayable date

library(quantmod)2 getSymbols(0005HKfrom=2010-01-01to=SysDate()src=yahoo)

getDividends(0005HKfrom=2010-01-01to=SysDate()src=yahoo)

a) Assuming that the portfolio with value Vt = ξtSt + ηtAt at time t is self-financing and that dividends are continuously reinvested write down theportfolio variation dVt

231

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

b) Assuming that the portfolio value Vt takes the form Vt = g(tSt) at timet derive the Black-Scholes PDE for the function g(tx) with its terminalcondition

c) Compute the price at time t isin [0T ] of the European call option withstrike price K by solving the corresponding Black-Scholes PDE

d) Compute the Delta of the option

Exercise 64

a) Check that the Black-Scholes formula (610) for European call options

gc(tx) = xΦ(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)

satisfies the following boundary conditions

i) at x = 0 gc(t 0) = 0ii) at maturity t = T

gc(T x) = (xminusK)+ =

xminusK x gt K

0 x 6 K

iii) as time to maturity tends to infinity

limTrarrinfin

Bl(Kxσ rT minus t) = x t isin R+

b) Check that the Black-Scholes formula (618) for European put options

gp(tx) = K eminus(Tminust)rΦ(minus dminus(T minus t)

)minus xΦ

(minus d+(T minus t)

)satisfies the following boundary conditions

i) at x = 0 gp(t 0) = K eminus(Tminust)rii) as x tends to infinity gp(tinfin) = 0 for all t isin [0T )iii) at maturity t = T

gp(T x) = (K minus x)+ =

0 x gt K

K minus x x 6 K

iv) as time to maturity tends to infinity

limTrarrinfin

Blp(KStσ rT minus t) = 0 t isin R+

Exercise 65 Power option (Exercise 314 continued)

232

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

a) Solve the Black-Scholes PDE

rg(x t) = partg

partt(x t) + rx

partg

partx(x t) + σ2

2 x2 part2g

partx2 (x t) (633)

with terminal condition g(xT ) = x2 x gt 0 t isin [0T ]

Hint Try a solution of the form g(x t) = x2f(t) and find f(t)b) Find the respective quantities ξt and ηt of the risky asset St and riskless

asset At = ert in the portfolio with value

Vt = g(St t) = ξtSt + ηtAt 0 6 t 6 T

hedging the contract with payoff S2T at maturity

Exercise 66 On December 18 2007 a call warrant has been issued byFortis Bank on the stock price S of the MTR Corporation with maturityT = 23122008 strike price K = HK$ 3608 and entitlement ratio=10Recall that in the Black-Scholes model the price at time t of the Europeanclaim on the underlying asset priced St with strike price K maturity T interest rate r and volatility σ gt 0 is given by the Black-Scholes formula as

f(tSt) = StΦ(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)

wheredminus(T minus t) =

(rminus σ22)(T minus t) + log(StK)

|σ|radicT minus t

d+(T minus t) = dminus(T minus t) + |σ|radicT minus t = (r+ σ22)(T minus t) + log(StK)

|σ|radicT minus t

Recall that by Proposition 64 we have

partf

partx(tSt) = Φ

(d+(T minus t)

) 0 6 t 6 T

a) Using the values of the Gaussian cumulative distribution function com-pute the Black-Scholes price of the corresponding call option at timet =November 07 2008 with St = HK$ 17200 assuming a volatility σ =90 = 090 and an annual risk-free interest rate r = 4377 = 004377

b) Still using the Gaussian cumulative distribution function compute thequantity of the risky asset required in your portfolio at time t =November07 2008 in order to hedge one such option at maturity T = 23122008

c) Figure 1 represents the Black-Scholes price of the call option as a functionof σ isin [05 15] = [50 150]

233

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

0

01

02

03

04

05

06

05 06 07 08 09 1 11 12 13 14 15σimp

Optio

n pr

ice

σ

Market price

Fig 621 Option price as a function of the volatility σ gt 0

1 BSCall lt- function(S K r T sigma)d1 lt- (log(SK)+(r+sigma^22)T)(sigmasqrt(T))d2 lt- d1 - sigma sqrt(T)

3 BSCall = Spnorm(d1) - Kexp(-rT)pnorm(d2)BSCallsigma lt- seq(0515 length=100)

5 plot(sigmaBSCall(172360800437746365sigma) type=llty=1 xlab=Sigmaylab=Black-Scholes Call Price ylim = c(006)col=bluelwd=3)grid()

abline(h=023col=redlwd=3)

Knowing that the closing price of the warrant on November 07 2008 wasHK$ 0023 which value can you infer for the implied volatility σ at thisdatelowast

Exercise 67 Forward contracts Recall that the price πt(C) of a claimpayoff C = h(ST ) of maturity T can be written as πt(C) = g(tSt) wherethe function g(tx) satisfies the Black-Scholes PDE

rg(tx) = partg

partt(tx) + rx

partg

partx(tx) + 1

2σ2x2 part

2g

partx2 (tx)

g(T x) = h(x) (1)

with terminal condition g(T x) = h(x) x gt 0

a) Assume that C is a forward contract with payoff

C = ST minusK

at time T Find the function h(x) in (1)b) Find the solution g(tx) of the above PDE and compute the price πt(C)

at time t isin [0T ]Hint search for a solution of the form g(tx) = xminus α(t) where α(t) is afunction of t to be determined

lowast Download the corresponding or the that can be runhere

234

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

BS lt- function(S K T r sig)d1 lt- (log(SK) + (r + sig^22)T) (sigsqrt(T))d2 lt- d1 - sigsqrt(T)return(Spnorm(d1) - Kexp(-rT)pnorm(d2))impliedvol lt- function(S K T r market)sig lt- 020sigup lt- 1sigdown lt- 0001count lt- 0err lt- BS(S K T r sig) - marketwhile(abs(err) gt 000001 ampamp countlt1000)if(err lt 0)sigdown lt- sigsig lt- (sigup + sig)2elsesigup lt- sigsig lt- (sigdown + sig)2err lt- BS(S K T r sig) - marketcount lt- count + 1if(count==2000)return(NA)elsereturn(sig)market = 083K = 628T = 7 365S = 634r = 002impliedvol(S K T r market)

cells [ cell_type code execution_count null metadata outputs [] source [ from IPythoncoredisplay import display HTMLn display(HTML( )) ] cell_type code execution_count null metadata collapsed true outputs [] source [ import numpy as npn import scipystats as ssn import time n n Black and Scholesn def d1(S0 K r sigma T)n return (nplog(S0K) + (r + sigma2 2) T)(sigma npsqrt(T))n n def d2(S0 K r sigma T)n return (nplog(S0 K) + (r - sigma2 2) T) (sigma npsqrt(T))n n def BlackScholes(typeS0 K r sigma T)n if type==Cn return S0 ssnormcdf(d1(S0 K r sigma T)) - K npexp(-r T) ssnormcdf(d2(S0 K r sigma T))n elsen return K npexp(-r T) ssnormcdf(-d2(S0 K r sigma T)) - S0 ssnormcdf(-d1(S0 K r sigma T)) ] cell_type code execution_count null metadata outputs [] source [ BlackScholes(C1000 1200 002 015 10) ] cell_type code execution_count null metadata outputs [] source [ def difference(x p S K r t)n return BlackScholes(CS K r x t) - p ] cell_type code execution_count null metadata outputs [] source [ from scipyoptimize import bisectn bisect(difference00011args=(11541763731112766 1000 1200 002 10)) ] ] metadata anaconda-cloud kernelspec display_name Python 3 language python name python3 language_info codemirror_mode name ipython version 3 file_extension py mimetype textx-python name python nbconvert_exporter python pygments_lexer ipython3 version 375rc1 nbformat 4 nbformat_minor 1

Black-Scholes Pricing and Hedging

c) Compute the quantityξt =

partg

partx(tSt)

of risky assets in a self-financing portfolio hedging Cd) Repeat the above questions with the terminal condition g(T x) = x

Exercise 68a) Solve the Black-Scholes PDE

rg(tx) = partg

partt(tx) + rx

partg

partx(tx) + σ2

2 x2 part2g

partx2 (tx) (634)

with terminal condition g(T x) = 1 x gt 0

Hint Try a solution of the form g(tx) = f(t) and find f(t)

b) Find the respective quantities ξt and ηt of the risky asset St and risklessasset At = ert in the portfolio with value

Vt = g(tSt) = ξtSt + ηtAt

hedging the contract with payoff $1 at maturity

Exercise 69 Log-contracts see also Exercise 84a) Solve the PDE

0 =partg

partt(x t) + rx

partg

partx(x t) + σ2

2 x2 part2g

partx2 (x t)

with the terminal condition g(xT ) = log x x gt 0

Hint Try a solution of the form g(x t) = f(t) + log x and find f(t)b) Solve the Black-Scholes PDE

rh(x t) = parth

partt(x t) + rx

parth

partx(x t) + σ2

2 x2 part2h

partx2 (x t) (635)

with the terminal condition h(xT ) = log x x gt 0

Hint Try a solution of the form h(x t) = u(t)g(x t) and find u(t)c) Find the respective quantities ξt and ηt of the risky asset St and riskless

asset At = ert in the portfolio with value

Vt = g(St t) = ξtSt + ηtAt

hedging a log-contract with payoff logST at maturity 235

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

Exercise 610 Binary options Consider a price process (St)tisinR+ given by

dStSt

= rdt+ σdBt S0 = 1

under the risk-neutral probability measure Plowast The binary (or digital) calloption is a contract with maturity T strike price K and payoff

Cd = 1[Kinfin)(ST ) =

$1 if ST gt K

0 if ST lt K

a) Derive the Black-Schole PDE satisfied by the pricing function Cd(tSt) ofthe binary call option together with its terminal condition

b) Show that the solution Cd(tx) of the Black-Scholes PDE of Question (a)is given by

Cd(tx) = eminus(Tminust)rΦ((rminus σ22)(T minus t) + log(xK)

|σ|radicT minus t

)= eminus(Tminust)rΦ

(dminus(T minus t)

)

where

dminus(T minus t) =(rminus σ22)(T minus t) + log(StK)

|σ|radicT minus t

0 6 t lt T

Exercise 611

a) Bachelier (1900) model Solve the stochastic differential equation

dSt = αStdt+ σdBt (636)

in terms of ασ isin R and the initial condition S0b) Write down the Bachelier PDE satisfied by the function C(tx) where

C(tSt) is the price at time t isin [0T ] of the contingent claim with payoffφ(ST ) = exp(ST ) and identify the process Delta (ξt)tisin[0T ] that hedgesthis claim

c) Solve the Black-Scholes PDE of Question (b) with the terminal conditionφ(x) = ex x isin R

Hint Search for a solution of the form

C(tx) = exp(minus(T minus t)r+ xh(t) +

σ2

4r (h2(t)minus 1)

) (637)

where h(t) is a function to be determined with h(T ) = 1

236

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

d) Compute the portfolio strategy (ξt ηt)tisin[0T ] that hedges the contingentclaim with payoff exp(ST )

Exercise 612

a) Show that for every fixed value of S the function

d 7minusrarr h(S d) = SΦ(d+ |σ|

radicT)minusK eminusrTΦ(d)

reaches its maximum at dlowast(S) =log(SK) + (rminus σ22)T

|σ|radicT

b) By the differentiation rule

d

dSh(S dlowast(S)) =

parth

partS(S dlowast(S)) + dprimelowast(S)

parth

partd(S dlowast(S))

recover the value of the Black-Scholes Delta

Exercise 613 Compute the Black-Scholes Vega by differentiation of theBlack-Scholes function

gc(tx) = Bl(Kxσ rT minus t) = xΦ(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)

with respect to the volatility parameter σ knowing that

minus12(dminus(T minus t)

)2= minus1

2

(log(xK) + (rminus σ22)(T minus t)

|σ|radicT minus t

)2

= minus12(d+(T minus t)

)2+ (T minus t)r+ log x

K (638)

Exercise 614 Consider the backward induction relation (313) ie

v(tx) = (1minus plowastN )v (t+ 1x(1 + aN )) + plowastN v (t+ 1x(1 + bN ))

using the renormalizations rN = rTN and

aN = (1 + rN )(1minus |σ|radicTN)minus 1 bN = (1 + rN )(1 + |σ|

radicTN)minus 1

of Section 36 N gt 1 with

plowastN =rN minus aNbN minus aN

and plowastN =bN minus rNbN minus aN

a) Show that the Black-Scholes PDE (62) of Proposition 61 can be recoveredfrom the induction relation (313) when the number N of time steps tendsto infinity

237

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

b) Show that the expression of the Delta ξt =partgcpartx

(tSt) can be similarlyrecovered from the finite difference relation (319) ie

ξ(1)t (Stminus1) =

v (t (1 + bN )Stminus1)minus v (t (1 + aN )Stminus1)

Stminus1(bN minus aN )

as N tends to infinity

Problem 615 (Leung and Sircar (2015)) ProShares Ultra SampP500 andProShares UltraShort SampP500 are leveraged investment funds that seek dailyinvestment results before fees and expenses that correspond to β times (βx)the daily performance of the SampP500reg with respectively β = 2 for ProSharesUltra and β = minus2 for ProShares UltraShort Here leveraging with a factorβ 1 aims at multiplying the potential return of an investment by a factorβ The following 10 questions are interdependent and should be treated insequence

a) Consider a risky asset priced S0 = $4 at time t = 0 and taking twopossible values S1 = $5 and S1 = $2 at time t = 1 Compute the twopossible returns (in ) achieved when investing $4 in one share of the assetS and the expected return under the risk-neutral probability measureassuming that the risk-free interest rate is zero

b) Leveraging Still based on an initial $4 investment we decide to leverageby a factor β = 3 by borrowing another (β minus 1) times $4 = 2times $4 at ratezero to purchase a total of β = 3 shares of the asset S Compute thetwo returns (in ) possibly achieved in this case and the expected returnunder the risk-neutral probability measure assuming that the risk-freeinterest rate is zero

c) Denoting by Ft the ProShares value at time t how much should the fundinvest in the underlying asset priced St and how much $ should it borrowor save on the risk-free market at any time t in order to leverage with afactor β 1

d) Find the portfolio allocation (ξt ηt) for the fund value

Ft = ξtSt + ηtAt t isin R+

according to Question (c) where At = A0 ert is the riskless money marketaccount

e) We choose to model the SampP500 index St as the geometric Brownianmotion

dSt = rStdt+ σStdBt t isin R+

under the risk-neutral probability measure Plowast Find the stochastic dif-ferential equation satisfied by (Ft)tisinR+ under the self-financing conditiondFt = ξtdSt + ηtdAt

238

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

f) Is the discounted fund value ( eminusrtFt)tisinR+ a martingale under the risk-neutral probability measure Plowast

g) Find the relation between the fund value Ft and the index St by solvingthe stochastic differential equation obtained for Ft in Question (e) Forsimplicity we normalize F0 = Sβ0

h) Write the price at time t = 0 of the call option with payoff (FT minusK)+ onthe ProShares index using the Black-Scholes formula

i) Show that when β gt 0 the Delta at time t isin [0T ) of the call optionwith payoff (FT minusK)+ on ProShares Ultra is equal to the Delta of thecall option with payoff (ST minusKβ(t))

+ on the SampP500 for a certain strikeprice Kβ(t) to be determined explicitly

j) When β lt 0 find the relation between the Delta at time t isin [0T ) ofthe call option with payoff (FT minusK)+ on ProShares UltraShort and theDelta of the put option with payoff (Kβ(t)minus ST )+ on the SampP500

239

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

  1. pbsARFix223
  2. pbsARFix224
  3. pbsARFix225
  4. pbsARFix226
  5. pbsARFix227
  6. pbsARFix228
  7. pbsARFix229
  8. pbsARFix230
  9. fdrm1
  10. pbsARFix231
  11. 100
  12. 101
  13. 102
  14. 103
  15. 104
  16. 105
  17. 106
  18. 107
  19. 108
  20. 109
  21. 1010
  22. 1011
  23. 1012
  24. 1013
  25. 1014
  26. 1015
  27. 1016
  28. 1017
  29. 1018
  30. 1019
  31. anm10
  32. 10EndLeft
  33. 10StepLeft
  34. 10PauseLeft
  35. 10PlayLeft
  36. 10PlayPauseLeft
  37. 10PauseRight
  38. 10PlayRight
  39. 10PlayPauseRight
  40. 10StepRight
  41. 10EndRight
  42. 10Minus
  43. 10Reset
  44. 10Plus
  45. pbsARFix232
  46. pbsARFix233
  47. pbsARFix234
  48. pbsARFix235
  49. pbsARFix236
  50. pbsARFix237
  51. fdrm2
  52. 110
  53. 111
  54. 112
  55. 113
  56. 114
  57. 115
  58. 116
  59. 117
  60. 118
  61. 119
  62. 1110
  63. 1111
  64. 1112
  65. 1113
  66. 1114
  67. 1115
  68. 1116
  69. 1117
  70. 1118
  71. 1119
  72. anm11
  73. 11EndLeft
  74. 11StepLeft
  75. 11PauseLeft
  76. 11PlayLeft
  77. 11PlayPauseLeft
  78. 11PauseRight
  79. 11PlayRight
  80. 11PlayPauseRight
  81. 11StepRight
  82. 11EndRight
  83. 11Minus
  84. 11Reset
  85. 11Plus
  86. pbsARFix238
  87. pbsARFix239
  88. pbsARFix240
  89. pbsARFix241
  90. pbsARFix242
  91. 120
  92. 121
  93. 122
  94. 123
  95. 124
  96. 125
  97. 126
  98. 127
  99. 128
  100. 129
  101. 1210
  102. anm12
  103. 12EndLeft
  104. 12StepLeft
  105. 12PauseLeft
  106. 12PlayLeft
  107. 12PlayPauseLeft
  108. 12PauseRight
  109. 12PlayRight
  110. 12PlayPauseRight
  111. 12StepRight
  112. 12EndRight
  113. 12Minus
  114. 12Reset
  115. 12Plus
  116. 130
  117. 131
  118. 132
  119. 133
  120. 134
  121. 135
  122. 136
  123. 137
  124. 138
  125. 139
  126. 1310
  127. anm13
  128. 13EndLeft
  129. 13StepLeft
  130. 13PauseLeft
  131. 13PlayLeft
  132. 13PlayPauseLeft
  133. 13PauseRight
  134. 13PlayRight
  135. 13PlayPauseRight
  136. 13StepRight
  137. 13EndRight
  138. 13Minus
  139. 13Reset
  140. 13Plus
  141. pbsARFix243
  142. pbsARFix244
  143. pbsARFix245
  144. pbsARFix246
  145. 140
  146. 141
  147. 142
  148. 143
  149. 144
  150. 145
  151. 146
  152. 147
  153. 148
  154. 149
  155. 1410
  156. 1411
  157. 1412
  158. 1413
  159. 1414
  160. 1415
  161. 1416
  162. 1417
  163. 1418
  164. 1419
  165. 1420
  166. 1421
  167. 1422
  168. 1423
  169. 1424
  170. 1425
  171. 1426
  172. 1427
  173. 1428
  174. 1429
  175. 1430
  176. 1431
  177. 1432
  178. 1433
  179. 1434
  180. 1435
  181. 1436
  182. 1437
  183. 1438
  184. 1439
  185. 1440
  186. 1441
  187. 1442
  188. 1443
  189. 1444
  190. 1445
  191. 1446
  192. 1447
  193. 1448
  194. 1449
  195. 1450
  196. 1451
  197. 1452
  198. 1453
  199. 1454
  200. 1455
  201. 1456
  202. 1457
  203. 1458
  204. 1459
  205. 1460
  206. 1461
  207. 1462
  208. 1463
  209. 1464
  210. 1465
  211. 1466
  212. 1467
  213. 1468
  214. 1469
  215. 1470
  216. 1471
  217. 1472
  218. 1473
  219. 1474
  220. 1475
  221. 1476
  222. 1477
  223. 1478
  224. 1479
  225. 1480
  226. 1481
  227. 1482
  228. 1483
  229. 1484
  230. 1485
  231. 1486
  232. 1487
  233. 1488
  234. 1489
  235. 1490
  236. 1491
  237. 1492
  238. 1493
  239. 1494
  240. 1495
  241. 1496
  242. 1497
  243. 1498
  244. 1499
  245. 14100
  246. 14101
  247. 14102
  248. 14103
  249. 14104
  250. 14105
  251. 14106
  252. 14107
  253. 14108
  254. 14109
  255. 14110
  256. 14111
  257. 14112
  258. 14113
  259. 14114
  260. 14115
  261. 14116
  262. 14117
  263. 14118
  264. 14119
  265. 14120
  266. 14121
  267. 14122
  268. 14123
  269. 14124
  270. 14125
  271. 14126
  272. 14127
  273. 14128
  274. 14129
  275. 14130
  276. 14131
  277. 14132
  278. 14133
  279. 14134
  280. 14135
  281. 14136
  282. 14137
  283. 14138
  284. 14139
  285. 14140
  286. 14141
  287. 14142
  288. 14143
  289. 14144
  290. 14145
  291. 14146
  292. 14147
  293. 14148
  294. 14149
  295. 14150
  296. 14151
  297. 14152
  298. 14153
  299. 14154
  300. 14155
  301. 14156
  302. 14157
  303. 14158
  304. 14159
  305. 14160
  306. 14161
  307. 14162
  308. 14163
  309. 14164
  310. 14165
  311. 14166
  312. 14167
  313. 14168
  314. 14169
  315. 14170
  316. 14171
  317. 14172
  318. 14173
  319. 14174
  320. 14175
  321. 14176
  322. 14177
  323. 14178
  324. 14179
  325. 14180
  326. 14181
  327. 14182
  328. 14183
  329. 14184
  330. 14185
  331. 14186
  332. 14187
  333. 14188
  334. 14189
  335. 14190
  336. 14191
  337. 14192
  338. 14193
  339. 14194
  340. 14195
  341. 14196
  342. 14197
  343. anm14
  344. 14EndLeft
  345. 14StepLeft
  346. 14PauseLeft
  347. 14PlayLeft
  348. 14PlayPauseLeft
  349. 14PauseRight
  350. 14PlayRight
  351. 14PlayPauseRight
  352. 14StepRight
  353. 14EndRight
  354. 14Minus
  355. 14Reset
  356. 14Plus
  357. pbsARFix247
  358. pbsARFix248
  359. 150
  360. 151
  361. 152
  362. 153
  363. 154
  364. 155
  365. 156
  366. 157
  367. 158
  368. 159
  369. 1510
  370. 1511
  371. 1512
  372. 1513
  373. 1514
  374. 1515
  375. 1516
  376. 1517
  377. 1518
  378. 1519
  379. anm15
  380. 15EndLeft
  381. 15StepLeft
  382. 15PauseLeft
  383. 15PlayLeft
  384. 15PlayPauseLeft
  385. 15PauseRight
  386. 15PlayRight
  387. 15PlayPauseRight
  388. 15StepRight
  389. 15EndRight
  390. 15Minus
  391. 15Reset
  392. 15Plus
  393. pbsARFix249
  394. pbsARFix250
  395. pbsARFix251
  396. pbsARFix252
  397. pbsARFix253
  398. pbsARFix254
  399. pbsARFix255
  400. pbsARFix256
  401. pbsARFix257
  402. pbsARFix258
  403. pbsARFix259
  404. pbsARFix260
  405. pbsARFix261
Page 8: Black-ScholesPricingandHedging - NTU · to the Black-Scholes PDE (6.2) in order to price a claim payoff Cof the formC= h(S T).Asinthediscrete-timecase,thearbitragepriceπt(C) at

N Privault

The following R script is an implementation of the Black-Scholes formula forEuropean call options in Rlowast

1 BSCall lt- function(S K r T sigma)d1 lt- (log(SK)+(r+sigma^22)T)(sigmasqrt(T))

3 d2 lt- d1 - sigma sqrt(T)BSCall = Spnorm(d1) - Kexp(-rT)pnorm(d2)

5 BSCall

In comparison with the discrete-time Cox-Ross-Rubinstein (CRR) model ofSection 26 the interest in the formula (610) is to provide an analytical so-lution that can be evaluated in a single step which is computationally muchmore efficient

Fig 64 Graph of the Black-Scholes call price map with strike price K = 100dagger

Figure 64 presents an interactive graph of the Black-Scholes call price mapie the solution

(tx) 7minusrarr gc(tx) = xΦ(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)of the Black-Scholes PDE (67) for a call optionlowast Download the corresponding that can be run heredagger Right-click on the figure for interaction and ldquoFull Screen Multimediardquo view

208

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

(C) 2012--today Alexander Grahn 3Dmenujs version 20140923 3D JavaScript used by media9sty Extended functionality of the (right click) context menu of 3D annotations 1) Adds the following items to the 3D context menu `Generate Default View Finds good default camera settings returned as options for use with the includemedia command `Get Current View Determines camera cross section and part settings of the current view returned as `VIEW section that can be copied into a views file of additional views The views file is inserted using the `3Dviews option of includemedia `Cross Section Toggle switch to add or remove a cross section into or from the current view The cross section can be moved in the x y z directions using x y z and X Y Z keys on the keyboard be tilted against and spun around the upright Z axis using the UpDown and LeftRight arrow keys and caled using the s and S keys 2) Enables manipulation of position and orientation of indiviual parts and groups of parts in the 3D scene Parts which have been selected with the mouse can be scaled moved around and rotated like the cross section as described above To spin the parts around their local up-axis keep Control key pressed while using the UpDown and LeftRight arrow keys This work may be distributed andor modified under the conditions of the LaTeX Project Public License The latest version of this license is in httpmirrorsctanorgmacroslatexbaselppltxt This work has the LPPL maintenance status `maintained The Current Maintainer of this work is A Grahn The code borrows heavily from Bernd Gaertners `Miniball software originally written in C++ for computing the smallest enclosing ball of a set of points see httpwwwinfethzchpersonalgaertnerminiballhtmlhostconsoleshow()constructor for doubly linked listfunction List() thisfirst_node=null thislast_node=new Node(undefined)Listprototypepush_back=function(x) var new_node=new Node(x) if(thisfirst_node==null) thisfirst_node=new_node new_nodeprev=null else new_nodeprev=thislast_nodeprev new_nodeprevnext=new_node new_nodenext=thislast_node thislast_nodeprev=new_nodeListprototypemove_to_front=function(it) var node=itget() if(nodenext=null ampamp nodeprev=null) nodenextprev=nodeprev nodeprevnext=nodenext nodeprev=null nodenext=thisfirst_node thisfirst_nodeprev=node thisfirst_node=node Listprototypebegin=function() var i=new Iterator() itarget=thisfirst_node return(i)Listprototypeend=function() var i=new Iterator() itarget=thislast_node return(i)function Iterator(it) if( it=undefined ) thistarget=ittarget else thistarget=null Iteratorprototypeset=function(it)thistarget=ittargetIteratorprototypeget=function()return(thistarget)Iteratorprototypederef=function()return(thistargetdata)Iteratorprototypeincr=function() if(thistargetnext=null) thistarget=thistargetnextconstructor for node objects that populate the linked listfunction Node(x) thisprev=null thisnext=null thisdata=xfunction sqr(r)return(rr)helper functionMiniball algorithm by B Gaertnerfunction Basis() thism=0 thisq0=new Array(3) thisz=new Array(4) thisf=new Array(4) thisv=new Array(new Array(3) new Array(3) new Array(3) new Array(3)) thisa=new Array(new Array(3) new Array(3) new Array(3) new Array(3)) thisc=new Array(new Array(3) new Array(3) new Array(3) new Array(3)) thissqr_r=new Array(4) thiscurrent_c=thisc[0] thiscurrent_sqr_r=0 thisreset()Basisprototypecenter=function()return(thiscurrent_c)Basisprototypesize=function()return(thism)Basisprototypepop=function()--thismBasisprototypeexcess=function(p) var e=-thiscurrent_sqr_r for(var k=0klt3++k) e+=sqr(p[k]-thiscurrent_c[k]) return(e)Basisprototypereset=function() thism=0 for(var j=0jlt3++j) thisc[0][j]=0 thiscurrent_c=thisc[0] thiscurrent_sqr_r=-1Basisprototypepush=function(p) var i j var eps=1e-32 if(thism==0) for(i=0ilt3++i) thisq0[i]=p[i] for(i=0ilt3++i) thisc[0][i]=thisq0[i] thissqr_r[0]=0 else for(i=0ilt3++i) thisv[thism][i]=p[i]-thisq0[i] for(i=1iltthism++i) thisa[thism][i]=0 for(j=0jlt3++j) thisa[thism][i]+=thisv[i][j]thisv[thism][j] thisa[thism][i]=(2thisz[i]) for(i=1iltthism++i) for(j=0jlt3++j) thisv[thism][j]-=thisa[thism][i]thisv[i][j] thisz[thism]=0 for(j=0jlt3++j) thisz[thism]+=sqr(thisv[thism][j]) thisz[thism]=2 if(thisz[thism]ltepsthiscurrent_sqr_r) return(false) var e=-thissqr_r[thism-1] for(i=0ilt3++i) e+=sqr(p[i]-thisc[thism-1][i]) thisf[thism]=ethisz[thism] for(i=0ilt3++i) thisc[thism][i]=thisc[thism-1][i]+thisf[thism]thisv[thism][i] thissqr_r[thism]=thissqr_r[thism-1]+ethisf[thism]2 thiscurrent_c=thisc[thism] thiscurrent_sqr_r=thissqr_r[thism] ++thism return(true)function Miniball() thisL=new List() thisB=new Basis() thissupport_end=new Iterator()Miniballprototypemtf_mb=function(it) var i=new Iterator(it) thissupport_endset(thisLbegin()) if((thisBsize())==4) return for(var k=new Iterator(thisLbegin())kget()=iget()) var j=new Iterator(k) kincr() if(thisBexcess(jderef()) gt 0) if(thisBpush(jderef())) thismtf_mb(j) thisBpop() if(thissupport_endget()==jget()) thissupport_endincr() thisLmove_to_front(j) Miniballprototypecheck_in=function(b) thisLpush_back(b)Miniballprototypebuild=function() thisBreset() thissupport_endset(thisLbegin()) thismtf_mb(thisLend())Miniballprototypecenter=function() return(thisBcenter())Miniballprototyperadius=function() return(Mathsqrt(thisBcurrent_sqr_r))functions called by menu itemsfunction calc3Dopts () create Miniball object var mb=new Miniball() auxiliary vector var corner=new Vector3() iterate over all visible mesh nodes in the scene for(i=0iltscenemeshescounti++) var mesh=scenemeshesgetByIndex(i) if(meshvisible) continue local to parent transformation matrix var trans=meshtransform build local to world transformation matrix by recursively multiplying the parents transf matrix on the right var parent=meshparent while(parenttransform) trans=transmultiply(parenttransform) parent=parentparent get the bbox of the mesh (local coordinates) var bbox=meshcomputeBoundingBox() transform the local bounding box corner coordinates to world coordinates for bounding sphere determination BBoxmin cornerset(bboxmin) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) BBoxmax cornerset(bboxmax) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) remaining six BBox corners cornerset(bboxminx bboxmaxy bboxmaxz) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) cornerset(bboxminx bboxminy bboxmaxz) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) cornerset(bboxminx bboxmaxy bboxminz) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) cornerset(bboxmaxx bboxminy bboxminz) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) cornerset(bboxmaxx bboxminy bboxmaxz) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) cornerset(bboxmaxx bboxmaxy bboxminz) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) compute the smallest enclosing bounding sphere mbbuild() current camera settings var camera=scenecamerasgetByIndex(0) var res= initialize result string aperture angle of the virtual camera (perspective projection) or orthographic scale (orthographic projection) if(cameraprojectionType==cameraTYPE_PERSPECTIVE) var aac=camerafov180MathPI if(hostutilprintf(4f aac)=30) res+=hostutilprintf(n3Daac=s aac) else cameraviewPlaneSize=2mbradius() res+=hostutilprintf(n3Dortho=s 1cameraviewPlaneSize) camera roll var roll = cameraroll180MathPI if(hostutilprintf(4f roll)=0) res+=hostutilprintf(n3Droll=sroll) target to camera vector var c2c=new Vector3() c2cset(cameraposition) c2csubtractInPlace(cameratargetPosition) c2cnormalize() if((c2cx==0 ampamp c2cy==-1 ampamp c2cz==0)) res+=hostutilprintf(n3Dc2c=s s s c2cx c2cy c2cz) new camera settings bounding sphere centre --gt new camera target var coo=new Vector3() cooset((mbcenter())[0] (mbcenter())[1] (mbcenter())[2]) if(coolength) res+=hostutilprintf(n3Dcoo=s s s coox cooy cooz) radius of orbit if(cameraprojectionType==cameraTYPE_PERSPECTIVE) var roo=mbradius() Mathsin(aac MathPI 360) else orthographic projection var roo=mbradius() res+=hostutilprintf(n3Droo=s roo) update camera settings in the viewer var currol=cameraroll cameratargetPositionset(coo) camerapositionset(cooadd(c2cscale(roo))) cameraroll=currol determine background colour rgb=scenebackgroundgetColor() if((rgbr==1 ampamp rgbg==1 ampamp rgbb==1)) res+=hostutilprintf(n3Dbg=s s s rgbr rgbg rgbb) determine lighting scheme switch(scenelightScheme) case sceneLIGHT_MODE_FILE curlights=Artworkbreak case sceneLIGHT_MODE_NONE curlights=Nonebreak case sceneLIGHT_MODE_WHITE curlights=Whitebreak case sceneLIGHT_MODE_DAY curlights=Daybreak case sceneLIGHT_MODE_NIGHT curlights=Nightbreak case sceneLIGHT_MODE_BRIGHT curlights=Hardbreak case sceneLIGHT_MODE_RGB curlights=Primarybreak case sceneLIGHT_MODE_BLUE curlights=Bluebreak case sceneLIGHT_MODE_RED curlights=Redbreak case sceneLIGHT_MODE_CUBE curlights=Cubebreak case sceneLIGHT_MODE_CAD curlights=CADbreak case sceneLIGHT_MODE_HEADLAMP curlights=Headlampbreak if(curlights=Artwork) res+=hostutilprintf(n3Dlights=s curlights) determine global render mode switch(scenerenderMode) case sceneRENDER_MODE_BOUNDING_BOX currender=BoundingBoxbreak case sceneRENDER_MODE_TRANSPARENT_BOUNDING_BOX currender=TransparentBoundingBoxbreak case sceneRENDER_MODE_TRANSPARENT_BOUNDING_BOX_OUTLINE currender=TransparentBoundingBoxOutlinebreak case sceneRENDER_MODE_VERTICES currender=Verticesbreak case sceneRENDER_MODE_SHADED_VERTICES currender=ShadedVerticesbreak case sceneRENDER_MODE_WIREFRAME currender=Wireframebreak case sceneRENDER_MODE_SHADED_WIREFRAME currender=ShadedWireframebreak case sceneRENDER_MODE_SOLID currender=Solidbreak case sceneRENDER_MODE_TRANSPARENT currender=Transparentbreak case sceneRENDER_MODE_SOLID_WIREFRAME currender=SolidWireframebreak case sceneRENDER_MODE_TRANSPARENT_WIREFRAME currender=TransparentWireframebreak case sceneRENDER_MODE_ILLUSTRATION currender=Illustrationbreak case sceneRENDER_MODE_SOLID_OUTLINE currender=SolidOutlinebreak case sceneRENDER_MODE_SHADED_ILLUSTRATION currender=ShadedIllustrationbreak case sceneRENDER_MODE_HIDDEN_WIREFRAME currender=HiddenWireframebreak if(currender=Solid) res+=hostutilprintf(n3Drender=s currender) write result string to the console hostconsoleshow() hostconsoleclear() hostconsoleprintln(n Copy and paste the following text to then+ option list of includemedian + res + n)function get3Dview () var camera=scenecamerasgetByIndex(0) var coo=cameratargetPosition var c2c=camerapositionsubtract(coo) var roo=c2clength c2cnormalize() var res=VIEW=insert optional name heren if((coox==0 ampamp cooy==0 ampamp cooz==0)) res+=hostutilprintf( COO=s s sn coox cooy cooz) if((c2cx==0 ampamp c2cy==-1 ampamp c2cz==0)) res+=hostutilprintf( C2C=s s sn c2cx c2cy c2cz) if(roo gt 1e-9) res+=hostutilprintf( ROO=sn roo) var roll = cameraroll180MathPI if(hostutilprintf(4f roll)=0) res+=hostutilprintf( ROLL=sn roll) if(cameraprojectionType==cameraTYPE_PERSPECTIVE) var aac=camerafov 180MathPI if(hostutilprintf(4f aac)=30) res+=hostutilprintf( AAC=sn aac) else if(hostutilprintf(4f cameraviewPlaneSize)=1) res+=hostutilprintf( ORTHO=sn 1cameraviewPlaneSize) rgb=scenebackgroundgetColor() if((rgbr==1 ampamp rgbg==1 ampamp rgbb==1)) res+=hostutilprintf( BGCOLOR=s s sn rgbr rgbg rgbb) switch(scenelightScheme) case sceneLIGHT_MODE_FILE curlights=Artworkbreak case sceneLIGHT_MODE_NONE curlights=Nonebreak case sceneLIGHT_MODE_WHITE curlights=Whitebreak case sceneLIGHT_MODE_DAY curlights=Daybreak case sceneLIGHT_MODE_NIGHT curlights=Nightbreak case sceneLIGHT_MODE_BRIGHT curlights=Hardbreak case sceneLIGHT_MODE_RGB curlights=Primarybreak case sceneLIGHT_MODE_BLUE curlights=Bluebreak case sceneLIGHT_MODE_RED curlights=Redbreak case sceneLIGHT_MODE_CUBE curlights=Cubebreak case sceneLIGHT_MODE_CAD curlights=CADbreak case sceneLIGHT_MODE_HEADLAMP curlights=Headlampbreak if(curlights=Artwork) res+= LIGHTS=+curlights+n switch(scenerenderMode) case sceneRENDER_MODE_BOUNDING_BOX defaultrender=BoundingBoxbreak case sceneRENDER_MODE_TRANSPARENT_BOUNDING_BOX defaultrender=TransparentBoundingBoxbreak case sceneRENDER_MODE_TRANSPARENT_BOUNDING_BOX_OUTLINE defaultrender=TransparentBoundingBoxOutlinebreak case sceneRENDER_MODE_VERTICES defaultrender=Verticesbreak case sceneRENDER_MODE_SHADED_VERTICES defaultrender=ShadedVerticesbreak case sceneRENDER_MODE_WIREFRAME defaultrender=Wireframebreak case sceneRENDER_MODE_SHADED_WIREFRAME defaultrender=ShadedWireframebreak case sceneRENDER_MODE_SOLID defaultrender=Solidbreak case sceneRENDER_MODE_TRANSPARENT defaultrender=Transparentbreak case sceneRENDER_MODE_SOLID_WIREFRAME defaultrender=SolidWireframebreak case sceneRENDER_MODE_TRANSPARENT_WIREFRAME defaultrender=TransparentWireframebreak case sceneRENDER_MODE_ILLUSTRATION defaultrender=Illustrationbreak case sceneRENDER_MODE_SOLID_OUTLINE defaultrender=SolidOutlinebreak case sceneRENDER_MODE_SHADED_ILLUSTRATION defaultrender=ShadedIllustrationbreak case sceneRENDER_MODE_HIDDEN_WIREFRAME defaultrender=HiddenWireframebreak if(defaultrender=Solid) res+= RENDERMODE=+defaultrender+n detect existing Clipping Plane (3D Cross Section) var clip=null if( clip=scenenodesgetByName($$$$$$)|| clip=scenenodesgetByName(Clipping Plane) ) for(var i=0iltscenenodescounti++) var nd=scenenodesgetByIndex(i) if(nd==clip||ndname==) continue var ndUTFName= for (var j=0 jltndnamelength j++) var theUnicode = ndnamecharCodeAt(j)toString(16) while (theUnicodelengthlt4) theUnicode = 0 + theUnicode ndUTFName += theUnicode var end=ndnamelastIndexOf() if(endgt0) var ndUserName=ndnamesubstr(0end) else var ndUserName=ndname respart= PART=+ndUserName+n respart+= UTF16NAME=+ndUTFName+n defaultvals=true if(ndvisible) respart+= VISIBLE=falsen defaultvals=false if(ndopacitylt10) respart+= OPACITY=+ndopacity+n defaultvals=false if(ndconstructorname==Mesh) currender=defaultrender switch(ndrenderMode) case sceneRENDER_MODE_BOUNDING_BOX currender=BoundingBoxbreak case sceneRENDER_MODE_TRANSPARENT_BOUNDING_BOX currender=TransparentBoundingBoxbreak case sceneRENDER_MODE_TRANSPARENT_BOUNDING_BOX_OUTLINE currender=TransparentBoundingBoxOutlinebreak case sceneRENDER_MODE_VERTICES currender=Verticesbreak case sceneRENDER_MODE_SHADED_VERTICES currender=ShadedVerticesbreak case sceneRENDER_MODE_WIREFRAME currender=Wireframebreak case sceneRENDER_MODE_SHADED_WIREFRAME currender=ShadedWireframebreak case sceneRENDER_MODE_SOLID currender=Solidbreak case sceneRENDER_MODE_TRANSPARENT currender=Transparentbreak case sceneRENDER_MODE_SOLID_WIREFRAME currender=SolidWireframebreak case sceneRENDER_MODE_TRANSPARENT_WIREFRAME currender=TransparentWireframebreak case sceneRENDER_MODE_ILLUSTRATION currender=Illustrationbreak case sceneRENDER_MODE_SOLID_OUTLINE currender=SolidOutlinebreak case sceneRENDER_MODE_SHADED_ILLUSTRATION currender=ShadedIllustrationbreak case sceneRENDER_MODE_HIDDEN_WIREFRAME currender=HiddenWireframebreak case sceneRENDER_MODE_DEFAULT currender=Defaultbreak if(currender=defaultrender) respart+= RENDERMODE=+currender+n defaultvals=false if(origtrans[ndname]ampampndtransformisEqual(origtrans[ndname])) var lvec=ndtransformtransformDirection(new Vector3(100)) var uvec=ndtransformtransformDirection(new Vector3(010)) var vvec=ndtransformtransformDirection(new Vector3(001)) respart+= TRANSFORM= +lvecx+ +lvecy+ +lvecz+ +uvecx+ +uvecy+ +uvecz+ +vvecx+ +vvecy+ +vvecz+ +ndtransformtranslationx+ +ndtransformtranslationy+ +ndtransformtranslationz+n defaultvals=false respart+= ENDn if(defaultvals) res+=respart if(clip) var centre=cliptransformtranslation var normal=cliptransformtransformDirection(new Vector3(001)) res+= CROSSSECTn if((centrex==0 ampamp centrey==0 ampamp centrez==0)) res+=hostutilprintf( CENTER=s s sn centrex centrey centrez) if((normalx==1 ampamp normaly==0 ampamp normalz==0)) res+=hostutilprintf( NORMAL=s s sn normalx normaly normalz) res+=hostutilprintf( VISIBLE=sn clipvisible) res+=hostutilprintf( PLANECOLOR=s s sn clipmaterialemissiveColorr clipmaterialemissiveColorg clipmaterialemissiveColorb) res+=hostutilprintf( OPACITY=sn clipopacity) res+=hostutilprintf( INTERSECTIONCOLOR=s s sn clipwireframeColorr clipwireframeColorg clipwireframeColorb) res+= ENDn for(var propt in clip) consoleprintln(propt++clip[propt]) res+=ENDn hostconsoleshow() hostconsoleclear() hostconsoleprintln(n Add the following VIEW section to a file ofn+ predefined views (See option 3Dviews)nn + The view may be given a name after VIEW=n + (Remove in front of =)n) hostconsoleprintln(res + n)add items to 3D context menuruntimeaddCustomMenuItem(dfltview Generate Default View default 0)runtimeaddCustomMenuItem(currview Get Current View default 0)runtimeaddCustomMenuItem(csection Cross Section checked 0)menu event handlersmenuEventHandler = new MenuEventHandler()menuEventHandleronEvent = function(e) switch(emenuItemName) case dfltview calc3Dopts() break case currview get3Dview() break case csection addremoveClipPlane(emenuItemChecked) break runtimeaddEventHandler(menuEventHandler)global variable taking reference to currently selected nodevar target=nullselectionEventHandler=new SelectionEventHandler()selectionEventHandleronEvent=function(e) if(eselectedampampenodename=) target=enode else target=null runtimeaddEventHandler(selectionEventHandler)cameraEventHandler=new CameraEventHandler()cameraEventHandleronEvent=function(e) var clip=null runtimeremoveCustomMenuItem(csection) runtimeaddCustomMenuItem(csection Cross Section checked 0) if(clip=scenenodesgetByName($$$$$$)|| predefined scenenodesgetByName(Clipping Plane)) added via context menu runtimeremoveCustomMenuItem(csection) runtimeaddCustomMenuItem(csection Cross Section checked 1) if(clip)plane in predefined views must be rotated by 90 deg around normal cliptransformrotateAboutLineInPlace( MathPI2cliptransformtranslation cliptransformtransformDirection(new Vector3(001)) ) for(var i=0 iltrot4x4length i++)rot4x4[i]setIdentity() target=nullruntimeaddEventHandler(cameraEventHandler)var rot4x4=new Array() keeps track of spin and tilt axes transformationskey event handler for scaling moving spinning and tilting objectskeyEventHandler=new KeyEventHandler()keyEventHandleronEvent=function(e) var backtrans=new Matrix4x4() var trgt=null if(target) trgt=target var backtrans=new Matrix4x4() var trans=trgttransform var parent=trgtparent while(parenttransform) build local to world transformation matrix transmultiplyInPlace(parenttransform) also build world to local back-transformation matrix backtransmultiplyInPlace(parenttransforminversetranspose) parent=parentparent backtranstransposeInPlace() else if( trgt=scenenodesgetByName($$$$$$)|| trgt=scenenodesgetByName(Clipping Plane) ) var trans=trgttransform if(trgt) return var tname=trgtname if(typeof(rot4x4[tname])==undefined) rot4x4[tname]=new Matrix4x4() if(target) var tiltAxis=rot4x4[tname]transformDirection(new Vector3(010)) else var tiltAxis=transtransformDirection(new Vector3(010)) var spinAxis=rot4x4[tname]transformDirection(new Vector3(001)) get the centre of the mesh if(targetampamptrgtconstructorname==Mesh) var centre=transtransformPosition(trgtcomputeBoundingBox()center) else part group (Node3 parent node clipping plane) var centre=new Vector3(transtranslation) switch(echaracterCode) case 30tilt up rot4x4[tname]rotateAboutLineInPlace( -MathPI900rot4x4[tname]translationtiltAxis) transrotateAboutLineInPlace(-MathPI900centretiltAxis) break case 31tilt down rot4x4[tname]rotateAboutLineInPlace( MathPI900rot4x4[tname]translationtiltAxis) transrotateAboutLineInPlace(MathPI900centretiltAxis) break case 28spin right if(ectrlKeyDownampamptarget) transrotateAboutLineInPlace(-MathPI900centrespinAxis) else rot4x4[tname]rotateAboutLineInPlace( -MathPI900rot4x4[tname]translationnew Vector3(001)) transrotateAboutLineInPlace(-MathPI900centrenew Vector3(001)) break case 29spin left if(ectrlKeyDownampamptarget) transrotateAboutLineInPlace(MathPI900centrespinAxis) else rot4x4[tname]rotateAboutLineInPlace( MathPI900rot4x4[tname]translationnew Vector3(001)) transrotateAboutLineInPlace(MathPI900centrenew Vector3(001)) break case 120 x translateTarget(trans new Vector3(100) e) break case 121 y translateTarget(trans new Vector3(010) e) break case 122 z translateTarget(trans new Vector3(001) e) break case 88 shift + x translateTarget(trans new Vector3(-100) e) break case 89 shift + y translateTarget(trans new Vector3(0-10) e) break case 90 shift + z translateTarget(trans new Vector3(00-1) e) break case 115 s transtranslateInPlace(centrescale(-1)) transscaleInPlace(101) transtranslateInPlace(centrescale(1)) break case 83 shift + s transtranslateInPlace(centrescale(-1)) transscaleInPlace(1101) transtranslateInPlace(centrescale(1)) break transmultiplyInPlace(backtrans)runtimeaddEventHandler(keyEventHandler)translates object by amount calculated from Canvas sizefunction translateTarget(t d e) var cam=scenecamerasgetByIndex(0) if(camprojectionType==camTYPE_PERSPECTIVE) var scale=Mathtan(camfov2) camtargetPositionsubtract(camposition)length Mathmin(ecanvasPixelWidthecanvasPixelHeight) else var scale=camviewPlaneSize2 Mathmin(ecanvasPixelWidthecanvasPixelHeight) ttranslateInPlace(dscale(scale))function addremoveClipPlane(chk) var curTrans=getCurTrans() var clip=scenecreateClippingPlane() if(chk) add Clipping Plane and place its center either into the camera target position or into the centre of the currently selected mesh node var centre=new Vector3() if(target) var trans=targettransform var parent=targetparent while(parenttransform) trans=transmultiply(parenttransform) parent=parentparent if(targetconstructorname==Mesh) var centre=transtransformPosition(targetcomputeBoundingBox()center) else var centre=new Vector3(transtranslation) target=null else centreset(scenecamerasgetByIndex(0)targetPosition) cliptransformsetView( new Vector3(000) new Vector3(100) new Vector3(010)) cliptransformtranslateInPlace(centre) else if( scenenodesgetByName($$$$$$)|| scenenodesgetByName(Clipping Plane) ) clipremove()clip=null restoreTrans(curTrans) return clipfunction to store current transformation matrix of all nodes in the scenefunction getCurTrans() var tA=new Array() for(var i=0 iltscenenodescount i++) var nd=scenenodesgetByIndex(i) if(ndname==) continue tA[ndname]=new Matrix4x4(ndtransform) return tAfunction to restore transformation matrices given as argfunction restoreTrans(tA) for(var i=0 iltscenenodescount i++) var nd=scenenodesgetByIndex(i) if(tA[ndname]) ndtransformset(tA[ndname]) store original transformation matrix of all mesh nodes in the scenevar origtrans=getCurTrans()set initial state of Cross Section menu entrycameraEventHandleronEvent(1)hostconsoleclear()

var ocgs=hostgetOCGs(hostpageNum)for(var i=0iltocgslengthi++)if(ocgs[i]name==MediaPlayButton1)ocgs[i]state=false

(C) 2012 Michail Vidiassov John C Bowman Alexander Grahn asylabelsjs version 20120912 3D JavaScript to be used with media9sty (option `add3Djscript) for Asymptote generated PRC files adds billboard behaviour to text labels in Asymptote PRC files so that they always face the camera under 3D rotation This work may be distributed andor modified under the conditions of the LaTeX Project Public License The latest version of this license is in httpmirrorsctanorgmacroslatexbaselppltxt This work has the LPPL maintenance status `maintained The Current Maintainer of this work is A Grahnvar bbnodes=new Array() billboard meshesvar bbtrans=new Array() billboard transformsfunction fulltransform(mesh) var t=new Matrix4x4(meshtransform) if(meshparentname = ) var parentTransform=fulltransform(meshparent) tmultiplyInPlace(parentTransform) return t else return t find all text labels in the scene and determine pivoting pointsvar nodes=scenenodesvar nodescount=nodescountvar third=1030for(var i=0 i lt nodescount i++) var node=nodesgetByIndex(i) var name=nodename var end=namelastIndexOf()-1 if(end gt 0) if(namecharAt(end) == 001) var start=namelastIndexOf(-)+1 if(end gt start) nodename=namesubstr(0start-1) var nodeMatrix=fulltransform(nodeparent) var c=nodeMatrixtranslation position var d=Mathpow(Mathabs(nodeMatrixdeterminant)third) scale bbnodespush(node) bbtranspush(Matrix4x4()scale(ddd)translate(c)multiply(nodeMatrixinverse)) var camera=scenecamerasgetByIndex(0) var zero=new Vector3(000)var bbcount=bbnodeslength event handler to maintain camera-facing text labelsbillboardHandler=new RenderEventHandler()billboardHandleronEvent=function(event) var T=new Matrix4x4() TsetView(zerocamerapositionsubtract(cameratargetPosition) cameraupsubtract(cameraposition)) for(var j=0 j lt bbcount j++) bbnodes[j]transformset(Tmultiply(bbtrans[j])) runtimerefresh() runtimeaddEventHandler(billboardHandler)runtimerefresh()

(C) 2012 Alexander Grahn 3Dspintooljs version 20120301 3D JavaScript to be used with media9sty (option `add3Djscript) enables the Spin tool (also accessible via 3D toolbar or context menu) upon activation of the 3D scene the scene then rotates around the upright axis while dragging with the mouse This work may be distributed andor modified under the conditions of the LaTeX Project Public License The latest version of this license is in httpmirrorsctanorgmacroslatexbaselppltxt This work has the LPPL maintenance status `maintained The Current Maintainer of this work is A GrahnruntimesetCurrentTool(runtimeTOOL_NAME_SPIN)

cells [ cell_type code execution_count null metadata outputs [] source [ from IPythoncoredisplay import display HTMLn display(HTML( )) ] cell_type code execution_count null metadata collapsed true outputs [] source [ import numpy as npn import scipystats as ssn import time n n Black and Scholesn def d1(S0 K r sigma T)n return (nplog(S0K) + (r + sigma2 2) T)(sigma npsqrt(T))n n def d2(S0 K r sigma T)n return (nplog(S0 K) + (r - sigma2 2) T) (sigma npsqrt(T))n n def BlackScholes(typeS0 K r sigma T)n if type==Cn return S0 ssnormcdf(d1(S0 K r sigma T)) - K npexp(-r T) ssnormcdf(d2(S0 K r sigma T))n elsen return K npexp(-r T) ssnormcdf(-d2(S0 K r sigma T)) - S0 ssnormcdf(-d1(S0 K r sigma T)) ] cell_type code execution_count null metadata outputs [] source [ BlackScholes(C100 120 002 02 10) ] ] metadata anaconda-cloud kernelspec display_name Python 3 language python name python3 language_info codemirror_mode name ipython version 3 file_extension py mimetype textx-python name python nbconvert_exporter python pygments_lexer ipython3 version 375rc1 nbformat 4 nbformat_minor 1

Black-Scholes Pricing and Hedging

Fig 65 Time-dependent solution of the Black-Scholes PDE (call option)lowast

The next proposition is proved by a direct differentiation of the Black-Scholesfunction and will be recovered later using a probabilistic argument in Propo-sition 714 below

Proposition 64 The Black-Scholes Delta of the European call option isgiven by

ξt = ξt(St) =partgcpartx

(tSt) = Φ(d+(T minus t)

)isin [0 1] (615)

where d+(T minus t) is given by (611)

Proof From Relation (613) we note that the standard normal probabilitydensity function

ϕ(x) = Φprime(x) =1radic2π

eminusx22 x isin R

satisfies

ϕ(d+(T minus t)) = ϕ

(log(xK) + (r+ σ22)(T minus t)

|σ|radicT minus t

)=

1radic2π

exp(minus1

2

(log(xK) + (r+ σ22)(T minus t)

|σ|radicT minus t

)2)

=1radic2π

exp(minus1

2

(log(xK) + (rminus σ22)(T minus t)

|σ|radicT minus t

+ |σ|radicT minus t

)2)

=1radic2π

exp(minus1

2 (dminus(T minus t))2 minus (T minus t)rminus log x

K

)=

K

xradic

2πeminus(Tminust)r exp

(minus1

2 (dminus(T minus t))2)

lowast The animation works in Acrobat Reader on the entire pdf file

209

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

=K

xeminus(Tminust)rϕ(dminus(T minus t))

hence by (610) we have

partgcpartx

(tx) = part

partx

(xΦ(

log(xK) + (r+ σ22)(T minus t)|σ|radicT minus t

))(616)

minusK eminus(Tminust)r partpartx

(Φ(

log(xK) + (rminus σ22)(T minus t)|σ|radicT minus t

))= Φ

(log(xK) + (r+ σ22)(T minus t)

|σ|radicT minus t

)+x

part

partxΦ(

log(xK) + (r+ σ22)(T minus t)|σ|radicT minus t

)minusK eminus(Tminust)r part

partxΦ(

log(xK) + (rminus σ22)(T minus t)|σ|radicT minus t

)= Φ

(log(xK) + (r+ σ22)(T minus t)

|σ|radicT minus t

)+

x

|σ|radicT minus t

ϕ

(log(xK) + (r+ σ22)(T minus t)

|σ|radicT minus t

)minusK eminus(Tminust)r

|σ|radicT minus t

ϕ

(log(xK) + (rminus σ22)(T minus t)

|σ|radicT minus t

)= Φ(d+(T minus t)) +

x

|σ|radicT minus t

ϕ(d+(T minus t))minusK eminus(Tminust)r

|σ|radicT minus t

ϕ(dminus(T minus t))

= Φ(d+(T minus t))

As a consequence of Proposition 64 the Black-Scholes call price splits into arisky component StΦ

(d+(T minus t)

)and a riskless componentminusK eminus(Tminust)rΦ

(dminus(T minus

t)) as follows

gc(tSt) = StΦ(d+(T minus t)

)︸ ︷︷ ︸risky investment (held)

minus K eminus(Tminust)rΦ(dminus(T minus t)

)︸ ︷︷ ︸

riskminusfree investment (borrowed)

0 6 t 6 T

See Exercise 64 for a computation of the boundary values of gc(tx) t isin[0T ) x gt 0 The following R script is an implementation of the Black-ScholesDelta for European call options in R

1 Delta lt- function(S K r T sigma)d1 lt- (log(SK)+(r+sigma^22)T)(sigmasqrt(T))

3 Delta = pnorm(d1)Delta

210

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

In Figure 66 we plot the Delta of the European call option as a function ofthe underlying asset price and of the time remaining until maturity

Payoff function (x-K)+

0

50

100

150

200

Underlying

0

5

10

15

Time to maturity T-t

0

025

05

075

1

Fig 66 Delta of a European call option with strike price K = 100 r = 3 σ = 10

The Gamma of the European call option is defined as the first derivative ofDelta or second derivative of the option price with respect to the underlyingasset price This gives

γt =1

St|σ|radicT minus t

Φprime(d+(T minus t)

)=

1St|σ|

radic2(T minus t)π

exp(minus1

2

(log(StK) + (r+ σ22)(T minus t)

|σ|radicT minus t

)2)gt 0

In particular a positive value of γt implies that the Delta ξt = ξt(St) shouldincrease when the underlying asset price St increases In other words the po-sition ξt in the underlying asset should be increased by additional purchasesif the underlying asset price St increases

In Figure 67 we plot the (truncated) value of the Gamma of a European calloption as a function of the underlying asset price and of time to maturity

211

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

Fig 67 Gamma of a European call option with strike price K = 100

As Gamma is always nonnegative the Black-Scholes hedging strategy is tokeep buying the risky underlying asset when its price increases and to sell itwhen its price decreases as can be checked from Figure 67

Numerical example - hedging of a call option

In Figure 68 we consider the historical stock price of HSBC Holdings(0005HK) over one year

Fig 68 Graph of the stock price of HSBC Holdings

Consider the call option issued by Societe Generale on 31 December 2008 withstrike price K=$63704 maturity T = October 05 2009 and an entitlementratio of 100 meaning that one option contract is divided into 100 warrants cfpage 9 The next graph gives the time evolution of the Black-Scholes portfoliovalue

t 7minusrarr gc(tSt)

driven by the market price t 7minusrarr St of the risky underlying asset as given inFigure 68 in which the number of days is counted from the origin and notfrom maturity

212

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

40 50 60 70 80 90 0 50 100 150 200

0

5

10

15

20

25

30

35

40

Underlying (HK$) Time in days

Fig 69 Path of the Black-Scholes price for a call option on HSBC

As a consequence of Proposition 64 in the Black-Scholes call option hedgingmodel the amount invested in the risky asset is

Stξt = StΦ(d+(T minus t)

)= StΦ

(log(StK) + (r+ σ22)(T minus t)

|σ|radicT minus t

)gt 0

which is always nonnegative ie there is no short selling and the amountinvested on the riskless asset is

ηtAt = minusK eminus(Tminust)rΦ(dminus(T minus t)

)= minusK eminus(Tminust)rΦ

(log(StK) + (rminus σ22)(T minus t)

|σ|radicT minus t

)6 0

which is always nonpositive ie we are constantly borrowing money on theriskless asset as noted in Figure 610

-60

-40

-20

0

20

40

60

80

100

0 50 100 150 200

K

HK$

Black-Scholes priceRisky investment ξtSt

Riskless investment ηtAtUnderlying asset price

Fig 610 Time evolution of a hedging portfolio for a call option on HSBC

213

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

A comparison of Figure 610 with market data can be found in Figures 911and 912 below

Cash settlement In the case of a cash settlement the option issuer will sat-isfy the option contract by selling ξT = 1 stock at the price ST = $83refund the K = $63 risk-free investment and hand in the remaining amountC = (ST minusK)+ = 83minus 63 = $20 to the option holder

Physical delivery In the case of physical delivery of the underlying asset theoption issuer will deliver ξT = 1 stock to the option holder in exchange forK = $63 which will be used together with the portfolio value to refund therisk-free loan

63 European Put Options

Similarly in the case of the European put option with strike price K thepayoff function is given by h(x) = (Kminusx)+ and the Black-Scholes PDE (67)reads

rgp(tx) =partgppartt

(tx) + rxpartgppartx

(tx) + 12σ

2x2 part2gppartx2 (tx)

gp(T x) = (K minus x)+(617)

The next proposition can be proved as in Sections 65 and 66 see Proposi-tion 611

Proposition 65 The solution of the PDE (617) is given by the Black-Scholes formula for put options

gp(tx) = K eminus(Tminust)rΦ(minus dminus(T minus t)

)minus xΦ

(minus d+(T minus t)

) (618)

withd+(T minus t) =

log(xK) + (r+ σ22)(T minus t)|σ|radicT minus t

(619)

dminus(T minus t) =log(xK) + (rminus σ22)(T minus t)

|σ|radicT minus t

(620)

as illustrated in Figure 611

214

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

Fig 611 Graph of the Black-Scholes put price function with strike price K = 100lowast

In other words the European put option with strike price K and maturityT is priced at time t isin [0T ] as

gp(tSt) = K eminus(Tminust)rΦ(minus dminus(T minus t)

)minus StΦ

(minus d+(T minus t)

) 0 6 t 6 T

Fig 612 Time-dependent solution of the Black-Scholes PDE (put option)dagger

The following R script is an implementation of the Black-Scholes formula forEuropean put options in R

1 BSPut lt- function(S K r T sigma)d1 = (log(SK)+(r+sigma^22)T)(sigmasqrt(T))

3 d2 = d1 - sigma sqrt(T)BSPut = Kexp(-rT) pnorm(-d2) - Spnorm(-d1)

5 BSPut

Call-put parity

lowast Right-click on the figure for interaction and ldquoFull Screen Multimediardquo viewdagger The animation works in Acrobat Reader on the entire pdf file

215

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

(C) 2012--today Alexander Grahn 3Dmenujs version 20140923 3D JavaScript used by media9sty Extended functionality of the (right click) context menu of 3D annotations 1) Adds the following items to the 3D context menu `Generate Default View Finds good default camera settings returned as options for use with the includemedia command `Get Current View Determines camera cross section and part settings of the current view returned as `VIEW section that can be copied into a views file of additional views The views file is inserted using the `3Dviews option of includemedia `Cross Section Toggle switch to add or remove a cross section into or from the current view The cross section can be moved in the x y z directions using x y z and X Y Z keys on the keyboard be tilted against and spun around the upright Z axis using the UpDown and LeftRight arrow keys and caled using the s and S keys 2) Enables manipulation of position and orientation of indiviual parts and groups of parts in the 3D scene Parts which have been selected with the mouse can be scaled moved around and rotated like the cross section as described above To spin the parts around their local up-axis keep Control key pressed while using the UpDown and LeftRight arrow keys This work may be distributed andor modified under the conditions of the LaTeX Project Public License The latest version of this license is in httpmirrorsctanorgmacroslatexbaselppltxt This work has the LPPL maintenance status `maintained The Current Maintainer of this work is A Grahn The code borrows heavily from Bernd Gaertners `Miniball software originally written in C++ for computing the smallest enclosing ball of a set of points see httpwwwinfethzchpersonalgaertnerminiballhtmlhostconsoleshow()constructor for doubly linked listfunction List() thisfirst_node=null thislast_node=new Node(undefined)Listprototypepush_back=function(x) var new_node=new Node(x) if(thisfirst_node==null) thisfirst_node=new_node new_nodeprev=null else new_nodeprev=thislast_nodeprev new_nodeprevnext=new_node new_nodenext=thislast_node thislast_nodeprev=new_nodeListprototypemove_to_front=function(it) var node=itget() if(nodenext=null ampamp nodeprev=null) nodenextprev=nodeprev nodeprevnext=nodenext nodeprev=null nodenext=thisfirst_node thisfirst_nodeprev=node thisfirst_node=node Listprototypebegin=function() var i=new Iterator() itarget=thisfirst_node return(i)Listprototypeend=function() var i=new Iterator() itarget=thislast_node return(i)function Iterator(it) if( it=undefined ) thistarget=ittarget else thistarget=null Iteratorprototypeset=function(it)thistarget=ittargetIteratorprototypeget=function()return(thistarget)Iteratorprototypederef=function()return(thistargetdata)Iteratorprototypeincr=function() if(thistargetnext=null) thistarget=thistargetnextconstructor for node objects that populate the linked listfunction Node(x) thisprev=null thisnext=null thisdata=xfunction sqr(r)return(rr)helper functionMiniball algorithm by B Gaertnerfunction Basis() thism=0 thisq0=new Array(3) thisz=new Array(4) thisf=new Array(4) thisv=new Array(new Array(3) new Array(3) new Array(3) new Array(3)) thisa=new Array(new Array(3) new Array(3) new Array(3) new Array(3)) thisc=new Array(new Array(3) new Array(3) new Array(3) new Array(3)) thissqr_r=new Array(4) thiscurrent_c=thisc[0] thiscurrent_sqr_r=0 thisreset()Basisprototypecenter=function()return(thiscurrent_c)Basisprototypesize=function()return(thism)Basisprototypepop=function()--thismBasisprototypeexcess=function(p) var e=-thiscurrent_sqr_r for(var k=0klt3++k) e+=sqr(p[k]-thiscurrent_c[k]) return(e)Basisprototypereset=function() thism=0 for(var j=0jlt3++j) thisc[0][j]=0 thiscurrent_c=thisc[0] thiscurrent_sqr_r=-1Basisprototypepush=function(p) var i j var eps=1e-32 if(thism==0) for(i=0ilt3++i) thisq0[i]=p[i] for(i=0ilt3++i) thisc[0][i]=thisq0[i] thissqr_r[0]=0 else for(i=0ilt3++i) thisv[thism][i]=p[i]-thisq0[i] for(i=1iltthism++i) thisa[thism][i]=0 for(j=0jlt3++j) thisa[thism][i]+=thisv[i][j]thisv[thism][j] thisa[thism][i]=(2thisz[i]) for(i=1iltthism++i) for(j=0jlt3++j) thisv[thism][j]-=thisa[thism][i]thisv[i][j] thisz[thism]=0 for(j=0jlt3++j) thisz[thism]+=sqr(thisv[thism][j]) thisz[thism]=2 if(thisz[thism]ltepsthiscurrent_sqr_r) return(false) var e=-thissqr_r[thism-1] for(i=0ilt3++i) e+=sqr(p[i]-thisc[thism-1][i]) thisf[thism]=ethisz[thism] for(i=0ilt3++i) thisc[thism][i]=thisc[thism-1][i]+thisf[thism]thisv[thism][i] thissqr_r[thism]=thissqr_r[thism-1]+ethisf[thism]2 thiscurrent_c=thisc[thism] thiscurrent_sqr_r=thissqr_r[thism] ++thism return(true)function Miniball() thisL=new List() thisB=new Basis() thissupport_end=new Iterator()Miniballprototypemtf_mb=function(it) var i=new Iterator(it) thissupport_endset(thisLbegin()) if((thisBsize())==4) return for(var k=new Iterator(thisLbegin())kget()=iget()) var j=new Iterator(k) kincr() if(thisBexcess(jderef()) gt 0) if(thisBpush(jderef())) thismtf_mb(j) thisBpop() if(thissupport_endget()==jget()) thissupport_endincr() thisLmove_to_front(j) Miniballprototypecheck_in=function(b) thisLpush_back(b)Miniballprototypebuild=function() thisBreset() thissupport_endset(thisLbegin()) thismtf_mb(thisLend())Miniballprototypecenter=function() return(thisBcenter())Miniballprototyperadius=function() return(Mathsqrt(thisBcurrent_sqr_r))functions called by menu itemsfunction calc3Dopts () create Miniball object var mb=new Miniball() auxiliary vector var corner=new Vector3() iterate over all visible mesh nodes in the scene for(i=0iltscenemeshescounti++) var mesh=scenemeshesgetByIndex(i) if(meshvisible) continue local to parent transformation matrix var trans=meshtransform build local to world transformation matrix by recursively multiplying the parents transf matrix on the right var parent=meshparent while(parenttransform) trans=transmultiply(parenttransform) parent=parentparent get the bbox of the mesh (local coordinates) var bbox=meshcomputeBoundingBox() transform the local bounding box corner coordinates to world coordinates for bounding sphere determination BBoxmin cornerset(bboxmin) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) BBoxmax cornerset(bboxmax) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) remaining six BBox corners cornerset(bboxminx bboxmaxy bboxmaxz) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) cornerset(bboxminx bboxminy bboxmaxz) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) cornerset(bboxminx bboxmaxy bboxminz) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) cornerset(bboxmaxx bboxminy bboxminz) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) cornerset(bboxmaxx bboxminy bboxmaxz) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) cornerset(bboxmaxx bboxmaxy bboxminz) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) compute the smallest enclosing bounding sphere mbbuild() current camera settings var camera=scenecamerasgetByIndex(0) var res= initialize result string aperture angle of the virtual camera (perspective projection) or orthographic scale (orthographic projection) if(cameraprojectionType==cameraTYPE_PERSPECTIVE) var aac=camerafov180MathPI if(hostutilprintf(4f aac)=30) res+=hostutilprintf(n3Daac=s aac) else cameraviewPlaneSize=2mbradius() res+=hostutilprintf(n3Dortho=s 1cameraviewPlaneSize) camera roll var roll = cameraroll180MathPI if(hostutilprintf(4f roll)=0) res+=hostutilprintf(n3Droll=sroll) target to camera vector var c2c=new Vector3() c2cset(cameraposition) c2csubtractInPlace(cameratargetPosition) c2cnormalize() if((c2cx==0 ampamp c2cy==-1 ampamp c2cz==0)) res+=hostutilprintf(n3Dc2c=s s s c2cx c2cy c2cz) new camera settings bounding sphere centre --gt new camera target var coo=new Vector3() cooset((mbcenter())[0] (mbcenter())[1] (mbcenter())[2]) if(coolength) res+=hostutilprintf(n3Dcoo=s s s coox cooy cooz) radius of orbit if(cameraprojectionType==cameraTYPE_PERSPECTIVE) var roo=mbradius() Mathsin(aac MathPI 360) else orthographic projection var roo=mbradius() res+=hostutilprintf(n3Droo=s roo) update camera settings in the viewer var currol=cameraroll cameratargetPositionset(coo) camerapositionset(cooadd(c2cscale(roo))) cameraroll=currol determine background colour rgb=scenebackgroundgetColor() if((rgbr==1 ampamp rgbg==1 ampamp rgbb==1)) res+=hostutilprintf(n3Dbg=s s s rgbr rgbg rgbb) determine lighting scheme switch(scenelightScheme) case sceneLIGHT_MODE_FILE curlights=Artworkbreak case sceneLIGHT_MODE_NONE curlights=Nonebreak case sceneLIGHT_MODE_WHITE curlights=Whitebreak case sceneLIGHT_MODE_DAY curlights=Daybreak case sceneLIGHT_MODE_NIGHT curlights=Nightbreak case sceneLIGHT_MODE_BRIGHT curlights=Hardbreak case sceneLIGHT_MODE_RGB curlights=Primarybreak case sceneLIGHT_MODE_BLUE curlights=Bluebreak case sceneLIGHT_MODE_RED curlights=Redbreak case sceneLIGHT_MODE_CUBE curlights=Cubebreak case sceneLIGHT_MODE_CAD curlights=CADbreak case sceneLIGHT_MODE_HEADLAMP curlights=Headlampbreak if(curlights=Artwork) res+=hostutilprintf(n3Dlights=s curlights) determine global render mode switch(scenerenderMode) case sceneRENDER_MODE_BOUNDING_BOX currender=BoundingBoxbreak case sceneRENDER_MODE_TRANSPARENT_BOUNDING_BOX currender=TransparentBoundingBoxbreak case sceneRENDER_MODE_TRANSPARENT_BOUNDING_BOX_OUTLINE currender=TransparentBoundingBoxOutlinebreak case sceneRENDER_MODE_VERTICES currender=Verticesbreak case sceneRENDER_MODE_SHADED_VERTICES currender=ShadedVerticesbreak case sceneRENDER_MODE_WIREFRAME currender=Wireframebreak case sceneRENDER_MODE_SHADED_WIREFRAME currender=ShadedWireframebreak case sceneRENDER_MODE_SOLID currender=Solidbreak case sceneRENDER_MODE_TRANSPARENT currender=Transparentbreak case sceneRENDER_MODE_SOLID_WIREFRAME currender=SolidWireframebreak case sceneRENDER_MODE_TRANSPARENT_WIREFRAME currender=TransparentWireframebreak case sceneRENDER_MODE_ILLUSTRATION currender=Illustrationbreak case sceneRENDER_MODE_SOLID_OUTLINE currender=SolidOutlinebreak case sceneRENDER_MODE_SHADED_ILLUSTRATION currender=ShadedIllustrationbreak case sceneRENDER_MODE_HIDDEN_WIREFRAME currender=HiddenWireframebreak if(currender=Solid) res+=hostutilprintf(n3Drender=s currender) write result string to the console hostconsoleshow() hostconsoleclear() hostconsoleprintln(n Copy and paste the following text to then+ option list of includemedian + res + n)function get3Dview () var camera=scenecamerasgetByIndex(0) var coo=cameratargetPosition var c2c=camerapositionsubtract(coo) var roo=c2clength c2cnormalize() var res=VIEW=insert optional name heren if((coox==0 ampamp cooy==0 ampamp cooz==0)) res+=hostutilprintf( COO=s s sn coox cooy cooz) if((c2cx==0 ampamp c2cy==-1 ampamp c2cz==0)) res+=hostutilprintf( C2C=s s sn c2cx c2cy c2cz) if(roo gt 1e-9) res+=hostutilprintf( ROO=sn roo) var roll = cameraroll180MathPI if(hostutilprintf(4f roll)=0) res+=hostutilprintf( ROLL=sn roll) if(cameraprojectionType==cameraTYPE_PERSPECTIVE) var aac=camerafov 180MathPI if(hostutilprintf(4f aac)=30) res+=hostutilprintf( AAC=sn aac) else if(hostutilprintf(4f cameraviewPlaneSize)=1) res+=hostutilprintf( ORTHO=sn 1cameraviewPlaneSize) rgb=scenebackgroundgetColor() if((rgbr==1 ampamp rgbg==1 ampamp rgbb==1)) res+=hostutilprintf( BGCOLOR=s s sn rgbr rgbg rgbb) switch(scenelightScheme) case sceneLIGHT_MODE_FILE curlights=Artworkbreak case sceneLIGHT_MODE_NONE curlights=Nonebreak case sceneLIGHT_MODE_WHITE curlights=Whitebreak case sceneLIGHT_MODE_DAY curlights=Daybreak case sceneLIGHT_MODE_NIGHT curlights=Nightbreak case sceneLIGHT_MODE_BRIGHT curlights=Hardbreak case sceneLIGHT_MODE_RGB curlights=Primarybreak case sceneLIGHT_MODE_BLUE curlights=Bluebreak case sceneLIGHT_MODE_RED curlights=Redbreak case sceneLIGHT_MODE_CUBE curlights=Cubebreak case sceneLIGHT_MODE_CAD curlights=CADbreak case sceneLIGHT_MODE_HEADLAMP curlights=Headlampbreak if(curlights=Artwork) res+= LIGHTS=+curlights+n switch(scenerenderMode) case sceneRENDER_MODE_BOUNDING_BOX defaultrender=BoundingBoxbreak case sceneRENDER_MODE_TRANSPARENT_BOUNDING_BOX defaultrender=TransparentBoundingBoxbreak case sceneRENDER_MODE_TRANSPARENT_BOUNDING_BOX_OUTLINE defaultrender=TransparentBoundingBoxOutlinebreak case sceneRENDER_MODE_VERTICES defaultrender=Verticesbreak case sceneRENDER_MODE_SHADED_VERTICES defaultrender=ShadedVerticesbreak case sceneRENDER_MODE_WIREFRAME defaultrender=Wireframebreak case sceneRENDER_MODE_SHADED_WIREFRAME defaultrender=ShadedWireframebreak case sceneRENDER_MODE_SOLID defaultrender=Solidbreak case sceneRENDER_MODE_TRANSPARENT defaultrender=Transparentbreak case sceneRENDER_MODE_SOLID_WIREFRAME defaultrender=SolidWireframebreak case sceneRENDER_MODE_TRANSPARENT_WIREFRAME defaultrender=TransparentWireframebreak case sceneRENDER_MODE_ILLUSTRATION defaultrender=Illustrationbreak case sceneRENDER_MODE_SOLID_OUTLINE defaultrender=SolidOutlinebreak case sceneRENDER_MODE_SHADED_ILLUSTRATION defaultrender=ShadedIllustrationbreak case sceneRENDER_MODE_HIDDEN_WIREFRAME defaultrender=HiddenWireframebreak if(defaultrender=Solid) res+= RENDERMODE=+defaultrender+n detect existing Clipping Plane (3D Cross Section) var clip=null if( clip=scenenodesgetByName($$$$$$)|| clip=scenenodesgetByName(Clipping Plane) ) for(var i=0iltscenenodescounti++) var nd=scenenodesgetByIndex(i) if(nd==clip||ndname==) continue var ndUTFName= for (var j=0 jltndnamelength j++) var theUnicode = ndnamecharCodeAt(j)toString(16) while (theUnicodelengthlt4) theUnicode = 0 + theUnicode ndUTFName += theUnicode var end=ndnamelastIndexOf() if(endgt0) var ndUserName=ndnamesubstr(0end) else var ndUserName=ndname respart= PART=+ndUserName+n respart+= UTF16NAME=+ndUTFName+n defaultvals=true if(ndvisible) respart+= VISIBLE=falsen defaultvals=false if(ndopacitylt10) respart+= OPACITY=+ndopacity+n defaultvals=false if(ndconstructorname==Mesh) currender=defaultrender switch(ndrenderMode) case sceneRENDER_MODE_BOUNDING_BOX currender=BoundingBoxbreak case sceneRENDER_MODE_TRANSPARENT_BOUNDING_BOX currender=TransparentBoundingBoxbreak case sceneRENDER_MODE_TRANSPARENT_BOUNDING_BOX_OUTLINE currender=TransparentBoundingBoxOutlinebreak case sceneRENDER_MODE_VERTICES currender=Verticesbreak case sceneRENDER_MODE_SHADED_VERTICES currender=ShadedVerticesbreak case sceneRENDER_MODE_WIREFRAME currender=Wireframebreak case sceneRENDER_MODE_SHADED_WIREFRAME currender=ShadedWireframebreak case sceneRENDER_MODE_SOLID currender=Solidbreak case sceneRENDER_MODE_TRANSPARENT currender=Transparentbreak case sceneRENDER_MODE_SOLID_WIREFRAME currender=SolidWireframebreak case sceneRENDER_MODE_TRANSPARENT_WIREFRAME currender=TransparentWireframebreak case sceneRENDER_MODE_ILLUSTRATION currender=Illustrationbreak case sceneRENDER_MODE_SOLID_OUTLINE currender=SolidOutlinebreak case sceneRENDER_MODE_SHADED_ILLUSTRATION currender=ShadedIllustrationbreak case sceneRENDER_MODE_HIDDEN_WIREFRAME currender=HiddenWireframebreak case sceneRENDER_MODE_DEFAULT currender=Defaultbreak if(currender=defaultrender) respart+= RENDERMODE=+currender+n defaultvals=false if(origtrans[ndname]ampampndtransformisEqual(origtrans[ndname])) var lvec=ndtransformtransformDirection(new Vector3(100)) var uvec=ndtransformtransformDirection(new Vector3(010)) var vvec=ndtransformtransformDirection(new Vector3(001)) respart+= TRANSFORM= +lvecx+ +lvecy+ +lvecz+ +uvecx+ +uvecy+ +uvecz+ +vvecx+ +vvecy+ +vvecz+ +ndtransformtranslationx+ +ndtransformtranslationy+ +ndtransformtranslationz+n defaultvals=false respart+= ENDn if(defaultvals) res+=respart if(clip) var centre=cliptransformtranslation var normal=cliptransformtransformDirection(new Vector3(001)) res+= CROSSSECTn if((centrex==0 ampamp centrey==0 ampamp centrez==0)) res+=hostutilprintf( CENTER=s s sn centrex centrey centrez) if((normalx==1 ampamp normaly==0 ampamp normalz==0)) res+=hostutilprintf( NORMAL=s s sn normalx normaly normalz) res+=hostutilprintf( VISIBLE=sn clipvisible) res+=hostutilprintf( PLANECOLOR=s s sn clipmaterialemissiveColorr clipmaterialemissiveColorg clipmaterialemissiveColorb) res+=hostutilprintf( OPACITY=sn clipopacity) res+=hostutilprintf( INTERSECTIONCOLOR=s s sn clipwireframeColorr clipwireframeColorg clipwireframeColorb) res+= ENDn for(var propt in clip) consoleprintln(propt++clip[propt]) res+=ENDn hostconsoleshow() hostconsoleclear() hostconsoleprintln(n Add the following VIEW section to a file ofn+ predefined views (See option 3Dviews)nn + The view may be given a name after VIEW=n + (Remove in front of =)n) hostconsoleprintln(res + n)add items to 3D context menuruntimeaddCustomMenuItem(dfltview Generate Default View default 0)runtimeaddCustomMenuItem(currview Get Current View default 0)runtimeaddCustomMenuItem(csection Cross Section checked 0)menu event handlersmenuEventHandler = new MenuEventHandler()menuEventHandleronEvent = function(e) switch(emenuItemName) case dfltview calc3Dopts() break case currview get3Dview() break case csection addremoveClipPlane(emenuItemChecked) break runtimeaddEventHandler(menuEventHandler)global variable taking reference to currently selected nodevar target=nullselectionEventHandler=new SelectionEventHandler()selectionEventHandleronEvent=function(e) if(eselectedampampenodename=) target=enode else target=null runtimeaddEventHandler(selectionEventHandler)cameraEventHandler=new CameraEventHandler()cameraEventHandleronEvent=function(e) var clip=null runtimeremoveCustomMenuItem(csection) runtimeaddCustomMenuItem(csection Cross Section checked 0) if(clip=scenenodesgetByName($$$$$$)|| predefined scenenodesgetByName(Clipping Plane)) added via context menu runtimeremoveCustomMenuItem(csection) runtimeaddCustomMenuItem(csection Cross Section checked 1) if(clip)plane in predefined views must be rotated by 90 deg around normal cliptransformrotateAboutLineInPlace( MathPI2cliptransformtranslation cliptransformtransformDirection(new Vector3(001)) ) for(var i=0 iltrot4x4length i++)rot4x4[i]setIdentity() target=nullruntimeaddEventHandler(cameraEventHandler)var rot4x4=new Array() keeps track of spin and tilt axes transformationskey event handler for scaling moving spinning and tilting objectskeyEventHandler=new KeyEventHandler()keyEventHandleronEvent=function(e) var backtrans=new Matrix4x4() var trgt=null if(target) trgt=target var backtrans=new Matrix4x4() var trans=trgttransform var parent=trgtparent while(parenttransform) build local to world transformation matrix transmultiplyInPlace(parenttransform) also build world to local back-transformation matrix backtransmultiplyInPlace(parenttransforminversetranspose) parent=parentparent backtranstransposeInPlace() else if( trgt=scenenodesgetByName($$$$$$)|| trgt=scenenodesgetByName(Clipping Plane) ) var trans=trgttransform if(trgt) return var tname=trgtname if(typeof(rot4x4[tname])==undefined) rot4x4[tname]=new Matrix4x4() if(target) var tiltAxis=rot4x4[tname]transformDirection(new Vector3(010)) else var tiltAxis=transtransformDirection(new Vector3(010)) var spinAxis=rot4x4[tname]transformDirection(new Vector3(001)) get the centre of the mesh if(targetampamptrgtconstructorname==Mesh) var centre=transtransformPosition(trgtcomputeBoundingBox()center) else part group (Node3 parent node clipping plane) var centre=new Vector3(transtranslation) switch(echaracterCode) case 30tilt up rot4x4[tname]rotateAboutLineInPlace( -MathPI900rot4x4[tname]translationtiltAxis) transrotateAboutLineInPlace(-MathPI900centretiltAxis) break case 31tilt down rot4x4[tname]rotateAboutLineInPlace( MathPI900rot4x4[tname]translationtiltAxis) transrotateAboutLineInPlace(MathPI900centretiltAxis) break case 28spin right if(ectrlKeyDownampamptarget) transrotateAboutLineInPlace(-MathPI900centrespinAxis) else rot4x4[tname]rotateAboutLineInPlace( -MathPI900rot4x4[tname]translationnew Vector3(001)) transrotateAboutLineInPlace(-MathPI900centrenew Vector3(001)) break case 29spin left if(ectrlKeyDownampamptarget) transrotateAboutLineInPlace(MathPI900centrespinAxis) else rot4x4[tname]rotateAboutLineInPlace( MathPI900rot4x4[tname]translationnew Vector3(001)) transrotateAboutLineInPlace(MathPI900centrenew Vector3(001)) break case 120 x translateTarget(trans new Vector3(100) e) break case 121 y translateTarget(trans new Vector3(010) e) break case 122 z translateTarget(trans new Vector3(001) e) break case 88 shift + x translateTarget(trans new Vector3(-100) e) break case 89 shift + y translateTarget(trans new Vector3(0-10) e) break case 90 shift + z translateTarget(trans new Vector3(00-1) e) break case 115 s transtranslateInPlace(centrescale(-1)) transscaleInPlace(101) transtranslateInPlace(centrescale(1)) break case 83 shift + s transtranslateInPlace(centrescale(-1)) transscaleInPlace(1101) transtranslateInPlace(centrescale(1)) break transmultiplyInPlace(backtrans)runtimeaddEventHandler(keyEventHandler)translates object by amount calculated from Canvas sizefunction translateTarget(t d e) var cam=scenecamerasgetByIndex(0) if(camprojectionType==camTYPE_PERSPECTIVE) var scale=Mathtan(camfov2) camtargetPositionsubtract(camposition)length Mathmin(ecanvasPixelWidthecanvasPixelHeight) else var scale=camviewPlaneSize2 Mathmin(ecanvasPixelWidthecanvasPixelHeight) ttranslateInPlace(dscale(scale))function addremoveClipPlane(chk) var curTrans=getCurTrans() var clip=scenecreateClippingPlane() if(chk) add Clipping Plane and place its center either into the camera target position or into the centre of the currently selected mesh node var centre=new Vector3() if(target) var trans=targettransform var parent=targetparent while(parenttransform) trans=transmultiply(parenttransform) parent=parentparent if(targetconstructorname==Mesh) var centre=transtransformPosition(targetcomputeBoundingBox()center) else var centre=new Vector3(transtranslation) target=null else centreset(scenecamerasgetByIndex(0)targetPosition) cliptransformsetView( new Vector3(000) new Vector3(100) new Vector3(010)) cliptransformtranslateInPlace(centre) else if( scenenodesgetByName($$$$$$)|| scenenodesgetByName(Clipping Plane) ) clipremove()clip=null restoreTrans(curTrans) return clipfunction to store current transformation matrix of all nodes in the scenefunction getCurTrans() var tA=new Array() for(var i=0 iltscenenodescount i++) var nd=scenenodesgetByIndex(i) if(ndname==) continue tA[ndname]=new Matrix4x4(ndtransform) return tAfunction to restore transformation matrices given as argfunction restoreTrans(tA) for(var i=0 iltscenenodescount i++) var nd=scenenodesgetByIndex(i) if(tA[ndname]) ndtransformset(tA[ndname]) store original transformation matrix of all mesh nodes in the scenevar origtrans=getCurTrans()set initial state of Cross Section menu entrycameraEventHandleronEvent(1)hostconsoleclear()

var ocgs=hostgetOCGs(hostpageNum)for(var i=0iltocgslengthi++)if(ocgs[i]name==MediaPlayButton2)ocgs[i]state=false

(C) 2012 Michail Vidiassov John C Bowman Alexander Grahn asylabelsjs version 20120912 3D JavaScript to be used with media9sty (option `add3Djscript) for Asymptote generated PRC files adds billboard behaviour to text labels in Asymptote PRC files so that they always face the camera under 3D rotation This work may be distributed andor modified under the conditions of the LaTeX Project Public License The latest version of this license is in httpmirrorsctanorgmacroslatexbaselppltxt This work has the LPPL maintenance status `maintained The Current Maintainer of this work is A Grahnvar bbnodes=new Array() billboard meshesvar bbtrans=new Array() billboard transformsfunction fulltransform(mesh) var t=new Matrix4x4(meshtransform) if(meshparentname = ) var parentTransform=fulltransform(meshparent) tmultiplyInPlace(parentTransform) return t else return t find all text labels in the scene and determine pivoting pointsvar nodes=scenenodesvar nodescount=nodescountvar third=1030for(var i=0 i lt nodescount i++) var node=nodesgetByIndex(i) var name=nodename var end=namelastIndexOf()-1 if(end gt 0) if(namecharAt(end) == 001) var start=namelastIndexOf(-)+1 if(end gt start) nodename=namesubstr(0start-1) var nodeMatrix=fulltransform(nodeparent) var c=nodeMatrixtranslation position var d=Mathpow(Mathabs(nodeMatrixdeterminant)third) scale bbnodespush(node) bbtranspush(Matrix4x4()scale(ddd)translate(c)multiply(nodeMatrixinverse)) var camera=scenecamerasgetByIndex(0) var zero=new Vector3(000)var bbcount=bbnodeslength event handler to maintain camera-facing text labelsbillboardHandler=new RenderEventHandler()billboardHandleronEvent=function(event) var T=new Matrix4x4() TsetView(zerocamerapositionsubtract(cameratargetPosition) cameraupsubtract(cameraposition)) for(var j=0 j lt bbcount j++) bbnodes[j]transformset(Tmultiply(bbtrans[j])) runtimerefresh() runtimeaddEventHandler(billboardHandler)runtimerefresh()

(C) 2012 Alexander Grahn 3Dspintooljs version 20120301 3D JavaScript to be used with media9sty (option `add3Djscript) enables the Spin tool (also accessible via 3D toolbar or context menu) upon activation of the 3D scene the scene then rotates around the upright axis while dragging with the mouse This work may be distributed andor modified under the conditions of the LaTeX Project Public License The latest version of this license is in httpmirrorsctanorgmacroslatexbaselppltxt This work has the LPPL maintenance status `maintained The Current Maintainer of this work is A GrahnruntimesetCurrentTool(runtimeTOOL_NAME_SPIN)

N Privault

Proposition 66 Call-put parity We have the call-put parity relation

gc(tSt)minus gp(tSt) = St minusK eminus(Tminust)r 0 6 t 6 T (621)

between the Black-Scholes prices of call and put options in terms of theforward contract price St minusK eminus(Tminust)r

Proof The call-put parity (621) is a consequence of the relation

xminusK = (xminusK)+ minus (K minus x)+

satisfied by the terminal call and put payoff functions in the Black-ScholesPDE (67) It can also be verified directly from (610) and (618) as

gc(tx)minus gp(tx) = xΦ(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)minus(K eminus(Tminust)rΦ

(minus dminus(T minus t)

)minus xΦ

(minus d+(T minus t)

))= xΦ

(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)minusK eminus(Tminust)r

(1minusΦ

(dminus(T minus t)

))+ x

(1minusΦ

(d+(T minus t)

))= xminusK

The Delta of the Black-Scholes put option can be obtained by differentiationof the call-put parity relation (621) and Proposition 64

Proposition 67 The Delta of the Black-Scholes put option is given by

ξt = minus(1minusΦ(d+(T minus t)

)) = minusΦ

(minus d+(T minus t)

)isin [minus1 0] 0 6 t 6 T

Proof By the call-put parity relation (621) and Proposition 64 we have

partgppartx

(tSt) =partgcpartx

(tSt)minus 1

= Φ(d+(T minus t))minus 1= minusΦ(minusd+(T minus t)) 0 6 t 6 T

where we applied (614)

As a consequence of Proposition 67 the Black-Scholes put price splitsinto a risky component minusStΦ

(minus d+(T minus t)

)and a riskless component

K eminus(Tminust)rΦ(minus dminus(T minus t)

) as follows

gp(tSt) = K eminus(Tminust)rΦ(minus dminus(T minus t)

)︸ ︷︷ ︸riskminusfree investment (savings)

minus StΦ(minus d+(T minus t)

)︸ ︷︷ ︸

risky investment (short)

0 6 t 6 T

216

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

In Figure 613 we plot the Delta of the European put option as a function ofthe underlying asset price and of the time remaining until maturity

Payoff function (x-K)+

0

50

100

150

200

Underlying

0

5

10

15 Time to maturity T-t

-1

-075

-05

-025

0

Fig 613 Delta of a European put option with strike price K = 100 r = 3 σ = 10

Numerical example - hedging of a put option

For one more example we consider a put option issued by BNP Paribas on04 November 2008 with strike price K=$77667 maturity T = October 052009 and entitlement ratio 92593 cf page 9 In the next Figure 614 thenumber of days is counted from the origin not from maturity

40 50 60 70 80 90 100

0 50 100 150 200

0 5

10 15 20 25 30 35 40 45

Underlying (HK$)Time in days

Fig 614 Path of the Black-Scholes price for a put option on HSBC

As a consequence of Proposition 67 the amount invested on the risky assetfor the hedging of a put option is

minusStΦ(minus d+(T minus t)

)= minusStΦ

(minus log(StK) + (r+ σ22)(T minus t)

|σ|radicT minus t

)6 0

217

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

ie there is always short selling and the amount invested on the riskless assetpriced At = ert t isin [0T ] is

ηtAt = K eminus(Tminust)rΦ(minus dminus(T minus t)

)= K eminus(Tminust)rΦ

(minus log(StK) + (rminus σ22)(T minus t)

|σ|radicT minus t

)gt 0

which is always nonnegative ie we are constantly saving money on theriskless asset as noted in Figure 615

-60

-40

-20

0

20

40

60

80

100

0 50 100 150 200

K

HK$

Black-Scholes priceRisky investment ξtSt

Riskless investment ηtAtUnderlying asset price

Fig 615 Time evolution of the hedging portfolio for a put option on HSBC

In the above example the put option finished out of the money (OTM) so thatno cash settlement or physical delivery occurs A comparison of Figure 610with market data can be found in Figures 913 and 914 below

64 Market Terms and Data

The following Table 61 provides a summary of formulas for the computationof Black-Scholes sensitivities also called Greekslowast

lowast ldquoEvery class feels like attending a Greek lessonrdquo (AY2018-2019 student feedback)

218

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

Call option Put option

Option price g(tSt) StΦ(d+(T minus t))minusK eminus(Tminust)rΦ(dminus(T minus t)) K eminus(Tminust)rΦ(minusdminus(T minus t))minus StΦ(minusd+(T minus t))

Delta (∆) partg

partx(tSt) Φ(d+(T minus t)) gt 0 minusΦ(minusd+(T minus t)) 6 0

Gamma (Γ) part2g

partx2 (tSt)Φprime(d+(T minus t))St|σ|

radicT minus t

gt 0

Vega partg

partσ(tSt) St

radicT minus tΦprime(d+(T minus t)) gt 0

Theta (Θ) partg

partt(tSt) minusSt|σ|Φ

prime(d+(T minus t))2radicT minus t

minus rK eminus(Tminust)rΦ(dminus(T minus t)) 6 0 minusSt|σ|Φprime(d+(T minus t))

2radicT minus t

+ rK eminus(Tminust)rΦ(minusdminus(T minus t))

Rho (ρ) partg

partr(tSt) K(T minus t) eminus(Tminust)rΦ(dminus(T minus t)) minusK(T minus t) eminus(Tminust)rΦ(minusdminus(T minus t))

Table 61 Black-Scholes Greeks (Wikipedia)

From Table 61 we can conclude that call option prices are increasing func-tions of the underlying asset price St of the interest rate r and of the volatil-ity parameter σ Similarly put option prices are decreasing functions of theunderlying asset price St of the interest rate r and increasing functions ofthe volatility parameter σ

Parameter Variation of call option prices Variation of put option prices

Underlying St increasing decreasing

Volatility σ increasing increasing

Time t decreasing depends on the underlying price level

Interest rate r increasing decreasing

Table 62 Variations of Black-Scholes prices

The change of sign of the sensitivity Theta (Θ) with respect to time t can beverified in the following Figure 616

219

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

(a) Black-Scholes call price maps (b) Black-Scholes put price maps

Fig 616 Time-dependent solutions of the Black-Scholes PDElowast

Intrinsic value The intrinsic value at time t isin [0T ] of the option withpayoff C = h

(S(1)T

)is given by the immediate exercise payoff h

(S(1)t

) The

extrinsic value at time t isin [0T ] of the option is the remaining differenceπt(C) minus h

(S(1)t

)between the option price πt(C) and the immediate ex-

ercise payoff h(S(1)t

) In general the option price πt(C) decomposes as

πt(C) = h(S(1)t

)︸ ︷︷ ︸intrinsic value

+ πt(C)minus h(S(1)t

)︸ ︷︷ ︸

extrinsic value

0 6 t 6 T ]

Gearing The gearing at time t isin [0T ] of the option with payoff C = h(ST )is defined as the ratio

Gt =St

πt(C)=

Stg(tSt)

0 6 t 6 T

Effective gearing The effective gearing at time t isin [0T ] of the option withpayoff C = h(ST ) is defined as the ratio

Get = Gtξt

=ξtStπt(C)

=St

πt(C)

partg

partx(tSt)

=St

g(tSt)partg

partx(tSt)

= Stpart

partxlog g(tSt) 0 6 t 6 T

lowast The animation works in Acrobat Reader on the entire pdf file

220

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

The effective gearingGet =

ξtStπt(C)

can be interpreted as the hedge ratio ie the percentage of the portfoliowhich is invested on the risky asset When written as

∆g(tSt)g(tSt)

= Get times

∆StSt

the effective gearing gives the relative variation or percentage change∆g(tSt)g(tSt) of the option price g(tSt) from the relative variation∆StSt in the underlying asset price

The ratio Get = Stpart log g(tSt)partx can also be interpreted as an elasticity

coefficient

Break-even price The break-even price BEPt of the underlying asset is thevalue of S for which the intrinsic option value h(S) equals the option priceπt(C) at time t isin [0T ] For European call options it is given by

BEPt = K + πt(C) = K + g(tSt) t = 0 1 N

whereas for European put options it is given by

BEPt = K minus πt(C) = K minus g(tSt) 0 6 t 6 T

Premium The option premium OPt can be defined as the variation requiredfrom the underlying asset price in order to reach the break-even price iewe have

OPt =BEPt minus St

St=K + g(tSt)minus St

St 0 6 t 6 T

for European call options and

OPt =St minusBEPt

St=St + g(tSt)minusK

St 0 6 t 6 T

for European put options see Figure 617 below The term ldquopremiumrdquo issometimes also used to denote the arbitrage price g(tSt) of the option

221

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

f (tx σ)100

=

x =

K =

xpart log f

partx=

σ =

partf

partt(tx σ)=

T=

=(xminusK)x

∆ = = partf

partx(tx σ)

= partf

partσ(tx σ)

=K+f (txσ)minusx

x

=K+f (tx σ)

rf=

partf

partt+rxpartf

partx+

σ2 2x2part2f

partx2

Fig 617 Warrant terms and data

The R package bizdays (requires to install QuantLib) can be used to computecalendar time vs business time to maturity1 installpackages(bizdays)

library(bizdays)3 load_quantlib_calendars(HongKong from=2018-01-01 to=2018-12-31)

load_quantlib_calendars(Singapore from=2018-01-01 to=2018-12-31)5 bizdays(2018-03-10 2018-04-03 QuantLibHongKong)

bizdays(2018-03-10 2018-04-03 QuantLibSingapore)

65 The Heat Equation

In the next proposition we notice that the solution f(tx) of the Black-Scholes PDE (67) can be transformed into a solution g(t y) of the simplerheat equation by a change of variable and a time inversion t 7minusrarr T minus t onthe interval [0T ] so that the terminal condition at time T in the Black-Scholes equation (622) becomes an initial condition at time t = 0 in theheat equation (625) See also here for a related discussion on changes ofvariables for the Black-Scholes PDE

222

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

Proposition 68 Assume that f(tx) solves the Black-Scholes PDErf(tx) = partf

partt(tx) + rx

partf

partx(tx) + 1

2σ2x2 part

2f

partx2 (tx)

f(T x) = (xminusK)+(622)

with terminal condition h(x) = (xminusK)+ x gt 0 Then the function g(t y)defined by

g(t y) = ertf(T minus t e|σ|y+(σ22minusr)t) (623)

solves the heat equation (625) with initial condition

ψ(y) = h(

e|σ|y) y isin R (624)

ie we have partg

partt(t y) = 1

2part2g

party2 (t y)

g(0 y) = h(

e|σ|y)

(625)

Proposition 68 will be proved in Section 66 It will allow us to solve theBlack-Scholes PDE (622) based on the solution of the heat equation (625)with initial condition ψ(y) = h

(e|σ|y

) y isin R by inversion of Relation (623)

with s = T minus t x = e|σ|y+(σ22minusr)t ie

f(sx) = eminus(Tminuss)rg(T minus s minus(σ

22minus r)(T minus s) + log x|σ|

)

Next we focus on the heat equation

partϕ

partt(t y) = 1

2part2ϕ

party2 (t y) (626)

which is used to model the diffusion of heat over time through solids Herethe data of g(x t) represents the temperature measured at time t and pointx We refer the reader to Widder (1975) for a complete treatment of thistopic

223

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

Fig 618 Time-dependent solution of the heat equationlowast

Proposition 69 The fundamental solution of the heat equation (626) isgiven by the Gaussian probability density function

ϕ(t y) =1radic2πt

eminusy2(2t) y isin R

with variance t gt 0

Proof The proof is done by a direct calculation as follows

partϕ

partt(t y) = part

partt

(eminusy2(2t)radic

2πt

)

= minus eminusy2(2t)

2t32radic

2π+

y2

2t2eminusy2(2t)radic

2πt

=

(minus 1

2t +y2

2t2

)ϕ(t y)

and

12part2ϕ

party2 (t y) = minus12part

party

(y

t

eminusy2(2t)radic

2πt

)

= minus eminusy2(2t)

2tradic

2πt+

y2

2t2eminusy2(2t)radic

2πt

=

(minus 1

2t +y2

2t2

)ϕ(t y) t gt 0 y isin R

lowast The animation works in Acrobat Reader on the entire pdf file

224

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

In Section 66 the heat equation (626) will be shown to be equivalent to theBlack-Scholes PDE after a change of variables In particular this will lead tothe explicit solution of the Black-Scholes PDE

Proposition 610 The heat equationpartg

partt(t y) = 1

2part2g

party2 (t y)

g(0 y) = ψ(y)

(627)

with continuous initial condition

g(0 y) = ψ(y)

has the solution

g(t y) =winfinminusinfin

ψ(z) eminus(yminusz)2(2t) dzradic2πt

y isin R t gt 0 (628)

Proof We have

partg

partt(t y) = part

partt

winfinminusinfin

ψ(z) eminus(yminusz)2(2t) dzradic2πt

=winfinminusinfin

ψ(z)part

partt

(eminus(yminusz)2(2t)radic

2πt

)dz

=12winfinminusinfin

ψ(z)

((yminus z)2

t2minus 1t

)eminus(yminusz)2(2t) dzradic

2πt

=12winfinminusinfin

ψ(z)part2

partz2 eminus(yminusz)2(2t) dzradic2πt

=12winfinminusinfin

ψ(z)part2

party2 eminus(yminusz)2(2t) dzradic2πt

=12part2

party2

winfinminusinfin

ψ(z) eminus(yminusz)2(2t) dzradic2πt

=12part2g

party2 (t y)

On the other hand it can be checked that at time t = 0 we have

limtrarr0

winfinminusinfin

ψ(z) eminus(yminusz)2(2t) dzradic2πt

= limtrarr0

winfinminusinfin

ψ(y+ z) eminusz2(2t) dzradic2πt

= ψ(y) y isin R

225

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

The next Figure 619 shows the evolution of g(tx) with initial conditionbased on the European call payoff function h(x) = (xminusK)+ ie

g(0 y) = ψ(y) = h(

e|σ|y)=(

e|σ|y minusK)+ y isin R

Fig 619 Time-dependent solution of the heat equationlowast

Let us provide a second proof of Proposition 610 this time using Brownianmotion and stochastic calculus

Proof of Proposition 610 First note that under the change of variable x =z minus y we have

g(t y) =winfinminusinfin

ψ(z) eminus(yminusz)2(2t) dzradic2πt

=winfinminusinfin

ψ(y+ x) eminusx2(2t) dxradic2πt

= IE[ψ(y+Bt)]

= IE[ψ(yminusBt)]

where (Bt)tisinR+ is a standard Brownian motion and Bt N (0 t) t isin R+Applying Itocircrsquos formula and using the fact that the expectation of the stochas-tic integral with respect to Brownian motion is zero see Relation (417) inProposition 420 we find

g(t y) = IE[ψ(yminusBt)]

= ψ(y)minus IE[w t

0ψprime(yminusBs)dBs

]+

12 IE

[w t0ψprimeprime(yminusBs)ds

]= ψ(y) +

12w t

0IE[ψprimeprime(yminusBs)

]ds

lowast The animation works in Acrobat Reader on the entire pdf file

226

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

= ψ(y) +12w t

0part2

party2 IE [ψ(yminusBs)] ds

= ψ(y) +12w t

0part2g

party2 (s y)ds

Hence we have

partg

partt(t y) = part

parttIE[ψ(yminusBt)]

=12part2

party2 IE [ψ(yminusBt)]

=12part2g

party2 (t y)

Regarding the initial condition we check that

g(0 y) = IE[ψ(yminusB0)] = IE[ψ(y)] = ψ(y)

The expression g(t y) = IE[ψ(yminusBt)] provides a probabilistic interpreta-tion of the heat diffusion phenomenon based on Brownian motion Namelywhen ψε(y) = 1[minusεε](y) we find that

gε(t y) = IE[ψε(yminusBt)]= IE[1[minusεε](yminusBt)]= P

(yminusBt isin [minusε ε]

)= P

(yminus ε 6 Bt 6 y+ ε

)represents the probability of finding Bt within a neighborhood [y minus ε y + ε]of the point y isin R

66 Solution of the Black-Scholes PDE

In this section we solve the Black-Scholes PDE by the kernel method of Sec-tion 65 and a change of variables This solution method uses the change ofvariables (623) of Proposition 68 and a time inversion from which the ter-minal condition at time T in the Black-Scholes equation becomes an initialcondition at time t = 0 in the heat equation

Next we state the proof Proposition 68

Proof Letting s = T minus t and x = e|σ|y+(σ22minusr)t and using Relation (623)ie

g(t y) = ertf(T minus t e|σ|y+(σ22minusr)t)

227

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

we have

partg

partt(t y) = r ertf

(T minus t e|σ|y+(σ22minusr)t)minus ert partf

parts

(T minus t e|σ|y+(σ22minusr)t)

+

(σ2

2 minus r)

ert e|σ|y+(σ22minusr)t partf

partx

(T minus t e|σ|y+(σ22minusr)t)

= r ertf(T minus tx)minus ert partfparts

(T minus tx) +(σ2

2 minus r)

ertxpartfpartx

(T minus tx)

=12 ertx2σ2 part

2f

partx2 (T minus tx) +σ2

2 ertxpartfpartx

(T minus tx) (629)

where on the last step we used the Black-Scholes PDE On the other handwe have

partg

party(t y) = |σ| ert e|σ|y+(σ22minusr)t partf

partx

(T minus t e|σ|y+(σ22minusr)t)

and

12partg2

party2 (t y) =σ2

2 ert e|σ|y+(σ22minusr)t partf

partx

(T minus t e|σ|y+(σ22minusr)t)

+σ2

2 ert e2|σ|y+2(σ22minusr)t part2f

partx2(T minus t e|σ|y+(σ22minusr)t)

=σ2

2 ertxpartfpartx

(T minus tx) + σ2

2 ertx2 part2f

partx2 (T minus tx) (630)

We conclude by comparing (629) with (630) which shows that g(tx) solvesthe heat equation (627) with initial condition

g(0 y) = f(T e|σ|y

)= h

(e|σ|y

)

In the next proposition we derive the Black-Scholes formula (610) by solv-ing the PDE (622) The Black-Scholes formula will also be recovered by aprobabilistic argument via the computation of an expected value in Proposi-tion 77

Proposition 611 When h(x) = (x minusK)+ the solution of the Black-Scholes PDE (622) is given by

f(tx) = xΦ(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

) x gt 0

whereΦ(x) =

1radic2π

w xminusinfin

eminusy22dy x isin R

and

228

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

d+(T minus t) =

log(xK) + (r+ σ22)(T minus t)|σ|radicT minus t

dminus(T minus t) =log(xK) + (rminus σ22)(T minus t)

|σ|radicT minus t

x gt 0 t isin [0T )

Proof By inversion of Relation (623) with s = T minus t and x = e|σ|y+(σ22minusr)twe get

f(sx) = eminus(Tminuss)rg(T minus s minus(σ

22minus r)(T minus s) + log x|σ|

)and

h(x) = ψ

(log x|σ|

) x gt 0 or ψ(y) = h

(e|σ|y

) y isin R

Hence using the solution (628) and Relation (624) we get

f(tx) = eminus(Tminust)rg(T minus t minus(σ

22minus r)(T minus t) + log x|σ|

)= eminus(Tminust)r

winfinminusinfin

ψ

(minus(σ22minus r)(T minus t) + log x

|σ|+ z

)eminusz2(2(Tminust)) dzradic

2(T minus t)π

= eminus(Tminust)rwinfinminusinfin

h(x e|σ|zminus(σ22minusr)(Tminust)) eminusz2(2(Tminust)) dzradic

2(T minus t)π

= eminus(Tminust)rwinfinminusinfin

(x e|σ|zminus(σ22minusr)(Tminust) minusK

)+ eminusz2(2(Tminust)) dzradic2(T minus t)π

= eminus(Tminust)r

timeswinfin

(minusr+σ22)(Tminust)+log(Kx)|σ|

(x e|σ|zminus(σ22minusr)(Tminust) minusK

)eminusz2(2(Tminust)) dzradic

2(T minus t)π

= x eminus(Tminust)rwinfinminusdminus(Tminust)

radicTminust

e|σ|zminus(σ22minusr)(Tminust) eminusz2(2(Tminust)) dzradic2(T minus t)π

minusK eminus(Tminust)rwinfinminusdminus(Tminust)

radicTminust

eminusz2(2(Tminust)) dzradic2(T minus t)π

= xwinfinminusdminus(Tminust)

radicTminust

e|σ|zminus(Tminust)σ22minusz2(2(Tminust)) dzradic2(T minus t)π

minusK eminus(Tminust)rwinfinminusdminus(Tminust)

radicTminust

eminusz2(2(Tminust)) dzradic2(T minus t)π

= xwinfinminusdminus(Tminust)

radicTminust

eminus(zminus(Tminust)|σ|)2(2(Tminust)) dzradic2(T minus t)π

229

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

minusK eminus(Tminust)rwinfinminusdminus(Tminust)

radicTminust

eminusz2(2(Tminust)) dzradic2(T minus t)π

= xwinfinminusdminus(Tminust)

radicTminustminus(Tminust)|σ|

eminusz2(2(Tminust)) dzradic2(T minus t)π

minusK eminus(Tminust)rwinfinminusdminus(Tminust)

radicTminust

eminusz2(2(Tminust)) dzradic2(T minus t)π

= xwinfinminusdminus(Tminust)minus|σ|

radicTminust

eminusz22 dzradic2πminusK eminus(Tminust)r

winfinminusdminus(Tminust)

eminusz22 dzradic2π

= x(1minusΦ

(minus d+(T minus t)

))minusK eminus(Tminust)r

(1minusΦ

(minus dminus(T minus t)

))= xΦ

(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)

where we used the relation (614) ie

1minusΦ(a) = Φ(minusa) a isin R

Exercises

Exercise 61 Bachelier (1900) model Consider a market made of a risklessasset valued At = A0 with zero interest rate t isin R+ and a risky asset whoseprice St is modeled by a standard Brownian motion as St = Bt t isin R+

a) Show that the price g(tBt) of the option with payoff C = B2T satisfies

the heat equationpartϕ

partt(t y) = minus1

2part2ϕ

party2 (t y)

with terminal condition g(T x) = x2b) Find the function g(tx) by solving the PDE of Question (a)

Hint Try a solution of the form g(tx) = x2 + f(t)

See Exercises 611 713 and 714 for extensions to nonzero interest rates

Exercise 62 Consider a risky asset price (St)tisinR modeled in the Cox et al(1985) (CIR) model as

dSt = β(αminus St)dt+ σradicStdBt αβσ gt 0 (631)

and let (ηt ξt)tisinR+ be a portfolio strategy whose value Vt = ηtAt + ξtSttakes the form Vt = g(tSt) t isin R+ Figure 620 presents a random simula-tion of the solution to (631) with α = 0025 β = 1 and σ = 13230

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

0

1

2

3

4

5

6

7

8

0 01 02 03 04 05 06 07 08 09 1

St

t

Fig 620 Graph of the CIR short rate t 7rarr rt with α = 25 β = 1 and σ = 13

N=10000 t lt- 0(N-1) dt lt- 10Na=0025 b=2 sigma=0052 X lt- rnorm(Nmean=0sd=sqrt(dt))R lt- rep(0N)R[1]=001

for (j in 2N)R[j]=max(0R[j-1]+(a-bR[j-1])dt+sigmasqrt(R[j-1])X[j])4 plot(t R xlab = t ylab = type = l ylim = c(0002) col = blue)

Based on the self-financing condition written as

dVt = rVtdtminus rξtStdt+ ξtdSt

= rVtdtminus rξtStdt+ β(αminus St)ξtdt+ σξtradicStdBt t isin R+ (632)

derive the PDE satisfied by the function g(tx) using the Itocirc formula

Exercise 63 Black-Scholes PDE with dividends Consider a riskless as-set with price At = A0 ert t isin R+ and an underlying asset price process(St)tisinR+ modeled as

dSt = (microminus δ)Stdt+ σStdBt

where (Bt)tisinR+ is a standard Brownian motion and δ gt 0 is a continuous-time dividend rate By absence of arbitrage the payment of a dividend entailsa drop in the stock price by the same amount occuring generally on the ex-dividend date on which the purchase of the security no longer entitles theinvestor to the dividend amount The list of investors entitled to dividendpayment is consolidated on the date of record and payment is made on thepayable date

library(quantmod)2 getSymbols(0005HKfrom=2010-01-01to=SysDate()src=yahoo)

getDividends(0005HKfrom=2010-01-01to=SysDate()src=yahoo)

a) Assuming that the portfolio with value Vt = ξtSt + ηtAt at time t is self-financing and that dividends are continuously reinvested write down theportfolio variation dVt

231

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

b) Assuming that the portfolio value Vt takes the form Vt = g(tSt) at timet derive the Black-Scholes PDE for the function g(tx) with its terminalcondition

c) Compute the price at time t isin [0T ] of the European call option withstrike price K by solving the corresponding Black-Scholes PDE

d) Compute the Delta of the option

Exercise 64

a) Check that the Black-Scholes formula (610) for European call options

gc(tx) = xΦ(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)

satisfies the following boundary conditions

i) at x = 0 gc(t 0) = 0ii) at maturity t = T

gc(T x) = (xminusK)+ =

xminusK x gt K

0 x 6 K

iii) as time to maturity tends to infinity

limTrarrinfin

Bl(Kxσ rT minus t) = x t isin R+

b) Check that the Black-Scholes formula (618) for European put options

gp(tx) = K eminus(Tminust)rΦ(minus dminus(T minus t)

)minus xΦ

(minus d+(T minus t)

)satisfies the following boundary conditions

i) at x = 0 gp(t 0) = K eminus(Tminust)rii) as x tends to infinity gp(tinfin) = 0 for all t isin [0T )iii) at maturity t = T

gp(T x) = (K minus x)+ =

0 x gt K

K minus x x 6 K

iv) as time to maturity tends to infinity

limTrarrinfin

Blp(KStσ rT minus t) = 0 t isin R+

Exercise 65 Power option (Exercise 314 continued)

232

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

a) Solve the Black-Scholes PDE

rg(x t) = partg

partt(x t) + rx

partg

partx(x t) + σ2

2 x2 part2g

partx2 (x t) (633)

with terminal condition g(xT ) = x2 x gt 0 t isin [0T ]

Hint Try a solution of the form g(x t) = x2f(t) and find f(t)b) Find the respective quantities ξt and ηt of the risky asset St and riskless

asset At = ert in the portfolio with value

Vt = g(St t) = ξtSt + ηtAt 0 6 t 6 T

hedging the contract with payoff S2T at maturity

Exercise 66 On December 18 2007 a call warrant has been issued byFortis Bank on the stock price S of the MTR Corporation with maturityT = 23122008 strike price K = HK$ 3608 and entitlement ratio=10Recall that in the Black-Scholes model the price at time t of the Europeanclaim on the underlying asset priced St with strike price K maturity T interest rate r and volatility σ gt 0 is given by the Black-Scholes formula as

f(tSt) = StΦ(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)

wheredminus(T minus t) =

(rminus σ22)(T minus t) + log(StK)

|σ|radicT minus t

d+(T minus t) = dminus(T minus t) + |σ|radicT minus t = (r+ σ22)(T minus t) + log(StK)

|σ|radicT minus t

Recall that by Proposition 64 we have

partf

partx(tSt) = Φ

(d+(T minus t)

) 0 6 t 6 T

a) Using the values of the Gaussian cumulative distribution function com-pute the Black-Scholes price of the corresponding call option at timet =November 07 2008 with St = HK$ 17200 assuming a volatility σ =90 = 090 and an annual risk-free interest rate r = 4377 = 004377

b) Still using the Gaussian cumulative distribution function compute thequantity of the risky asset required in your portfolio at time t =November07 2008 in order to hedge one such option at maturity T = 23122008

c) Figure 1 represents the Black-Scholes price of the call option as a functionof σ isin [05 15] = [50 150]

233

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

0

01

02

03

04

05

06

05 06 07 08 09 1 11 12 13 14 15σimp

Optio

n pr

ice

σ

Market price

Fig 621 Option price as a function of the volatility σ gt 0

1 BSCall lt- function(S K r T sigma)d1 lt- (log(SK)+(r+sigma^22)T)(sigmasqrt(T))d2 lt- d1 - sigma sqrt(T)

3 BSCall = Spnorm(d1) - Kexp(-rT)pnorm(d2)BSCallsigma lt- seq(0515 length=100)

5 plot(sigmaBSCall(172360800437746365sigma) type=llty=1 xlab=Sigmaylab=Black-Scholes Call Price ylim = c(006)col=bluelwd=3)grid()

abline(h=023col=redlwd=3)

Knowing that the closing price of the warrant on November 07 2008 wasHK$ 0023 which value can you infer for the implied volatility σ at thisdatelowast

Exercise 67 Forward contracts Recall that the price πt(C) of a claimpayoff C = h(ST ) of maturity T can be written as πt(C) = g(tSt) wherethe function g(tx) satisfies the Black-Scholes PDE

rg(tx) = partg

partt(tx) + rx

partg

partx(tx) + 1

2σ2x2 part

2g

partx2 (tx)

g(T x) = h(x) (1)

with terminal condition g(T x) = h(x) x gt 0

a) Assume that C is a forward contract with payoff

C = ST minusK

at time T Find the function h(x) in (1)b) Find the solution g(tx) of the above PDE and compute the price πt(C)

at time t isin [0T ]Hint search for a solution of the form g(tx) = xminus α(t) where α(t) is afunction of t to be determined

lowast Download the corresponding or the that can be runhere

234

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

BS lt- function(S K T r sig)d1 lt- (log(SK) + (r + sig^22)T) (sigsqrt(T))d2 lt- d1 - sigsqrt(T)return(Spnorm(d1) - Kexp(-rT)pnorm(d2))impliedvol lt- function(S K T r market)sig lt- 020sigup lt- 1sigdown lt- 0001count lt- 0err lt- BS(S K T r sig) - marketwhile(abs(err) gt 000001 ampamp countlt1000)if(err lt 0)sigdown lt- sigsig lt- (sigup + sig)2elsesigup lt- sigsig lt- (sigdown + sig)2err lt- BS(S K T r sig) - marketcount lt- count + 1if(count==2000)return(NA)elsereturn(sig)market = 083K = 628T = 7 365S = 634r = 002impliedvol(S K T r market)

cells [ cell_type code execution_count null metadata outputs [] source [ from IPythoncoredisplay import display HTMLn display(HTML( )) ] cell_type code execution_count null metadata collapsed true outputs [] source [ import numpy as npn import scipystats as ssn import time n n Black and Scholesn def d1(S0 K r sigma T)n return (nplog(S0K) + (r + sigma2 2) T)(sigma npsqrt(T))n n def d2(S0 K r sigma T)n return (nplog(S0 K) + (r - sigma2 2) T) (sigma npsqrt(T))n n def BlackScholes(typeS0 K r sigma T)n if type==Cn return S0 ssnormcdf(d1(S0 K r sigma T)) - K npexp(-r T) ssnormcdf(d2(S0 K r sigma T))n elsen return K npexp(-r T) ssnormcdf(-d2(S0 K r sigma T)) - S0 ssnormcdf(-d1(S0 K r sigma T)) ] cell_type code execution_count null metadata outputs [] source [ BlackScholes(C1000 1200 002 015 10) ] cell_type code execution_count null metadata outputs [] source [ def difference(x p S K r t)n return BlackScholes(CS K r x t) - p ] cell_type code execution_count null metadata outputs [] source [ from scipyoptimize import bisectn bisect(difference00011args=(11541763731112766 1000 1200 002 10)) ] ] metadata anaconda-cloud kernelspec display_name Python 3 language python name python3 language_info codemirror_mode name ipython version 3 file_extension py mimetype textx-python name python nbconvert_exporter python pygments_lexer ipython3 version 375rc1 nbformat 4 nbformat_minor 1

Black-Scholes Pricing and Hedging

c) Compute the quantityξt =

partg

partx(tSt)

of risky assets in a self-financing portfolio hedging Cd) Repeat the above questions with the terminal condition g(T x) = x

Exercise 68a) Solve the Black-Scholes PDE

rg(tx) = partg

partt(tx) + rx

partg

partx(tx) + σ2

2 x2 part2g

partx2 (tx) (634)

with terminal condition g(T x) = 1 x gt 0

Hint Try a solution of the form g(tx) = f(t) and find f(t)

b) Find the respective quantities ξt and ηt of the risky asset St and risklessasset At = ert in the portfolio with value

Vt = g(tSt) = ξtSt + ηtAt

hedging the contract with payoff $1 at maturity

Exercise 69 Log-contracts see also Exercise 84a) Solve the PDE

0 =partg

partt(x t) + rx

partg

partx(x t) + σ2

2 x2 part2g

partx2 (x t)

with the terminal condition g(xT ) = log x x gt 0

Hint Try a solution of the form g(x t) = f(t) + log x and find f(t)b) Solve the Black-Scholes PDE

rh(x t) = parth

partt(x t) + rx

parth

partx(x t) + σ2

2 x2 part2h

partx2 (x t) (635)

with the terminal condition h(xT ) = log x x gt 0

Hint Try a solution of the form h(x t) = u(t)g(x t) and find u(t)c) Find the respective quantities ξt and ηt of the risky asset St and riskless

asset At = ert in the portfolio with value

Vt = g(St t) = ξtSt + ηtAt

hedging a log-contract with payoff logST at maturity 235

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

Exercise 610 Binary options Consider a price process (St)tisinR+ given by

dStSt

= rdt+ σdBt S0 = 1

under the risk-neutral probability measure Plowast The binary (or digital) calloption is a contract with maturity T strike price K and payoff

Cd = 1[Kinfin)(ST ) =

$1 if ST gt K

0 if ST lt K

a) Derive the Black-Schole PDE satisfied by the pricing function Cd(tSt) ofthe binary call option together with its terminal condition

b) Show that the solution Cd(tx) of the Black-Scholes PDE of Question (a)is given by

Cd(tx) = eminus(Tminust)rΦ((rminus σ22)(T minus t) + log(xK)

|σ|radicT minus t

)= eminus(Tminust)rΦ

(dminus(T minus t)

)

where

dminus(T minus t) =(rminus σ22)(T minus t) + log(StK)

|σ|radicT minus t

0 6 t lt T

Exercise 611

a) Bachelier (1900) model Solve the stochastic differential equation

dSt = αStdt+ σdBt (636)

in terms of ασ isin R and the initial condition S0b) Write down the Bachelier PDE satisfied by the function C(tx) where

C(tSt) is the price at time t isin [0T ] of the contingent claim with payoffφ(ST ) = exp(ST ) and identify the process Delta (ξt)tisin[0T ] that hedgesthis claim

c) Solve the Black-Scholes PDE of Question (b) with the terminal conditionφ(x) = ex x isin R

Hint Search for a solution of the form

C(tx) = exp(minus(T minus t)r+ xh(t) +

σ2

4r (h2(t)minus 1)

) (637)

where h(t) is a function to be determined with h(T ) = 1

236

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

d) Compute the portfolio strategy (ξt ηt)tisin[0T ] that hedges the contingentclaim with payoff exp(ST )

Exercise 612

a) Show that for every fixed value of S the function

d 7minusrarr h(S d) = SΦ(d+ |σ|

radicT)minusK eminusrTΦ(d)

reaches its maximum at dlowast(S) =log(SK) + (rminus σ22)T

|σ|radicT

b) By the differentiation rule

d

dSh(S dlowast(S)) =

parth

partS(S dlowast(S)) + dprimelowast(S)

parth

partd(S dlowast(S))

recover the value of the Black-Scholes Delta

Exercise 613 Compute the Black-Scholes Vega by differentiation of theBlack-Scholes function

gc(tx) = Bl(Kxσ rT minus t) = xΦ(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)

with respect to the volatility parameter σ knowing that

minus12(dminus(T minus t)

)2= minus1

2

(log(xK) + (rminus σ22)(T minus t)

|σ|radicT minus t

)2

= minus12(d+(T minus t)

)2+ (T minus t)r+ log x

K (638)

Exercise 614 Consider the backward induction relation (313) ie

v(tx) = (1minus plowastN )v (t+ 1x(1 + aN )) + plowastN v (t+ 1x(1 + bN ))

using the renormalizations rN = rTN and

aN = (1 + rN )(1minus |σ|radicTN)minus 1 bN = (1 + rN )(1 + |σ|

radicTN)minus 1

of Section 36 N gt 1 with

plowastN =rN minus aNbN minus aN

and plowastN =bN minus rNbN minus aN

a) Show that the Black-Scholes PDE (62) of Proposition 61 can be recoveredfrom the induction relation (313) when the number N of time steps tendsto infinity

237

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

b) Show that the expression of the Delta ξt =partgcpartx

(tSt) can be similarlyrecovered from the finite difference relation (319) ie

ξ(1)t (Stminus1) =

v (t (1 + bN )Stminus1)minus v (t (1 + aN )Stminus1)

Stminus1(bN minus aN )

as N tends to infinity

Problem 615 (Leung and Sircar (2015)) ProShares Ultra SampP500 andProShares UltraShort SampP500 are leveraged investment funds that seek dailyinvestment results before fees and expenses that correspond to β times (βx)the daily performance of the SampP500reg with respectively β = 2 for ProSharesUltra and β = minus2 for ProShares UltraShort Here leveraging with a factorβ 1 aims at multiplying the potential return of an investment by a factorβ The following 10 questions are interdependent and should be treated insequence

a) Consider a risky asset priced S0 = $4 at time t = 0 and taking twopossible values S1 = $5 and S1 = $2 at time t = 1 Compute the twopossible returns (in ) achieved when investing $4 in one share of the assetS and the expected return under the risk-neutral probability measureassuming that the risk-free interest rate is zero

b) Leveraging Still based on an initial $4 investment we decide to leverageby a factor β = 3 by borrowing another (β minus 1) times $4 = 2times $4 at ratezero to purchase a total of β = 3 shares of the asset S Compute thetwo returns (in ) possibly achieved in this case and the expected returnunder the risk-neutral probability measure assuming that the risk-freeinterest rate is zero

c) Denoting by Ft the ProShares value at time t how much should the fundinvest in the underlying asset priced St and how much $ should it borrowor save on the risk-free market at any time t in order to leverage with afactor β 1

d) Find the portfolio allocation (ξt ηt) for the fund value

Ft = ξtSt + ηtAt t isin R+

according to Question (c) where At = A0 ert is the riskless money marketaccount

e) We choose to model the SampP500 index St as the geometric Brownianmotion

dSt = rStdt+ σStdBt t isin R+

under the risk-neutral probability measure Plowast Find the stochastic dif-ferential equation satisfied by (Ft)tisinR+ under the self-financing conditiondFt = ξtdSt + ηtdAt

238

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

f) Is the discounted fund value ( eminusrtFt)tisinR+ a martingale under the risk-neutral probability measure Plowast

g) Find the relation between the fund value Ft and the index St by solvingthe stochastic differential equation obtained for Ft in Question (e) Forsimplicity we normalize F0 = Sβ0

h) Write the price at time t = 0 of the call option with payoff (FT minusK)+ onthe ProShares index using the Black-Scholes formula

i) Show that when β gt 0 the Delta at time t isin [0T ) of the call optionwith payoff (FT minusK)+ on ProShares Ultra is equal to the Delta of thecall option with payoff (ST minusKβ(t))

+ on the SampP500 for a certain strikeprice Kβ(t) to be determined explicitly

j) When β lt 0 find the relation between the Delta at time t isin [0T ) ofthe call option with payoff (FT minusK)+ on ProShares UltraShort and theDelta of the put option with payoff (Kβ(t)minus ST )+ on the SampP500

239

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

  1. pbsARFix223
  2. pbsARFix224
  3. pbsARFix225
  4. pbsARFix226
  5. pbsARFix227
  6. pbsARFix228
  7. pbsARFix229
  8. pbsARFix230
  9. fdrm1
  10. pbsARFix231
  11. 100
  12. 101
  13. 102
  14. 103
  15. 104
  16. 105
  17. 106
  18. 107
  19. 108
  20. 109
  21. 1010
  22. 1011
  23. 1012
  24. 1013
  25. 1014
  26. 1015
  27. 1016
  28. 1017
  29. 1018
  30. 1019
  31. anm10
  32. 10EndLeft
  33. 10StepLeft
  34. 10PauseLeft
  35. 10PlayLeft
  36. 10PlayPauseLeft
  37. 10PauseRight
  38. 10PlayRight
  39. 10PlayPauseRight
  40. 10StepRight
  41. 10EndRight
  42. 10Minus
  43. 10Reset
  44. 10Plus
  45. pbsARFix232
  46. pbsARFix233
  47. pbsARFix234
  48. pbsARFix235
  49. pbsARFix236
  50. pbsARFix237
  51. fdrm2
  52. 110
  53. 111
  54. 112
  55. 113
  56. 114
  57. 115
  58. 116
  59. 117
  60. 118
  61. 119
  62. 1110
  63. 1111
  64. 1112
  65. 1113
  66. 1114
  67. 1115
  68. 1116
  69. 1117
  70. 1118
  71. 1119
  72. anm11
  73. 11EndLeft
  74. 11StepLeft
  75. 11PauseLeft
  76. 11PlayLeft
  77. 11PlayPauseLeft
  78. 11PauseRight
  79. 11PlayRight
  80. 11PlayPauseRight
  81. 11StepRight
  82. 11EndRight
  83. 11Minus
  84. 11Reset
  85. 11Plus
  86. pbsARFix238
  87. pbsARFix239
  88. pbsARFix240
  89. pbsARFix241
  90. pbsARFix242
  91. 120
  92. 121
  93. 122
  94. 123
  95. 124
  96. 125
  97. 126
  98. 127
  99. 128
  100. 129
  101. 1210
  102. anm12
  103. 12EndLeft
  104. 12StepLeft
  105. 12PauseLeft
  106. 12PlayLeft
  107. 12PlayPauseLeft
  108. 12PauseRight
  109. 12PlayRight
  110. 12PlayPauseRight
  111. 12StepRight
  112. 12EndRight
  113. 12Minus
  114. 12Reset
  115. 12Plus
  116. 130
  117. 131
  118. 132
  119. 133
  120. 134
  121. 135
  122. 136
  123. 137
  124. 138
  125. 139
  126. 1310
  127. anm13
  128. 13EndLeft
  129. 13StepLeft
  130. 13PauseLeft
  131. 13PlayLeft
  132. 13PlayPauseLeft
  133. 13PauseRight
  134. 13PlayRight
  135. 13PlayPauseRight
  136. 13StepRight
  137. 13EndRight
  138. 13Minus
  139. 13Reset
  140. 13Plus
  141. pbsARFix243
  142. pbsARFix244
  143. pbsARFix245
  144. pbsARFix246
  145. 140
  146. 141
  147. 142
  148. 143
  149. 144
  150. 145
  151. 146
  152. 147
  153. 148
  154. 149
  155. 1410
  156. 1411
  157. 1412
  158. 1413
  159. 1414
  160. 1415
  161. 1416
  162. 1417
  163. 1418
  164. 1419
  165. 1420
  166. 1421
  167. 1422
  168. 1423
  169. 1424
  170. 1425
  171. 1426
  172. 1427
  173. 1428
  174. 1429
  175. 1430
  176. 1431
  177. 1432
  178. 1433
  179. 1434
  180. 1435
  181. 1436
  182. 1437
  183. 1438
  184. 1439
  185. 1440
  186. 1441
  187. 1442
  188. 1443
  189. 1444
  190. 1445
  191. 1446
  192. 1447
  193. 1448
  194. 1449
  195. 1450
  196. 1451
  197. 1452
  198. 1453
  199. 1454
  200. 1455
  201. 1456
  202. 1457
  203. 1458
  204. 1459
  205. 1460
  206. 1461
  207. 1462
  208. 1463
  209. 1464
  210. 1465
  211. 1466
  212. 1467
  213. 1468
  214. 1469
  215. 1470
  216. 1471
  217. 1472
  218. 1473
  219. 1474
  220. 1475
  221. 1476
  222. 1477
  223. 1478
  224. 1479
  225. 1480
  226. 1481
  227. 1482
  228. 1483
  229. 1484
  230. 1485
  231. 1486
  232. 1487
  233. 1488
  234. 1489
  235. 1490
  236. 1491
  237. 1492
  238. 1493
  239. 1494
  240. 1495
  241. 1496
  242. 1497
  243. 1498
  244. 1499
  245. 14100
  246. 14101
  247. 14102
  248. 14103
  249. 14104
  250. 14105
  251. 14106
  252. 14107
  253. 14108
  254. 14109
  255. 14110
  256. 14111
  257. 14112
  258. 14113
  259. 14114
  260. 14115
  261. 14116
  262. 14117
  263. 14118
  264. 14119
  265. 14120
  266. 14121
  267. 14122
  268. 14123
  269. 14124
  270. 14125
  271. 14126
  272. 14127
  273. 14128
  274. 14129
  275. 14130
  276. 14131
  277. 14132
  278. 14133
  279. 14134
  280. 14135
  281. 14136
  282. 14137
  283. 14138
  284. 14139
  285. 14140
  286. 14141
  287. 14142
  288. 14143
  289. 14144
  290. 14145
  291. 14146
  292. 14147
  293. 14148
  294. 14149
  295. 14150
  296. 14151
  297. 14152
  298. 14153
  299. 14154
  300. 14155
  301. 14156
  302. 14157
  303. 14158
  304. 14159
  305. 14160
  306. 14161
  307. 14162
  308. 14163
  309. 14164
  310. 14165
  311. 14166
  312. 14167
  313. 14168
  314. 14169
  315. 14170
  316. 14171
  317. 14172
  318. 14173
  319. 14174
  320. 14175
  321. 14176
  322. 14177
  323. 14178
  324. 14179
  325. 14180
  326. 14181
  327. 14182
  328. 14183
  329. 14184
  330. 14185
  331. 14186
  332. 14187
  333. 14188
  334. 14189
  335. 14190
  336. 14191
  337. 14192
  338. 14193
  339. 14194
  340. 14195
  341. 14196
  342. 14197
  343. anm14
  344. 14EndLeft
  345. 14StepLeft
  346. 14PauseLeft
  347. 14PlayLeft
  348. 14PlayPauseLeft
  349. 14PauseRight
  350. 14PlayRight
  351. 14PlayPauseRight
  352. 14StepRight
  353. 14EndRight
  354. 14Minus
  355. 14Reset
  356. 14Plus
  357. pbsARFix247
  358. pbsARFix248
  359. 150
  360. 151
  361. 152
  362. 153
  363. 154
  364. 155
  365. 156
  366. 157
  367. 158
  368. 159
  369. 1510
  370. 1511
  371. 1512
  372. 1513
  373. 1514
  374. 1515
  375. 1516
  376. 1517
  377. 1518
  378. 1519
  379. anm15
  380. 15EndLeft
  381. 15StepLeft
  382. 15PauseLeft
  383. 15PlayLeft
  384. 15PlayPauseLeft
  385. 15PauseRight
  386. 15PlayRight
  387. 15PlayPauseRight
  388. 15StepRight
  389. 15EndRight
  390. 15Minus
  391. 15Reset
  392. 15Plus
  393. pbsARFix249
  394. pbsARFix250
  395. pbsARFix251
  396. pbsARFix252
  397. pbsARFix253
  398. pbsARFix254
  399. pbsARFix255
  400. pbsARFix256
  401. pbsARFix257
  402. pbsARFix258
  403. pbsARFix259
  404. pbsARFix260
  405. pbsARFix261
Page 9: Black-ScholesPricingandHedging - NTU · to the Black-Scholes PDE (6.2) in order to price a claim payoff Cof the formC= h(S T).Asinthediscrete-timecase,thearbitragepriceπt(C) at

Black-Scholes Pricing and Hedging

Fig 65 Time-dependent solution of the Black-Scholes PDE (call option)lowast

The next proposition is proved by a direct differentiation of the Black-Scholesfunction and will be recovered later using a probabilistic argument in Propo-sition 714 below

Proposition 64 The Black-Scholes Delta of the European call option isgiven by

ξt = ξt(St) =partgcpartx

(tSt) = Φ(d+(T minus t)

)isin [0 1] (615)

where d+(T minus t) is given by (611)

Proof From Relation (613) we note that the standard normal probabilitydensity function

ϕ(x) = Φprime(x) =1radic2π

eminusx22 x isin R

satisfies

ϕ(d+(T minus t)) = ϕ

(log(xK) + (r+ σ22)(T minus t)

|σ|radicT minus t

)=

1radic2π

exp(minus1

2

(log(xK) + (r+ σ22)(T minus t)

|σ|radicT minus t

)2)

=1radic2π

exp(minus1

2

(log(xK) + (rminus σ22)(T minus t)

|σ|radicT minus t

+ |σ|radicT minus t

)2)

=1radic2π

exp(minus1

2 (dminus(T minus t))2 minus (T minus t)rminus log x

K

)=

K

xradic

2πeminus(Tminust)r exp

(minus1

2 (dminus(T minus t))2)

lowast The animation works in Acrobat Reader on the entire pdf file

209

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

=K

xeminus(Tminust)rϕ(dminus(T minus t))

hence by (610) we have

partgcpartx

(tx) = part

partx

(xΦ(

log(xK) + (r+ σ22)(T minus t)|σ|radicT minus t

))(616)

minusK eminus(Tminust)r partpartx

(Φ(

log(xK) + (rminus σ22)(T minus t)|σ|radicT minus t

))= Φ

(log(xK) + (r+ σ22)(T minus t)

|σ|radicT minus t

)+x

part

partxΦ(

log(xK) + (r+ σ22)(T minus t)|σ|radicT minus t

)minusK eminus(Tminust)r part

partxΦ(

log(xK) + (rminus σ22)(T minus t)|σ|radicT minus t

)= Φ

(log(xK) + (r+ σ22)(T minus t)

|σ|radicT minus t

)+

x

|σ|radicT minus t

ϕ

(log(xK) + (r+ σ22)(T minus t)

|σ|radicT minus t

)minusK eminus(Tminust)r

|σ|radicT minus t

ϕ

(log(xK) + (rminus σ22)(T minus t)

|σ|radicT minus t

)= Φ(d+(T minus t)) +

x

|σ|radicT minus t

ϕ(d+(T minus t))minusK eminus(Tminust)r

|σ|radicT minus t

ϕ(dminus(T minus t))

= Φ(d+(T minus t))

As a consequence of Proposition 64 the Black-Scholes call price splits into arisky component StΦ

(d+(T minus t)

)and a riskless componentminusK eminus(Tminust)rΦ

(dminus(T minus

t)) as follows

gc(tSt) = StΦ(d+(T minus t)

)︸ ︷︷ ︸risky investment (held)

minus K eminus(Tminust)rΦ(dminus(T minus t)

)︸ ︷︷ ︸

riskminusfree investment (borrowed)

0 6 t 6 T

See Exercise 64 for a computation of the boundary values of gc(tx) t isin[0T ) x gt 0 The following R script is an implementation of the Black-ScholesDelta for European call options in R

1 Delta lt- function(S K r T sigma)d1 lt- (log(SK)+(r+sigma^22)T)(sigmasqrt(T))

3 Delta = pnorm(d1)Delta

210

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

In Figure 66 we plot the Delta of the European call option as a function ofthe underlying asset price and of the time remaining until maturity

Payoff function (x-K)+

0

50

100

150

200

Underlying

0

5

10

15

Time to maturity T-t

0

025

05

075

1

Fig 66 Delta of a European call option with strike price K = 100 r = 3 σ = 10

The Gamma of the European call option is defined as the first derivative ofDelta or second derivative of the option price with respect to the underlyingasset price This gives

γt =1

St|σ|radicT minus t

Φprime(d+(T minus t)

)=

1St|σ|

radic2(T minus t)π

exp(minus1

2

(log(StK) + (r+ σ22)(T minus t)

|σ|radicT minus t

)2)gt 0

In particular a positive value of γt implies that the Delta ξt = ξt(St) shouldincrease when the underlying asset price St increases In other words the po-sition ξt in the underlying asset should be increased by additional purchasesif the underlying asset price St increases

In Figure 67 we plot the (truncated) value of the Gamma of a European calloption as a function of the underlying asset price and of time to maturity

211

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

Fig 67 Gamma of a European call option with strike price K = 100

As Gamma is always nonnegative the Black-Scholes hedging strategy is tokeep buying the risky underlying asset when its price increases and to sell itwhen its price decreases as can be checked from Figure 67

Numerical example - hedging of a call option

In Figure 68 we consider the historical stock price of HSBC Holdings(0005HK) over one year

Fig 68 Graph of the stock price of HSBC Holdings

Consider the call option issued by Societe Generale on 31 December 2008 withstrike price K=$63704 maturity T = October 05 2009 and an entitlementratio of 100 meaning that one option contract is divided into 100 warrants cfpage 9 The next graph gives the time evolution of the Black-Scholes portfoliovalue

t 7minusrarr gc(tSt)

driven by the market price t 7minusrarr St of the risky underlying asset as given inFigure 68 in which the number of days is counted from the origin and notfrom maturity

212

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

40 50 60 70 80 90 0 50 100 150 200

0

5

10

15

20

25

30

35

40

Underlying (HK$) Time in days

Fig 69 Path of the Black-Scholes price for a call option on HSBC

As a consequence of Proposition 64 in the Black-Scholes call option hedgingmodel the amount invested in the risky asset is

Stξt = StΦ(d+(T minus t)

)= StΦ

(log(StK) + (r+ σ22)(T minus t)

|σ|radicT minus t

)gt 0

which is always nonnegative ie there is no short selling and the amountinvested on the riskless asset is

ηtAt = minusK eminus(Tminust)rΦ(dminus(T minus t)

)= minusK eminus(Tminust)rΦ

(log(StK) + (rminus σ22)(T minus t)

|σ|radicT minus t

)6 0

which is always nonpositive ie we are constantly borrowing money on theriskless asset as noted in Figure 610

-60

-40

-20

0

20

40

60

80

100

0 50 100 150 200

K

HK$

Black-Scholes priceRisky investment ξtSt

Riskless investment ηtAtUnderlying asset price

Fig 610 Time evolution of a hedging portfolio for a call option on HSBC

213

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

A comparison of Figure 610 with market data can be found in Figures 911and 912 below

Cash settlement In the case of a cash settlement the option issuer will sat-isfy the option contract by selling ξT = 1 stock at the price ST = $83refund the K = $63 risk-free investment and hand in the remaining amountC = (ST minusK)+ = 83minus 63 = $20 to the option holder

Physical delivery In the case of physical delivery of the underlying asset theoption issuer will deliver ξT = 1 stock to the option holder in exchange forK = $63 which will be used together with the portfolio value to refund therisk-free loan

63 European Put Options

Similarly in the case of the European put option with strike price K thepayoff function is given by h(x) = (Kminusx)+ and the Black-Scholes PDE (67)reads

rgp(tx) =partgppartt

(tx) + rxpartgppartx

(tx) + 12σ

2x2 part2gppartx2 (tx)

gp(T x) = (K minus x)+(617)

The next proposition can be proved as in Sections 65 and 66 see Proposi-tion 611

Proposition 65 The solution of the PDE (617) is given by the Black-Scholes formula for put options

gp(tx) = K eminus(Tminust)rΦ(minus dminus(T minus t)

)minus xΦ

(minus d+(T minus t)

) (618)

withd+(T minus t) =

log(xK) + (r+ σ22)(T minus t)|σ|radicT minus t

(619)

dminus(T minus t) =log(xK) + (rminus σ22)(T minus t)

|σ|radicT minus t

(620)

as illustrated in Figure 611

214

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

Fig 611 Graph of the Black-Scholes put price function with strike price K = 100lowast

In other words the European put option with strike price K and maturityT is priced at time t isin [0T ] as

gp(tSt) = K eminus(Tminust)rΦ(minus dminus(T minus t)

)minus StΦ

(minus d+(T minus t)

) 0 6 t 6 T

Fig 612 Time-dependent solution of the Black-Scholes PDE (put option)dagger

The following R script is an implementation of the Black-Scholes formula forEuropean put options in R

1 BSPut lt- function(S K r T sigma)d1 = (log(SK)+(r+sigma^22)T)(sigmasqrt(T))

3 d2 = d1 - sigma sqrt(T)BSPut = Kexp(-rT) pnorm(-d2) - Spnorm(-d1)

5 BSPut

Call-put parity

lowast Right-click on the figure for interaction and ldquoFull Screen Multimediardquo viewdagger The animation works in Acrobat Reader on the entire pdf file

215

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

(C) 2012--today Alexander Grahn 3Dmenujs version 20140923 3D JavaScript used by media9sty Extended functionality of the (right click) context menu of 3D annotations 1) Adds the following items to the 3D context menu `Generate Default View Finds good default camera settings returned as options for use with the includemedia command `Get Current View Determines camera cross section and part settings of the current view returned as `VIEW section that can be copied into a views file of additional views The views file is inserted using the `3Dviews option of includemedia `Cross Section Toggle switch to add or remove a cross section into or from the current view The cross section can be moved in the x y z directions using x y z and X Y Z keys on the keyboard be tilted against and spun around the upright Z axis using the UpDown and LeftRight arrow keys and caled using the s and S keys 2) Enables manipulation of position and orientation of indiviual parts and groups of parts in the 3D scene Parts which have been selected with the mouse can be scaled moved around and rotated like the cross section as described above To spin the parts around their local up-axis keep Control key pressed while using the UpDown and LeftRight arrow keys This work may be distributed andor modified under the conditions of the LaTeX Project Public License The latest version of this license is in httpmirrorsctanorgmacroslatexbaselppltxt This work has the LPPL maintenance status `maintained The Current Maintainer of this work is A Grahn The code borrows heavily from Bernd Gaertners `Miniball software originally written in C++ for computing the smallest enclosing ball of a set of points see httpwwwinfethzchpersonalgaertnerminiballhtmlhostconsoleshow()constructor for doubly linked listfunction List() thisfirst_node=null thislast_node=new Node(undefined)Listprototypepush_back=function(x) var new_node=new Node(x) if(thisfirst_node==null) thisfirst_node=new_node new_nodeprev=null else new_nodeprev=thislast_nodeprev new_nodeprevnext=new_node new_nodenext=thislast_node thislast_nodeprev=new_nodeListprototypemove_to_front=function(it) var node=itget() if(nodenext=null ampamp nodeprev=null) nodenextprev=nodeprev nodeprevnext=nodenext nodeprev=null nodenext=thisfirst_node thisfirst_nodeprev=node thisfirst_node=node Listprototypebegin=function() var i=new Iterator() itarget=thisfirst_node return(i)Listprototypeend=function() var i=new Iterator() itarget=thislast_node return(i)function Iterator(it) if( it=undefined ) thistarget=ittarget else thistarget=null Iteratorprototypeset=function(it)thistarget=ittargetIteratorprototypeget=function()return(thistarget)Iteratorprototypederef=function()return(thistargetdata)Iteratorprototypeincr=function() if(thistargetnext=null) thistarget=thistargetnextconstructor for node objects that populate the linked listfunction Node(x) thisprev=null thisnext=null thisdata=xfunction sqr(r)return(rr)helper functionMiniball algorithm by B Gaertnerfunction Basis() thism=0 thisq0=new Array(3) thisz=new Array(4) thisf=new Array(4) thisv=new Array(new Array(3) new Array(3) new Array(3) new Array(3)) thisa=new Array(new Array(3) new Array(3) new Array(3) new Array(3)) thisc=new Array(new Array(3) new Array(3) new Array(3) new Array(3)) thissqr_r=new Array(4) thiscurrent_c=thisc[0] thiscurrent_sqr_r=0 thisreset()Basisprototypecenter=function()return(thiscurrent_c)Basisprototypesize=function()return(thism)Basisprototypepop=function()--thismBasisprototypeexcess=function(p) var e=-thiscurrent_sqr_r for(var k=0klt3++k) e+=sqr(p[k]-thiscurrent_c[k]) return(e)Basisprototypereset=function() thism=0 for(var j=0jlt3++j) thisc[0][j]=0 thiscurrent_c=thisc[0] thiscurrent_sqr_r=-1Basisprototypepush=function(p) var i j var eps=1e-32 if(thism==0) for(i=0ilt3++i) thisq0[i]=p[i] for(i=0ilt3++i) thisc[0][i]=thisq0[i] thissqr_r[0]=0 else for(i=0ilt3++i) thisv[thism][i]=p[i]-thisq0[i] for(i=1iltthism++i) thisa[thism][i]=0 for(j=0jlt3++j) thisa[thism][i]+=thisv[i][j]thisv[thism][j] thisa[thism][i]=(2thisz[i]) for(i=1iltthism++i) for(j=0jlt3++j) thisv[thism][j]-=thisa[thism][i]thisv[i][j] thisz[thism]=0 for(j=0jlt3++j) thisz[thism]+=sqr(thisv[thism][j]) thisz[thism]=2 if(thisz[thism]ltepsthiscurrent_sqr_r) return(false) var e=-thissqr_r[thism-1] for(i=0ilt3++i) e+=sqr(p[i]-thisc[thism-1][i]) thisf[thism]=ethisz[thism] for(i=0ilt3++i) thisc[thism][i]=thisc[thism-1][i]+thisf[thism]thisv[thism][i] thissqr_r[thism]=thissqr_r[thism-1]+ethisf[thism]2 thiscurrent_c=thisc[thism] thiscurrent_sqr_r=thissqr_r[thism] ++thism return(true)function Miniball() thisL=new List() thisB=new Basis() thissupport_end=new Iterator()Miniballprototypemtf_mb=function(it) var i=new Iterator(it) thissupport_endset(thisLbegin()) if((thisBsize())==4) return for(var k=new Iterator(thisLbegin())kget()=iget()) var j=new Iterator(k) kincr() if(thisBexcess(jderef()) gt 0) if(thisBpush(jderef())) thismtf_mb(j) thisBpop() if(thissupport_endget()==jget()) thissupport_endincr() thisLmove_to_front(j) Miniballprototypecheck_in=function(b) thisLpush_back(b)Miniballprototypebuild=function() thisBreset() thissupport_endset(thisLbegin()) thismtf_mb(thisLend())Miniballprototypecenter=function() return(thisBcenter())Miniballprototyperadius=function() return(Mathsqrt(thisBcurrent_sqr_r))functions called by menu itemsfunction calc3Dopts () create Miniball object var mb=new Miniball() auxiliary vector var corner=new Vector3() iterate over all visible mesh nodes in the scene for(i=0iltscenemeshescounti++) var mesh=scenemeshesgetByIndex(i) if(meshvisible) continue local to parent transformation matrix var trans=meshtransform build local to world transformation matrix by recursively multiplying the parents transf matrix on the right var parent=meshparent while(parenttransform) trans=transmultiply(parenttransform) parent=parentparent get the bbox of the mesh (local coordinates) var bbox=meshcomputeBoundingBox() transform the local bounding box corner coordinates to world coordinates for bounding sphere determination BBoxmin cornerset(bboxmin) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) BBoxmax cornerset(bboxmax) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) remaining six BBox corners cornerset(bboxminx bboxmaxy bboxmaxz) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) cornerset(bboxminx bboxminy bboxmaxz) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) cornerset(bboxminx bboxmaxy bboxminz) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) cornerset(bboxmaxx bboxminy bboxminz) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) cornerset(bboxmaxx bboxminy bboxmaxz) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) cornerset(bboxmaxx bboxmaxy bboxminz) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) compute the smallest enclosing bounding sphere mbbuild() current camera settings var camera=scenecamerasgetByIndex(0) var res= initialize result string aperture angle of the virtual camera (perspective projection) or orthographic scale (orthographic projection) if(cameraprojectionType==cameraTYPE_PERSPECTIVE) var aac=camerafov180MathPI if(hostutilprintf(4f aac)=30) res+=hostutilprintf(n3Daac=s aac) else cameraviewPlaneSize=2mbradius() res+=hostutilprintf(n3Dortho=s 1cameraviewPlaneSize) camera roll var roll = cameraroll180MathPI if(hostutilprintf(4f roll)=0) res+=hostutilprintf(n3Droll=sroll) target to camera vector var c2c=new Vector3() c2cset(cameraposition) c2csubtractInPlace(cameratargetPosition) c2cnormalize() if((c2cx==0 ampamp c2cy==-1 ampamp c2cz==0)) res+=hostutilprintf(n3Dc2c=s s s c2cx c2cy c2cz) new camera settings bounding sphere centre --gt new camera target var coo=new Vector3() cooset((mbcenter())[0] (mbcenter())[1] (mbcenter())[2]) if(coolength) res+=hostutilprintf(n3Dcoo=s s s coox cooy cooz) radius of orbit if(cameraprojectionType==cameraTYPE_PERSPECTIVE) var roo=mbradius() Mathsin(aac MathPI 360) else orthographic projection var roo=mbradius() res+=hostutilprintf(n3Droo=s roo) update camera settings in the viewer var currol=cameraroll cameratargetPositionset(coo) camerapositionset(cooadd(c2cscale(roo))) cameraroll=currol determine background colour rgb=scenebackgroundgetColor() if((rgbr==1 ampamp rgbg==1 ampamp rgbb==1)) res+=hostutilprintf(n3Dbg=s s s rgbr rgbg rgbb) determine lighting scheme switch(scenelightScheme) case sceneLIGHT_MODE_FILE curlights=Artworkbreak case sceneLIGHT_MODE_NONE curlights=Nonebreak case sceneLIGHT_MODE_WHITE curlights=Whitebreak case sceneLIGHT_MODE_DAY curlights=Daybreak case sceneLIGHT_MODE_NIGHT curlights=Nightbreak case sceneLIGHT_MODE_BRIGHT curlights=Hardbreak case sceneLIGHT_MODE_RGB curlights=Primarybreak case sceneLIGHT_MODE_BLUE curlights=Bluebreak case sceneLIGHT_MODE_RED curlights=Redbreak case sceneLIGHT_MODE_CUBE curlights=Cubebreak case sceneLIGHT_MODE_CAD curlights=CADbreak case sceneLIGHT_MODE_HEADLAMP curlights=Headlampbreak if(curlights=Artwork) res+=hostutilprintf(n3Dlights=s curlights) determine global render mode switch(scenerenderMode) case sceneRENDER_MODE_BOUNDING_BOX currender=BoundingBoxbreak case sceneRENDER_MODE_TRANSPARENT_BOUNDING_BOX currender=TransparentBoundingBoxbreak case sceneRENDER_MODE_TRANSPARENT_BOUNDING_BOX_OUTLINE currender=TransparentBoundingBoxOutlinebreak case sceneRENDER_MODE_VERTICES currender=Verticesbreak case sceneRENDER_MODE_SHADED_VERTICES currender=ShadedVerticesbreak case sceneRENDER_MODE_WIREFRAME currender=Wireframebreak case sceneRENDER_MODE_SHADED_WIREFRAME currender=ShadedWireframebreak case sceneRENDER_MODE_SOLID currender=Solidbreak case sceneRENDER_MODE_TRANSPARENT currender=Transparentbreak case sceneRENDER_MODE_SOLID_WIREFRAME currender=SolidWireframebreak case sceneRENDER_MODE_TRANSPARENT_WIREFRAME currender=TransparentWireframebreak case sceneRENDER_MODE_ILLUSTRATION currender=Illustrationbreak case sceneRENDER_MODE_SOLID_OUTLINE currender=SolidOutlinebreak case sceneRENDER_MODE_SHADED_ILLUSTRATION currender=ShadedIllustrationbreak case sceneRENDER_MODE_HIDDEN_WIREFRAME currender=HiddenWireframebreak if(currender=Solid) res+=hostutilprintf(n3Drender=s currender) write result string to the console hostconsoleshow() hostconsoleclear() hostconsoleprintln(n Copy and paste the following text to then+ option list of includemedian + res + n)function get3Dview () var camera=scenecamerasgetByIndex(0) var coo=cameratargetPosition var c2c=camerapositionsubtract(coo) var roo=c2clength c2cnormalize() var res=VIEW=insert optional name heren if((coox==0 ampamp cooy==0 ampamp cooz==0)) res+=hostutilprintf( COO=s s sn coox cooy cooz) if((c2cx==0 ampamp c2cy==-1 ampamp c2cz==0)) res+=hostutilprintf( C2C=s s sn c2cx c2cy c2cz) if(roo gt 1e-9) res+=hostutilprintf( ROO=sn roo) var roll = cameraroll180MathPI if(hostutilprintf(4f roll)=0) res+=hostutilprintf( ROLL=sn roll) if(cameraprojectionType==cameraTYPE_PERSPECTIVE) var aac=camerafov 180MathPI if(hostutilprintf(4f aac)=30) res+=hostutilprintf( AAC=sn aac) else if(hostutilprintf(4f cameraviewPlaneSize)=1) res+=hostutilprintf( ORTHO=sn 1cameraviewPlaneSize) rgb=scenebackgroundgetColor() if((rgbr==1 ampamp rgbg==1 ampamp rgbb==1)) res+=hostutilprintf( BGCOLOR=s s sn rgbr rgbg rgbb) switch(scenelightScheme) case sceneLIGHT_MODE_FILE curlights=Artworkbreak case sceneLIGHT_MODE_NONE curlights=Nonebreak case sceneLIGHT_MODE_WHITE curlights=Whitebreak case sceneLIGHT_MODE_DAY curlights=Daybreak case sceneLIGHT_MODE_NIGHT curlights=Nightbreak case sceneLIGHT_MODE_BRIGHT curlights=Hardbreak case sceneLIGHT_MODE_RGB curlights=Primarybreak case sceneLIGHT_MODE_BLUE curlights=Bluebreak case sceneLIGHT_MODE_RED curlights=Redbreak case sceneLIGHT_MODE_CUBE curlights=Cubebreak case sceneLIGHT_MODE_CAD curlights=CADbreak case sceneLIGHT_MODE_HEADLAMP curlights=Headlampbreak if(curlights=Artwork) res+= LIGHTS=+curlights+n switch(scenerenderMode) case sceneRENDER_MODE_BOUNDING_BOX defaultrender=BoundingBoxbreak case sceneRENDER_MODE_TRANSPARENT_BOUNDING_BOX defaultrender=TransparentBoundingBoxbreak case sceneRENDER_MODE_TRANSPARENT_BOUNDING_BOX_OUTLINE defaultrender=TransparentBoundingBoxOutlinebreak case sceneRENDER_MODE_VERTICES defaultrender=Verticesbreak case sceneRENDER_MODE_SHADED_VERTICES defaultrender=ShadedVerticesbreak case sceneRENDER_MODE_WIREFRAME defaultrender=Wireframebreak case sceneRENDER_MODE_SHADED_WIREFRAME defaultrender=ShadedWireframebreak case sceneRENDER_MODE_SOLID defaultrender=Solidbreak case sceneRENDER_MODE_TRANSPARENT defaultrender=Transparentbreak case sceneRENDER_MODE_SOLID_WIREFRAME defaultrender=SolidWireframebreak case sceneRENDER_MODE_TRANSPARENT_WIREFRAME defaultrender=TransparentWireframebreak case sceneRENDER_MODE_ILLUSTRATION defaultrender=Illustrationbreak case sceneRENDER_MODE_SOLID_OUTLINE defaultrender=SolidOutlinebreak case sceneRENDER_MODE_SHADED_ILLUSTRATION defaultrender=ShadedIllustrationbreak case sceneRENDER_MODE_HIDDEN_WIREFRAME defaultrender=HiddenWireframebreak if(defaultrender=Solid) res+= RENDERMODE=+defaultrender+n detect existing Clipping Plane (3D Cross Section) var clip=null if( clip=scenenodesgetByName($$$$$$)|| clip=scenenodesgetByName(Clipping Plane) ) for(var i=0iltscenenodescounti++) var nd=scenenodesgetByIndex(i) if(nd==clip||ndname==) continue var ndUTFName= for (var j=0 jltndnamelength j++) var theUnicode = ndnamecharCodeAt(j)toString(16) while (theUnicodelengthlt4) theUnicode = 0 + theUnicode ndUTFName += theUnicode var end=ndnamelastIndexOf() if(endgt0) var ndUserName=ndnamesubstr(0end) else var ndUserName=ndname respart= PART=+ndUserName+n respart+= UTF16NAME=+ndUTFName+n defaultvals=true if(ndvisible) respart+= VISIBLE=falsen defaultvals=false if(ndopacitylt10) respart+= OPACITY=+ndopacity+n defaultvals=false if(ndconstructorname==Mesh) currender=defaultrender switch(ndrenderMode) case sceneRENDER_MODE_BOUNDING_BOX currender=BoundingBoxbreak case sceneRENDER_MODE_TRANSPARENT_BOUNDING_BOX currender=TransparentBoundingBoxbreak case sceneRENDER_MODE_TRANSPARENT_BOUNDING_BOX_OUTLINE currender=TransparentBoundingBoxOutlinebreak case sceneRENDER_MODE_VERTICES currender=Verticesbreak case sceneRENDER_MODE_SHADED_VERTICES currender=ShadedVerticesbreak case sceneRENDER_MODE_WIREFRAME currender=Wireframebreak case sceneRENDER_MODE_SHADED_WIREFRAME currender=ShadedWireframebreak case sceneRENDER_MODE_SOLID currender=Solidbreak case sceneRENDER_MODE_TRANSPARENT currender=Transparentbreak case sceneRENDER_MODE_SOLID_WIREFRAME currender=SolidWireframebreak case sceneRENDER_MODE_TRANSPARENT_WIREFRAME currender=TransparentWireframebreak case sceneRENDER_MODE_ILLUSTRATION currender=Illustrationbreak case sceneRENDER_MODE_SOLID_OUTLINE currender=SolidOutlinebreak case sceneRENDER_MODE_SHADED_ILLUSTRATION currender=ShadedIllustrationbreak case sceneRENDER_MODE_HIDDEN_WIREFRAME currender=HiddenWireframebreak case sceneRENDER_MODE_DEFAULT currender=Defaultbreak if(currender=defaultrender) respart+= RENDERMODE=+currender+n defaultvals=false if(origtrans[ndname]ampampndtransformisEqual(origtrans[ndname])) var lvec=ndtransformtransformDirection(new Vector3(100)) var uvec=ndtransformtransformDirection(new Vector3(010)) var vvec=ndtransformtransformDirection(new Vector3(001)) respart+= TRANSFORM= +lvecx+ +lvecy+ +lvecz+ +uvecx+ +uvecy+ +uvecz+ +vvecx+ +vvecy+ +vvecz+ +ndtransformtranslationx+ +ndtransformtranslationy+ +ndtransformtranslationz+n defaultvals=false respart+= ENDn if(defaultvals) res+=respart if(clip) var centre=cliptransformtranslation var normal=cliptransformtransformDirection(new Vector3(001)) res+= CROSSSECTn if((centrex==0 ampamp centrey==0 ampamp centrez==0)) res+=hostutilprintf( CENTER=s s sn centrex centrey centrez) if((normalx==1 ampamp normaly==0 ampamp normalz==0)) res+=hostutilprintf( NORMAL=s s sn normalx normaly normalz) res+=hostutilprintf( VISIBLE=sn clipvisible) res+=hostutilprintf( PLANECOLOR=s s sn clipmaterialemissiveColorr clipmaterialemissiveColorg clipmaterialemissiveColorb) res+=hostutilprintf( OPACITY=sn clipopacity) res+=hostutilprintf( INTERSECTIONCOLOR=s s sn clipwireframeColorr clipwireframeColorg clipwireframeColorb) res+= ENDn for(var propt in clip) consoleprintln(propt++clip[propt]) res+=ENDn hostconsoleshow() hostconsoleclear() hostconsoleprintln(n Add the following VIEW section to a file ofn+ predefined views (See option 3Dviews)nn + The view may be given a name after VIEW=n + (Remove in front of =)n) hostconsoleprintln(res + n)add items to 3D context menuruntimeaddCustomMenuItem(dfltview Generate Default View default 0)runtimeaddCustomMenuItem(currview Get Current View default 0)runtimeaddCustomMenuItem(csection Cross Section checked 0)menu event handlersmenuEventHandler = new MenuEventHandler()menuEventHandleronEvent = function(e) switch(emenuItemName) case dfltview calc3Dopts() break case currview get3Dview() break case csection addremoveClipPlane(emenuItemChecked) break runtimeaddEventHandler(menuEventHandler)global variable taking reference to currently selected nodevar target=nullselectionEventHandler=new SelectionEventHandler()selectionEventHandleronEvent=function(e) if(eselectedampampenodename=) target=enode else target=null runtimeaddEventHandler(selectionEventHandler)cameraEventHandler=new CameraEventHandler()cameraEventHandleronEvent=function(e) var clip=null runtimeremoveCustomMenuItem(csection) runtimeaddCustomMenuItem(csection Cross Section checked 0) if(clip=scenenodesgetByName($$$$$$)|| predefined scenenodesgetByName(Clipping Plane)) added via context menu runtimeremoveCustomMenuItem(csection) runtimeaddCustomMenuItem(csection Cross Section checked 1) if(clip)plane in predefined views must be rotated by 90 deg around normal cliptransformrotateAboutLineInPlace( MathPI2cliptransformtranslation cliptransformtransformDirection(new Vector3(001)) ) for(var i=0 iltrot4x4length i++)rot4x4[i]setIdentity() target=nullruntimeaddEventHandler(cameraEventHandler)var rot4x4=new Array() keeps track of spin and tilt axes transformationskey event handler for scaling moving spinning and tilting objectskeyEventHandler=new KeyEventHandler()keyEventHandleronEvent=function(e) var backtrans=new Matrix4x4() var trgt=null if(target) trgt=target var backtrans=new Matrix4x4() var trans=trgttransform var parent=trgtparent while(parenttransform) build local to world transformation matrix transmultiplyInPlace(parenttransform) also build world to local back-transformation matrix backtransmultiplyInPlace(parenttransforminversetranspose) parent=parentparent backtranstransposeInPlace() else if( trgt=scenenodesgetByName($$$$$$)|| trgt=scenenodesgetByName(Clipping Plane) ) var trans=trgttransform if(trgt) return var tname=trgtname if(typeof(rot4x4[tname])==undefined) rot4x4[tname]=new Matrix4x4() if(target) var tiltAxis=rot4x4[tname]transformDirection(new Vector3(010)) else var tiltAxis=transtransformDirection(new Vector3(010)) var spinAxis=rot4x4[tname]transformDirection(new Vector3(001)) get the centre of the mesh if(targetampamptrgtconstructorname==Mesh) var centre=transtransformPosition(trgtcomputeBoundingBox()center) else part group (Node3 parent node clipping plane) var centre=new Vector3(transtranslation) switch(echaracterCode) case 30tilt up rot4x4[tname]rotateAboutLineInPlace( -MathPI900rot4x4[tname]translationtiltAxis) transrotateAboutLineInPlace(-MathPI900centretiltAxis) break case 31tilt down rot4x4[tname]rotateAboutLineInPlace( MathPI900rot4x4[tname]translationtiltAxis) transrotateAboutLineInPlace(MathPI900centretiltAxis) break case 28spin right if(ectrlKeyDownampamptarget) transrotateAboutLineInPlace(-MathPI900centrespinAxis) else rot4x4[tname]rotateAboutLineInPlace( -MathPI900rot4x4[tname]translationnew Vector3(001)) transrotateAboutLineInPlace(-MathPI900centrenew Vector3(001)) break case 29spin left if(ectrlKeyDownampamptarget) transrotateAboutLineInPlace(MathPI900centrespinAxis) else rot4x4[tname]rotateAboutLineInPlace( MathPI900rot4x4[tname]translationnew Vector3(001)) transrotateAboutLineInPlace(MathPI900centrenew Vector3(001)) break case 120 x translateTarget(trans new Vector3(100) e) break case 121 y translateTarget(trans new Vector3(010) e) break case 122 z translateTarget(trans new Vector3(001) e) break case 88 shift + x translateTarget(trans new Vector3(-100) e) break case 89 shift + y translateTarget(trans new Vector3(0-10) e) break case 90 shift + z translateTarget(trans new Vector3(00-1) e) break case 115 s transtranslateInPlace(centrescale(-1)) transscaleInPlace(101) transtranslateInPlace(centrescale(1)) break case 83 shift + s transtranslateInPlace(centrescale(-1)) transscaleInPlace(1101) transtranslateInPlace(centrescale(1)) break transmultiplyInPlace(backtrans)runtimeaddEventHandler(keyEventHandler)translates object by amount calculated from Canvas sizefunction translateTarget(t d e) var cam=scenecamerasgetByIndex(0) if(camprojectionType==camTYPE_PERSPECTIVE) var scale=Mathtan(camfov2) camtargetPositionsubtract(camposition)length Mathmin(ecanvasPixelWidthecanvasPixelHeight) else var scale=camviewPlaneSize2 Mathmin(ecanvasPixelWidthecanvasPixelHeight) ttranslateInPlace(dscale(scale))function addremoveClipPlane(chk) var curTrans=getCurTrans() var clip=scenecreateClippingPlane() if(chk) add Clipping Plane and place its center either into the camera target position or into the centre of the currently selected mesh node var centre=new Vector3() if(target) var trans=targettransform var parent=targetparent while(parenttransform) trans=transmultiply(parenttransform) parent=parentparent if(targetconstructorname==Mesh) var centre=transtransformPosition(targetcomputeBoundingBox()center) else var centre=new Vector3(transtranslation) target=null else centreset(scenecamerasgetByIndex(0)targetPosition) cliptransformsetView( new Vector3(000) new Vector3(100) new Vector3(010)) cliptransformtranslateInPlace(centre) else if( scenenodesgetByName($$$$$$)|| scenenodesgetByName(Clipping Plane) ) clipremove()clip=null restoreTrans(curTrans) return clipfunction to store current transformation matrix of all nodes in the scenefunction getCurTrans() var tA=new Array() for(var i=0 iltscenenodescount i++) var nd=scenenodesgetByIndex(i) if(ndname==) continue tA[ndname]=new Matrix4x4(ndtransform) return tAfunction to restore transformation matrices given as argfunction restoreTrans(tA) for(var i=0 iltscenenodescount i++) var nd=scenenodesgetByIndex(i) if(tA[ndname]) ndtransformset(tA[ndname]) store original transformation matrix of all mesh nodes in the scenevar origtrans=getCurTrans()set initial state of Cross Section menu entrycameraEventHandleronEvent(1)hostconsoleclear()

var ocgs=hostgetOCGs(hostpageNum)for(var i=0iltocgslengthi++)if(ocgs[i]name==MediaPlayButton2)ocgs[i]state=false

(C) 2012 Michail Vidiassov John C Bowman Alexander Grahn asylabelsjs version 20120912 3D JavaScript to be used with media9sty (option `add3Djscript) for Asymptote generated PRC files adds billboard behaviour to text labels in Asymptote PRC files so that they always face the camera under 3D rotation This work may be distributed andor modified under the conditions of the LaTeX Project Public License The latest version of this license is in httpmirrorsctanorgmacroslatexbaselppltxt This work has the LPPL maintenance status `maintained The Current Maintainer of this work is A Grahnvar bbnodes=new Array() billboard meshesvar bbtrans=new Array() billboard transformsfunction fulltransform(mesh) var t=new Matrix4x4(meshtransform) if(meshparentname = ) var parentTransform=fulltransform(meshparent) tmultiplyInPlace(parentTransform) return t else return t find all text labels in the scene and determine pivoting pointsvar nodes=scenenodesvar nodescount=nodescountvar third=1030for(var i=0 i lt nodescount i++) var node=nodesgetByIndex(i) var name=nodename var end=namelastIndexOf()-1 if(end gt 0) if(namecharAt(end) == 001) var start=namelastIndexOf(-)+1 if(end gt start) nodename=namesubstr(0start-1) var nodeMatrix=fulltransform(nodeparent) var c=nodeMatrixtranslation position var d=Mathpow(Mathabs(nodeMatrixdeterminant)third) scale bbnodespush(node) bbtranspush(Matrix4x4()scale(ddd)translate(c)multiply(nodeMatrixinverse)) var camera=scenecamerasgetByIndex(0) var zero=new Vector3(000)var bbcount=bbnodeslength event handler to maintain camera-facing text labelsbillboardHandler=new RenderEventHandler()billboardHandleronEvent=function(event) var T=new Matrix4x4() TsetView(zerocamerapositionsubtract(cameratargetPosition) cameraupsubtract(cameraposition)) for(var j=0 j lt bbcount j++) bbnodes[j]transformset(Tmultiply(bbtrans[j])) runtimerefresh() runtimeaddEventHandler(billboardHandler)runtimerefresh()

(C) 2012 Alexander Grahn 3Dspintooljs version 20120301 3D JavaScript to be used with media9sty (option `add3Djscript) enables the Spin tool (also accessible via 3D toolbar or context menu) upon activation of the 3D scene the scene then rotates around the upright axis while dragging with the mouse This work may be distributed andor modified under the conditions of the LaTeX Project Public License The latest version of this license is in httpmirrorsctanorgmacroslatexbaselppltxt This work has the LPPL maintenance status `maintained The Current Maintainer of this work is A GrahnruntimesetCurrentTool(runtimeTOOL_NAME_SPIN)

N Privault

Proposition 66 Call-put parity We have the call-put parity relation

gc(tSt)minus gp(tSt) = St minusK eminus(Tminust)r 0 6 t 6 T (621)

between the Black-Scholes prices of call and put options in terms of theforward contract price St minusK eminus(Tminust)r

Proof The call-put parity (621) is a consequence of the relation

xminusK = (xminusK)+ minus (K minus x)+

satisfied by the terminal call and put payoff functions in the Black-ScholesPDE (67) It can also be verified directly from (610) and (618) as

gc(tx)minus gp(tx) = xΦ(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)minus(K eminus(Tminust)rΦ

(minus dminus(T minus t)

)minus xΦ

(minus d+(T minus t)

))= xΦ

(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)minusK eminus(Tminust)r

(1minusΦ

(dminus(T minus t)

))+ x

(1minusΦ

(d+(T minus t)

))= xminusK

The Delta of the Black-Scholes put option can be obtained by differentiationof the call-put parity relation (621) and Proposition 64

Proposition 67 The Delta of the Black-Scholes put option is given by

ξt = minus(1minusΦ(d+(T minus t)

)) = minusΦ

(minus d+(T minus t)

)isin [minus1 0] 0 6 t 6 T

Proof By the call-put parity relation (621) and Proposition 64 we have

partgppartx

(tSt) =partgcpartx

(tSt)minus 1

= Φ(d+(T minus t))minus 1= minusΦ(minusd+(T minus t)) 0 6 t 6 T

where we applied (614)

As a consequence of Proposition 67 the Black-Scholes put price splitsinto a risky component minusStΦ

(minus d+(T minus t)

)and a riskless component

K eminus(Tminust)rΦ(minus dminus(T minus t)

) as follows

gp(tSt) = K eminus(Tminust)rΦ(minus dminus(T minus t)

)︸ ︷︷ ︸riskminusfree investment (savings)

minus StΦ(minus d+(T minus t)

)︸ ︷︷ ︸

risky investment (short)

0 6 t 6 T

216

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

In Figure 613 we plot the Delta of the European put option as a function ofthe underlying asset price and of the time remaining until maturity

Payoff function (x-K)+

0

50

100

150

200

Underlying

0

5

10

15 Time to maturity T-t

-1

-075

-05

-025

0

Fig 613 Delta of a European put option with strike price K = 100 r = 3 σ = 10

Numerical example - hedging of a put option

For one more example we consider a put option issued by BNP Paribas on04 November 2008 with strike price K=$77667 maturity T = October 052009 and entitlement ratio 92593 cf page 9 In the next Figure 614 thenumber of days is counted from the origin not from maturity

40 50 60 70 80 90 100

0 50 100 150 200

0 5

10 15 20 25 30 35 40 45

Underlying (HK$)Time in days

Fig 614 Path of the Black-Scholes price for a put option on HSBC

As a consequence of Proposition 67 the amount invested on the risky assetfor the hedging of a put option is

minusStΦ(minus d+(T minus t)

)= minusStΦ

(minus log(StK) + (r+ σ22)(T minus t)

|σ|radicT minus t

)6 0

217

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

ie there is always short selling and the amount invested on the riskless assetpriced At = ert t isin [0T ] is

ηtAt = K eminus(Tminust)rΦ(minus dminus(T minus t)

)= K eminus(Tminust)rΦ

(minus log(StK) + (rminus σ22)(T minus t)

|σ|radicT minus t

)gt 0

which is always nonnegative ie we are constantly saving money on theriskless asset as noted in Figure 615

-60

-40

-20

0

20

40

60

80

100

0 50 100 150 200

K

HK$

Black-Scholes priceRisky investment ξtSt

Riskless investment ηtAtUnderlying asset price

Fig 615 Time evolution of the hedging portfolio for a put option on HSBC

In the above example the put option finished out of the money (OTM) so thatno cash settlement or physical delivery occurs A comparison of Figure 610with market data can be found in Figures 913 and 914 below

64 Market Terms and Data

The following Table 61 provides a summary of formulas for the computationof Black-Scholes sensitivities also called Greekslowast

lowast ldquoEvery class feels like attending a Greek lessonrdquo (AY2018-2019 student feedback)

218

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

Call option Put option

Option price g(tSt) StΦ(d+(T minus t))minusK eminus(Tminust)rΦ(dminus(T minus t)) K eminus(Tminust)rΦ(minusdminus(T minus t))minus StΦ(minusd+(T minus t))

Delta (∆) partg

partx(tSt) Φ(d+(T minus t)) gt 0 minusΦ(minusd+(T minus t)) 6 0

Gamma (Γ) part2g

partx2 (tSt)Φprime(d+(T minus t))St|σ|

radicT minus t

gt 0

Vega partg

partσ(tSt) St

radicT minus tΦprime(d+(T minus t)) gt 0

Theta (Θ) partg

partt(tSt) minusSt|σ|Φ

prime(d+(T minus t))2radicT minus t

minus rK eminus(Tminust)rΦ(dminus(T minus t)) 6 0 minusSt|σ|Φprime(d+(T minus t))

2radicT minus t

+ rK eminus(Tminust)rΦ(minusdminus(T minus t))

Rho (ρ) partg

partr(tSt) K(T minus t) eminus(Tminust)rΦ(dminus(T minus t)) minusK(T minus t) eminus(Tminust)rΦ(minusdminus(T minus t))

Table 61 Black-Scholes Greeks (Wikipedia)

From Table 61 we can conclude that call option prices are increasing func-tions of the underlying asset price St of the interest rate r and of the volatil-ity parameter σ Similarly put option prices are decreasing functions of theunderlying asset price St of the interest rate r and increasing functions ofthe volatility parameter σ

Parameter Variation of call option prices Variation of put option prices

Underlying St increasing decreasing

Volatility σ increasing increasing

Time t decreasing depends on the underlying price level

Interest rate r increasing decreasing

Table 62 Variations of Black-Scholes prices

The change of sign of the sensitivity Theta (Θ) with respect to time t can beverified in the following Figure 616

219

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

(a) Black-Scholes call price maps (b) Black-Scholes put price maps

Fig 616 Time-dependent solutions of the Black-Scholes PDElowast

Intrinsic value The intrinsic value at time t isin [0T ] of the option withpayoff C = h

(S(1)T

)is given by the immediate exercise payoff h

(S(1)t

) The

extrinsic value at time t isin [0T ] of the option is the remaining differenceπt(C) minus h

(S(1)t

)between the option price πt(C) and the immediate ex-

ercise payoff h(S(1)t

) In general the option price πt(C) decomposes as

πt(C) = h(S(1)t

)︸ ︷︷ ︸intrinsic value

+ πt(C)minus h(S(1)t

)︸ ︷︷ ︸

extrinsic value

0 6 t 6 T ]

Gearing The gearing at time t isin [0T ] of the option with payoff C = h(ST )is defined as the ratio

Gt =St

πt(C)=

Stg(tSt)

0 6 t 6 T

Effective gearing The effective gearing at time t isin [0T ] of the option withpayoff C = h(ST ) is defined as the ratio

Get = Gtξt

=ξtStπt(C)

=St

πt(C)

partg

partx(tSt)

=St

g(tSt)partg

partx(tSt)

= Stpart

partxlog g(tSt) 0 6 t 6 T

lowast The animation works in Acrobat Reader on the entire pdf file

220

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

The effective gearingGet =

ξtStπt(C)

can be interpreted as the hedge ratio ie the percentage of the portfoliowhich is invested on the risky asset When written as

∆g(tSt)g(tSt)

= Get times

∆StSt

the effective gearing gives the relative variation or percentage change∆g(tSt)g(tSt) of the option price g(tSt) from the relative variation∆StSt in the underlying asset price

The ratio Get = Stpart log g(tSt)partx can also be interpreted as an elasticity

coefficient

Break-even price The break-even price BEPt of the underlying asset is thevalue of S for which the intrinsic option value h(S) equals the option priceπt(C) at time t isin [0T ] For European call options it is given by

BEPt = K + πt(C) = K + g(tSt) t = 0 1 N

whereas for European put options it is given by

BEPt = K minus πt(C) = K minus g(tSt) 0 6 t 6 T

Premium The option premium OPt can be defined as the variation requiredfrom the underlying asset price in order to reach the break-even price iewe have

OPt =BEPt minus St

St=K + g(tSt)minus St

St 0 6 t 6 T

for European call options and

OPt =St minusBEPt

St=St + g(tSt)minusK

St 0 6 t 6 T

for European put options see Figure 617 below The term ldquopremiumrdquo issometimes also used to denote the arbitrage price g(tSt) of the option

221

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

f (tx σ)100

=

x =

K =

xpart log f

partx=

σ =

partf

partt(tx σ)=

T=

=(xminusK)x

∆ = = partf

partx(tx σ)

= partf

partσ(tx σ)

=K+f (txσ)minusx

x

=K+f (tx σ)

rf=

partf

partt+rxpartf

partx+

σ2 2x2part2f

partx2

Fig 617 Warrant terms and data

The R package bizdays (requires to install QuantLib) can be used to computecalendar time vs business time to maturity1 installpackages(bizdays)

library(bizdays)3 load_quantlib_calendars(HongKong from=2018-01-01 to=2018-12-31)

load_quantlib_calendars(Singapore from=2018-01-01 to=2018-12-31)5 bizdays(2018-03-10 2018-04-03 QuantLibHongKong)

bizdays(2018-03-10 2018-04-03 QuantLibSingapore)

65 The Heat Equation

In the next proposition we notice that the solution f(tx) of the Black-Scholes PDE (67) can be transformed into a solution g(t y) of the simplerheat equation by a change of variable and a time inversion t 7minusrarr T minus t onthe interval [0T ] so that the terminal condition at time T in the Black-Scholes equation (622) becomes an initial condition at time t = 0 in theheat equation (625) See also here for a related discussion on changes ofvariables for the Black-Scholes PDE

222

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

Proposition 68 Assume that f(tx) solves the Black-Scholes PDErf(tx) = partf

partt(tx) + rx

partf

partx(tx) + 1

2σ2x2 part

2f

partx2 (tx)

f(T x) = (xminusK)+(622)

with terminal condition h(x) = (xminusK)+ x gt 0 Then the function g(t y)defined by

g(t y) = ertf(T minus t e|σ|y+(σ22minusr)t) (623)

solves the heat equation (625) with initial condition

ψ(y) = h(

e|σ|y) y isin R (624)

ie we have partg

partt(t y) = 1

2part2g

party2 (t y)

g(0 y) = h(

e|σ|y)

(625)

Proposition 68 will be proved in Section 66 It will allow us to solve theBlack-Scholes PDE (622) based on the solution of the heat equation (625)with initial condition ψ(y) = h

(e|σ|y

) y isin R by inversion of Relation (623)

with s = T minus t x = e|σ|y+(σ22minusr)t ie

f(sx) = eminus(Tminuss)rg(T minus s minus(σ

22minus r)(T minus s) + log x|σ|

)

Next we focus on the heat equation

partϕ

partt(t y) = 1

2part2ϕ

party2 (t y) (626)

which is used to model the diffusion of heat over time through solids Herethe data of g(x t) represents the temperature measured at time t and pointx We refer the reader to Widder (1975) for a complete treatment of thistopic

223

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

Fig 618 Time-dependent solution of the heat equationlowast

Proposition 69 The fundamental solution of the heat equation (626) isgiven by the Gaussian probability density function

ϕ(t y) =1radic2πt

eminusy2(2t) y isin R

with variance t gt 0

Proof The proof is done by a direct calculation as follows

partϕ

partt(t y) = part

partt

(eminusy2(2t)radic

2πt

)

= minus eminusy2(2t)

2t32radic

2π+

y2

2t2eminusy2(2t)radic

2πt

=

(minus 1

2t +y2

2t2

)ϕ(t y)

and

12part2ϕ

party2 (t y) = minus12part

party

(y

t

eminusy2(2t)radic

2πt

)

= minus eminusy2(2t)

2tradic

2πt+

y2

2t2eminusy2(2t)radic

2πt

=

(minus 1

2t +y2

2t2

)ϕ(t y) t gt 0 y isin R

lowast The animation works in Acrobat Reader on the entire pdf file

224

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

In Section 66 the heat equation (626) will be shown to be equivalent to theBlack-Scholes PDE after a change of variables In particular this will lead tothe explicit solution of the Black-Scholes PDE

Proposition 610 The heat equationpartg

partt(t y) = 1

2part2g

party2 (t y)

g(0 y) = ψ(y)

(627)

with continuous initial condition

g(0 y) = ψ(y)

has the solution

g(t y) =winfinminusinfin

ψ(z) eminus(yminusz)2(2t) dzradic2πt

y isin R t gt 0 (628)

Proof We have

partg

partt(t y) = part

partt

winfinminusinfin

ψ(z) eminus(yminusz)2(2t) dzradic2πt

=winfinminusinfin

ψ(z)part

partt

(eminus(yminusz)2(2t)radic

2πt

)dz

=12winfinminusinfin

ψ(z)

((yminus z)2

t2minus 1t

)eminus(yminusz)2(2t) dzradic

2πt

=12winfinminusinfin

ψ(z)part2

partz2 eminus(yminusz)2(2t) dzradic2πt

=12winfinminusinfin

ψ(z)part2

party2 eminus(yminusz)2(2t) dzradic2πt

=12part2

party2

winfinminusinfin

ψ(z) eminus(yminusz)2(2t) dzradic2πt

=12part2g

party2 (t y)

On the other hand it can be checked that at time t = 0 we have

limtrarr0

winfinminusinfin

ψ(z) eminus(yminusz)2(2t) dzradic2πt

= limtrarr0

winfinminusinfin

ψ(y+ z) eminusz2(2t) dzradic2πt

= ψ(y) y isin R

225

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

The next Figure 619 shows the evolution of g(tx) with initial conditionbased on the European call payoff function h(x) = (xminusK)+ ie

g(0 y) = ψ(y) = h(

e|σ|y)=(

e|σ|y minusK)+ y isin R

Fig 619 Time-dependent solution of the heat equationlowast

Let us provide a second proof of Proposition 610 this time using Brownianmotion and stochastic calculus

Proof of Proposition 610 First note that under the change of variable x =z minus y we have

g(t y) =winfinminusinfin

ψ(z) eminus(yminusz)2(2t) dzradic2πt

=winfinminusinfin

ψ(y+ x) eminusx2(2t) dxradic2πt

= IE[ψ(y+Bt)]

= IE[ψ(yminusBt)]

where (Bt)tisinR+ is a standard Brownian motion and Bt N (0 t) t isin R+Applying Itocircrsquos formula and using the fact that the expectation of the stochas-tic integral with respect to Brownian motion is zero see Relation (417) inProposition 420 we find

g(t y) = IE[ψ(yminusBt)]

= ψ(y)minus IE[w t

0ψprime(yminusBs)dBs

]+

12 IE

[w t0ψprimeprime(yminusBs)ds

]= ψ(y) +

12w t

0IE[ψprimeprime(yminusBs)

]ds

lowast The animation works in Acrobat Reader on the entire pdf file

226

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

= ψ(y) +12w t

0part2

party2 IE [ψ(yminusBs)] ds

= ψ(y) +12w t

0part2g

party2 (s y)ds

Hence we have

partg

partt(t y) = part

parttIE[ψ(yminusBt)]

=12part2

party2 IE [ψ(yminusBt)]

=12part2g

party2 (t y)

Regarding the initial condition we check that

g(0 y) = IE[ψ(yminusB0)] = IE[ψ(y)] = ψ(y)

The expression g(t y) = IE[ψ(yminusBt)] provides a probabilistic interpreta-tion of the heat diffusion phenomenon based on Brownian motion Namelywhen ψε(y) = 1[minusεε](y) we find that

gε(t y) = IE[ψε(yminusBt)]= IE[1[minusεε](yminusBt)]= P

(yminusBt isin [minusε ε]

)= P

(yminus ε 6 Bt 6 y+ ε

)represents the probability of finding Bt within a neighborhood [y minus ε y + ε]of the point y isin R

66 Solution of the Black-Scholes PDE

In this section we solve the Black-Scholes PDE by the kernel method of Sec-tion 65 and a change of variables This solution method uses the change ofvariables (623) of Proposition 68 and a time inversion from which the ter-minal condition at time T in the Black-Scholes equation becomes an initialcondition at time t = 0 in the heat equation

Next we state the proof Proposition 68

Proof Letting s = T minus t and x = e|σ|y+(σ22minusr)t and using Relation (623)ie

g(t y) = ertf(T minus t e|σ|y+(σ22minusr)t)

227

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

we have

partg

partt(t y) = r ertf

(T minus t e|σ|y+(σ22minusr)t)minus ert partf

parts

(T minus t e|σ|y+(σ22minusr)t)

+

(σ2

2 minus r)

ert e|σ|y+(σ22minusr)t partf

partx

(T minus t e|σ|y+(σ22minusr)t)

= r ertf(T minus tx)minus ert partfparts

(T minus tx) +(σ2

2 minus r)

ertxpartfpartx

(T minus tx)

=12 ertx2σ2 part

2f

partx2 (T minus tx) +σ2

2 ertxpartfpartx

(T minus tx) (629)

where on the last step we used the Black-Scholes PDE On the other handwe have

partg

party(t y) = |σ| ert e|σ|y+(σ22minusr)t partf

partx

(T minus t e|σ|y+(σ22minusr)t)

and

12partg2

party2 (t y) =σ2

2 ert e|σ|y+(σ22minusr)t partf

partx

(T minus t e|σ|y+(σ22minusr)t)

+σ2

2 ert e2|σ|y+2(σ22minusr)t part2f

partx2(T minus t e|σ|y+(σ22minusr)t)

=σ2

2 ertxpartfpartx

(T minus tx) + σ2

2 ertx2 part2f

partx2 (T minus tx) (630)

We conclude by comparing (629) with (630) which shows that g(tx) solvesthe heat equation (627) with initial condition

g(0 y) = f(T e|σ|y

)= h

(e|σ|y

)

In the next proposition we derive the Black-Scholes formula (610) by solv-ing the PDE (622) The Black-Scholes formula will also be recovered by aprobabilistic argument via the computation of an expected value in Proposi-tion 77

Proposition 611 When h(x) = (x minusK)+ the solution of the Black-Scholes PDE (622) is given by

f(tx) = xΦ(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

) x gt 0

whereΦ(x) =

1radic2π

w xminusinfin

eminusy22dy x isin R

and

228

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

d+(T minus t) =

log(xK) + (r+ σ22)(T minus t)|σ|radicT minus t

dminus(T minus t) =log(xK) + (rminus σ22)(T minus t)

|σ|radicT minus t

x gt 0 t isin [0T )

Proof By inversion of Relation (623) with s = T minus t and x = e|σ|y+(σ22minusr)twe get

f(sx) = eminus(Tminuss)rg(T minus s minus(σ

22minus r)(T minus s) + log x|σ|

)and

h(x) = ψ

(log x|σ|

) x gt 0 or ψ(y) = h

(e|σ|y

) y isin R

Hence using the solution (628) and Relation (624) we get

f(tx) = eminus(Tminust)rg(T minus t minus(σ

22minus r)(T minus t) + log x|σ|

)= eminus(Tminust)r

winfinminusinfin

ψ

(minus(σ22minus r)(T minus t) + log x

|σ|+ z

)eminusz2(2(Tminust)) dzradic

2(T minus t)π

= eminus(Tminust)rwinfinminusinfin

h(x e|σ|zminus(σ22minusr)(Tminust)) eminusz2(2(Tminust)) dzradic

2(T minus t)π

= eminus(Tminust)rwinfinminusinfin

(x e|σ|zminus(σ22minusr)(Tminust) minusK

)+ eminusz2(2(Tminust)) dzradic2(T minus t)π

= eminus(Tminust)r

timeswinfin

(minusr+σ22)(Tminust)+log(Kx)|σ|

(x e|σ|zminus(σ22minusr)(Tminust) minusK

)eminusz2(2(Tminust)) dzradic

2(T minus t)π

= x eminus(Tminust)rwinfinminusdminus(Tminust)

radicTminust

e|σ|zminus(σ22minusr)(Tminust) eminusz2(2(Tminust)) dzradic2(T minus t)π

minusK eminus(Tminust)rwinfinminusdminus(Tminust)

radicTminust

eminusz2(2(Tminust)) dzradic2(T minus t)π

= xwinfinminusdminus(Tminust)

radicTminust

e|σ|zminus(Tminust)σ22minusz2(2(Tminust)) dzradic2(T minus t)π

minusK eminus(Tminust)rwinfinminusdminus(Tminust)

radicTminust

eminusz2(2(Tminust)) dzradic2(T minus t)π

= xwinfinminusdminus(Tminust)

radicTminust

eminus(zminus(Tminust)|σ|)2(2(Tminust)) dzradic2(T minus t)π

229

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

minusK eminus(Tminust)rwinfinminusdminus(Tminust)

radicTminust

eminusz2(2(Tminust)) dzradic2(T minus t)π

= xwinfinminusdminus(Tminust)

radicTminustminus(Tminust)|σ|

eminusz2(2(Tminust)) dzradic2(T minus t)π

minusK eminus(Tminust)rwinfinminusdminus(Tminust)

radicTminust

eminusz2(2(Tminust)) dzradic2(T minus t)π

= xwinfinminusdminus(Tminust)minus|σ|

radicTminust

eminusz22 dzradic2πminusK eminus(Tminust)r

winfinminusdminus(Tminust)

eminusz22 dzradic2π

= x(1minusΦ

(minus d+(T minus t)

))minusK eminus(Tminust)r

(1minusΦ

(minus dminus(T minus t)

))= xΦ

(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)

where we used the relation (614) ie

1minusΦ(a) = Φ(minusa) a isin R

Exercises

Exercise 61 Bachelier (1900) model Consider a market made of a risklessasset valued At = A0 with zero interest rate t isin R+ and a risky asset whoseprice St is modeled by a standard Brownian motion as St = Bt t isin R+

a) Show that the price g(tBt) of the option with payoff C = B2T satisfies

the heat equationpartϕ

partt(t y) = minus1

2part2ϕ

party2 (t y)

with terminal condition g(T x) = x2b) Find the function g(tx) by solving the PDE of Question (a)

Hint Try a solution of the form g(tx) = x2 + f(t)

See Exercises 611 713 and 714 for extensions to nonzero interest rates

Exercise 62 Consider a risky asset price (St)tisinR modeled in the Cox et al(1985) (CIR) model as

dSt = β(αminus St)dt+ σradicStdBt αβσ gt 0 (631)

and let (ηt ξt)tisinR+ be a portfolio strategy whose value Vt = ηtAt + ξtSttakes the form Vt = g(tSt) t isin R+ Figure 620 presents a random simula-tion of the solution to (631) with α = 0025 β = 1 and σ = 13230

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

0

1

2

3

4

5

6

7

8

0 01 02 03 04 05 06 07 08 09 1

St

t

Fig 620 Graph of the CIR short rate t 7rarr rt with α = 25 β = 1 and σ = 13

N=10000 t lt- 0(N-1) dt lt- 10Na=0025 b=2 sigma=0052 X lt- rnorm(Nmean=0sd=sqrt(dt))R lt- rep(0N)R[1]=001

for (j in 2N)R[j]=max(0R[j-1]+(a-bR[j-1])dt+sigmasqrt(R[j-1])X[j])4 plot(t R xlab = t ylab = type = l ylim = c(0002) col = blue)

Based on the self-financing condition written as

dVt = rVtdtminus rξtStdt+ ξtdSt

= rVtdtminus rξtStdt+ β(αminus St)ξtdt+ σξtradicStdBt t isin R+ (632)

derive the PDE satisfied by the function g(tx) using the Itocirc formula

Exercise 63 Black-Scholes PDE with dividends Consider a riskless as-set with price At = A0 ert t isin R+ and an underlying asset price process(St)tisinR+ modeled as

dSt = (microminus δ)Stdt+ σStdBt

where (Bt)tisinR+ is a standard Brownian motion and δ gt 0 is a continuous-time dividend rate By absence of arbitrage the payment of a dividend entailsa drop in the stock price by the same amount occuring generally on the ex-dividend date on which the purchase of the security no longer entitles theinvestor to the dividend amount The list of investors entitled to dividendpayment is consolidated on the date of record and payment is made on thepayable date

library(quantmod)2 getSymbols(0005HKfrom=2010-01-01to=SysDate()src=yahoo)

getDividends(0005HKfrom=2010-01-01to=SysDate()src=yahoo)

a) Assuming that the portfolio with value Vt = ξtSt + ηtAt at time t is self-financing and that dividends are continuously reinvested write down theportfolio variation dVt

231

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

b) Assuming that the portfolio value Vt takes the form Vt = g(tSt) at timet derive the Black-Scholes PDE for the function g(tx) with its terminalcondition

c) Compute the price at time t isin [0T ] of the European call option withstrike price K by solving the corresponding Black-Scholes PDE

d) Compute the Delta of the option

Exercise 64

a) Check that the Black-Scholes formula (610) for European call options

gc(tx) = xΦ(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)

satisfies the following boundary conditions

i) at x = 0 gc(t 0) = 0ii) at maturity t = T

gc(T x) = (xminusK)+ =

xminusK x gt K

0 x 6 K

iii) as time to maturity tends to infinity

limTrarrinfin

Bl(Kxσ rT minus t) = x t isin R+

b) Check that the Black-Scholes formula (618) for European put options

gp(tx) = K eminus(Tminust)rΦ(minus dminus(T minus t)

)minus xΦ

(minus d+(T minus t)

)satisfies the following boundary conditions

i) at x = 0 gp(t 0) = K eminus(Tminust)rii) as x tends to infinity gp(tinfin) = 0 for all t isin [0T )iii) at maturity t = T

gp(T x) = (K minus x)+ =

0 x gt K

K minus x x 6 K

iv) as time to maturity tends to infinity

limTrarrinfin

Blp(KStσ rT minus t) = 0 t isin R+

Exercise 65 Power option (Exercise 314 continued)

232

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

a) Solve the Black-Scholes PDE

rg(x t) = partg

partt(x t) + rx

partg

partx(x t) + σ2

2 x2 part2g

partx2 (x t) (633)

with terminal condition g(xT ) = x2 x gt 0 t isin [0T ]

Hint Try a solution of the form g(x t) = x2f(t) and find f(t)b) Find the respective quantities ξt and ηt of the risky asset St and riskless

asset At = ert in the portfolio with value

Vt = g(St t) = ξtSt + ηtAt 0 6 t 6 T

hedging the contract with payoff S2T at maturity

Exercise 66 On December 18 2007 a call warrant has been issued byFortis Bank on the stock price S of the MTR Corporation with maturityT = 23122008 strike price K = HK$ 3608 and entitlement ratio=10Recall that in the Black-Scholes model the price at time t of the Europeanclaim on the underlying asset priced St with strike price K maturity T interest rate r and volatility σ gt 0 is given by the Black-Scholes formula as

f(tSt) = StΦ(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)

wheredminus(T minus t) =

(rminus σ22)(T minus t) + log(StK)

|σ|radicT minus t

d+(T minus t) = dminus(T minus t) + |σ|radicT minus t = (r+ σ22)(T minus t) + log(StK)

|σ|radicT minus t

Recall that by Proposition 64 we have

partf

partx(tSt) = Φ

(d+(T minus t)

) 0 6 t 6 T

a) Using the values of the Gaussian cumulative distribution function com-pute the Black-Scholes price of the corresponding call option at timet =November 07 2008 with St = HK$ 17200 assuming a volatility σ =90 = 090 and an annual risk-free interest rate r = 4377 = 004377

b) Still using the Gaussian cumulative distribution function compute thequantity of the risky asset required in your portfolio at time t =November07 2008 in order to hedge one such option at maturity T = 23122008

c) Figure 1 represents the Black-Scholes price of the call option as a functionof σ isin [05 15] = [50 150]

233

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

0

01

02

03

04

05

06

05 06 07 08 09 1 11 12 13 14 15σimp

Optio

n pr

ice

σ

Market price

Fig 621 Option price as a function of the volatility σ gt 0

1 BSCall lt- function(S K r T sigma)d1 lt- (log(SK)+(r+sigma^22)T)(sigmasqrt(T))d2 lt- d1 - sigma sqrt(T)

3 BSCall = Spnorm(d1) - Kexp(-rT)pnorm(d2)BSCallsigma lt- seq(0515 length=100)

5 plot(sigmaBSCall(172360800437746365sigma) type=llty=1 xlab=Sigmaylab=Black-Scholes Call Price ylim = c(006)col=bluelwd=3)grid()

abline(h=023col=redlwd=3)

Knowing that the closing price of the warrant on November 07 2008 wasHK$ 0023 which value can you infer for the implied volatility σ at thisdatelowast

Exercise 67 Forward contracts Recall that the price πt(C) of a claimpayoff C = h(ST ) of maturity T can be written as πt(C) = g(tSt) wherethe function g(tx) satisfies the Black-Scholes PDE

rg(tx) = partg

partt(tx) + rx

partg

partx(tx) + 1

2σ2x2 part

2g

partx2 (tx)

g(T x) = h(x) (1)

with terminal condition g(T x) = h(x) x gt 0

a) Assume that C is a forward contract with payoff

C = ST minusK

at time T Find the function h(x) in (1)b) Find the solution g(tx) of the above PDE and compute the price πt(C)

at time t isin [0T ]Hint search for a solution of the form g(tx) = xminus α(t) where α(t) is afunction of t to be determined

lowast Download the corresponding or the that can be runhere

234

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

BS lt- function(S K T r sig)d1 lt- (log(SK) + (r + sig^22)T) (sigsqrt(T))d2 lt- d1 - sigsqrt(T)return(Spnorm(d1) - Kexp(-rT)pnorm(d2))impliedvol lt- function(S K T r market)sig lt- 020sigup lt- 1sigdown lt- 0001count lt- 0err lt- BS(S K T r sig) - marketwhile(abs(err) gt 000001 ampamp countlt1000)if(err lt 0)sigdown lt- sigsig lt- (sigup + sig)2elsesigup lt- sigsig lt- (sigdown + sig)2err lt- BS(S K T r sig) - marketcount lt- count + 1if(count==2000)return(NA)elsereturn(sig)market = 083K = 628T = 7 365S = 634r = 002impliedvol(S K T r market)

cells [ cell_type code execution_count null metadata outputs [] source [ from IPythoncoredisplay import display HTMLn display(HTML( )) ] cell_type code execution_count null metadata collapsed true outputs [] source [ import numpy as npn import scipystats as ssn import time n n Black and Scholesn def d1(S0 K r sigma T)n return (nplog(S0K) + (r + sigma2 2) T)(sigma npsqrt(T))n n def d2(S0 K r sigma T)n return (nplog(S0 K) + (r - sigma2 2) T) (sigma npsqrt(T))n n def BlackScholes(typeS0 K r sigma T)n if type==Cn return S0 ssnormcdf(d1(S0 K r sigma T)) - K npexp(-r T) ssnormcdf(d2(S0 K r sigma T))n elsen return K npexp(-r T) ssnormcdf(-d2(S0 K r sigma T)) - S0 ssnormcdf(-d1(S0 K r sigma T)) ] cell_type code execution_count null metadata outputs [] source [ BlackScholes(C1000 1200 002 015 10) ] cell_type code execution_count null metadata outputs [] source [ def difference(x p S K r t)n return BlackScholes(CS K r x t) - p ] cell_type code execution_count null metadata outputs [] source [ from scipyoptimize import bisectn bisect(difference00011args=(11541763731112766 1000 1200 002 10)) ] ] metadata anaconda-cloud kernelspec display_name Python 3 language python name python3 language_info codemirror_mode name ipython version 3 file_extension py mimetype textx-python name python nbconvert_exporter python pygments_lexer ipython3 version 375rc1 nbformat 4 nbformat_minor 1

Black-Scholes Pricing and Hedging

c) Compute the quantityξt =

partg

partx(tSt)

of risky assets in a self-financing portfolio hedging Cd) Repeat the above questions with the terminal condition g(T x) = x

Exercise 68a) Solve the Black-Scholes PDE

rg(tx) = partg

partt(tx) + rx

partg

partx(tx) + σ2

2 x2 part2g

partx2 (tx) (634)

with terminal condition g(T x) = 1 x gt 0

Hint Try a solution of the form g(tx) = f(t) and find f(t)

b) Find the respective quantities ξt and ηt of the risky asset St and risklessasset At = ert in the portfolio with value

Vt = g(tSt) = ξtSt + ηtAt

hedging the contract with payoff $1 at maturity

Exercise 69 Log-contracts see also Exercise 84a) Solve the PDE

0 =partg

partt(x t) + rx

partg

partx(x t) + σ2

2 x2 part2g

partx2 (x t)

with the terminal condition g(xT ) = log x x gt 0

Hint Try a solution of the form g(x t) = f(t) + log x and find f(t)b) Solve the Black-Scholes PDE

rh(x t) = parth

partt(x t) + rx

parth

partx(x t) + σ2

2 x2 part2h

partx2 (x t) (635)

with the terminal condition h(xT ) = log x x gt 0

Hint Try a solution of the form h(x t) = u(t)g(x t) and find u(t)c) Find the respective quantities ξt and ηt of the risky asset St and riskless

asset At = ert in the portfolio with value

Vt = g(St t) = ξtSt + ηtAt

hedging a log-contract with payoff logST at maturity 235

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

Exercise 610 Binary options Consider a price process (St)tisinR+ given by

dStSt

= rdt+ σdBt S0 = 1

under the risk-neutral probability measure Plowast The binary (or digital) calloption is a contract with maturity T strike price K and payoff

Cd = 1[Kinfin)(ST ) =

$1 if ST gt K

0 if ST lt K

a) Derive the Black-Schole PDE satisfied by the pricing function Cd(tSt) ofthe binary call option together with its terminal condition

b) Show that the solution Cd(tx) of the Black-Scholes PDE of Question (a)is given by

Cd(tx) = eminus(Tminust)rΦ((rminus σ22)(T minus t) + log(xK)

|σ|radicT minus t

)= eminus(Tminust)rΦ

(dminus(T minus t)

)

where

dminus(T minus t) =(rminus σ22)(T minus t) + log(StK)

|σ|radicT minus t

0 6 t lt T

Exercise 611

a) Bachelier (1900) model Solve the stochastic differential equation

dSt = αStdt+ σdBt (636)

in terms of ασ isin R and the initial condition S0b) Write down the Bachelier PDE satisfied by the function C(tx) where

C(tSt) is the price at time t isin [0T ] of the contingent claim with payoffφ(ST ) = exp(ST ) and identify the process Delta (ξt)tisin[0T ] that hedgesthis claim

c) Solve the Black-Scholes PDE of Question (b) with the terminal conditionφ(x) = ex x isin R

Hint Search for a solution of the form

C(tx) = exp(minus(T minus t)r+ xh(t) +

σ2

4r (h2(t)minus 1)

) (637)

where h(t) is a function to be determined with h(T ) = 1

236

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

d) Compute the portfolio strategy (ξt ηt)tisin[0T ] that hedges the contingentclaim with payoff exp(ST )

Exercise 612

a) Show that for every fixed value of S the function

d 7minusrarr h(S d) = SΦ(d+ |σ|

radicT)minusK eminusrTΦ(d)

reaches its maximum at dlowast(S) =log(SK) + (rminus σ22)T

|σ|radicT

b) By the differentiation rule

d

dSh(S dlowast(S)) =

parth

partS(S dlowast(S)) + dprimelowast(S)

parth

partd(S dlowast(S))

recover the value of the Black-Scholes Delta

Exercise 613 Compute the Black-Scholes Vega by differentiation of theBlack-Scholes function

gc(tx) = Bl(Kxσ rT minus t) = xΦ(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)

with respect to the volatility parameter σ knowing that

minus12(dminus(T minus t)

)2= minus1

2

(log(xK) + (rminus σ22)(T minus t)

|σ|radicT minus t

)2

= minus12(d+(T minus t)

)2+ (T minus t)r+ log x

K (638)

Exercise 614 Consider the backward induction relation (313) ie

v(tx) = (1minus plowastN )v (t+ 1x(1 + aN )) + plowastN v (t+ 1x(1 + bN ))

using the renormalizations rN = rTN and

aN = (1 + rN )(1minus |σ|radicTN)minus 1 bN = (1 + rN )(1 + |σ|

radicTN)minus 1

of Section 36 N gt 1 with

plowastN =rN minus aNbN minus aN

and plowastN =bN minus rNbN minus aN

a) Show that the Black-Scholes PDE (62) of Proposition 61 can be recoveredfrom the induction relation (313) when the number N of time steps tendsto infinity

237

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

b) Show that the expression of the Delta ξt =partgcpartx

(tSt) can be similarlyrecovered from the finite difference relation (319) ie

ξ(1)t (Stminus1) =

v (t (1 + bN )Stminus1)minus v (t (1 + aN )Stminus1)

Stminus1(bN minus aN )

as N tends to infinity

Problem 615 (Leung and Sircar (2015)) ProShares Ultra SampP500 andProShares UltraShort SampP500 are leveraged investment funds that seek dailyinvestment results before fees and expenses that correspond to β times (βx)the daily performance of the SampP500reg with respectively β = 2 for ProSharesUltra and β = minus2 for ProShares UltraShort Here leveraging with a factorβ 1 aims at multiplying the potential return of an investment by a factorβ The following 10 questions are interdependent and should be treated insequence

a) Consider a risky asset priced S0 = $4 at time t = 0 and taking twopossible values S1 = $5 and S1 = $2 at time t = 1 Compute the twopossible returns (in ) achieved when investing $4 in one share of the assetS and the expected return under the risk-neutral probability measureassuming that the risk-free interest rate is zero

b) Leveraging Still based on an initial $4 investment we decide to leverageby a factor β = 3 by borrowing another (β minus 1) times $4 = 2times $4 at ratezero to purchase a total of β = 3 shares of the asset S Compute thetwo returns (in ) possibly achieved in this case and the expected returnunder the risk-neutral probability measure assuming that the risk-freeinterest rate is zero

c) Denoting by Ft the ProShares value at time t how much should the fundinvest in the underlying asset priced St and how much $ should it borrowor save on the risk-free market at any time t in order to leverage with afactor β 1

d) Find the portfolio allocation (ξt ηt) for the fund value

Ft = ξtSt + ηtAt t isin R+

according to Question (c) where At = A0 ert is the riskless money marketaccount

e) We choose to model the SampP500 index St as the geometric Brownianmotion

dSt = rStdt+ σStdBt t isin R+

under the risk-neutral probability measure Plowast Find the stochastic dif-ferential equation satisfied by (Ft)tisinR+ under the self-financing conditiondFt = ξtdSt + ηtdAt

238

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

f) Is the discounted fund value ( eminusrtFt)tisinR+ a martingale under the risk-neutral probability measure Plowast

g) Find the relation between the fund value Ft and the index St by solvingthe stochastic differential equation obtained for Ft in Question (e) Forsimplicity we normalize F0 = Sβ0

h) Write the price at time t = 0 of the call option with payoff (FT minusK)+ onthe ProShares index using the Black-Scholes formula

i) Show that when β gt 0 the Delta at time t isin [0T ) of the call optionwith payoff (FT minusK)+ on ProShares Ultra is equal to the Delta of thecall option with payoff (ST minusKβ(t))

+ on the SampP500 for a certain strikeprice Kβ(t) to be determined explicitly

j) When β lt 0 find the relation between the Delta at time t isin [0T ) ofthe call option with payoff (FT minusK)+ on ProShares UltraShort and theDelta of the put option with payoff (Kβ(t)minus ST )+ on the SampP500

239

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

  1. pbsARFix223
  2. pbsARFix224
  3. pbsARFix225
  4. pbsARFix226
  5. pbsARFix227
  6. pbsARFix228
  7. pbsARFix229
  8. pbsARFix230
  9. fdrm1
  10. pbsARFix231
  11. 100
  12. 101
  13. 102
  14. 103
  15. 104
  16. 105
  17. 106
  18. 107
  19. 108
  20. 109
  21. 1010
  22. 1011
  23. 1012
  24. 1013
  25. 1014
  26. 1015
  27. 1016
  28. 1017
  29. 1018
  30. 1019
  31. anm10
  32. 10EndLeft
  33. 10StepLeft
  34. 10PauseLeft
  35. 10PlayLeft
  36. 10PlayPauseLeft
  37. 10PauseRight
  38. 10PlayRight
  39. 10PlayPauseRight
  40. 10StepRight
  41. 10EndRight
  42. 10Minus
  43. 10Reset
  44. 10Plus
  45. pbsARFix232
  46. pbsARFix233
  47. pbsARFix234
  48. pbsARFix235
  49. pbsARFix236
  50. pbsARFix237
  51. fdrm2
  52. 110
  53. 111
  54. 112
  55. 113
  56. 114
  57. 115
  58. 116
  59. 117
  60. 118
  61. 119
  62. 1110
  63. 1111
  64. 1112
  65. 1113
  66. 1114
  67. 1115
  68. 1116
  69. 1117
  70. 1118
  71. 1119
  72. anm11
  73. 11EndLeft
  74. 11StepLeft
  75. 11PauseLeft
  76. 11PlayLeft
  77. 11PlayPauseLeft
  78. 11PauseRight
  79. 11PlayRight
  80. 11PlayPauseRight
  81. 11StepRight
  82. 11EndRight
  83. 11Minus
  84. 11Reset
  85. 11Plus
  86. pbsARFix238
  87. pbsARFix239
  88. pbsARFix240
  89. pbsARFix241
  90. pbsARFix242
  91. 120
  92. 121
  93. 122
  94. 123
  95. 124
  96. 125
  97. 126
  98. 127
  99. 128
  100. 129
  101. 1210
  102. anm12
  103. 12EndLeft
  104. 12StepLeft
  105. 12PauseLeft
  106. 12PlayLeft
  107. 12PlayPauseLeft
  108. 12PauseRight
  109. 12PlayRight
  110. 12PlayPauseRight
  111. 12StepRight
  112. 12EndRight
  113. 12Minus
  114. 12Reset
  115. 12Plus
  116. 130
  117. 131
  118. 132
  119. 133
  120. 134
  121. 135
  122. 136
  123. 137
  124. 138
  125. 139
  126. 1310
  127. anm13
  128. 13EndLeft
  129. 13StepLeft
  130. 13PauseLeft
  131. 13PlayLeft
  132. 13PlayPauseLeft
  133. 13PauseRight
  134. 13PlayRight
  135. 13PlayPauseRight
  136. 13StepRight
  137. 13EndRight
  138. 13Minus
  139. 13Reset
  140. 13Plus
  141. pbsARFix243
  142. pbsARFix244
  143. pbsARFix245
  144. pbsARFix246
  145. 140
  146. 141
  147. 142
  148. 143
  149. 144
  150. 145
  151. 146
  152. 147
  153. 148
  154. 149
  155. 1410
  156. 1411
  157. 1412
  158. 1413
  159. 1414
  160. 1415
  161. 1416
  162. 1417
  163. 1418
  164. 1419
  165. 1420
  166. 1421
  167. 1422
  168. 1423
  169. 1424
  170. 1425
  171. 1426
  172. 1427
  173. 1428
  174. 1429
  175. 1430
  176. 1431
  177. 1432
  178. 1433
  179. 1434
  180. 1435
  181. 1436
  182. 1437
  183. 1438
  184. 1439
  185. 1440
  186. 1441
  187. 1442
  188. 1443
  189. 1444
  190. 1445
  191. 1446
  192. 1447
  193. 1448
  194. 1449
  195. 1450
  196. 1451
  197. 1452
  198. 1453
  199. 1454
  200. 1455
  201. 1456
  202. 1457
  203. 1458
  204. 1459
  205. 1460
  206. 1461
  207. 1462
  208. 1463
  209. 1464
  210. 1465
  211. 1466
  212. 1467
  213. 1468
  214. 1469
  215. 1470
  216. 1471
  217. 1472
  218. 1473
  219. 1474
  220. 1475
  221. 1476
  222. 1477
  223. 1478
  224. 1479
  225. 1480
  226. 1481
  227. 1482
  228. 1483
  229. 1484
  230. 1485
  231. 1486
  232. 1487
  233. 1488
  234. 1489
  235. 1490
  236. 1491
  237. 1492
  238. 1493
  239. 1494
  240. 1495
  241. 1496
  242. 1497
  243. 1498
  244. 1499
  245. 14100
  246. 14101
  247. 14102
  248. 14103
  249. 14104
  250. 14105
  251. 14106
  252. 14107
  253. 14108
  254. 14109
  255. 14110
  256. 14111
  257. 14112
  258. 14113
  259. 14114
  260. 14115
  261. 14116
  262. 14117
  263. 14118
  264. 14119
  265. 14120
  266. 14121
  267. 14122
  268. 14123
  269. 14124
  270. 14125
  271. 14126
  272. 14127
  273. 14128
  274. 14129
  275. 14130
  276. 14131
  277. 14132
  278. 14133
  279. 14134
  280. 14135
  281. 14136
  282. 14137
  283. 14138
  284. 14139
  285. 14140
  286. 14141
  287. 14142
  288. 14143
  289. 14144
  290. 14145
  291. 14146
  292. 14147
  293. 14148
  294. 14149
  295. 14150
  296. 14151
  297. 14152
  298. 14153
  299. 14154
  300. 14155
  301. 14156
  302. 14157
  303. 14158
  304. 14159
  305. 14160
  306. 14161
  307. 14162
  308. 14163
  309. 14164
  310. 14165
  311. 14166
  312. 14167
  313. 14168
  314. 14169
  315. 14170
  316. 14171
  317. 14172
  318. 14173
  319. 14174
  320. 14175
  321. 14176
  322. 14177
  323. 14178
  324. 14179
  325. 14180
  326. 14181
  327. 14182
  328. 14183
  329. 14184
  330. 14185
  331. 14186
  332. 14187
  333. 14188
  334. 14189
  335. 14190
  336. 14191
  337. 14192
  338. 14193
  339. 14194
  340. 14195
  341. 14196
  342. 14197
  343. anm14
  344. 14EndLeft
  345. 14StepLeft
  346. 14PauseLeft
  347. 14PlayLeft
  348. 14PlayPauseLeft
  349. 14PauseRight
  350. 14PlayRight
  351. 14PlayPauseRight
  352. 14StepRight
  353. 14EndRight
  354. 14Minus
  355. 14Reset
  356. 14Plus
  357. pbsARFix247
  358. pbsARFix248
  359. 150
  360. 151
  361. 152
  362. 153
  363. 154
  364. 155
  365. 156
  366. 157
  367. 158
  368. 159
  369. 1510
  370. 1511
  371. 1512
  372. 1513
  373. 1514
  374. 1515
  375. 1516
  376. 1517
  377. 1518
  378. 1519
  379. anm15
  380. 15EndLeft
  381. 15StepLeft
  382. 15PauseLeft
  383. 15PlayLeft
  384. 15PlayPauseLeft
  385. 15PauseRight
  386. 15PlayRight
  387. 15PlayPauseRight
  388. 15StepRight
  389. 15EndRight
  390. 15Minus
  391. 15Reset
  392. 15Plus
  393. pbsARFix249
  394. pbsARFix250
  395. pbsARFix251
  396. pbsARFix252
  397. pbsARFix253
  398. pbsARFix254
  399. pbsARFix255
  400. pbsARFix256
  401. pbsARFix257
  402. pbsARFix258
  403. pbsARFix259
  404. pbsARFix260
  405. pbsARFix261
Page 10: Black-ScholesPricingandHedging - NTU · to the Black-Scholes PDE (6.2) in order to price a claim payoff Cof the formC= h(S T).Asinthediscrete-timecase,thearbitragepriceπt(C) at

N Privault

=K

xeminus(Tminust)rϕ(dminus(T minus t))

hence by (610) we have

partgcpartx

(tx) = part

partx

(xΦ(

log(xK) + (r+ σ22)(T minus t)|σ|radicT minus t

))(616)

minusK eminus(Tminust)r partpartx

(Φ(

log(xK) + (rminus σ22)(T minus t)|σ|radicT minus t

))= Φ

(log(xK) + (r+ σ22)(T minus t)

|σ|radicT minus t

)+x

part

partxΦ(

log(xK) + (r+ σ22)(T minus t)|σ|radicT minus t

)minusK eminus(Tminust)r part

partxΦ(

log(xK) + (rminus σ22)(T minus t)|σ|radicT minus t

)= Φ

(log(xK) + (r+ σ22)(T minus t)

|σ|radicT minus t

)+

x

|σ|radicT minus t

ϕ

(log(xK) + (r+ σ22)(T minus t)

|σ|radicT minus t

)minusK eminus(Tminust)r

|σ|radicT minus t

ϕ

(log(xK) + (rminus σ22)(T minus t)

|σ|radicT minus t

)= Φ(d+(T minus t)) +

x

|σ|radicT minus t

ϕ(d+(T minus t))minusK eminus(Tminust)r

|σ|radicT minus t

ϕ(dminus(T minus t))

= Φ(d+(T minus t))

As a consequence of Proposition 64 the Black-Scholes call price splits into arisky component StΦ

(d+(T minus t)

)and a riskless componentminusK eminus(Tminust)rΦ

(dminus(T minus

t)) as follows

gc(tSt) = StΦ(d+(T minus t)

)︸ ︷︷ ︸risky investment (held)

minus K eminus(Tminust)rΦ(dminus(T minus t)

)︸ ︷︷ ︸

riskminusfree investment (borrowed)

0 6 t 6 T

See Exercise 64 for a computation of the boundary values of gc(tx) t isin[0T ) x gt 0 The following R script is an implementation of the Black-ScholesDelta for European call options in R

1 Delta lt- function(S K r T sigma)d1 lt- (log(SK)+(r+sigma^22)T)(sigmasqrt(T))

3 Delta = pnorm(d1)Delta

210

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

In Figure 66 we plot the Delta of the European call option as a function ofthe underlying asset price and of the time remaining until maturity

Payoff function (x-K)+

0

50

100

150

200

Underlying

0

5

10

15

Time to maturity T-t

0

025

05

075

1

Fig 66 Delta of a European call option with strike price K = 100 r = 3 σ = 10

The Gamma of the European call option is defined as the first derivative ofDelta or second derivative of the option price with respect to the underlyingasset price This gives

γt =1

St|σ|radicT minus t

Φprime(d+(T minus t)

)=

1St|σ|

radic2(T minus t)π

exp(minus1

2

(log(StK) + (r+ σ22)(T minus t)

|σ|radicT minus t

)2)gt 0

In particular a positive value of γt implies that the Delta ξt = ξt(St) shouldincrease when the underlying asset price St increases In other words the po-sition ξt in the underlying asset should be increased by additional purchasesif the underlying asset price St increases

In Figure 67 we plot the (truncated) value of the Gamma of a European calloption as a function of the underlying asset price and of time to maturity

211

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

Fig 67 Gamma of a European call option with strike price K = 100

As Gamma is always nonnegative the Black-Scholes hedging strategy is tokeep buying the risky underlying asset when its price increases and to sell itwhen its price decreases as can be checked from Figure 67

Numerical example - hedging of a call option

In Figure 68 we consider the historical stock price of HSBC Holdings(0005HK) over one year

Fig 68 Graph of the stock price of HSBC Holdings

Consider the call option issued by Societe Generale on 31 December 2008 withstrike price K=$63704 maturity T = October 05 2009 and an entitlementratio of 100 meaning that one option contract is divided into 100 warrants cfpage 9 The next graph gives the time evolution of the Black-Scholes portfoliovalue

t 7minusrarr gc(tSt)

driven by the market price t 7minusrarr St of the risky underlying asset as given inFigure 68 in which the number of days is counted from the origin and notfrom maturity

212

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

40 50 60 70 80 90 0 50 100 150 200

0

5

10

15

20

25

30

35

40

Underlying (HK$) Time in days

Fig 69 Path of the Black-Scholes price for a call option on HSBC

As a consequence of Proposition 64 in the Black-Scholes call option hedgingmodel the amount invested in the risky asset is

Stξt = StΦ(d+(T minus t)

)= StΦ

(log(StK) + (r+ σ22)(T minus t)

|σ|radicT minus t

)gt 0

which is always nonnegative ie there is no short selling and the amountinvested on the riskless asset is

ηtAt = minusK eminus(Tminust)rΦ(dminus(T minus t)

)= minusK eminus(Tminust)rΦ

(log(StK) + (rminus σ22)(T minus t)

|σ|radicT minus t

)6 0

which is always nonpositive ie we are constantly borrowing money on theriskless asset as noted in Figure 610

-60

-40

-20

0

20

40

60

80

100

0 50 100 150 200

K

HK$

Black-Scholes priceRisky investment ξtSt

Riskless investment ηtAtUnderlying asset price

Fig 610 Time evolution of a hedging portfolio for a call option on HSBC

213

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

A comparison of Figure 610 with market data can be found in Figures 911and 912 below

Cash settlement In the case of a cash settlement the option issuer will sat-isfy the option contract by selling ξT = 1 stock at the price ST = $83refund the K = $63 risk-free investment and hand in the remaining amountC = (ST minusK)+ = 83minus 63 = $20 to the option holder

Physical delivery In the case of physical delivery of the underlying asset theoption issuer will deliver ξT = 1 stock to the option holder in exchange forK = $63 which will be used together with the portfolio value to refund therisk-free loan

63 European Put Options

Similarly in the case of the European put option with strike price K thepayoff function is given by h(x) = (Kminusx)+ and the Black-Scholes PDE (67)reads

rgp(tx) =partgppartt

(tx) + rxpartgppartx

(tx) + 12σ

2x2 part2gppartx2 (tx)

gp(T x) = (K minus x)+(617)

The next proposition can be proved as in Sections 65 and 66 see Proposi-tion 611

Proposition 65 The solution of the PDE (617) is given by the Black-Scholes formula for put options

gp(tx) = K eminus(Tminust)rΦ(minus dminus(T minus t)

)minus xΦ

(minus d+(T minus t)

) (618)

withd+(T minus t) =

log(xK) + (r+ σ22)(T minus t)|σ|radicT minus t

(619)

dminus(T minus t) =log(xK) + (rminus σ22)(T minus t)

|σ|radicT minus t

(620)

as illustrated in Figure 611

214

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

Fig 611 Graph of the Black-Scholes put price function with strike price K = 100lowast

In other words the European put option with strike price K and maturityT is priced at time t isin [0T ] as

gp(tSt) = K eminus(Tminust)rΦ(minus dminus(T minus t)

)minus StΦ

(minus d+(T minus t)

) 0 6 t 6 T

Fig 612 Time-dependent solution of the Black-Scholes PDE (put option)dagger

The following R script is an implementation of the Black-Scholes formula forEuropean put options in R

1 BSPut lt- function(S K r T sigma)d1 = (log(SK)+(r+sigma^22)T)(sigmasqrt(T))

3 d2 = d1 - sigma sqrt(T)BSPut = Kexp(-rT) pnorm(-d2) - Spnorm(-d1)

5 BSPut

Call-put parity

lowast Right-click on the figure for interaction and ldquoFull Screen Multimediardquo viewdagger The animation works in Acrobat Reader on the entire pdf file

215

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

(C) 2012--today Alexander Grahn 3Dmenujs version 20140923 3D JavaScript used by media9sty Extended functionality of the (right click) context menu of 3D annotations 1) Adds the following items to the 3D context menu `Generate Default View Finds good default camera settings returned as options for use with the includemedia command `Get Current View Determines camera cross section and part settings of the current view returned as `VIEW section that can be copied into a views file of additional views The views file is inserted using the `3Dviews option of includemedia `Cross Section Toggle switch to add or remove a cross section into or from the current view The cross section can be moved in the x y z directions using x y z and X Y Z keys on the keyboard be tilted against and spun around the upright Z axis using the UpDown and LeftRight arrow keys and caled using the s and S keys 2) Enables manipulation of position and orientation of indiviual parts and groups of parts in the 3D scene Parts which have been selected with the mouse can be scaled moved around and rotated like the cross section as described above To spin the parts around their local up-axis keep Control key pressed while using the UpDown and LeftRight arrow keys This work may be distributed andor modified under the conditions of the LaTeX Project Public License The latest version of this license is in httpmirrorsctanorgmacroslatexbaselppltxt This work has the LPPL maintenance status `maintained The Current Maintainer of this work is A Grahn The code borrows heavily from Bernd Gaertners `Miniball software originally written in C++ for computing the smallest enclosing ball of a set of points see httpwwwinfethzchpersonalgaertnerminiballhtmlhostconsoleshow()constructor for doubly linked listfunction List() thisfirst_node=null thislast_node=new Node(undefined)Listprototypepush_back=function(x) var new_node=new Node(x) if(thisfirst_node==null) thisfirst_node=new_node new_nodeprev=null else new_nodeprev=thislast_nodeprev new_nodeprevnext=new_node new_nodenext=thislast_node thislast_nodeprev=new_nodeListprototypemove_to_front=function(it) var node=itget() if(nodenext=null ampamp nodeprev=null) nodenextprev=nodeprev nodeprevnext=nodenext nodeprev=null nodenext=thisfirst_node thisfirst_nodeprev=node thisfirst_node=node Listprototypebegin=function() var i=new Iterator() itarget=thisfirst_node return(i)Listprototypeend=function() var i=new Iterator() itarget=thislast_node return(i)function Iterator(it) if( it=undefined ) thistarget=ittarget else thistarget=null Iteratorprototypeset=function(it)thistarget=ittargetIteratorprototypeget=function()return(thistarget)Iteratorprototypederef=function()return(thistargetdata)Iteratorprototypeincr=function() if(thistargetnext=null) thistarget=thistargetnextconstructor for node objects that populate the linked listfunction Node(x) thisprev=null thisnext=null thisdata=xfunction sqr(r)return(rr)helper functionMiniball algorithm by B Gaertnerfunction Basis() thism=0 thisq0=new Array(3) thisz=new Array(4) thisf=new Array(4) thisv=new Array(new Array(3) new Array(3) new Array(3) new Array(3)) thisa=new Array(new Array(3) new Array(3) new Array(3) new Array(3)) thisc=new Array(new Array(3) new Array(3) new Array(3) new Array(3)) thissqr_r=new Array(4) thiscurrent_c=thisc[0] thiscurrent_sqr_r=0 thisreset()Basisprototypecenter=function()return(thiscurrent_c)Basisprototypesize=function()return(thism)Basisprototypepop=function()--thismBasisprototypeexcess=function(p) var e=-thiscurrent_sqr_r for(var k=0klt3++k) e+=sqr(p[k]-thiscurrent_c[k]) return(e)Basisprototypereset=function() thism=0 for(var j=0jlt3++j) thisc[0][j]=0 thiscurrent_c=thisc[0] thiscurrent_sqr_r=-1Basisprototypepush=function(p) var i j var eps=1e-32 if(thism==0) for(i=0ilt3++i) thisq0[i]=p[i] for(i=0ilt3++i) thisc[0][i]=thisq0[i] thissqr_r[0]=0 else for(i=0ilt3++i) thisv[thism][i]=p[i]-thisq0[i] for(i=1iltthism++i) thisa[thism][i]=0 for(j=0jlt3++j) thisa[thism][i]+=thisv[i][j]thisv[thism][j] thisa[thism][i]=(2thisz[i]) for(i=1iltthism++i) for(j=0jlt3++j) thisv[thism][j]-=thisa[thism][i]thisv[i][j] thisz[thism]=0 for(j=0jlt3++j) thisz[thism]+=sqr(thisv[thism][j]) thisz[thism]=2 if(thisz[thism]ltepsthiscurrent_sqr_r) return(false) var e=-thissqr_r[thism-1] for(i=0ilt3++i) e+=sqr(p[i]-thisc[thism-1][i]) thisf[thism]=ethisz[thism] for(i=0ilt3++i) thisc[thism][i]=thisc[thism-1][i]+thisf[thism]thisv[thism][i] thissqr_r[thism]=thissqr_r[thism-1]+ethisf[thism]2 thiscurrent_c=thisc[thism] thiscurrent_sqr_r=thissqr_r[thism] ++thism return(true)function Miniball() thisL=new List() thisB=new Basis() thissupport_end=new Iterator()Miniballprototypemtf_mb=function(it) var i=new Iterator(it) thissupport_endset(thisLbegin()) if((thisBsize())==4) return for(var k=new Iterator(thisLbegin())kget()=iget()) var j=new Iterator(k) kincr() if(thisBexcess(jderef()) gt 0) if(thisBpush(jderef())) thismtf_mb(j) thisBpop() if(thissupport_endget()==jget()) thissupport_endincr() thisLmove_to_front(j) Miniballprototypecheck_in=function(b) thisLpush_back(b)Miniballprototypebuild=function() thisBreset() thissupport_endset(thisLbegin()) thismtf_mb(thisLend())Miniballprototypecenter=function() return(thisBcenter())Miniballprototyperadius=function() return(Mathsqrt(thisBcurrent_sqr_r))functions called by menu itemsfunction calc3Dopts () create Miniball object var mb=new Miniball() auxiliary vector var corner=new Vector3() iterate over all visible mesh nodes in the scene for(i=0iltscenemeshescounti++) var mesh=scenemeshesgetByIndex(i) if(meshvisible) continue local to parent transformation matrix var trans=meshtransform build local to world transformation matrix by recursively multiplying the parents transf matrix on the right var parent=meshparent while(parenttransform) trans=transmultiply(parenttransform) parent=parentparent get the bbox of the mesh (local coordinates) var bbox=meshcomputeBoundingBox() transform the local bounding box corner coordinates to world coordinates for bounding sphere determination BBoxmin cornerset(bboxmin) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) BBoxmax cornerset(bboxmax) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) remaining six BBox corners cornerset(bboxminx bboxmaxy bboxmaxz) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) cornerset(bboxminx bboxminy bboxmaxz) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) cornerset(bboxminx bboxmaxy bboxminz) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) cornerset(bboxmaxx bboxminy bboxminz) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) cornerset(bboxmaxx bboxminy bboxmaxz) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) cornerset(bboxmaxx bboxmaxy bboxminz) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) compute the smallest enclosing bounding sphere mbbuild() current camera settings var camera=scenecamerasgetByIndex(0) var res= initialize result string aperture angle of the virtual camera (perspective projection) or orthographic scale (orthographic projection) if(cameraprojectionType==cameraTYPE_PERSPECTIVE) var aac=camerafov180MathPI if(hostutilprintf(4f aac)=30) res+=hostutilprintf(n3Daac=s aac) else cameraviewPlaneSize=2mbradius() res+=hostutilprintf(n3Dortho=s 1cameraviewPlaneSize) camera roll var roll = cameraroll180MathPI if(hostutilprintf(4f roll)=0) res+=hostutilprintf(n3Droll=sroll) target to camera vector var c2c=new Vector3() c2cset(cameraposition) c2csubtractInPlace(cameratargetPosition) c2cnormalize() if((c2cx==0 ampamp c2cy==-1 ampamp c2cz==0)) res+=hostutilprintf(n3Dc2c=s s s c2cx c2cy c2cz) new camera settings bounding sphere centre --gt new camera target var coo=new Vector3() cooset((mbcenter())[0] (mbcenter())[1] (mbcenter())[2]) if(coolength) res+=hostutilprintf(n3Dcoo=s s s coox cooy cooz) radius of orbit if(cameraprojectionType==cameraTYPE_PERSPECTIVE) var roo=mbradius() Mathsin(aac MathPI 360) else orthographic projection var roo=mbradius() res+=hostutilprintf(n3Droo=s roo) update camera settings in the viewer var currol=cameraroll cameratargetPositionset(coo) camerapositionset(cooadd(c2cscale(roo))) cameraroll=currol determine background colour rgb=scenebackgroundgetColor() if((rgbr==1 ampamp rgbg==1 ampamp rgbb==1)) res+=hostutilprintf(n3Dbg=s s s rgbr rgbg rgbb) determine lighting scheme switch(scenelightScheme) case sceneLIGHT_MODE_FILE curlights=Artworkbreak case sceneLIGHT_MODE_NONE curlights=Nonebreak case sceneLIGHT_MODE_WHITE curlights=Whitebreak case sceneLIGHT_MODE_DAY curlights=Daybreak case sceneLIGHT_MODE_NIGHT curlights=Nightbreak case sceneLIGHT_MODE_BRIGHT curlights=Hardbreak case sceneLIGHT_MODE_RGB curlights=Primarybreak case sceneLIGHT_MODE_BLUE curlights=Bluebreak case sceneLIGHT_MODE_RED curlights=Redbreak case sceneLIGHT_MODE_CUBE curlights=Cubebreak case sceneLIGHT_MODE_CAD curlights=CADbreak case sceneLIGHT_MODE_HEADLAMP curlights=Headlampbreak if(curlights=Artwork) res+=hostutilprintf(n3Dlights=s curlights) determine global render mode switch(scenerenderMode) case sceneRENDER_MODE_BOUNDING_BOX currender=BoundingBoxbreak case sceneRENDER_MODE_TRANSPARENT_BOUNDING_BOX currender=TransparentBoundingBoxbreak case sceneRENDER_MODE_TRANSPARENT_BOUNDING_BOX_OUTLINE currender=TransparentBoundingBoxOutlinebreak case sceneRENDER_MODE_VERTICES currender=Verticesbreak case sceneRENDER_MODE_SHADED_VERTICES currender=ShadedVerticesbreak case sceneRENDER_MODE_WIREFRAME currender=Wireframebreak case sceneRENDER_MODE_SHADED_WIREFRAME currender=ShadedWireframebreak case sceneRENDER_MODE_SOLID currender=Solidbreak case sceneRENDER_MODE_TRANSPARENT currender=Transparentbreak case sceneRENDER_MODE_SOLID_WIREFRAME currender=SolidWireframebreak case sceneRENDER_MODE_TRANSPARENT_WIREFRAME currender=TransparentWireframebreak case sceneRENDER_MODE_ILLUSTRATION currender=Illustrationbreak case sceneRENDER_MODE_SOLID_OUTLINE currender=SolidOutlinebreak case sceneRENDER_MODE_SHADED_ILLUSTRATION currender=ShadedIllustrationbreak case sceneRENDER_MODE_HIDDEN_WIREFRAME currender=HiddenWireframebreak if(currender=Solid) res+=hostutilprintf(n3Drender=s currender) write result string to the console hostconsoleshow() hostconsoleclear() hostconsoleprintln(n Copy and paste the following text to then+ option list of includemedian + res + n)function get3Dview () var camera=scenecamerasgetByIndex(0) var coo=cameratargetPosition var c2c=camerapositionsubtract(coo) var roo=c2clength c2cnormalize() var res=VIEW=insert optional name heren if((coox==0 ampamp cooy==0 ampamp cooz==0)) res+=hostutilprintf( COO=s s sn coox cooy cooz) if((c2cx==0 ampamp c2cy==-1 ampamp c2cz==0)) res+=hostutilprintf( C2C=s s sn c2cx c2cy c2cz) if(roo gt 1e-9) res+=hostutilprintf( ROO=sn roo) var roll = cameraroll180MathPI if(hostutilprintf(4f roll)=0) res+=hostutilprintf( ROLL=sn roll) if(cameraprojectionType==cameraTYPE_PERSPECTIVE) var aac=camerafov 180MathPI if(hostutilprintf(4f aac)=30) res+=hostutilprintf( AAC=sn aac) else if(hostutilprintf(4f cameraviewPlaneSize)=1) res+=hostutilprintf( ORTHO=sn 1cameraviewPlaneSize) rgb=scenebackgroundgetColor() if((rgbr==1 ampamp rgbg==1 ampamp rgbb==1)) res+=hostutilprintf( BGCOLOR=s s sn rgbr rgbg rgbb) switch(scenelightScheme) case sceneLIGHT_MODE_FILE curlights=Artworkbreak case sceneLIGHT_MODE_NONE curlights=Nonebreak case sceneLIGHT_MODE_WHITE curlights=Whitebreak case sceneLIGHT_MODE_DAY curlights=Daybreak case sceneLIGHT_MODE_NIGHT curlights=Nightbreak case sceneLIGHT_MODE_BRIGHT curlights=Hardbreak case sceneLIGHT_MODE_RGB curlights=Primarybreak case sceneLIGHT_MODE_BLUE curlights=Bluebreak case sceneLIGHT_MODE_RED curlights=Redbreak case sceneLIGHT_MODE_CUBE curlights=Cubebreak case sceneLIGHT_MODE_CAD curlights=CADbreak case sceneLIGHT_MODE_HEADLAMP curlights=Headlampbreak if(curlights=Artwork) res+= LIGHTS=+curlights+n switch(scenerenderMode) case sceneRENDER_MODE_BOUNDING_BOX defaultrender=BoundingBoxbreak case sceneRENDER_MODE_TRANSPARENT_BOUNDING_BOX defaultrender=TransparentBoundingBoxbreak case sceneRENDER_MODE_TRANSPARENT_BOUNDING_BOX_OUTLINE defaultrender=TransparentBoundingBoxOutlinebreak case sceneRENDER_MODE_VERTICES defaultrender=Verticesbreak case sceneRENDER_MODE_SHADED_VERTICES defaultrender=ShadedVerticesbreak case sceneRENDER_MODE_WIREFRAME defaultrender=Wireframebreak case sceneRENDER_MODE_SHADED_WIREFRAME defaultrender=ShadedWireframebreak case sceneRENDER_MODE_SOLID defaultrender=Solidbreak case sceneRENDER_MODE_TRANSPARENT defaultrender=Transparentbreak case sceneRENDER_MODE_SOLID_WIREFRAME defaultrender=SolidWireframebreak case sceneRENDER_MODE_TRANSPARENT_WIREFRAME defaultrender=TransparentWireframebreak case sceneRENDER_MODE_ILLUSTRATION defaultrender=Illustrationbreak case sceneRENDER_MODE_SOLID_OUTLINE defaultrender=SolidOutlinebreak case sceneRENDER_MODE_SHADED_ILLUSTRATION defaultrender=ShadedIllustrationbreak case sceneRENDER_MODE_HIDDEN_WIREFRAME defaultrender=HiddenWireframebreak if(defaultrender=Solid) res+= RENDERMODE=+defaultrender+n detect existing Clipping Plane (3D Cross Section) var clip=null if( clip=scenenodesgetByName($$$$$$)|| clip=scenenodesgetByName(Clipping Plane) ) for(var i=0iltscenenodescounti++) var nd=scenenodesgetByIndex(i) if(nd==clip||ndname==) continue var ndUTFName= for (var j=0 jltndnamelength j++) var theUnicode = ndnamecharCodeAt(j)toString(16) while (theUnicodelengthlt4) theUnicode = 0 + theUnicode ndUTFName += theUnicode var end=ndnamelastIndexOf() if(endgt0) var ndUserName=ndnamesubstr(0end) else var ndUserName=ndname respart= PART=+ndUserName+n respart+= UTF16NAME=+ndUTFName+n defaultvals=true if(ndvisible) respart+= VISIBLE=falsen defaultvals=false if(ndopacitylt10) respart+= OPACITY=+ndopacity+n defaultvals=false if(ndconstructorname==Mesh) currender=defaultrender switch(ndrenderMode) case sceneRENDER_MODE_BOUNDING_BOX currender=BoundingBoxbreak case sceneRENDER_MODE_TRANSPARENT_BOUNDING_BOX currender=TransparentBoundingBoxbreak case sceneRENDER_MODE_TRANSPARENT_BOUNDING_BOX_OUTLINE currender=TransparentBoundingBoxOutlinebreak case sceneRENDER_MODE_VERTICES currender=Verticesbreak case sceneRENDER_MODE_SHADED_VERTICES currender=ShadedVerticesbreak case sceneRENDER_MODE_WIREFRAME currender=Wireframebreak case sceneRENDER_MODE_SHADED_WIREFRAME currender=ShadedWireframebreak case sceneRENDER_MODE_SOLID currender=Solidbreak case sceneRENDER_MODE_TRANSPARENT currender=Transparentbreak case sceneRENDER_MODE_SOLID_WIREFRAME currender=SolidWireframebreak case sceneRENDER_MODE_TRANSPARENT_WIREFRAME currender=TransparentWireframebreak case sceneRENDER_MODE_ILLUSTRATION currender=Illustrationbreak case sceneRENDER_MODE_SOLID_OUTLINE currender=SolidOutlinebreak case sceneRENDER_MODE_SHADED_ILLUSTRATION currender=ShadedIllustrationbreak case sceneRENDER_MODE_HIDDEN_WIREFRAME currender=HiddenWireframebreak case sceneRENDER_MODE_DEFAULT currender=Defaultbreak if(currender=defaultrender) respart+= RENDERMODE=+currender+n defaultvals=false if(origtrans[ndname]ampampndtransformisEqual(origtrans[ndname])) var lvec=ndtransformtransformDirection(new Vector3(100)) var uvec=ndtransformtransformDirection(new Vector3(010)) var vvec=ndtransformtransformDirection(new Vector3(001)) respart+= TRANSFORM= +lvecx+ +lvecy+ +lvecz+ +uvecx+ +uvecy+ +uvecz+ +vvecx+ +vvecy+ +vvecz+ +ndtransformtranslationx+ +ndtransformtranslationy+ +ndtransformtranslationz+n defaultvals=false respart+= ENDn if(defaultvals) res+=respart if(clip) var centre=cliptransformtranslation var normal=cliptransformtransformDirection(new Vector3(001)) res+= CROSSSECTn if((centrex==0 ampamp centrey==0 ampamp centrez==0)) res+=hostutilprintf( CENTER=s s sn centrex centrey centrez) if((normalx==1 ampamp normaly==0 ampamp normalz==0)) res+=hostutilprintf( NORMAL=s s sn normalx normaly normalz) res+=hostutilprintf( VISIBLE=sn clipvisible) res+=hostutilprintf( PLANECOLOR=s s sn clipmaterialemissiveColorr clipmaterialemissiveColorg clipmaterialemissiveColorb) res+=hostutilprintf( OPACITY=sn clipopacity) res+=hostutilprintf( INTERSECTIONCOLOR=s s sn clipwireframeColorr clipwireframeColorg clipwireframeColorb) res+= ENDn for(var propt in clip) consoleprintln(propt++clip[propt]) res+=ENDn hostconsoleshow() hostconsoleclear() hostconsoleprintln(n Add the following VIEW section to a file ofn+ predefined views (See option 3Dviews)nn + The view may be given a name after VIEW=n + (Remove in front of =)n) hostconsoleprintln(res + n)add items to 3D context menuruntimeaddCustomMenuItem(dfltview Generate Default View default 0)runtimeaddCustomMenuItem(currview Get Current View default 0)runtimeaddCustomMenuItem(csection Cross Section checked 0)menu event handlersmenuEventHandler = new MenuEventHandler()menuEventHandleronEvent = function(e) switch(emenuItemName) case dfltview calc3Dopts() break case currview get3Dview() break case csection addremoveClipPlane(emenuItemChecked) break runtimeaddEventHandler(menuEventHandler)global variable taking reference to currently selected nodevar target=nullselectionEventHandler=new SelectionEventHandler()selectionEventHandleronEvent=function(e) if(eselectedampampenodename=) target=enode else target=null runtimeaddEventHandler(selectionEventHandler)cameraEventHandler=new CameraEventHandler()cameraEventHandleronEvent=function(e) var clip=null runtimeremoveCustomMenuItem(csection) runtimeaddCustomMenuItem(csection Cross Section checked 0) if(clip=scenenodesgetByName($$$$$$)|| predefined scenenodesgetByName(Clipping Plane)) added via context menu runtimeremoveCustomMenuItem(csection) runtimeaddCustomMenuItem(csection Cross Section checked 1) if(clip)plane in predefined views must be rotated by 90 deg around normal cliptransformrotateAboutLineInPlace( MathPI2cliptransformtranslation cliptransformtransformDirection(new Vector3(001)) ) for(var i=0 iltrot4x4length i++)rot4x4[i]setIdentity() target=nullruntimeaddEventHandler(cameraEventHandler)var rot4x4=new Array() keeps track of spin and tilt axes transformationskey event handler for scaling moving spinning and tilting objectskeyEventHandler=new KeyEventHandler()keyEventHandleronEvent=function(e) var backtrans=new Matrix4x4() var trgt=null if(target) trgt=target var backtrans=new Matrix4x4() var trans=trgttransform var parent=trgtparent while(parenttransform) build local to world transformation matrix transmultiplyInPlace(parenttransform) also build world to local back-transformation matrix backtransmultiplyInPlace(parenttransforminversetranspose) parent=parentparent backtranstransposeInPlace() else if( trgt=scenenodesgetByName($$$$$$)|| trgt=scenenodesgetByName(Clipping Plane) ) var trans=trgttransform if(trgt) return var tname=trgtname if(typeof(rot4x4[tname])==undefined) rot4x4[tname]=new Matrix4x4() if(target) var tiltAxis=rot4x4[tname]transformDirection(new Vector3(010)) else var tiltAxis=transtransformDirection(new Vector3(010)) var spinAxis=rot4x4[tname]transformDirection(new Vector3(001)) get the centre of the mesh if(targetampamptrgtconstructorname==Mesh) var centre=transtransformPosition(trgtcomputeBoundingBox()center) else part group (Node3 parent node clipping plane) var centre=new Vector3(transtranslation) switch(echaracterCode) case 30tilt up rot4x4[tname]rotateAboutLineInPlace( -MathPI900rot4x4[tname]translationtiltAxis) transrotateAboutLineInPlace(-MathPI900centretiltAxis) break case 31tilt down rot4x4[tname]rotateAboutLineInPlace( MathPI900rot4x4[tname]translationtiltAxis) transrotateAboutLineInPlace(MathPI900centretiltAxis) break case 28spin right if(ectrlKeyDownampamptarget) transrotateAboutLineInPlace(-MathPI900centrespinAxis) else rot4x4[tname]rotateAboutLineInPlace( -MathPI900rot4x4[tname]translationnew Vector3(001)) transrotateAboutLineInPlace(-MathPI900centrenew Vector3(001)) break case 29spin left if(ectrlKeyDownampamptarget) transrotateAboutLineInPlace(MathPI900centrespinAxis) else rot4x4[tname]rotateAboutLineInPlace( MathPI900rot4x4[tname]translationnew Vector3(001)) transrotateAboutLineInPlace(MathPI900centrenew Vector3(001)) break case 120 x translateTarget(trans new Vector3(100) e) break case 121 y translateTarget(trans new Vector3(010) e) break case 122 z translateTarget(trans new Vector3(001) e) break case 88 shift + x translateTarget(trans new Vector3(-100) e) break case 89 shift + y translateTarget(trans new Vector3(0-10) e) break case 90 shift + z translateTarget(trans new Vector3(00-1) e) break case 115 s transtranslateInPlace(centrescale(-1)) transscaleInPlace(101) transtranslateInPlace(centrescale(1)) break case 83 shift + s transtranslateInPlace(centrescale(-1)) transscaleInPlace(1101) transtranslateInPlace(centrescale(1)) break transmultiplyInPlace(backtrans)runtimeaddEventHandler(keyEventHandler)translates object by amount calculated from Canvas sizefunction translateTarget(t d e) var cam=scenecamerasgetByIndex(0) if(camprojectionType==camTYPE_PERSPECTIVE) var scale=Mathtan(camfov2) camtargetPositionsubtract(camposition)length Mathmin(ecanvasPixelWidthecanvasPixelHeight) else var scale=camviewPlaneSize2 Mathmin(ecanvasPixelWidthecanvasPixelHeight) ttranslateInPlace(dscale(scale))function addremoveClipPlane(chk) var curTrans=getCurTrans() var clip=scenecreateClippingPlane() if(chk) add Clipping Plane and place its center either into the camera target position or into the centre of the currently selected mesh node var centre=new Vector3() if(target) var trans=targettransform var parent=targetparent while(parenttransform) trans=transmultiply(parenttransform) parent=parentparent if(targetconstructorname==Mesh) var centre=transtransformPosition(targetcomputeBoundingBox()center) else var centre=new Vector3(transtranslation) target=null else centreset(scenecamerasgetByIndex(0)targetPosition) cliptransformsetView( new Vector3(000) new Vector3(100) new Vector3(010)) cliptransformtranslateInPlace(centre) else if( scenenodesgetByName($$$$$$)|| scenenodesgetByName(Clipping Plane) ) clipremove()clip=null restoreTrans(curTrans) return clipfunction to store current transformation matrix of all nodes in the scenefunction getCurTrans() var tA=new Array() for(var i=0 iltscenenodescount i++) var nd=scenenodesgetByIndex(i) if(ndname==) continue tA[ndname]=new Matrix4x4(ndtransform) return tAfunction to restore transformation matrices given as argfunction restoreTrans(tA) for(var i=0 iltscenenodescount i++) var nd=scenenodesgetByIndex(i) if(tA[ndname]) ndtransformset(tA[ndname]) store original transformation matrix of all mesh nodes in the scenevar origtrans=getCurTrans()set initial state of Cross Section menu entrycameraEventHandleronEvent(1)hostconsoleclear()

var ocgs=hostgetOCGs(hostpageNum)for(var i=0iltocgslengthi++)if(ocgs[i]name==MediaPlayButton2)ocgs[i]state=false

(C) 2012 Michail Vidiassov John C Bowman Alexander Grahn asylabelsjs version 20120912 3D JavaScript to be used with media9sty (option `add3Djscript) for Asymptote generated PRC files adds billboard behaviour to text labels in Asymptote PRC files so that they always face the camera under 3D rotation This work may be distributed andor modified under the conditions of the LaTeX Project Public License The latest version of this license is in httpmirrorsctanorgmacroslatexbaselppltxt This work has the LPPL maintenance status `maintained The Current Maintainer of this work is A Grahnvar bbnodes=new Array() billboard meshesvar bbtrans=new Array() billboard transformsfunction fulltransform(mesh) var t=new Matrix4x4(meshtransform) if(meshparentname = ) var parentTransform=fulltransform(meshparent) tmultiplyInPlace(parentTransform) return t else return t find all text labels in the scene and determine pivoting pointsvar nodes=scenenodesvar nodescount=nodescountvar third=1030for(var i=0 i lt nodescount i++) var node=nodesgetByIndex(i) var name=nodename var end=namelastIndexOf()-1 if(end gt 0) if(namecharAt(end) == 001) var start=namelastIndexOf(-)+1 if(end gt start) nodename=namesubstr(0start-1) var nodeMatrix=fulltransform(nodeparent) var c=nodeMatrixtranslation position var d=Mathpow(Mathabs(nodeMatrixdeterminant)third) scale bbnodespush(node) bbtranspush(Matrix4x4()scale(ddd)translate(c)multiply(nodeMatrixinverse)) var camera=scenecamerasgetByIndex(0) var zero=new Vector3(000)var bbcount=bbnodeslength event handler to maintain camera-facing text labelsbillboardHandler=new RenderEventHandler()billboardHandleronEvent=function(event) var T=new Matrix4x4() TsetView(zerocamerapositionsubtract(cameratargetPosition) cameraupsubtract(cameraposition)) for(var j=0 j lt bbcount j++) bbnodes[j]transformset(Tmultiply(bbtrans[j])) runtimerefresh() runtimeaddEventHandler(billboardHandler)runtimerefresh()

(C) 2012 Alexander Grahn 3Dspintooljs version 20120301 3D JavaScript to be used with media9sty (option `add3Djscript) enables the Spin tool (also accessible via 3D toolbar or context menu) upon activation of the 3D scene the scene then rotates around the upright axis while dragging with the mouse This work may be distributed andor modified under the conditions of the LaTeX Project Public License The latest version of this license is in httpmirrorsctanorgmacroslatexbaselppltxt This work has the LPPL maintenance status `maintained The Current Maintainer of this work is A GrahnruntimesetCurrentTool(runtimeTOOL_NAME_SPIN)

N Privault

Proposition 66 Call-put parity We have the call-put parity relation

gc(tSt)minus gp(tSt) = St minusK eminus(Tminust)r 0 6 t 6 T (621)

between the Black-Scholes prices of call and put options in terms of theforward contract price St minusK eminus(Tminust)r

Proof The call-put parity (621) is a consequence of the relation

xminusK = (xminusK)+ minus (K minus x)+

satisfied by the terminal call and put payoff functions in the Black-ScholesPDE (67) It can also be verified directly from (610) and (618) as

gc(tx)minus gp(tx) = xΦ(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)minus(K eminus(Tminust)rΦ

(minus dminus(T minus t)

)minus xΦ

(minus d+(T minus t)

))= xΦ

(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)minusK eminus(Tminust)r

(1minusΦ

(dminus(T minus t)

))+ x

(1minusΦ

(d+(T minus t)

))= xminusK

The Delta of the Black-Scholes put option can be obtained by differentiationof the call-put parity relation (621) and Proposition 64

Proposition 67 The Delta of the Black-Scholes put option is given by

ξt = minus(1minusΦ(d+(T minus t)

)) = minusΦ

(minus d+(T minus t)

)isin [minus1 0] 0 6 t 6 T

Proof By the call-put parity relation (621) and Proposition 64 we have

partgppartx

(tSt) =partgcpartx

(tSt)minus 1

= Φ(d+(T minus t))minus 1= minusΦ(minusd+(T minus t)) 0 6 t 6 T

where we applied (614)

As a consequence of Proposition 67 the Black-Scholes put price splitsinto a risky component minusStΦ

(minus d+(T minus t)

)and a riskless component

K eminus(Tminust)rΦ(minus dminus(T minus t)

) as follows

gp(tSt) = K eminus(Tminust)rΦ(minus dminus(T minus t)

)︸ ︷︷ ︸riskminusfree investment (savings)

minus StΦ(minus d+(T minus t)

)︸ ︷︷ ︸

risky investment (short)

0 6 t 6 T

216

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

In Figure 613 we plot the Delta of the European put option as a function ofthe underlying asset price and of the time remaining until maturity

Payoff function (x-K)+

0

50

100

150

200

Underlying

0

5

10

15 Time to maturity T-t

-1

-075

-05

-025

0

Fig 613 Delta of a European put option with strike price K = 100 r = 3 σ = 10

Numerical example - hedging of a put option

For one more example we consider a put option issued by BNP Paribas on04 November 2008 with strike price K=$77667 maturity T = October 052009 and entitlement ratio 92593 cf page 9 In the next Figure 614 thenumber of days is counted from the origin not from maturity

40 50 60 70 80 90 100

0 50 100 150 200

0 5

10 15 20 25 30 35 40 45

Underlying (HK$)Time in days

Fig 614 Path of the Black-Scholes price for a put option on HSBC

As a consequence of Proposition 67 the amount invested on the risky assetfor the hedging of a put option is

minusStΦ(minus d+(T minus t)

)= minusStΦ

(minus log(StK) + (r+ σ22)(T minus t)

|σ|radicT minus t

)6 0

217

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

ie there is always short selling and the amount invested on the riskless assetpriced At = ert t isin [0T ] is

ηtAt = K eminus(Tminust)rΦ(minus dminus(T minus t)

)= K eminus(Tminust)rΦ

(minus log(StK) + (rminus σ22)(T minus t)

|σ|radicT minus t

)gt 0

which is always nonnegative ie we are constantly saving money on theriskless asset as noted in Figure 615

-60

-40

-20

0

20

40

60

80

100

0 50 100 150 200

K

HK$

Black-Scholes priceRisky investment ξtSt

Riskless investment ηtAtUnderlying asset price

Fig 615 Time evolution of the hedging portfolio for a put option on HSBC

In the above example the put option finished out of the money (OTM) so thatno cash settlement or physical delivery occurs A comparison of Figure 610with market data can be found in Figures 913 and 914 below

64 Market Terms and Data

The following Table 61 provides a summary of formulas for the computationof Black-Scholes sensitivities also called Greekslowast

lowast ldquoEvery class feels like attending a Greek lessonrdquo (AY2018-2019 student feedback)

218

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

Call option Put option

Option price g(tSt) StΦ(d+(T minus t))minusK eminus(Tminust)rΦ(dminus(T minus t)) K eminus(Tminust)rΦ(minusdminus(T minus t))minus StΦ(minusd+(T minus t))

Delta (∆) partg

partx(tSt) Φ(d+(T minus t)) gt 0 minusΦ(minusd+(T minus t)) 6 0

Gamma (Γ) part2g

partx2 (tSt)Φprime(d+(T minus t))St|σ|

radicT minus t

gt 0

Vega partg

partσ(tSt) St

radicT minus tΦprime(d+(T minus t)) gt 0

Theta (Θ) partg

partt(tSt) minusSt|σ|Φ

prime(d+(T minus t))2radicT minus t

minus rK eminus(Tminust)rΦ(dminus(T minus t)) 6 0 minusSt|σ|Φprime(d+(T minus t))

2radicT minus t

+ rK eminus(Tminust)rΦ(minusdminus(T minus t))

Rho (ρ) partg

partr(tSt) K(T minus t) eminus(Tminust)rΦ(dminus(T minus t)) minusK(T minus t) eminus(Tminust)rΦ(minusdminus(T minus t))

Table 61 Black-Scholes Greeks (Wikipedia)

From Table 61 we can conclude that call option prices are increasing func-tions of the underlying asset price St of the interest rate r and of the volatil-ity parameter σ Similarly put option prices are decreasing functions of theunderlying asset price St of the interest rate r and increasing functions ofthe volatility parameter σ

Parameter Variation of call option prices Variation of put option prices

Underlying St increasing decreasing

Volatility σ increasing increasing

Time t decreasing depends on the underlying price level

Interest rate r increasing decreasing

Table 62 Variations of Black-Scholes prices

The change of sign of the sensitivity Theta (Θ) with respect to time t can beverified in the following Figure 616

219

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

(a) Black-Scholes call price maps (b) Black-Scholes put price maps

Fig 616 Time-dependent solutions of the Black-Scholes PDElowast

Intrinsic value The intrinsic value at time t isin [0T ] of the option withpayoff C = h

(S(1)T

)is given by the immediate exercise payoff h

(S(1)t

) The

extrinsic value at time t isin [0T ] of the option is the remaining differenceπt(C) minus h

(S(1)t

)between the option price πt(C) and the immediate ex-

ercise payoff h(S(1)t

) In general the option price πt(C) decomposes as

πt(C) = h(S(1)t

)︸ ︷︷ ︸intrinsic value

+ πt(C)minus h(S(1)t

)︸ ︷︷ ︸

extrinsic value

0 6 t 6 T ]

Gearing The gearing at time t isin [0T ] of the option with payoff C = h(ST )is defined as the ratio

Gt =St

πt(C)=

Stg(tSt)

0 6 t 6 T

Effective gearing The effective gearing at time t isin [0T ] of the option withpayoff C = h(ST ) is defined as the ratio

Get = Gtξt

=ξtStπt(C)

=St

πt(C)

partg

partx(tSt)

=St

g(tSt)partg

partx(tSt)

= Stpart

partxlog g(tSt) 0 6 t 6 T

lowast The animation works in Acrobat Reader on the entire pdf file

220

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

The effective gearingGet =

ξtStπt(C)

can be interpreted as the hedge ratio ie the percentage of the portfoliowhich is invested on the risky asset When written as

∆g(tSt)g(tSt)

= Get times

∆StSt

the effective gearing gives the relative variation or percentage change∆g(tSt)g(tSt) of the option price g(tSt) from the relative variation∆StSt in the underlying asset price

The ratio Get = Stpart log g(tSt)partx can also be interpreted as an elasticity

coefficient

Break-even price The break-even price BEPt of the underlying asset is thevalue of S for which the intrinsic option value h(S) equals the option priceπt(C) at time t isin [0T ] For European call options it is given by

BEPt = K + πt(C) = K + g(tSt) t = 0 1 N

whereas for European put options it is given by

BEPt = K minus πt(C) = K minus g(tSt) 0 6 t 6 T

Premium The option premium OPt can be defined as the variation requiredfrom the underlying asset price in order to reach the break-even price iewe have

OPt =BEPt minus St

St=K + g(tSt)minus St

St 0 6 t 6 T

for European call options and

OPt =St minusBEPt

St=St + g(tSt)minusK

St 0 6 t 6 T

for European put options see Figure 617 below The term ldquopremiumrdquo issometimes also used to denote the arbitrage price g(tSt) of the option

221

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

f (tx σ)100

=

x =

K =

xpart log f

partx=

σ =

partf

partt(tx σ)=

T=

=(xminusK)x

∆ = = partf

partx(tx σ)

= partf

partσ(tx σ)

=K+f (txσ)minusx

x

=K+f (tx σ)

rf=

partf

partt+rxpartf

partx+

σ2 2x2part2f

partx2

Fig 617 Warrant terms and data

The R package bizdays (requires to install QuantLib) can be used to computecalendar time vs business time to maturity1 installpackages(bizdays)

library(bizdays)3 load_quantlib_calendars(HongKong from=2018-01-01 to=2018-12-31)

load_quantlib_calendars(Singapore from=2018-01-01 to=2018-12-31)5 bizdays(2018-03-10 2018-04-03 QuantLibHongKong)

bizdays(2018-03-10 2018-04-03 QuantLibSingapore)

65 The Heat Equation

In the next proposition we notice that the solution f(tx) of the Black-Scholes PDE (67) can be transformed into a solution g(t y) of the simplerheat equation by a change of variable and a time inversion t 7minusrarr T minus t onthe interval [0T ] so that the terminal condition at time T in the Black-Scholes equation (622) becomes an initial condition at time t = 0 in theheat equation (625) See also here for a related discussion on changes ofvariables for the Black-Scholes PDE

222

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

Proposition 68 Assume that f(tx) solves the Black-Scholes PDErf(tx) = partf

partt(tx) + rx

partf

partx(tx) + 1

2σ2x2 part

2f

partx2 (tx)

f(T x) = (xminusK)+(622)

with terminal condition h(x) = (xminusK)+ x gt 0 Then the function g(t y)defined by

g(t y) = ertf(T minus t e|σ|y+(σ22minusr)t) (623)

solves the heat equation (625) with initial condition

ψ(y) = h(

e|σ|y) y isin R (624)

ie we have partg

partt(t y) = 1

2part2g

party2 (t y)

g(0 y) = h(

e|σ|y)

(625)

Proposition 68 will be proved in Section 66 It will allow us to solve theBlack-Scholes PDE (622) based on the solution of the heat equation (625)with initial condition ψ(y) = h

(e|σ|y

) y isin R by inversion of Relation (623)

with s = T minus t x = e|σ|y+(σ22minusr)t ie

f(sx) = eminus(Tminuss)rg(T minus s minus(σ

22minus r)(T minus s) + log x|σ|

)

Next we focus on the heat equation

partϕ

partt(t y) = 1

2part2ϕ

party2 (t y) (626)

which is used to model the diffusion of heat over time through solids Herethe data of g(x t) represents the temperature measured at time t and pointx We refer the reader to Widder (1975) for a complete treatment of thistopic

223

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

Fig 618 Time-dependent solution of the heat equationlowast

Proposition 69 The fundamental solution of the heat equation (626) isgiven by the Gaussian probability density function

ϕ(t y) =1radic2πt

eminusy2(2t) y isin R

with variance t gt 0

Proof The proof is done by a direct calculation as follows

partϕ

partt(t y) = part

partt

(eminusy2(2t)radic

2πt

)

= minus eminusy2(2t)

2t32radic

2π+

y2

2t2eminusy2(2t)radic

2πt

=

(minus 1

2t +y2

2t2

)ϕ(t y)

and

12part2ϕ

party2 (t y) = minus12part

party

(y

t

eminusy2(2t)radic

2πt

)

= minus eminusy2(2t)

2tradic

2πt+

y2

2t2eminusy2(2t)radic

2πt

=

(minus 1

2t +y2

2t2

)ϕ(t y) t gt 0 y isin R

lowast The animation works in Acrobat Reader on the entire pdf file

224

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

In Section 66 the heat equation (626) will be shown to be equivalent to theBlack-Scholes PDE after a change of variables In particular this will lead tothe explicit solution of the Black-Scholes PDE

Proposition 610 The heat equationpartg

partt(t y) = 1

2part2g

party2 (t y)

g(0 y) = ψ(y)

(627)

with continuous initial condition

g(0 y) = ψ(y)

has the solution

g(t y) =winfinminusinfin

ψ(z) eminus(yminusz)2(2t) dzradic2πt

y isin R t gt 0 (628)

Proof We have

partg

partt(t y) = part

partt

winfinminusinfin

ψ(z) eminus(yminusz)2(2t) dzradic2πt

=winfinminusinfin

ψ(z)part

partt

(eminus(yminusz)2(2t)radic

2πt

)dz

=12winfinminusinfin

ψ(z)

((yminus z)2

t2minus 1t

)eminus(yminusz)2(2t) dzradic

2πt

=12winfinminusinfin

ψ(z)part2

partz2 eminus(yminusz)2(2t) dzradic2πt

=12winfinminusinfin

ψ(z)part2

party2 eminus(yminusz)2(2t) dzradic2πt

=12part2

party2

winfinminusinfin

ψ(z) eminus(yminusz)2(2t) dzradic2πt

=12part2g

party2 (t y)

On the other hand it can be checked that at time t = 0 we have

limtrarr0

winfinminusinfin

ψ(z) eminus(yminusz)2(2t) dzradic2πt

= limtrarr0

winfinminusinfin

ψ(y+ z) eminusz2(2t) dzradic2πt

= ψ(y) y isin R

225

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

The next Figure 619 shows the evolution of g(tx) with initial conditionbased on the European call payoff function h(x) = (xminusK)+ ie

g(0 y) = ψ(y) = h(

e|σ|y)=(

e|σ|y minusK)+ y isin R

Fig 619 Time-dependent solution of the heat equationlowast

Let us provide a second proof of Proposition 610 this time using Brownianmotion and stochastic calculus

Proof of Proposition 610 First note that under the change of variable x =z minus y we have

g(t y) =winfinminusinfin

ψ(z) eminus(yminusz)2(2t) dzradic2πt

=winfinminusinfin

ψ(y+ x) eminusx2(2t) dxradic2πt

= IE[ψ(y+Bt)]

= IE[ψ(yminusBt)]

where (Bt)tisinR+ is a standard Brownian motion and Bt N (0 t) t isin R+Applying Itocircrsquos formula and using the fact that the expectation of the stochas-tic integral with respect to Brownian motion is zero see Relation (417) inProposition 420 we find

g(t y) = IE[ψ(yminusBt)]

= ψ(y)minus IE[w t

0ψprime(yminusBs)dBs

]+

12 IE

[w t0ψprimeprime(yminusBs)ds

]= ψ(y) +

12w t

0IE[ψprimeprime(yminusBs)

]ds

lowast The animation works in Acrobat Reader on the entire pdf file

226

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

= ψ(y) +12w t

0part2

party2 IE [ψ(yminusBs)] ds

= ψ(y) +12w t

0part2g

party2 (s y)ds

Hence we have

partg

partt(t y) = part

parttIE[ψ(yminusBt)]

=12part2

party2 IE [ψ(yminusBt)]

=12part2g

party2 (t y)

Regarding the initial condition we check that

g(0 y) = IE[ψ(yminusB0)] = IE[ψ(y)] = ψ(y)

The expression g(t y) = IE[ψ(yminusBt)] provides a probabilistic interpreta-tion of the heat diffusion phenomenon based on Brownian motion Namelywhen ψε(y) = 1[minusεε](y) we find that

gε(t y) = IE[ψε(yminusBt)]= IE[1[minusεε](yminusBt)]= P

(yminusBt isin [minusε ε]

)= P

(yminus ε 6 Bt 6 y+ ε

)represents the probability of finding Bt within a neighborhood [y minus ε y + ε]of the point y isin R

66 Solution of the Black-Scholes PDE

In this section we solve the Black-Scholes PDE by the kernel method of Sec-tion 65 and a change of variables This solution method uses the change ofvariables (623) of Proposition 68 and a time inversion from which the ter-minal condition at time T in the Black-Scholes equation becomes an initialcondition at time t = 0 in the heat equation

Next we state the proof Proposition 68

Proof Letting s = T minus t and x = e|σ|y+(σ22minusr)t and using Relation (623)ie

g(t y) = ertf(T minus t e|σ|y+(σ22minusr)t)

227

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

we have

partg

partt(t y) = r ertf

(T minus t e|σ|y+(σ22minusr)t)minus ert partf

parts

(T minus t e|σ|y+(σ22minusr)t)

+

(σ2

2 minus r)

ert e|σ|y+(σ22minusr)t partf

partx

(T minus t e|σ|y+(σ22minusr)t)

= r ertf(T minus tx)minus ert partfparts

(T minus tx) +(σ2

2 minus r)

ertxpartfpartx

(T minus tx)

=12 ertx2σ2 part

2f

partx2 (T minus tx) +σ2

2 ertxpartfpartx

(T minus tx) (629)

where on the last step we used the Black-Scholes PDE On the other handwe have

partg

party(t y) = |σ| ert e|σ|y+(σ22minusr)t partf

partx

(T minus t e|σ|y+(σ22minusr)t)

and

12partg2

party2 (t y) =σ2

2 ert e|σ|y+(σ22minusr)t partf

partx

(T minus t e|σ|y+(σ22minusr)t)

+σ2

2 ert e2|σ|y+2(σ22minusr)t part2f

partx2(T minus t e|σ|y+(σ22minusr)t)

=σ2

2 ertxpartfpartx

(T minus tx) + σ2

2 ertx2 part2f

partx2 (T minus tx) (630)

We conclude by comparing (629) with (630) which shows that g(tx) solvesthe heat equation (627) with initial condition

g(0 y) = f(T e|σ|y

)= h

(e|σ|y

)

In the next proposition we derive the Black-Scholes formula (610) by solv-ing the PDE (622) The Black-Scholes formula will also be recovered by aprobabilistic argument via the computation of an expected value in Proposi-tion 77

Proposition 611 When h(x) = (x minusK)+ the solution of the Black-Scholes PDE (622) is given by

f(tx) = xΦ(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

) x gt 0

whereΦ(x) =

1radic2π

w xminusinfin

eminusy22dy x isin R

and

228

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

d+(T minus t) =

log(xK) + (r+ σ22)(T minus t)|σ|radicT minus t

dminus(T minus t) =log(xK) + (rminus σ22)(T minus t)

|σ|radicT minus t

x gt 0 t isin [0T )

Proof By inversion of Relation (623) with s = T minus t and x = e|σ|y+(σ22minusr)twe get

f(sx) = eminus(Tminuss)rg(T minus s minus(σ

22minus r)(T minus s) + log x|σ|

)and

h(x) = ψ

(log x|σ|

) x gt 0 or ψ(y) = h

(e|σ|y

) y isin R

Hence using the solution (628) and Relation (624) we get

f(tx) = eminus(Tminust)rg(T minus t minus(σ

22minus r)(T minus t) + log x|σ|

)= eminus(Tminust)r

winfinminusinfin

ψ

(minus(σ22minus r)(T minus t) + log x

|σ|+ z

)eminusz2(2(Tminust)) dzradic

2(T minus t)π

= eminus(Tminust)rwinfinminusinfin

h(x e|σ|zminus(σ22minusr)(Tminust)) eminusz2(2(Tminust)) dzradic

2(T minus t)π

= eminus(Tminust)rwinfinminusinfin

(x e|σ|zminus(σ22minusr)(Tminust) minusK

)+ eminusz2(2(Tminust)) dzradic2(T minus t)π

= eminus(Tminust)r

timeswinfin

(minusr+σ22)(Tminust)+log(Kx)|σ|

(x e|σ|zminus(σ22minusr)(Tminust) minusK

)eminusz2(2(Tminust)) dzradic

2(T minus t)π

= x eminus(Tminust)rwinfinminusdminus(Tminust)

radicTminust

e|σ|zminus(σ22minusr)(Tminust) eminusz2(2(Tminust)) dzradic2(T minus t)π

minusK eminus(Tminust)rwinfinminusdminus(Tminust)

radicTminust

eminusz2(2(Tminust)) dzradic2(T minus t)π

= xwinfinminusdminus(Tminust)

radicTminust

e|σ|zminus(Tminust)σ22minusz2(2(Tminust)) dzradic2(T minus t)π

minusK eminus(Tminust)rwinfinminusdminus(Tminust)

radicTminust

eminusz2(2(Tminust)) dzradic2(T minus t)π

= xwinfinminusdminus(Tminust)

radicTminust

eminus(zminus(Tminust)|σ|)2(2(Tminust)) dzradic2(T minus t)π

229

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

minusK eminus(Tminust)rwinfinminusdminus(Tminust)

radicTminust

eminusz2(2(Tminust)) dzradic2(T minus t)π

= xwinfinminusdminus(Tminust)

radicTminustminus(Tminust)|σ|

eminusz2(2(Tminust)) dzradic2(T minus t)π

minusK eminus(Tminust)rwinfinminusdminus(Tminust)

radicTminust

eminusz2(2(Tminust)) dzradic2(T minus t)π

= xwinfinminusdminus(Tminust)minus|σ|

radicTminust

eminusz22 dzradic2πminusK eminus(Tminust)r

winfinminusdminus(Tminust)

eminusz22 dzradic2π

= x(1minusΦ

(minus d+(T minus t)

))minusK eminus(Tminust)r

(1minusΦ

(minus dminus(T minus t)

))= xΦ

(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)

where we used the relation (614) ie

1minusΦ(a) = Φ(minusa) a isin R

Exercises

Exercise 61 Bachelier (1900) model Consider a market made of a risklessasset valued At = A0 with zero interest rate t isin R+ and a risky asset whoseprice St is modeled by a standard Brownian motion as St = Bt t isin R+

a) Show that the price g(tBt) of the option with payoff C = B2T satisfies

the heat equationpartϕ

partt(t y) = minus1

2part2ϕ

party2 (t y)

with terminal condition g(T x) = x2b) Find the function g(tx) by solving the PDE of Question (a)

Hint Try a solution of the form g(tx) = x2 + f(t)

See Exercises 611 713 and 714 for extensions to nonzero interest rates

Exercise 62 Consider a risky asset price (St)tisinR modeled in the Cox et al(1985) (CIR) model as

dSt = β(αminus St)dt+ σradicStdBt αβσ gt 0 (631)

and let (ηt ξt)tisinR+ be a portfolio strategy whose value Vt = ηtAt + ξtSttakes the form Vt = g(tSt) t isin R+ Figure 620 presents a random simula-tion of the solution to (631) with α = 0025 β = 1 and σ = 13230

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

0

1

2

3

4

5

6

7

8

0 01 02 03 04 05 06 07 08 09 1

St

t

Fig 620 Graph of the CIR short rate t 7rarr rt with α = 25 β = 1 and σ = 13

N=10000 t lt- 0(N-1) dt lt- 10Na=0025 b=2 sigma=0052 X lt- rnorm(Nmean=0sd=sqrt(dt))R lt- rep(0N)R[1]=001

for (j in 2N)R[j]=max(0R[j-1]+(a-bR[j-1])dt+sigmasqrt(R[j-1])X[j])4 plot(t R xlab = t ylab = type = l ylim = c(0002) col = blue)

Based on the self-financing condition written as

dVt = rVtdtminus rξtStdt+ ξtdSt

= rVtdtminus rξtStdt+ β(αminus St)ξtdt+ σξtradicStdBt t isin R+ (632)

derive the PDE satisfied by the function g(tx) using the Itocirc formula

Exercise 63 Black-Scholes PDE with dividends Consider a riskless as-set with price At = A0 ert t isin R+ and an underlying asset price process(St)tisinR+ modeled as

dSt = (microminus δ)Stdt+ σStdBt

where (Bt)tisinR+ is a standard Brownian motion and δ gt 0 is a continuous-time dividend rate By absence of arbitrage the payment of a dividend entailsa drop in the stock price by the same amount occuring generally on the ex-dividend date on which the purchase of the security no longer entitles theinvestor to the dividend amount The list of investors entitled to dividendpayment is consolidated on the date of record and payment is made on thepayable date

library(quantmod)2 getSymbols(0005HKfrom=2010-01-01to=SysDate()src=yahoo)

getDividends(0005HKfrom=2010-01-01to=SysDate()src=yahoo)

a) Assuming that the portfolio with value Vt = ξtSt + ηtAt at time t is self-financing and that dividends are continuously reinvested write down theportfolio variation dVt

231

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

b) Assuming that the portfolio value Vt takes the form Vt = g(tSt) at timet derive the Black-Scholes PDE for the function g(tx) with its terminalcondition

c) Compute the price at time t isin [0T ] of the European call option withstrike price K by solving the corresponding Black-Scholes PDE

d) Compute the Delta of the option

Exercise 64

a) Check that the Black-Scholes formula (610) for European call options

gc(tx) = xΦ(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)

satisfies the following boundary conditions

i) at x = 0 gc(t 0) = 0ii) at maturity t = T

gc(T x) = (xminusK)+ =

xminusK x gt K

0 x 6 K

iii) as time to maturity tends to infinity

limTrarrinfin

Bl(Kxσ rT minus t) = x t isin R+

b) Check that the Black-Scholes formula (618) for European put options

gp(tx) = K eminus(Tminust)rΦ(minus dminus(T minus t)

)minus xΦ

(minus d+(T minus t)

)satisfies the following boundary conditions

i) at x = 0 gp(t 0) = K eminus(Tminust)rii) as x tends to infinity gp(tinfin) = 0 for all t isin [0T )iii) at maturity t = T

gp(T x) = (K minus x)+ =

0 x gt K

K minus x x 6 K

iv) as time to maturity tends to infinity

limTrarrinfin

Blp(KStσ rT minus t) = 0 t isin R+

Exercise 65 Power option (Exercise 314 continued)

232

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

a) Solve the Black-Scholes PDE

rg(x t) = partg

partt(x t) + rx

partg

partx(x t) + σ2

2 x2 part2g

partx2 (x t) (633)

with terminal condition g(xT ) = x2 x gt 0 t isin [0T ]

Hint Try a solution of the form g(x t) = x2f(t) and find f(t)b) Find the respective quantities ξt and ηt of the risky asset St and riskless

asset At = ert in the portfolio with value

Vt = g(St t) = ξtSt + ηtAt 0 6 t 6 T

hedging the contract with payoff S2T at maturity

Exercise 66 On December 18 2007 a call warrant has been issued byFortis Bank on the stock price S of the MTR Corporation with maturityT = 23122008 strike price K = HK$ 3608 and entitlement ratio=10Recall that in the Black-Scholes model the price at time t of the Europeanclaim on the underlying asset priced St with strike price K maturity T interest rate r and volatility σ gt 0 is given by the Black-Scholes formula as

f(tSt) = StΦ(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)

wheredminus(T minus t) =

(rminus σ22)(T minus t) + log(StK)

|σ|radicT minus t

d+(T minus t) = dminus(T minus t) + |σ|radicT minus t = (r+ σ22)(T minus t) + log(StK)

|σ|radicT minus t

Recall that by Proposition 64 we have

partf

partx(tSt) = Φ

(d+(T minus t)

) 0 6 t 6 T

a) Using the values of the Gaussian cumulative distribution function com-pute the Black-Scholes price of the corresponding call option at timet =November 07 2008 with St = HK$ 17200 assuming a volatility σ =90 = 090 and an annual risk-free interest rate r = 4377 = 004377

b) Still using the Gaussian cumulative distribution function compute thequantity of the risky asset required in your portfolio at time t =November07 2008 in order to hedge one such option at maturity T = 23122008

c) Figure 1 represents the Black-Scholes price of the call option as a functionof σ isin [05 15] = [50 150]

233

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

0

01

02

03

04

05

06

05 06 07 08 09 1 11 12 13 14 15σimp

Optio

n pr

ice

σ

Market price

Fig 621 Option price as a function of the volatility σ gt 0

1 BSCall lt- function(S K r T sigma)d1 lt- (log(SK)+(r+sigma^22)T)(sigmasqrt(T))d2 lt- d1 - sigma sqrt(T)

3 BSCall = Spnorm(d1) - Kexp(-rT)pnorm(d2)BSCallsigma lt- seq(0515 length=100)

5 plot(sigmaBSCall(172360800437746365sigma) type=llty=1 xlab=Sigmaylab=Black-Scholes Call Price ylim = c(006)col=bluelwd=3)grid()

abline(h=023col=redlwd=3)

Knowing that the closing price of the warrant on November 07 2008 wasHK$ 0023 which value can you infer for the implied volatility σ at thisdatelowast

Exercise 67 Forward contracts Recall that the price πt(C) of a claimpayoff C = h(ST ) of maturity T can be written as πt(C) = g(tSt) wherethe function g(tx) satisfies the Black-Scholes PDE

rg(tx) = partg

partt(tx) + rx

partg

partx(tx) + 1

2σ2x2 part

2g

partx2 (tx)

g(T x) = h(x) (1)

with terminal condition g(T x) = h(x) x gt 0

a) Assume that C is a forward contract with payoff

C = ST minusK

at time T Find the function h(x) in (1)b) Find the solution g(tx) of the above PDE and compute the price πt(C)

at time t isin [0T ]Hint search for a solution of the form g(tx) = xminus α(t) where α(t) is afunction of t to be determined

lowast Download the corresponding or the that can be runhere

234

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

BS lt- function(S K T r sig)d1 lt- (log(SK) + (r + sig^22)T) (sigsqrt(T))d2 lt- d1 - sigsqrt(T)return(Spnorm(d1) - Kexp(-rT)pnorm(d2))impliedvol lt- function(S K T r market)sig lt- 020sigup lt- 1sigdown lt- 0001count lt- 0err lt- BS(S K T r sig) - marketwhile(abs(err) gt 000001 ampamp countlt1000)if(err lt 0)sigdown lt- sigsig lt- (sigup + sig)2elsesigup lt- sigsig lt- (sigdown + sig)2err lt- BS(S K T r sig) - marketcount lt- count + 1if(count==2000)return(NA)elsereturn(sig)market = 083K = 628T = 7 365S = 634r = 002impliedvol(S K T r market)

cells [ cell_type code execution_count null metadata outputs [] source [ from IPythoncoredisplay import display HTMLn display(HTML( )) ] cell_type code execution_count null metadata collapsed true outputs [] source [ import numpy as npn import scipystats as ssn import time n n Black and Scholesn def d1(S0 K r sigma T)n return (nplog(S0K) + (r + sigma2 2) T)(sigma npsqrt(T))n n def d2(S0 K r sigma T)n return (nplog(S0 K) + (r - sigma2 2) T) (sigma npsqrt(T))n n def BlackScholes(typeS0 K r sigma T)n if type==Cn return S0 ssnormcdf(d1(S0 K r sigma T)) - K npexp(-r T) ssnormcdf(d2(S0 K r sigma T))n elsen return K npexp(-r T) ssnormcdf(-d2(S0 K r sigma T)) - S0 ssnormcdf(-d1(S0 K r sigma T)) ] cell_type code execution_count null metadata outputs [] source [ BlackScholes(C1000 1200 002 015 10) ] cell_type code execution_count null metadata outputs [] source [ def difference(x p S K r t)n return BlackScholes(CS K r x t) - p ] cell_type code execution_count null metadata outputs [] source [ from scipyoptimize import bisectn bisect(difference00011args=(11541763731112766 1000 1200 002 10)) ] ] metadata anaconda-cloud kernelspec display_name Python 3 language python name python3 language_info codemirror_mode name ipython version 3 file_extension py mimetype textx-python name python nbconvert_exporter python pygments_lexer ipython3 version 375rc1 nbformat 4 nbformat_minor 1

Black-Scholes Pricing and Hedging

c) Compute the quantityξt =

partg

partx(tSt)

of risky assets in a self-financing portfolio hedging Cd) Repeat the above questions with the terminal condition g(T x) = x

Exercise 68a) Solve the Black-Scholes PDE

rg(tx) = partg

partt(tx) + rx

partg

partx(tx) + σ2

2 x2 part2g

partx2 (tx) (634)

with terminal condition g(T x) = 1 x gt 0

Hint Try a solution of the form g(tx) = f(t) and find f(t)

b) Find the respective quantities ξt and ηt of the risky asset St and risklessasset At = ert in the portfolio with value

Vt = g(tSt) = ξtSt + ηtAt

hedging the contract with payoff $1 at maturity

Exercise 69 Log-contracts see also Exercise 84a) Solve the PDE

0 =partg

partt(x t) + rx

partg

partx(x t) + σ2

2 x2 part2g

partx2 (x t)

with the terminal condition g(xT ) = log x x gt 0

Hint Try a solution of the form g(x t) = f(t) + log x and find f(t)b) Solve the Black-Scholes PDE

rh(x t) = parth

partt(x t) + rx

parth

partx(x t) + σ2

2 x2 part2h

partx2 (x t) (635)

with the terminal condition h(xT ) = log x x gt 0

Hint Try a solution of the form h(x t) = u(t)g(x t) and find u(t)c) Find the respective quantities ξt and ηt of the risky asset St and riskless

asset At = ert in the portfolio with value

Vt = g(St t) = ξtSt + ηtAt

hedging a log-contract with payoff logST at maturity 235

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

Exercise 610 Binary options Consider a price process (St)tisinR+ given by

dStSt

= rdt+ σdBt S0 = 1

under the risk-neutral probability measure Plowast The binary (or digital) calloption is a contract with maturity T strike price K and payoff

Cd = 1[Kinfin)(ST ) =

$1 if ST gt K

0 if ST lt K

a) Derive the Black-Schole PDE satisfied by the pricing function Cd(tSt) ofthe binary call option together with its terminal condition

b) Show that the solution Cd(tx) of the Black-Scholes PDE of Question (a)is given by

Cd(tx) = eminus(Tminust)rΦ((rminus σ22)(T minus t) + log(xK)

|σ|radicT minus t

)= eminus(Tminust)rΦ

(dminus(T minus t)

)

where

dminus(T minus t) =(rminus σ22)(T minus t) + log(StK)

|σ|radicT minus t

0 6 t lt T

Exercise 611

a) Bachelier (1900) model Solve the stochastic differential equation

dSt = αStdt+ σdBt (636)

in terms of ασ isin R and the initial condition S0b) Write down the Bachelier PDE satisfied by the function C(tx) where

C(tSt) is the price at time t isin [0T ] of the contingent claim with payoffφ(ST ) = exp(ST ) and identify the process Delta (ξt)tisin[0T ] that hedgesthis claim

c) Solve the Black-Scholes PDE of Question (b) with the terminal conditionφ(x) = ex x isin R

Hint Search for a solution of the form

C(tx) = exp(minus(T minus t)r+ xh(t) +

σ2

4r (h2(t)minus 1)

) (637)

where h(t) is a function to be determined with h(T ) = 1

236

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

d) Compute the portfolio strategy (ξt ηt)tisin[0T ] that hedges the contingentclaim with payoff exp(ST )

Exercise 612

a) Show that for every fixed value of S the function

d 7minusrarr h(S d) = SΦ(d+ |σ|

radicT)minusK eminusrTΦ(d)

reaches its maximum at dlowast(S) =log(SK) + (rminus σ22)T

|σ|radicT

b) By the differentiation rule

d

dSh(S dlowast(S)) =

parth

partS(S dlowast(S)) + dprimelowast(S)

parth

partd(S dlowast(S))

recover the value of the Black-Scholes Delta

Exercise 613 Compute the Black-Scholes Vega by differentiation of theBlack-Scholes function

gc(tx) = Bl(Kxσ rT minus t) = xΦ(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)

with respect to the volatility parameter σ knowing that

minus12(dminus(T minus t)

)2= minus1

2

(log(xK) + (rminus σ22)(T minus t)

|σ|radicT minus t

)2

= minus12(d+(T minus t)

)2+ (T minus t)r+ log x

K (638)

Exercise 614 Consider the backward induction relation (313) ie

v(tx) = (1minus plowastN )v (t+ 1x(1 + aN )) + plowastN v (t+ 1x(1 + bN ))

using the renormalizations rN = rTN and

aN = (1 + rN )(1minus |σ|radicTN)minus 1 bN = (1 + rN )(1 + |σ|

radicTN)minus 1

of Section 36 N gt 1 with

plowastN =rN minus aNbN minus aN

and plowastN =bN minus rNbN minus aN

a) Show that the Black-Scholes PDE (62) of Proposition 61 can be recoveredfrom the induction relation (313) when the number N of time steps tendsto infinity

237

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

b) Show that the expression of the Delta ξt =partgcpartx

(tSt) can be similarlyrecovered from the finite difference relation (319) ie

ξ(1)t (Stminus1) =

v (t (1 + bN )Stminus1)minus v (t (1 + aN )Stminus1)

Stminus1(bN minus aN )

as N tends to infinity

Problem 615 (Leung and Sircar (2015)) ProShares Ultra SampP500 andProShares UltraShort SampP500 are leveraged investment funds that seek dailyinvestment results before fees and expenses that correspond to β times (βx)the daily performance of the SampP500reg with respectively β = 2 for ProSharesUltra and β = minus2 for ProShares UltraShort Here leveraging with a factorβ 1 aims at multiplying the potential return of an investment by a factorβ The following 10 questions are interdependent and should be treated insequence

a) Consider a risky asset priced S0 = $4 at time t = 0 and taking twopossible values S1 = $5 and S1 = $2 at time t = 1 Compute the twopossible returns (in ) achieved when investing $4 in one share of the assetS and the expected return under the risk-neutral probability measureassuming that the risk-free interest rate is zero

b) Leveraging Still based on an initial $4 investment we decide to leverageby a factor β = 3 by borrowing another (β minus 1) times $4 = 2times $4 at ratezero to purchase a total of β = 3 shares of the asset S Compute thetwo returns (in ) possibly achieved in this case and the expected returnunder the risk-neutral probability measure assuming that the risk-freeinterest rate is zero

c) Denoting by Ft the ProShares value at time t how much should the fundinvest in the underlying asset priced St and how much $ should it borrowor save on the risk-free market at any time t in order to leverage with afactor β 1

d) Find the portfolio allocation (ξt ηt) for the fund value

Ft = ξtSt + ηtAt t isin R+

according to Question (c) where At = A0 ert is the riskless money marketaccount

e) We choose to model the SampP500 index St as the geometric Brownianmotion

dSt = rStdt+ σStdBt t isin R+

under the risk-neutral probability measure Plowast Find the stochastic dif-ferential equation satisfied by (Ft)tisinR+ under the self-financing conditiondFt = ξtdSt + ηtdAt

238

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

f) Is the discounted fund value ( eminusrtFt)tisinR+ a martingale under the risk-neutral probability measure Plowast

g) Find the relation between the fund value Ft and the index St by solvingthe stochastic differential equation obtained for Ft in Question (e) Forsimplicity we normalize F0 = Sβ0

h) Write the price at time t = 0 of the call option with payoff (FT minusK)+ onthe ProShares index using the Black-Scholes formula

i) Show that when β gt 0 the Delta at time t isin [0T ) of the call optionwith payoff (FT minusK)+ on ProShares Ultra is equal to the Delta of thecall option with payoff (ST minusKβ(t))

+ on the SampP500 for a certain strikeprice Kβ(t) to be determined explicitly

j) When β lt 0 find the relation between the Delta at time t isin [0T ) ofthe call option with payoff (FT minusK)+ on ProShares UltraShort and theDelta of the put option with payoff (Kβ(t)minus ST )+ on the SampP500

239

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

  1. pbsARFix223
  2. pbsARFix224
  3. pbsARFix225
  4. pbsARFix226
  5. pbsARFix227
  6. pbsARFix228
  7. pbsARFix229
  8. pbsARFix230
  9. fdrm1
  10. pbsARFix231
  11. 100
  12. 101
  13. 102
  14. 103
  15. 104
  16. 105
  17. 106
  18. 107
  19. 108
  20. 109
  21. 1010
  22. 1011
  23. 1012
  24. 1013
  25. 1014
  26. 1015
  27. 1016
  28. 1017
  29. 1018
  30. 1019
  31. anm10
  32. 10EndLeft
  33. 10StepLeft
  34. 10PauseLeft
  35. 10PlayLeft
  36. 10PlayPauseLeft
  37. 10PauseRight
  38. 10PlayRight
  39. 10PlayPauseRight
  40. 10StepRight
  41. 10EndRight
  42. 10Minus
  43. 10Reset
  44. 10Plus
  45. pbsARFix232
  46. pbsARFix233
  47. pbsARFix234
  48. pbsARFix235
  49. pbsARFix236
  50. pbsARFix237
  51. fdrm2
  52. 110
  53. 111
  54. 112
  55. 113
  56. 114
  57. 115
  58. 116
  59. 117
  60. 118
  61. 119
  62. 1110
  63. 1111
  64. 1112
  65. 1113
  66. 1114
  67. 1115
  68. 1116
  69. 1117
  70. 1118
  71. 1119
  72. anm11
  73. 11EndLeft
  74. 11StepLeft
  75. 11PauseLeft
  76. 11PlayLeft
  77. 11PlayPauseLeft
  78. 11PauseRight
  79. 11PlayRight
  80. 11PlayPauseRight
  81. 11StepRight
  82. 11EndRight
  83. 11Minus
  84. 11Reset
  85. 11Plus
  86. pbsARFix238
  87. pbsARFix239
  88. pbsARFix240
  89. pbsARFix241
  90. pbsARFix242
  91. 120
  92. 121
  93. 122
  94. 123
  95. 124
  96. 125
  97. 126
  98. 127
  99. 128
  100. 129
  101. 1210
  102. anm12
  103. 12EndLeft
  104. 12StepLeft
  105. 12PauseLeft
  106. 12PlayLeft
  107. 12PlayPauseLeft
  108. 12PauseRight
  109. 12PlayRight
  110. 12PlayPauseRight
  111. 12StepRight
  112. 12EndRight
  113. 12Minus
  114. 12Reset
  115. 12Plus
  116. 130
  117. 131
  118. 132
  119. 133
  120. 134
  121. 135
  122. 136
  123. 137
  124. 138
  125. 139
  126. 1310
  127. anm13
  128. 13EndLeft
  129. 13StepLeft
  130. 13PauseLeft
  131. 13PlayLeft
  132. 13PlayPauseLeft
  133. 13PauseRight
  134. 13PlayRight
  135. 13PlayPauseRight
  136. 13StepRight
  137. 13EndRight
  138. 13Minus
  139. 13Reset
  140. 13Plus
  141. pbsARFix243
  142. pbsARFix244
  143. pbsARFix245
  144. pbsARFix246
  145. 140
  146. 141
  147. 142
  148. 143
  149. 144
  150. 145
  151. 146
  152. 147
  153. 148
  154. 149
  155. 1410
  156. 1411
  157. 1412
  158. 1413
  159. 1414
  160. 1415
  161. 1416
  162. 1417
  163. 1418
  164. 1419
  165. 1420
  166. 1421
  167. 1422
  168. 1423
  169. 1424
  170. 1425
  171. 1426
  172. 1427
  173. 1428
  174. 1429
  175. 1430
  176. 1431
  177. 1432
  178. 1433
  179. 1434
  180. 1435
  181. 1436
  182. 1437
  183. 1438
  184. 1439
  185. 1440
  186. 1441
  187. 1442
  188. 1443
  189. 1444
  190. 1445
  191. 1446
  192. 1447
  193. 1448
  194. 1449
  195. 1450
  196. 1451
  197. 1452
  198. 1453
  199. 1454
  200. 1455
  201. 1456
  202. 1457
  203. 1458
  204. 1459
  205. 1460
  206. 1461
  207. 1462
  208. 1463
  209. 1464
  210. 1465
  211. 1466
  212. 1467
  213. 1468
  214. 1469
  215. 1470
  216. 1471
  217. 1472
  218. 1473
  219. 1474
  220. 1475
  221. 1476
  222. 1477
  223. 1478
  224. 1479
  225. 1480
  226. 1481
  227. 1482
  228. 1483
  229. 1484
  230. 1485
  231. 1486
  232. 1487
  233. 1488
  234. 1489
  235. 1490
  236. 1491
  237. 1492
  238. 1493
  239. 1494
  240. 1495
  241. 1496
  242. 1497
  243. 1498
  244. 1499
  245. 14100
  246. 14101
  247. 14102
  248. 14103
  249. 14104
  250. 14105
  251. 14106
  252. 14107
  253. 14108
  254. 14109
  255. 14110
  256. 14111
  257. 14112
  258. 14113
  259. 14114
  260. 14115
  261. 14116
  262. 14117
  263. 14118
  264. 14119
  265. 14120
  266. 14121
  267. 14122
  268. 14123
  269. 14124
  270. 14125
  271. 14126
  272. 14127
  273. 14128
  274. 14129
  275. 14130
  276. 14131
  277. 14132
  278. 14133
  279. 14134
  280. 14135
  281. 14136
  282. 14137
  283. 14138
  284. 14139
  285. 14140
  286. 14141
  287. 14142
  288. 14143
  289. 14144
  290. 14145
  291. 14146
  292. 14147
  293. 14148
  294. 14149
  295. 14150
  296. 14151
  297. 14152
  298. 14153
  299. 14154
  300. 14155
  301. 14156
  302. 14157
  303. 14158
  304. 14159
  305. 14160
  306. 14161
  307. 14162
  308. 14163
  309. 14164
  310. 14165
  311. 14166
  312. 14167
  313. 14168
  314. 14169
  315. 14170
  316. 14171
  317. 14172
  318. 14173
  319. 14174
  320. 14175
  321. 14176
  322. 14177
  323. 14178
  324. 14179
  325. 14180
  326. 14181
  327. 14182
  328. 14183
  329. 14184
  330. 14185
  331. 14186
  332. 14187
  333. 14188
  334. 14189
  335. 14190
  336. 14191
  337. 14192
  338. 14193
  339. 14194
  340. 14195
  341. 14196
  342. 14197
  343. anm14
  344. 14EndLeft
  345. 14StepLeft
  346. 14PauseLeft
  347. 14PlayLeft
  348. 14PlayPauseLeft
  349. 14PauseRight
  350. 14PlayRight
  351. 14PlayPauseRight
  352. 14StepRight
  353. 14EndRight
  354. 14Minus
  355. 14Reset
  356. 14Plus
  357. pbsARFix247
  358. pbsARFix248
  359. 150
  360. 151
  361. 152
  362. 153
  363. 154
  364. 155
  365. 156
  366. 157
  367. 158
  368. 159
  369. 1510
  370. 1511
  371. 1512
  372. 1513
  373. 1514
  374. 1515
  375. 1516
  376. 1517
  377. 1518
  378. 1519
  379. anm15
  380. 15EndLeft
  381. 15StepLeft
  382. 15PauseLeft
  383. 15PlayLeft
  384. 15PlayPauseLeft
  385. 15PauseRight
  386. 15PlayRight
  387. 15PlayPauseRight
  388. 15StepRight
  389. 15EndRight
  390. 15Minus
  391. 15Reset
  392. 15Plus
  393. pbsARFix249
  394. pbsARFix250
  395. pbsARFix251
  396. pbsARFix252
  397. pbsARFix253
  398. pbsARFix254
  399. pbsARFix255
  400. pbsARFix256
  401. pbsARFix257
  402. pbsARFix258
  403. pbsARFix259
  404. pbsARFix260
  405. pbsARFix261
Page 11: Black-ScholesPricingandHedging - NTU · to the Black-Scholes PDE (6.2) in order to price a claim payoff Cof the formC= h(S T).Asinthediscrete-timecase,thearbitragepriceπt(C) at

Black-Scholes Pricing and Hedging

In Figure 66 we plot the Delta of the European call option as a function ofthe underlying asset price and of the time remaining until maturity

Payoff function (x-K)+

0

50

100

150

200

Underlying

0

5

10

15

Time to maturity T-t

0

025

05

075

1

Fig 66 Delta of a European call option with strike price K = 100 r = 3 σ = 10

The Gamma of the European call option is defined as the first derivative ofDelta or second derivative of the option price with respect to the underlyingasset price This gives

γt =1

St|σ|radicT minus t

Φprime(d+(T minus t)

)=

1St|σ|

radic2(T minus t)π

exp(minus1

2

(log(StK) + (r+ σ22)(T minus t)

|σ|radicT minus t

)2)gt 0

In particular a positive value of γt implies that the Delta ξt = ξt(St) shouldincrease when the underlying asset price St increases In other words the po-sition ξt in the underlying asset should be increased by additional purchasesif the underlying asset price St increases

In Figure 67 we plot the (truncated) value of the Gamma of a European calloption as a function of the underlying asset price and of time to maturity

211

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

Fig 67 Gamma of a European call option with strike price K = 100

As Gamma is always nonnegative the Black-Scholes hedging strategy is tokeep buying the risky underlying asset when its price increases and to sell itwhen its price decreases as can be checked from Figure 67

Numerical example - hedging of a call option

In Figure 68 we consider the historical stock price of HSBC Holdings(0005HK) over one year

Fig 68 Graph of the stock price of HSBC Holdings

Consider the call option issued by Societe Generale on 31 December 2008 withstrike price K=$63704 maturity T = October 05 2009 and an entitlementratio of 100 meaning that one option contract is divided into 100 warrants cfpage 9 The next graph gives the time evolution of the Black-Scholes portfoliovalue

t 7minusrarr gc(tSt)

driven by the market price t 7minusrarr St of the risky underlying asset as given inFigure 68 in which the number of days is counted from the origin and notfrom maturity

212

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

40 50 60 70 80 90 0 50 100 150 200

0

5

10

15

20

25

30

35

40

Underlying (HK$) Time in days

Fig 69 Path of the Black-Scholes price for a call option on HSBC

As a consequence of Proposition 64 in the Black-Scholes call option hedgingmodel the amount invested in the risky asset is

Stξt = StΦ(d+(T minus t)

)= StΦ

(log(StK) + (r+ σ22)(T minus t)

|σ|radicT minus t

)gt 0

which is always nonnegative ie there is no short selling and the amountinvested on the riskless asset is

ηtAt = minusK eminus(Tminust)rΦ(dminus(T minus t)

)= minusK eminus(Tminust)rΦ

(log(StK) + (rminus σ22)(T minus t)

|σ|radicT minus t

)6 0

which is always nonpositive ie we are constantly borrowing money on theriskless asset as noted in Figure 610

-60

-40

-20

0

20

40

60

80

100

0 50 100 150 200

K

HK$

Black-Scholes priceRisky investment ξtSt

Riskless investment ηtAtUnderlying asset price

Fig 610 Time evolution of a hedging portfolio for a call option on HSBC

213

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

A comparison of Figure 610 with market data can be found in Figures 911and 912 below

Cash settlement In the case of a cash settlement the option issuer will sat-isfy the option contract by selling ξT = 1 stock at the price ST = $83refund the K = $63 risk-free investment and hand in the remaining amountC = (ST minusK)+ = 83minus 63 = $20 to the option holder

Physical delivery In the case of physical delivery of the underlying asset theoption issuer will deliver ξT = 1 stock to the option holder in exchange forK = $63 which will be used together with the portfolio value to refund therisk-free loan

63 European Put Options

Similarly in the case of the European put option with strike price K thepayoff function is given by h(x) = (Kminusx)+ and the Black-Scholes PDE (67)reads

rgp(tx) =partgppartt

(tx) + rxpartgppartx

(tx) + 12σ

2x2 part2gppartx2 (tx)

gp(T x) = (K minus x)+(617)

The next proposition can be proved as in Sections 65 and 66 see Proposi-tion 611

Proposition 65 The solution of the PDE (617) is given by the Black-Scholes formula for put options

gp(tx) = K eminus(Tminust)rΦ(minus dminus(T minus t)

)minus xΦ

(minus d+(T minus t)

) (618)

withd+(T minus t) =

log(xK) + (r+ σ22)(T minus t)|σ|radicT minus t

(619)

dminus(T minus t) =log(xK) + (rminus σ22)(T minus t)

|σ|radicT minus t

(620)

as illustrated in Figure 611

214

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

Fig 611 Graph of the Black-Scholes put price function with strike price K = 100lowast

In other words the European put option with strike price K and maturityT is priced at time t isin [0T ] as

gp(tSt) = K eminus(Tminust)rΦ(minus dminus(T minus t)

)minus StΦ

(minus d+(T minus t)

) 0 6 t 6 T

Fig 612 Time-dependent solution of the Black-Scholes PDE (put option)dagger

The following R script is an implementation of the Black-Scholes formula forEuropean put options in R

1 BSPut lt- function(S K r T sigma)d1 = (log(SK)+(r+sigma^22)T)(sigmasqrt(T))

3 d2 = d1 - sigma sqrt(T)BSPut = Kexp(-rT) pnorm(-d2) - Spnorm(-d1)

5 BSPut

Call-put parity

lowast Right-click on the figure for interaction and ldquoFull Screen Multimediardquo viewdagger The animation works in Acrobat Reader on the entire pdf file

215

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

(C) 2012--today Alexander Grahn 3Dmenujs version 20140923 3D JavaScript used by media9sty Extended functionality of the (right click) context menu of 3D annotations 1) Adds the following items to the 3D context menu `Generate Default View Finds good default camera settings returned as options for use with the includemedia command `Get Current View Determines camera cross section and part settings of the current view returned as `VIEW section that can be copied into a views file of additional views The views file is inserted using the `3Dviews option of includemedia `Cross Section Toggle switch to add or remove a cross section into or from the current view The cross section can be moved in the x y z directions using x y z and X Y Z keys on the keyboard be tilted against and spun around the upright Z axis using the UpDown and LeftRight arrow keys and caled using the s and S keys 2) Enables manipulation of position and orientation of indiviual parts and groups of parts in the 3D scene Parts which have been selected with the mouse can be scaled moved around and rotated like the cross section as described above To spin the parts around their local up-axis keep Control key pressed while using the UpDown and LeftRight arrow keys This work may be distributed andor modified under the conditions of the LaTeX Project Public License The latest version of this license is in httpmirrorsctanorgmacroslatexbaselppltxt This work has the LPPL maintenance status `maintained The Current Maintainer of this work is A Grahn The code borrows heavily from Bernd Gaertners `Miniball software originally written in C++ for computing the smallest enclosing ball of a set of points see httpwwwinfethzchpersonalgaertnerminiballhtmlhostconsoleshow()constructor for doubly linked listfunction List() thisfirst_node=null thislast_node=new Node(undefined)Listprototypepush_back=function(x) var new_node=new Node(x) if(thisfirst_node==null) thisfirst_node=new_node new_nodeprev=null else new_nodeprev=thislast_nodeprev new_nodeprevnext=new_node new_nodenext=thislast_node thislast_nodeprev=new_nodeListprototypemove_to_front=function(it) var node=itget() if(nodenext=null ampamp nodeprev=null) nodenextprev=nodeprev nodeprevnext=nodenext nodeprev=null nodenext=thisfirst_node thisfirst_nodeprev=node thisfirst_node=node Listprototypebegin=function() var i=new Iterator() itarget=thisfirst_node return(i)Listprototypeend=function() var i=new Iterator() itarget=thislast_node return(i)function Iterator(it) if( it=undefined ) thistarget=ittarget else thistarget=null Iteratorprototypeset=function(it)thistarget=ittargetIteratorprototypeget=function()return(thistarget)Iteratorprototypederef=function()return(thistargetdata)Iteratorprototypeincr=function() if(thistargetnext=null) thistarget=thistargetnextconstructor for node objects that populate the linked listfunction Node(x) thisprev=null thisnext=null thisdata=xfunction sqr(r)return(rr)helper functionMiniball algorithm by B Gaertnerfunction Basis() thism=0 thisq0=new Array(3) thisz=new Array(4) thisf=new Array(4) thisv=new Array(new Array(3) new Array(3) new Array(3) new Array(3)) thisa=new Array(new Array(3) new Array(3) new Array(3) new Array(3)) thisc=new Array(new Array(3) new Array(3) new Array(3) new Array(3)) thissqr_r=new Array(4) thiscurrent_c=thisc[0] thiscurrent_sqr_r=0 thisreset()Basisprototypecenter=function()return(thiscurrent_c)Basisprototypesize=function()return(thism)Basisprototypepop=function()--thismBasisprototypeexcess=function(p) var e=-thiscurrent_sqr_r for(var k=0klt3++k) e+=sqr(p[k]-thiscurrent_c[k]) return(e)Basisprototypereset=function() thism=0 for(var j=0jlt3++j) thisc[0][j]=0 thiscurrent_c=thisc[0] thiscurrent_sqr_r=-1Basisprototypepush=function(p) var i j var eps=1e-32 if(thism==0) for(i=0ilt3++i) thisq0[i]=p[i] for(i=0ilt3++i) thisc[0][i]=thisq0[i] thissqr_r[0]=0 else for(i=0ilt3++i) thisv[thism][i]=p[i]-thisq0[i] for(i=1iltthism++i) thisa[thism][i]=0 for(j=0jlt3++j) thisa[thism][i]+=thisv[i][j]thisv[thism][j] thisa[thism][i]=(2thisz[i]) for(i=1iltthism++i) for(j=0jlt3++j) thisv[thism][j]-=thisa[thism][i]thisv[i][j] thisz[thism]=0 for(j=0jlt3++j) thisz[thism]+=sqr(thisv[thism][j]) thisz[thism]=2 if(thisz[thism]ltepsthiscurrent_sqr_r) return(false) var e=-thissqr_r[thism-1] for(i=0ilt3++i) e+=sqr(p[i]-thisc[thism-1][i]) thisf[thism]=ethisz[thism] for(i=0ilt3++i) thisc[thism][i]=thisc[thism-1][i]+thisf[thism]thisv[thism][i] thissqr_r[thism]=thissqr_r[thism-1]+ethisf[thism]2 thiscurrent_c=thisc[thism] thiscurrent_sqr_r=thissqr_r[thism] ++thism return(true)function Miniball() thisL=new List() thisB=new Basis() thissupport_end=new Iterator()Miniballprototypemtf_mb=function(it) var i=new Iterator(it) thissupport_endset(thisLbegin()) if((thisBsize())==4) return for(var k=new Iterator(thisLbegin())kget()=iget()) var j=new Iterator(k) kincr() if(thisBexcess(jderef()) gt 0) if(thisBpush(jderef())) thismtf_mb(j) thisBpop() if(thissupport_endget()==jget()) thissupport_endincr() thisLmove_to_front(j) Miniballprototypecheck_in=function(b) thisLpush_back(b)Miniballprototypebuild=function() thisBreset() thissupport_endset(thisLbegin()) thismtf_mb(thisLend())Miniballprototypecenter=function() return(thisBcenter())Miniballprototyperadius=function() return(Mathsqrt(thisBcurrent_sqr_r))functions called by menu itemsfunction calc3Dopts () create Miniball object var mb=new Miniball() auxiliary vector var corner=new Vector3() iterate over all visible mesh nodes in the scene for(i=0iltscenemeshescounti++) var mesh=scenemeshesgetByIndex(i) if(meshvisible) continue local to parent transformation matrix var trans=meshtransform build local to world transformation matrix by recursively multiplying the parents transf matrix on the right var parent=meshparent while(parenttransform) trans=transmultiply(parenttransform) parent=parentparent get the bbox of the mesh (local coordinates) var bbox=meshcomputeBoundingBox() transform the local bounding box corner coordinates to world coordinates for bounding sphere determination BBoxmin cornerset(bboxmin) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) BBoxmax cornerset(bboxmax) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) remaining six BBox corners cornerset(bboxminx bboxmaxy bboxmaxz) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) cornerset(bboxminx bboxminy bboxmaxz) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) cornerset(bboxminx bboxmaxy bboxminz) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) cornerset(bboxmaxx bboxminy bboxminz) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) cornerset(bboxmaxx bboxminy bboxmaxz) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) cornerset(bboxmaxx bboxmaxy bboxminz) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) compute the smallest enclosing bounding sphere mbbuild() current camera settings var camera=scenecamerasgetByIndex(0) var res= initialize result string aperture angle of the virtual camera (perspective projection) or orthographic scale (orthographic projection) if(cameraprojectionType==cameraTYPE_PERSPECTIVE) var aac=camerafov180MathPI if(hostutilprintf(4f aac)=30) res+=hostutilprintf(n3Daac=s aac) else cameraviewPlaneSize=2mbradius() res+=hostutilprintf(n3Dortho=s 1cameraviewPlaneSize) camera roll var roll = cameraroll180MathPI if(hostutilprintf(4f roll)=0) res+=hostutilprintf(n3Droll=sroll) target to camera vector var c2c=new Vector3() c2cset(cameraposition) c2csubtractInPlace(cameratargetPosition) c2cnormalize() if((c2cx==0 ampamp c2cy==-1 ampamp c2cz==0)) res+=hostutilprintf(n3Dc2c=s s s c2cx c2cy c2cz) new camera settings bounding sphere centre --gt new camera target var coo=new Vector3() cooset((mbcenter())[0] (mbcenter())[1] (mbcenter())[2]) if(coolength) res+=hostutilprintf(n3Dcoo=s s s coox cooy cooz) radius of orbit if(cameraprojectionType==cameraTYPE_PERSPECTIVE) var roo=mbradius() Mathsin(aac MathPI 360) else orthographic projection var roo=mbradius() res+=hostutilprintf(n3Droo=s roo) update camera settings in the viewer var currol=cameraroll cameratargetPositionset(coo) camerapositionset(cooadd(c2cscale(roo))) cameraroll=currol determine background colour rgb=scenebackgroundgetColor() if((rgbr==1 ampamp rgbg==1 ampamp rgbb==1)) res+=hostutilprintf(n3Dbg=s s s rgbr rgbg rgbb) determine lighting scheme switch(scenelightScheme) case sceneLIGHT_MODE_FILE curlights=Artworkbreak case sceneLIGHT_MODE_NONE curlights=Nonebreak case sceneLIGHT_MODE_WHITE curlights=Whitebreak case sceneLIGHT_MODE_DAY curlights=Daybreak case sceneLIGHT_MODE_NIGHT curlights=Nightbreak case sceneLIGHT_MODE_BRIGHT curlights=Hardbreak case sceneLIGHT_MODE_RGB curlights=Primarybreak case sceneLIGHT_MODE_BLUE curlights=Bluebreak case sceneLIGHT_MODE_RED curlights=Redbreak case sceneLIGHT_MODE_CUBE curlights=Cubebreak case sceneLIGHT_MODE_CAD curlights=CADbreak case sceneLIGHT_MODE_HEADLAMP curlights=Headlampbreak if(curlights=Artwork) res+=hostutilprintf(n3Dlights=s curlights) determine global render mode switch(scenerenderMode) case sceneRENDER_MODE_BOUNDING_BOX currender=BoundingBoxbreak case sceneRENDER_MODE_TRANSPARENT_BOUNDING_BOX currender=TransparentBoundingBoxbreak case sceneRENDER_MODE_TRANSPARENT_BOUNDING_BOX_OUTLINE currender=TransparentBoundingBoxOutlinebreak case sceneRENDER_MODE_VERTICES currender=Verticesbreak case sceneRENDER_MODE_SHADED_VERTICES currender=ShadedVerticesbreak case sceneRENDER_MODE_WIREFRAME currender=Wireframebreak case sceneRENDER_MODE_SHADED_WIREFRAME currender=ShadedWireframebreak case sceneRENDER_MODE_SOLID currender=Solidbreak case sceneRENDER_MODE_TRANSPARENT currender=Transparentbreak case sceneRENDER_MODE_SOLID_WIREFRAME currender=SolidWireframebreak case sceneRENDER_MODE_TRANSPARENT_WIREFRAME currender=TransparentWireframebreak case sceneRENDER_MODE_ILLUSTRATION currender=Illustrationbreak case sceneRENDER_MODE_SOLID_OUTLINE currender=SolidOutlinebreak case sceneRENDER_MODE_SHADED_ILLUSTRATION currender=ShadedIllustrationbreak case sceneRENDER_MODE_HIDDEN_WIREFRAME currender=HiddenWireframebreak if(currender=Solid) res+=hostutilprintf(n3Drender=s currender) write result string to the console hostconsoleshow() hostconsoleclear() hostconsoleprintln(n Copy and paste the following text to then+ option list of includemedian + res + n)function get3Dview () var camera=scenecamerasgetByIndex(0) var coo=cameratargetPosition var c2c=camerapositionsubtract(coo) var roo=c2clength c2cnormalize() var res=VIEW=insert optional name heren if((coox==0 ampamp cooy==0 ampamp cooz==0)) res+=hostutilprintf( COO=s s sn coox cooy cooz) if((c2cx==0 ampamp c2cy==-1 ampamp c2cz==0)) res+=hostutilprintf( C2C=s s sn c2cx c2cy c2cz) if(roo gt 1e-9) res+=hostutilprintf( ROO=sn roo) var roll = cameraroll180MathPI if(hostutilprintf(4f roll)=0) res+=hostutilprintf( ROLL=sn roll) if(cameraprojectionType==cameraTYPE_PERSPECTIVE) var aac=camerafov 180MathPI if(hostutilprintf(4f aac)=30) res+=hostutilprintf( AAC=sn aac) else if(hostutilprintf(4f cameraviewPlaneSize)=1) res+=hostutilprintf( ORTHO=sn 1cameraviewPlaneSize) rgb=scenebackgroundgetColor() if((rgbr==1 ampamp rgbg==1 ampamp rgbb==1)) res+=hostutilprintf( BGCOLOR=s s sn rgbr rgbg rgbb) switch(scenelightScheme) case sceneLIGHT_MODE_FILE curlights=Artworkbreak case sceneLIGHT_MODE_NONE curlights=Nonebreak case sceneLIGHT_MODE_WHITE curlights=Whitebreak case sceneLIGHT_MODE_DAY curlights=Daybreak case sceneLIGHT_MODE_NIGHT curlights=Nightbreak case sceneLIGHT_MODE_BRIGHT curlights=Hardbreak case sceneLIGHT_MODE_RGB curlights=Primarybreak case sceneLIGHT_MODE_BLUE curlights=Bluebreak case sceneLIGHT_MODE_RED curlights=Redbreak case sceneLIGHT_MODE_CUBE curlights=Cubebreak case sceneLIGHT_MODE_CAD curlights=CADbreak case sceneLIGHT_MODE_HEADLAMP curlights=Headlampbreak if(curlights=Artwork) res+= LIGHTS=+curlights+n switch(scenerenderMode) case sceneRENDER_MODE_BOUNDING_BOX defaultrender=BoundingBoxbreak case sceneRENDER_MODE_TRANSPARENT_BOUNDING_BOX defaultrender=TransparentBoundingBoxbreak case sceneRENDER_MODE_TRANSPARENT_BOUNDING_BOX_OUTLINE defaultrender=TransparentBoundingBoxOutlinebreak case sceneRENDER_MODE_VERTICES defaultrender=Verticesbreak case sceneRENDER_MODE_SHADED_VERTICES defaultrender=ShadedVerticesbreak case sceneRENDER_MODE_WIREFRAME defaultrender=Wireframebreak case sceneRENDER_MODE_SHADED_WIREFRAME defaultrender=ShadedWireframebreak case sceneRENDER_MODE_SOLID defaultrender=Solidbreak case sceneRENDER_MODE_TRANSPARENT defaultrender=Transparentbreak case sceneRENDER_MODE_SOLID_WIREFRAME defaultrender=SolidWireframebreak case sceneRENDER_MODE_TRANSPARENT_WIREFRAME defaultrender=TransparentWireframebreak case sceneRENDER_MODE_ILLUSTRATION defaultrender=Illustrationbreak case sceneRENDER_MODE_SOLID_OUTLINE defaultrender=SolidOutlinebreak case sceneRENDER_MODE_SHADED_ILLUSTRATION defaultrender=ShadedIllustrationbreak case sceneRENDER_MODE_HIDDEN_WIREFRAME defaultrender=HiddenWireframebreak if(defaultrender=Solid) res+= RENDERMODE=+defaultrender+n detect existing Clipping Plane (3D Cross Section) var clip=null if( clip=scenenodesgetByName($$$$$$)|| clip=scenenodesgetByName(Clipping Plane) ) for(var i=0iltscenenodescounti++) var nd=scenenodesgetByIndex(i) if(nd==clip||ndname==) continue var ndUTFName= for (var j=0 jltndnamelength j++) var theUnicode = ndnamecharCodeAt(j)toString(16) while (theUnicodelengthlt4) theUnicode = 0 + theUnicode ndUTFName += theUnicode var end=ndnamelastIndexOf() if(endgt0) var ndUserName=ndnamesubstr(0end) else var ndUserName=ndname respart= PART=+ndUserName+n respart+= UTF16NAME=+ndUTFName+n defaultvals=true if(ndvisible) respart+= VISIBLE=falsen defaultvals=false if(ndopacitylt10) respart+= OPACITY=+ndopacity+n defaultvals=false if(ndconstructorname==Mesh) currender=defaultrender switch(ndrenderMode) case sceneRENDER_MODE_BOUNDING_BOX currender=BoundingBoxbreak case sceneRENDER_MODE_TRANSPARENT_BOUNDING_BOX currender=TransparentBoundingBoxbreak case sceneRENDER_MODE_TRANSPARENT_BOUNDING_BOX_OUTLINE currender=TransparentBoundingBoxOutlinebreak case sceneRENDER_MODE_VERTICES currender=Verticesbreak case sceneRENDER_MODE_SHADED_VERTICES currender=ShadedVerticesbreak case sceneRENDER_MODE_WIREFRAME currender=Wireframebreak case sceneRENDER_MODE_SHADED_WIREFRAME currender=ShadedWireframebreak case sceneRENDER_MODE_SOLID currender=Solidbreak case sceneRENDER_MODE_TRANSPARENT currender=Transparentbreak case sceneRENDER_MODE_SOLID_WIREFRAME currender=SolidWireframebreak case sceneRENDER_MODE_TRANSPARENT_WIREFRAME currender=TransparentWireframebreak case sceneRENDER_MODE_ILLUSTRATION currender=Illustrationbreak case sceneRENDER_MODE_SOLID_OUTLINE currender=SolidOutlinebreak case sceneRENDER_MODE_SHADED_ILLUSTRATION currender=ShadedIllustrationbreak case sceneRENDER_MODE_HIDDEN_WIREFRAME currender=HiddenWireframebreak case sceneRENDER_MODE_DEFAULT currender=Defaultbreak if(currender=defaultrender) respart+= RENDERMODE=+currender+n defaultvals=false if(origtrans[ndname]ampampndtransformisEqual(origtrans[ndname])) var lvec=ndtransformtransformDirection(new Vector3(100)) var uvec=ndtransformtransformDirection(new Vector3(010)) var vvec=ndtransformtransformDirection(new Vector3(001)) respart+= TRANSFORM= +lvecx+ +lvecy+ +lvecz+ +uvecx+ +uvecy+ +uvecz+ +vvecx+ +vvecy+ +vvecz+ +ndtransformtranslationx+ +ndtransformtranslationy+ +ndtransformtranslationz+n defaultvals=false respart+= ENDn if(defaultvals) res+=respart if(clip) var centre=cliptransformtranslation var normal=cliptransformtransformDirection(new Vector3(001)) res+= CROSSSECTn if((centrex==0 ampamp centrey==0 ampamp centrez==0)) res+=hostutilprintf( CENTER=s s sn centrex centrey centrez) if((normalx==1 ampamp normaly==0 ampamp normalz==0)) res+=hostutilprintf( NORMAL=s s sn normalx normaly normalz) res+=hostutilprintf( VISIBLE=sn clipvisible) res+=hostutilprintf( PLANECOLOR=s s sn clipmaterialemissiveColorr clipmaterialemissiveColorg clipmaterialemissiveColorb) res+=hostutilprintf( OPACITY=sn clipopacity) res+=hostutilprintf( INTERSECTIONCOLOR=s s sn clipwireframeColorr clipwireframeColorg clipwireframeColorb) res+= ENDn for(var propt in clip) consoleprintln(propt++clip[propt]) res+=ENDn hostconsoleshow() hostconsoleclear() hostconsoleprintln(n Add the following VIEW section to a file ofn+ predefined views (See option 3Dviews)nn + The view may be given a name after VIEW=n + (Remove in front of =)n) hostconsoleprintln(res + n)add items to 3D context menuruntimeaddCustomMenuItem(dfltview Generate Default View default 0)runtimeaddCustomMenuItem(currview Get Current View default 0)runtimeaddCustomMenuItem(csection Cross Section checked 0)menu event handlersmenuEventHandler = new MenuEventHandler()menuEventHandleronEvent = function(e) switch(emenuItemName) case dfltview calc3Dopts() break case currview get3Dview() break case csection addremoveClipPlane(emenuItemChecked) break runtimeaddEventHandler(menuEventHandler)global variable taking reference to currently selected nodevar target=nullselectionEventHandler=new SelectionEventHandler()selectionEventHandleronEvent=function(e) if(eselectedampampenodename=) target=enode else target=null runtimeaddEventHandler(selectionEventHandler)cameraEventHandler=new CameraEventHandler()cameraEventHandleronEvent=function(e) var clip=null runtimeremoveCustomMenuItem(csection) runtimeaddCustomMenuItem(csection Cross Section checked 0) if(clip=scenenodesgetByName($$$$$$)|| predefined scenenodesgetByName(Clipping Plane)) added via context menu runtimeremoveCustomMenuItem(csection) runtimeaddCustomMenuItem(csection Cross Section checked 1) if(clip)plane in predefined views must be rotated by 90 deg around normal cliptransformrotateAboutLineInPlace( MathPI2cliptransformtranslation cliptransformtransformDirection(new Vector3(001)) ) for(var i=0 iltrot4x4length i++)rot4x4[i]setIdentity() target=nullruntimeaddEventHandler(cameraEventHandler)var rot4x4=new Array() keeps track of spin and tilt axes transformationskey event handler for scaling moving spinning and tilting objectskeyEventHandler=new KeyEventHandler()keyEventHandleronEvent=function(e) var backtrans=new Matrix4x4() var trgt=null if(target) trgt=target var backtrans=new Matrix4x4() var trans=trgttransform var parent=trgtparent while(parenttransform) build local to world transformation matrix transmultiplyInPlace(parenttransform) also build world to local back-transformation matrix backtransmultiplyInPlace(parenttransforminversetranspose) parent=parentparent backtranstransposeInPlace() else if( trgt=scenenodesgetByName($$$$$$)|| trgt=scenenodesgetByName(Clipping Plane) ) var trans=trgttransform if(trgt) return var tname=trgtname if(typeof(rot4x4[tname])==undefined) rot4x4[tname]=new Matrix4x4() if(target) var tiltAxis=rot4x4[tname]transformDirection(new Vector3(010)) else var tiltAxis=transtransformDirection(new Vector3(010)) var spinAxis=rot4x4[tname]transformDirection(new Vector3(001)) get the centre of the mesh if(targetampamptrgtconstructorname==Mesh) var centre=transtransformPosition(trgtcomputeBoundingBox()center) else part group (Node3 parent node clipping plane) var centre=new Vector3(transtranslation) switch(echaracterCode) case 30tilt up rot4x4[tname]rotateAboutLineInPlace( -MathPI900rot4x4[tname]translationtiltAxis) transrotateAboutLineInPlace(-MathPI900centretiltAxis) break case 31tilt down rot4x4[tname]rotateAboutLineInPlace( MathPI900rot4x4[tname]translationtiltAxis) transrotateAboutLineInPlace(MathPI900centretiltAxis) break case 28spin right if(ectrlKeyDownampamptarget) transrotateAboutLineInPlace(-MathPI900centrespinAxis) else rot4x4[tname]rotateAboutLineInPlace( -MathPI900rot4x4[tname]translationnew Vector3(001)) transrotateAboutLineInPlace(-MathPI900centrenew Vector3(001)) break case 29spin left if(ectrlKeyDownampamptarget) transrotateAboutLineInPlace(MathPI900centrespinAxis) else rot4x4[tname]rotateAboutLineInPlace( MathPI900rot4x4[tname]translationnew Vector3(001)) transrotateAboutLineInPlace(MathPI900centrenew Vector3(001)) break case 120 x translateTarget(trans new Vector3(100) e) break case 121 y translateTarget(trans new Vector3(010) e) break case 122 z translateTarget(trans new Vector3(001) e) break case 88 shift + x translateTarget(trans new Vector3(-100) e) break case 89 shift + y translateTarget(trans new Vector3(0-10) e) break case 90 shift + z translateTarget(trans new Vector3(00-1) e) break case 115 s transtranslateInPlace(centrescale(-1)) transscaleInPlace(101) transtranslateInPlace(centrescale(1)) break case 83 shift + s transtranslateInPlace(centrescale(-1)) transscaleInPlace(1101) transtranslateInPlace(centrescale(1)) break transmultiplyInPlace(backtrans)runtimeaddEventHandler(keyEventHandler)translates object by amount calculated from Canvas sizefunction translateTarget(t d e) var cam=scenecamerasgetByIndex(0) if(camprojectionType==camTYPE_PERSPECTIVE) var scale=Mathtan(camfov2) camtargetPositionsubtract(camposition)length Mathmin(ecanvasPixelWidthecanvasPixelHeight) else var scale=camviewPlaneSize2 Mathmin(ecanvasPixelWidthecanvasPixelHeight) ttranslateInPlace(dscale(scale))function addremoveClipPlane(chk) var curTrans=getCurTrans() var clip=scenecreateClippingPlane() if(chk) add Clipping Plane and place its center either into the camera target position or into the centre of the currently selected mesh node var centre=new Vector3() if(target) var trans=targettransform var parent=targetparent while(parenttransform) trans=transmultiply(parenttransform) parent=parentparent if(targetconstructorname==Mesh) var centre=transtransformPosition(targetcomputeBoundingBox()center) else var centre=new Vector3(transtranslation) target=null else centreset(scenecamerasgetByIndex(0)targetPosition) cliptransformsetView( new Vector3(000) new Vector3(100) new Vector3(010)) cliptransformtranslateInPlace(centre) else if( scenenodesgetByName($$$$$$)|| scenenodesgetByName(Clipping Plane) ) clipremove()clip=null restoreTrans(curTrans) return clipfunction to store current transformation matrix of all nodes in the scenefunction getCurTrans() var tA=new Array() for(var i=0 iltscenenodescount i++) var nd=scenenodesgetByIndex(i) if(ndname==) continue tA[ndname]=new Matrix4x4(ndtransform) return tAfunction to restore transformation matrices given as argfunction restoreTrans(tA) for(var i=0 iltscenenodescount i++) var nd=scenenodesgetByIndex(i) if(tA[ndname]) ndtransformset(tA[ndname]) store original transformation matrix of all mesh nodes in the scenevar origtrans=getCurTrans()set initial state of Cross Section menu entrycameraEventHandleronEvent(1)hostconsoleclear()

var ocgs=hostgetOCGs(hostpageNum)for(var i=0iltocgslengthi++)if(ocgs[i]name==MediaPlayButton2)ocgs[i]state=false

(C) 2012 Michail Vidiassov John C Bowman Alexander Grahn asylabelsjs version 20120912 3D JavaScript to be used with media9sty (option `add3Djscript) for Asymptote generated PRC files adds billboard behaviour to text labels in Asymptote PRC files so that they always face the camera under 3D rotation This work may be distributed andor modified under the conditions of the LaTeX Project Public License The latest version of this license is in httpmirrorsctanorgmacroslatexbaselppltxt This work has the LPPL maintenance status `maintained The Current Maintainer of this work is A Grahnvar bbnodes=new Array() billboard meshesvar bbtrans=new Array() billboard transformsfunction fulltransform(mesh) var t=new Matrix4x4(meshtransform) if(meshparentname = ) var parentTransform=fulltransform(meshparent) tmultiplyInPlace(parentTransform) return t else return t find all text labels in the scene and determine pivoting pointsvar nodes=scenenodesvar nodescount=nodescountvar third=1030for(var i=0 i lt nodescount i++) var node=nodesgetByIndex(i) var name=nodename var end=namelastIndexOf()-1 if(end gt 0) if(namecharAt(end) == 001) var start=namelastIndexOf(-)+1 if(end gt start) nodename=namesubstr(0start-1) var nodeMatrix=fulltransform(nodeparent) var c=nodeMatrixtranslation position var d=Mathpow(Mathabs(nodeMatrixdeterminant)third) scale bbnodespush(node) bbtranspush(Matrix4x4()scale(ddd)translate(c)multiply(nodeMatrixinverse)) var camera=scenecamerasgetByIndex(0) var zero=new Vector3(000)var bbcount=bbnodeslength event handler to maintain camera-facing text labelsbillboardHandler=new RenderEventHandler()billboardHandleronEvent=function(event) var T=new Matrix4x4() TsetView(zerocamerapositionsubtract(cameratargetPosition) cameraupsubtract(cameraposition)) for(var j=0 j lt bbcount j++) bbnodes[j]transformset(Tmultiply(bbtrans[j])) runtimerefresh() runtimeaddEventHandler(billboardHandler)runtimerefresh()

(C) 2012 Alexander Grahn 3Dspintooljs version 20120301 3D JavaScript to be used with media9sty (option `add3Djscript) enables the Spin tool (also accessible via 3D toolbar or context menu) upon activation of the 3D scene the scene then rotates around the upright axis while dragging with the mouse This work may be distributed andor modified under the conditions of the LaTeX Project Public License The latest version of this license is in httpmirrorsctanorgmacroslatexbaselppltxt This work has the LPPL maintenance status `maintained The Current Maintainer of this work is A GrahnruntimesetCurrentTool(runtimeTOOL_NAME_SPIN)

N Privault

Proposition 66 Call-put parity We have the call-put parity relation

gc(tSt)minus gp(tSt) = St minusK eminus(Tminust)r 0 6 t 6 T (621)

between the Black-Scholes prices of call and put options in terms of theforward contract price St minusK eminus(Tminust)r

Proof The call-put parity (621) is a consequence of the relation

xminusK = (xminusK)+ minus (K minus x)+

satisfied by the terminal call and put payoff functions in the Black-ScholesPDE (67) It can also be verified directly from (610) and (618) as

gc(tx)minus gp(tx) = xΦ(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)minus(K eminus(Tminust)rΦ

(minus dminus(T minus t)

)minus xΦ

(minus d+(T minus t)

))= xΦ

(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)minusK eminus(Tminust)r

(1minusΦ

(dminus(T minus t)

))+ x

(1minusΦ

(d+(T minus t)

))= xminusK

The Delta of the Black-Scholes put option can be obtained by differentiationof the call-put parity relation (621) and Proposition 64

Proposition 67 The Delta of the Black-Scholes put option is given by

ξt = minus(1minusΦ(d+(T minus t)

)) = minusΦ

(minus d+(T minus t)

)isin [minus1 0] 0 6 t 6 T

Proof By the call-put parity relation (621) and Proposition 64 we have

partgppartx

(tSt) =partgcpartx

(tSt)minus 1

= Φ(d+(T minus t))minus 1= minusΦ(minusd+(T minus t)) 0 6 t 6 T

where we applied (614)

As a consequence of Proposition 67 the Black-Scholes put price splitsinto a risky component minusStΦ

(minus d+(T minus t)

)and a riskless component

K eminus(Tminust)rΦ(minus dminus(T minus t)

) as follows

gp(tSt) = K eminus(Tminust)rΦ(minus dminus(T minus t)

)︸ ︷︷ ︸riskminusfree investment (savings)

minus StΦ(minus d+(T minus t)

)︸ ︷︷ ︸

risky investment (short)

0 6 t 6 T

216

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

In Figure 613 we plot the Delta of the European put option as a function ofthe underlying asset price and of the time remaining until maturity

Payoff function (x-K)+

0

50

100

150

200

Underlying

0

5

10

15 Time to maturity T-t

-1

-075

-05

-025

0

Fig 613 Delta of a European put option with strike price K = 100 r = 3 σ = 10

Numerical example - hedging of a put option

For one more example we consider a put option issued by BNP Paribas on04 November 2008 with strike price K=$77667 maturity T = October 052009 and entitlement ratio 92593 cf page 9 In the next Figure 614 thenumber of days is counted from the origin not from maturity

40 50 60 70 80 90 100

0 50 100 150 200

0 5

10 15 20 25 30 35 40 45

Underlying (HK$)Time in days

Fig 614 Path of the Black-Scholes price for a put option on HSBC

As a consequence of Proposition 67 the amount invested on the risky assetfor the hedging of a put option is

minusStΦ(minus d+(T minus t)

)= minusStΦ

(minus log(StK) + (r+ σ22)(T minus t)

|σ|radicT minus t

)6 0

217

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

ie there is always short selling and the amount invested on the riskless assetpriced At = ert t isin [0T ] is

ηtAt = K eminus(Tminust)rΦ(minus dminus(T minus t)

)= K eminus(Tminust)rΦ

(minus log(StK) + (rminus σ22)(T minus t)

|σ|radicT minus t

)gt 0

which is always nonnegative ie we are constantly saving money on theriskless asset as noted in Figure 615

-60

-40

-20

0

20

40

60

80

100

0 50 100 150 200

K

HK$

Black-Scholes priceRisky investment ξtSt

Riskless investment ηtAtUnderlying asset price

Fig 615 Time evolution of the hedging portfolio for a put option on HSBC

In the above example the put option finished out of the money (OTM) so thatno cash settlement or physical delivery occurs A comparison of Figure 610with market data can be found in Figures 913 and 914 below

64 Market Terms and Data

The following Table 61 provides a summary of formulas for the computationof Black-Scholes sensitivities also called Greekslowast

lowast ldquoEvery class feels like attending a Greek lessonrdquo (AY2018-2019 student feedback)

218

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

Call option Put option

Option price g(tSt) StΦ(d+(T minus t))minusK eminus(Tminust)rΦ(dminus(T minus t)) K eminus(Tminust)rΦ(minusdminus(T minus t))minus StΦ(minusd+(T minus t))

Delta (∆) partg

partx(tSt) Φ(d+(T minus t)) gt 0 minusΦ(minusd+(T minus t)) 6 0

Gamma (Γ) part2g

partx2 (tSt)Φprime(d+(T minus t))St|σ|

radicT minus t

gt 0

Vega partg

partσ(tSt) St

radicT minus tΦprime(d+(T minus t)) gt 0

Theta (Θ) partg

partt(tSt) minusSt|σ|Φ

prime(d+(T minus t))2radicT minus t

minus rK eminus(Tminust)rΦ(dminus(T minus t)) 6 0 minusSt|σ|Φprime(d+(T minus t))

2radicT minus t

+ rK eminus(Tminust)rΦ(minusdminus(T minus t))

Rho (ρ) partg

partr(tSt) K(T minus t) eminus(Tminust)rΦ(dminus(T minus t)) minusK(T minus t) eminus(Tminust)rΦ(minusdminus(T minus t))

Table 61 Black-Scholes Greeks (Wikipedia)

From Table 61 we can conclude that call option prices are increasing func-tions of the underlying asset price St of the interest rate r and of the volatil-ity parameter σ Similarly put option prices are decreasing functions of theunderlying asset price St of the interest rate r and increasing functions ofthe volatility parameter σ

Parameter Variation of call option prices Variation of put option prices

Underlying St increasing decreasing

Volatility σ increasing increasing

Time t decreasing depends on the underlying price level

Interest rate r increasing decreasing

Table 62 Variations of Black-Scholes prices

The change of sign of the sensitivity Theta (Θ) with respect to time t can beverified in the following Figure 616

219

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

(a) Black-Scholes call price maps (b) Black-Scholes put price maps

Fig 616 Time-dependent solutions of the Black-Scholes PDElowast

Intrinsic value The intrinsic value at time t isin [0T ] of the option withpayoff C = h

(S(1)T

)is given by the immediate exercise payoff h

(S(1)t

) The

extrinsic value at time t isin [0T ] of the option is the remaining differenceπt(C) minus h

(S(1)t

)between the option price πt(C) and the immediate ex-

ercise payoff h(S(1)t

) In general the option price πt(C) decomposes as

πt(C) = h(S(1)t

)︸ ︷︷ ︸intrinsic value

+ πt(C)minus h(S(1)t

)︸ ︷︷ ︸

extrinsic value

0 6 t 6 T ]

Gearing The gearing at time t isin [0T ] of the option with payoff C = h(ST )is defined as the ratio

Gt =St

πt(C)=

Stg(tSt)

0 6 t 6 T

Effective gearing The effective gearing at time t isin [0T ] of the option withpayoff C = h(ST ) is defined as the ratio

Get = Gtξt

=ξtStπt(C)

=St

πt(C)

partg

partx(tSt)

=St

g(tSt)partg

partx(tSt)

= Stpart

partxlog g(tSt) 0 6 t 6 T

lowast The animation works in Acrobat Reader on the entire pdf file

220

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

The effective gearingGet =

ξtStπt(C)

can be interpreted as the hedge ratio ie the percentage of the portfoliowhich is invested on the risky asset When written as

∆g(tSt)g(tSt)

= Get times

∆StSt

the effective gearing gives the relative variation or percentage change∆g(tSt)g(tSt) of the option price g(tSt) from the relative variation∆StSt in the underlying asset price

The ratio Get = Stpart log g(tSt)partx can also be interpreted as an elasticity

coefficient

Break-even price The break-even price BEPt of the underlying asset is thevalue of S for which the intrinsic option value h(S) equals the option priceπt(C) at time t isin [0T ] For European call options it is given by

BEPt = K + πt(C) = K + g(tSt) t = 0 1 N

whereas for European put options it is given by

BEPt = K minus πt(C) = K minus g(tSt) 0 6 t 6 T

Premium The option premium OPt can be defined as the variation requiredfrom the underlying asset price in order to reach the break-even price iewe have

OPt =BEPt minus St

St=K + g(tSt)minus St

St 0 6 t 6 T

for European call options and

OPt =St minusBEPt

St=St + g(tSt)minusK

St 0 6 t 6 T

for European put options see Figure 617 below The term ldquopremiumrdquo issometimes also used to denote the arbitrage price g(tSt) of the option

221

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

f (tx σ)100

=

x =

K =

xpart log f

partx=

σ =

partf

partt(tx σ)=

T=

=(xminusK)x

∆ = = partf

partx(tx σ)

= partf

partσ(tx σ)

=K+f (txσ)minusx

x

=K+f (tx σ)

rf=

partf

partt+rxpartf

partx+

σ2 2x2part2f

partx2

Fig 617 Warrant terms and data

The R package bizdays (requires to install QuantLib) can be used to computecalendar time vs business time to maturity1 installpackages(bizdays)

library(bizdays)3 load_quantlib_calendars(HongKong from=2018-01-01 to=2018-12-31)

load_quantlib_calendars(Singapore from=2018-01-01 to=2018-12-31)5 bizdays(2018-03-10 2018-04-03 QuantLibHongKong)

bizdays(2018-03-10 2018-04-03 QuantLibSingapore)

65 The Heat Equation

In the next proposition we notice that the solution f(tx) of the Black-Scholes PDE (67) can be transformed into a solution g(t y) of the simplerheat equation by a change of variable and a time inversion t 7minusrarr T minus t onthe interval [0T ] so that the terminal condition at time T in the Black-Scholes equation (622) becomes an initial condition at time t = 0 in theheat equation (625) See also here for a related discussion on changes ofvariables for the Black-Scholes PDE

222

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

Proposition 68 Assume that f(tx) solves the Black-Scholes PDErf(tx) = partf

partt(tx) + rx

partf

partx(tx) + 1

2σ2x2 part

2f

partx2 (tx)

f(T x) = (xminusK)+(622)

with terminal condition h(x) = (xminusK)+ x gt 0 Then the function g(t y)defined by

g(t y) = ertf(T minus t e|σ|y+(σ22minusr)t) (623)

solves the heat equation (625) with initial condition

ψ(y) = h(

e|σ|y) y isin R (624)

ie we have partg

partt(t y) = 1

2part2g

party2 (t y)

g(0 y) = h(

e|σ|y)

(625)

Proposition 68 will be proved in Section 66 It will allow us to solve theBlack-Scholes PDE (622) based on the solution of the heat equation (625)with initial condition ψ(y) = h

(e|σ|y

) y isin R by inversion of Relation (623)

with s = T minus t x = e|σ|y+(σ22minusr)t ie

f(sx) = eminus(Tminuss)rg(T minus s minus(σ

22minus r)(T minus s) + log x|σ|

)

Next we focus on the heat equation

partϕ

partt(t y) = 1

2part2ϕ

party2 (t y) (626)

which is used to model the diffusion of heat over time through solids Herethe data of g(x t) represents the temperature measured at time t and pointx We refer the reader to Widder (1975) for a complete treatment of thistopic

223

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

Fig 618 Time-dependent solution of the heat equationlowast

Proposition 69 The fundamental solution of the heat equation (626) isgiven by the Gaussian probability density function

ϕ(t y) =1radic2πt

eminusy2(2t) y isin R

with variance t gt 0

Proof The proof is done by a direct calculation as follows

partϕ

partt(t y) = part

partt

(eminusy2(2t)radic

2πt

)

= minus eminusy2(2t)

2t32radic

2π+

y2

2t2eminusy2(2t)radic

2πt

=

(minus 1

2t +y2

2t2

)ϕ(t y)

and

12part2ϕ

party2 (t y) = minus12part

party

(y

t

eminusy2(2t)radic

2πt

)

= minus eminusy2(2t)

2tradic

2πt+

y2

2t2eminusy2(2t)radic

2πt

=

(minus 1

2t +y2

2t2

)ϕ(t y) t gt 0 y isin R

lowast The animation works in Acrobat Reader on the entire pdf file

224

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

In Section 66 the heat equation (626) will be shown to be equivalent to theBlack-Scholes PDE after a change of variables In particular this will lead tothe explicit solution of the Black-Scholes PDE

Proposition 610 The heat equationpartg

partt(t y) = 1

2part2g

party2 (t y)

g(0 y) = ψ(y)

(627)

with continuous initial condition

g(0 y) = ψ(y)

has the solution

g(t y) =winfinminusinfin

ψ(z) eminus(yminusz)2(2t) dzradic2πt

y isin R t gt 0 (628)

Proof We have

partg

partt(t y) = part

partt

winfinminusinfin

ψ(z) eminus(yminusz)2(2t) dzradic2πt

=winfinminusinfin

ψ(z)part

partt

(eminus(yminusz)2(2t)radic

2πt

)dz

=12winfinminusinfin

ψ(z)

((yminus z)2

t2minus 1t

)eminus(yminusz)2(2t) dzradic

2πt

=12winfinminusinfin

ψ(z)part2

partz2 eminus(yminusz)2(2t) dzradic2πt

=12winfinminusinfin

ψ(z)part2

party2 eminus(yminusz)2(2t) dzradic2πt

=12part2

party2

winfinminusinfin

ψ(z) eminus(yminusz)2(2t) dzradic2πt

=12part2g

party2 (t y)

On the other hand it can be checked that at time t = 0 we have

limtrarr0

winfinminusinfin

ψ(z) eminus(yminusz)2(2t) dzradic2πt

= limtrarr0

winfinminusinfin

ψ(y+ z) eminusz2(2t) dzradic2πt

= ψ(y) y isin R

225

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

The next Figure 619 shows the evolution of g(tx) with initial conditionbased on the European call payoff function h(x) = (xminusK)+ ie

g(0 y) = ψ(y) = h(

e|σ|y)=(

e|σ|y minusK)+ y isin R

Fig 619 Time-dependent solution of the heat equationlowast

Let us provide a second proof of Proposition 610 this time using Brownianmotion and stochastic calculus

Proof of Proposition 610 First note that under the change of variable x =z minus y we have

g(t y) =winfinminusinfin

ψ(z) eminus(yminusz)2(2t) dzradic2πt

=winfinminusinfin

ψ(y+ x) eminusx2(2t) dxradic2πt

= IE[ψ(y+Bt)]

= IE[ψ(yminusBt)]

where (Bt)tisinR+ is a standard Brownian motion and Bt N (0 t) t isin R+Applying Itocircrsquos formula and using the fact that the expectation of the stochas-tic integral with respect to Brownian motion is zero see Relation (417) inProposition 420 we find

g(t y) = IE[ψ(yminusBt)]

= ψ(y)minus IE[w t

0ψprime(yminusBs)dBs

]+

12 IE

[w t0ψprimeprime(yminusBs)ds

]= ψ(y) +

12w t

0IE[ψprimeprime(yminusBs)

]ds

lowast The animation works in Acrobat Reader on the entire pdf file

226

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

= ψ(y) +12w t

0part2

party2 IE [ψ(yminusBs)] ds

= ψ(y) +12w t

0part2g

party2 (s y)ds

Hence we have

partg

partt(t y) = part

parttIE[ψ(yminusBt)]

=12part2

party2 IE [ψ(yminusBt)]

=12part2g

party2 (t y)

Regarding the initial condition we check that

g(0 y) = IE[ψ(yminusB0)] = IE[ψ(y)] = ψ(y)

The expression g(t y) = IE[ψ(yminusBt)] provides a probabilistic interpreta-tion of the heat diffusion phenomenon based on Brownian motion Namelywhen ψε(y) = 1[minusεε](y) we find that

gε(t y) = IE[ψε(yminusBt)]= IE[1[minusεε](yminusBt)]= P

(yminusBt isin [minusε ε]

)= P

(yminus ε 6 Bt 6 y+ ε

)represents the probability of finding Bt within a neighborhood [y minus ε y + ε]of the point y isin R

66 Solution of the Black-Scholes PDE

In this section we solve the Black-Scholes PDE by the kernel method of Sec-tion 65 and a change of variables This solution method uses the change ofvariables (623) of Proposition 68 and a time inversion from which the ter-minal condition at time T in the Black-Scholes equation becomes an initialcondition at time t = 0 in the heat equation

Next we state the proof Proposition 68

Proof Letting s = T minus t and x = e|σ|y+(σ22minusr)t and using Relation (623)ie

g(t y) = ertf(T minus t e|σ|y+(σ22minusr)t)

227

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

we have

partg

partt(t y) = r ertf

(T minus t e|σ|y+(σ22minusr)t)minus ert partf

parts

(T minus t e|σ|y+(σ22minusr)t)

+

(σ2

2 minus r)

ert e|σ|y+(σ22minusr)t partf

partx

(T minus t e|σ|y+(σ22minusr)t)

= r ertf(T minus tx)minus ert partfparts

(T minus tx) +(σ2

2 minus r)

ertxpartfpartx

(T minus tx)

=12 ertx2σ2 part

2f

partx2 (T minus tx) +σ2

2 ertxpartfpartx

(T minus tx) (629)

where on the last step we used the Black-Scholes PDE On the other handwe have

partg

party(t y) = |σ| ert e|σ|y+(σ22minusr)t partf

partx

(T minus t e|σ|y+(σ22minusr)t)

and

12partg2

party2 (t y) =σ2

2 ert e|σ|y+(σ22minusr)t partf

partx

(T minus t e|σ|y+(σ22minusr)t)

+σ2

2 ert e2|σ|y+2(σ22minusr)t part2f

partx2(T minus t e|σ|y+(σ22minusr)t)

=σ2

2 ertxpartfpartx

(T minus tx) + σ2

2 ertx2 part2f

partx2 (T minus tx) (630)

We conclude by comparing (629) with (630) which shows that g(tx) solvesthe heat equation (627) with initial condition

g(0 y) = f(T e|σ|y

)= h

(e|σ|y

)

In the next proposition we derive the Black-Scholes formula (610) by solv-ing the PDE (622) The Black-Scholes formula will also be recovered by aprobabilistic argument via the computation of an expected value in Proposi-tion 77

Proposition 611 When h(x) = (x minusK)+ the solution of the Black-Scholes PDE (622) is given by

f(tx) = xΦ(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

) x gt 0

whereΦ(x) =

1radic2π

w xminusinfin

eminusy22dy x isin R

and

228

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

d+(T minus t) =

log(xK) + (r+ σ22)(T minus t)|σ|radicT minus t

dminus(T minus t) =log(xK) + (rminus σ22)(T minus t)

|σ|radicT minus t

x gt 0 t isin [0T )

Proof By inversion of Relation (623) with s = T minus t and x = e|σ|y+(σ22minusr)twe get

f(sx) = eminus(Tminuss)rg(T minus s minus(σ

22minus r)(T minus s) + log x|σ|

)and

h(x) = ψ

(log x|σ|

) x gt 0 or ψ(y) = h

(e|σ|y

) y isin R

Hence using the solution (628) and Relation (624) we get

f(tx) = eminus(Tminust)rg(T minus t minus(σ

22minus r)(T minus t) + log x|σ|

)= eminus(Tminust)r

winfinminusinfin

ψ

(minus(σ22minus r)(T minus t) + log x

|σ|+ z

)eminusz2(2(Tminust)) dzradic

2(T minus t)π

= eminus(Tminust)rwinfinminusinfin

h(x e|σ|zminus(σ22minusr)(Tminust)) eminusz2(2(Tminust)) dzradic

2(T minus t)π

= eminus(Tminust)rwinfinminusinfin

(x e|σ|zminus(σ22minusr)(Tminust) minusK

)+ eminusz2(2(Tminust)) dzradic2(T minus t)π

= eminus(Tminust)r

timeswinfin

(minusr+σ22)(Tminust)+log(Kx)|σ|

(x e|σ|zminus(σ22minusr)(Tminust) minusK

)eminusz2(2(Tminust)) dzradic

2(T minus t)π

= x eminus(Tminust)rwinfinminusdminus(Tminust)

radicTminust

e|σ|zminus(σ22minusr)(Tminust) eminusz2(2(Tminust)) dzradic2(T minus t)π

minusK eminus(Tminust)rwinfinminusdminus(Tminust)

radicTminust

eminusz2(2(Tminust)) dzradic2(T minus t)π

= xwinfinminusdminus(Tminust)

radicTminust

e|σ|zminus(Tminust)σ22minusz2(2(Tminust)) dzradic2(T minus t)π

minusK eminus(Tminust)rwinfinminusdminus(Tminust)

radicTminust

eminusz2(2(Tminust)) dzradic2(T minus t)π

= xwinfinminusdminus(Tminust)

radicTminust

eminus(zminus(Tminust)|σ|)2(2(Tminust)) dzradic2(T minus t)π

229

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

minusK eminus(Tminust)rwinfinminusdminus(Tminust)

radicTminust

eminusz2(2(Tminust)) dzradic2(T minus t)π

= xwinfinminusdminus(Tminust)

radicTminustminus(Tminust)|σ|

eminusz2(2(Tminust)) dzradic2(T minus t)π

minusK eminus(Tminust)rwinfinminusdminus(Tminust)

radicTminust

eminusz2(2(Tminust)) dzradic2(T minus t)π

= xwinfinminusdminus(Tminust)minus|σ|

radicTminust

eminusz22 dzradic2πminusK eminus(Tminust)r

winfinminusdminus(Tminust)

eminusz22 dzradic2π

= x(1minusΦ

(minus d+(T minus t)

))minusK eminus(Tminust)r

(1minusΦ

(minus dminus(T minus t)

))= xΦ

(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)

where we used the relation (614) ie

1minusΦ(a) = Φ(minusa) a isin R

Exercises

Exercise 61 Bachelier (1900) model Consider a market made of a risklessasset valued At = A0 with zero interest rate t isin R+ and a risky asset whoseprice St is modeled by a standard Brownian motion as St = Bt t isin R+

a) Show that the price g(tBt) of the option with payoff C = B2T satisfies

the heat equationpartϕ

partt(t y) = minus1

2part2ϕ

party2 (t y)

with terminal condition g(T x) = x2b) Find the function g(tx) by solving the PDE of Question (a)

Hint Try a solution of the form g(tx) = x2 + f(t)

See Exercises 611 713 and 714 for extensions to nonzero interest rates

Exercise 62 Consider a risky asset price (St)tisinR modeled in the Cox et al(1985) (CIR) model as

dSt = β(αminus St)dt+ σradicStdBt αβσ gt 0 (631)

and let (ηt ξt)tisinR+ be a portfolio strategy whose value Vt = ηtAt + ξtSttakes the form Vt = g(tSt) t isin R+ Figure 620 presents a random simula-tion of the solution to (631) with α = 0025 β = 1 and σ = 13230

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

0

1

2

3

4

5

6

7

8

0 01 02 03 04 05 06 07 08 09 1

St

t

Fig 620 Graph of the CIR short rate t 7rarr rt with α = 25 β = 1 and σ = 13

N=10000 t lt- 0(N-1) dt lt- 10Na=0025 b=2 sigma=0052 X lt- rnorm(Nmean=0sd=sqrt(dt))R lt- rep(0N)R[1]=001

for (j in 2N)R[j]=max(0R[j-1]+(a-bR[j-1])dt+sigmasqrt(R[j-1])X[j])4 plot(t R xlab = t ylab = type = l ylim = c(0002) col = blue)

Based on the self-financing condition written as

dVt = rVtdtminus rξtStdt+ ξtdSt

= rVtdtminus rξtStdt+ β(αminus St)ξtdt+ σξtradicStdBt t isin R+ (632)

derive the PDE satisfied by the function g(tx) using the Itocirc formula

Exercise 63 Black-Scholes PDE with dividends Consider a riskless as-set with price At = A0 ert t isin R+ and an underlying asset price process(St)tisinR+ modeled as

dSt = (microminus δ)Stdt+ σStdBt

where (Bt)tisinR+ is a standard Brownian motion and δ gt 0 is a continuous-time dividend rate By absence of arbitrage the payment of a dividend entailsa drop in the stock price by the same amount occuring generally on the ex-dividend date on which the purchase of the security no longer entitles theinvestor to the dividend amount The list of investors entitled to dividendpayment is consolidated on the date of record and payment is made on thepayable date

library(quantmod)2 getSymbols(0005HKfrom=2010-01-01to=SysDate()src=yahoo)

getDividends(0005HKfrom=2010-01-01to=SysDate()src=yahoo)

a) Assuming that the portfolio with value Vt = ξtSt + ηtAt at time t is self-financing and that dividends are continuously reinvested write down theportfolio variation dVt

231

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

b) Assuming that the portfolio value Vt takes the form Vt = g(tSt) at timet derive the Black-Scholes PDE for the function g(tx) with its terminalcondition

c) Compute the price at time t isin [0T ] of the European call option withstrike price K by solving the corresponding Black-Scholes PDE

d) Compute the Delta of the option

Exercise 64

a) Check that the Black-Scholes formula (610) for European call options

gc(tx) = xΦ(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)

satisfies the following boundary conditions

i) at x = 0 gc(t 0) = 0ii) at maturity t = T

gc(T x) = (xminusK)+ =

xminusK x gt K

0 x 6 K

iii) as time to maturity tends to infinity

limTrarrinfin

Bl(Kxσ rT minus t) = x t isin R+

b) Check that the Black-Scholes formula (618) for European put options

gp(tx) = K eminus(Tminust)rΦ(minus dminus(T minus t)

)minus xΦ

(minus d+(T minus t)

)satisfies the following boundary conditions

i) at x = 0 gp(t 0) = K eminus(Tminust)rii) as x tends to infinity gp(tinfin) = 0 for all t isin [0T )iii) at maturity t = T

gp(T x) = (K minus x)+ =

0 x gt K

K minus x x 6 K

iv) as time to maturity tends to infinity

limTrarrinfin

Blp(KStσ rT minus t) = 0 t isin R+

Exercise 65 Power option (Exercise 314 continued)

232

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

a) Solve the Black-Scholes PDE

rg(x t) = partg

partt(x t) + rx

partg

partx(x t) + σ2

2 x2 part2g

partx2 (x t) (633)

with terminal condition g(xT ) = x2 x gt 0 t isin [0T ]

Hint Try a solution of the form g(x t) = x2f(t) and find f(t)b) Find the respective quantities ξt and ηt of the risky asset St and riskless

asset At = ert in the portfolio with value

Vt = g(St t) = ξtSt + ηtAt 0 6 t 6 T

hedging the contract with payoff S2T at maturity

Exercise 66 On December 18 2007 a call warrant has been issued byFortis Bank on the stock price S of the MTR Corporation with maturityT = 23122008 strike price K = HK$ 3608 and entitlement ratio=10Recall that in the Black-Scholes model the price at time t of the Europeanclaim on the underlying asset priced St with strike price K maturity T interest rate r and volatility σ gt 0 is given by the Black-Scholes formula as

f(tSt) = StΦ(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)

wheredminus(T minus t) =

(rminus σ22)(T minus t) + log(StK)

|σ|radicT minus t

d+(T minus t) = dminus(T minus t) + |σ|radicT minus t = (r+ σ22)(T minus t) + log(StK)

|σ|radicT minus t

Recall that by Proposition 64 we have

partf

partx(tSt) = Φ

(d+(T minus t)

) 0 6 t 6 T

a) Using the values of the Gaussian cumulative distribution function com-pute the Black-Scholes price of the corresponding call option at timet =November 07 2008 with St = HK$ 17200 assuming a volatility σ =90 = 090 and an annual risk-free interest rate r = 4377 = 004377

b) Still using the Gaussian cumulative distribution function compute thequantity of the risky asset required in your portfolio at time t =November07 2008 in order to hedge one such option at maturity T = 23122008

c) Figure 1 represents the Black-Scholes price of the call option as a functionof σ isin [05 15] = [50 150]

233

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

0

01

02

03

04

05

06

05 06 07 08 09 1 11 12 13 14 15σimp

Optio

n pr

ice

σ

Market price

Fig 621 Option price as a function of the volatility σ gt 0

1 BSCall lt- function(S K r T sigma)d1 lt- (log(SK)+(r+sigma^22)T)(sigmasqrt(T))d2 lt- d1 - sigma sqrt(T)

3 BSCall = Spnorm(d1) - Kexp(-rT)pnorm(d2)BSCallsigma lt- seq(0515 length=100)

5 plot(sigmaBSCall(172360800437746365sigma) type=llty=1 xlab=Sigmaylab=Black-Scholes Call Price ylim = c(006)col=bluelwd=3)grid()

abline(h=023col=redlwd=3)

Knowing that the closing price of the warrant on November 07 2008 wasHK$ 0023 which value can you infer for the implied volatility σ at thisdatelowast

Exercise 67 Forward contracts Recall that the price πt(C) of a claimpayoff C = h(ST ) of maturity T can be written as πt(C) = g(tSt) wherethe function g(tx) satisfies the Black-Scholes PDE

rg(tx) = partg

partt(tx) + rx

partg

partx(tx) + 1

2σ2x2 part

2g

partx2 (tx)

g(T x) = h(x) (1)

with terminal condition g(T x) = h(x) x gt 0

a) Assume that C is a forward contract with payoff

C = ST minusK

at time T Find the function h(x) in (1)b) Find the solution g(tx) of the above PDE and compute the price πt(C)

at time t isin [0T ]Hint search for a solution of the form g(tx) = xminus α(t) where α(t) is afunction of t to be determined

lowast Download the corresponding or the that can be runhere

234

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

BS lt- function(S K T r sig)d1 lt- (log(SK) + (r + sig^22)T) (sigsqrt(T))d2 lt- d1 - sigsqrt(T)return(Spnorm(d1) - Kexp(-rT)pnorm(d2))impliedvol lt- function(S K T r market)sig lt- 020sigup lt- 1sigdown lt- 0001count lt- 0err lt- BS(S K T r sig) - marketwhile(abs(err) gt 000001 ampamp countlt1000)if(err lt 0)sigdown lt- sigsig lt- (sigup + sig)2elsesigup lt- sigsig lt- (sigdown + sig)2err lt- BS(S K T r sig) - marketcount lt- count + 1if(count==2000)return(NA)elsereturn(sig)market = 083K = 628T = 7 365S = 634r = 002impliedvol(S K T r market)

cells [ cell_type code execution_count null metadata outputs [] source [ from IPythoncoredisplay import display HTMLn display(HTML( )) ] cell_type code execution_count null metadata collapsed true outputs [] source [ import numpy as npn import scipystats as ssn import time n n Black and Scholesn def d1(S0 K r sigma T)n return (nplog(S0K) + (r + sigma2 2) T)(sigma npsqrt(T))n n def d2(S0 K r sigma T)n return (nplog(S0 K) + (r - sigma2 2) T) (sigma npsqrt(T))n n def BlackScholes(typeS0 K r sigma T)n if type==Cn return S0 ssnormcdf(d1(S0 K r sigma T)) - K npexp(-r T) ssnormcdf(d2(S0 K r sigma T))n elsen return K npexp(-r T) ssnormcdf(-d2(S0 K r sigma T)) - S0 ssnormcdf(-d1(S0 K r sigma T)) ] cell_type code execution_count null metadata outputs [] source [ BlackScholes(C1000 1200 002 015 10) ] cell_type code execution_count null metadata outputs [] source [ def difference(x p S K r t)n return BlackScholes(CS K r x t) - p ] cell_type code execution_count null metadata outputs [] source [ from scipyoptimize import bisectn bisect(difference00011args=(11541763731112766 1000 1200 002 10)) ] ] metadata anaconda-cloud kernelspec display_name Python 3 language python name python3 language_info codemirror_mode name ipython version 3 file_extension py mimetype textx-python name python nbconvert_exporter python pygments_lexer ipython3 version 375rc1 nbformat 4 nbformat_minor 1

Black-Scholes Pricing and Hedging

c) Compute the quantityξt =

partg

partx(tSt)

of risky assets in a self-financing portfolio hedging Cd) Repeat the above questions with the terminal condition g(T x) = x

Exercise 68a) Solve the Black-Scholes PDE

rg(tx) = partg

partt(tx) + rx

partg

partx(tx) + σ2

2 x2 part2g

partx2 (tx) (634)

with terminal condition g(T x) = 1 x gt 0

Hint Try a solution of the form g(tx) = f(t) and find f(t)

b) Find the respective quantities ξt and ηt of the risky asset St and risklessasset At = ert in the portfolio with value

Vt = g(tSt) = ξtSt + ηtAt

hedging the contract with payoff $1 at maturity

Exercise 69 Log-contracts see also Exercise 84a) Solve the PDE

0 =partg

partt(x t) + rx

partg

partx(x t) + σ2

2 x2 part2g

partx2 (x t)

with the terminal condition g(xT ) = log x x gt 0

Hint Try a solution of the form g(x t) = f(t) + log x and find f(t)b) Solve the Black-Scholes PDE

rh(x t) = parth

partt(x t) + rx

parth

partx(x t) + σ2

2 x2 part2h

partx2 (x t) (635)

with the terminal condition h(xT ) = log x x gt 0

Hint Try a solution of the form h(x t) = u(t)g(x t) and find u(t)c) Find the respective quantities ξt and ηt of the risky asset St and riskless

asset At = ert in the portfolio with value

Vt = g(St t) = ξtSt + ηtAt

hedging a log-contract with payoff logST at maturity 235

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

Exercise 610 Binary options Consider a price process (St)tisinR+ given by

dStSt

= rdt+ σdBt S0 = 1

under the risk-neutral probability measure Plowast The binary (or digital) calloption is a contract with maturity T strike price K and payoff

Cd = 1[Kinfin)(ST ) =

$1 if ST gt K

0 if ST lt K

a) Derive the Black-Schole PDE satisfied by the pricing function Cd(tSt) ofthe binary call option together with its terminal condition

b) Show that the solution Cd(tx) of the Black-Scholes PDE of Question (a)is given by

Cd(tx) = eminus(Tminust)rΦ((rminus σ22)(T minus t) + log(xK)

|σ|radicT minus t

)= eminus(Tminust)rΦ

(dminus(T minus t)

)

where

dminus(T minus t) =(rminus σ22)(T minus t) + log(StK)

|σ|radicT minus t

0 6 t lt T

Exercise 611

a) Bachelier (1900) model Solve the stochastic differential equation

dSt = αStdt+ σdBt (636)

in terms of ασ isin R and the initial condition S0b) Write down the Bachelier PDE satisfied by the function C(tx) where

C(tSt) is the price at time t isin [0T ] of the contingent claim with payoffφ(ST ) = exp(ST ) and identify the process Delta (ξt)tisin[0T ] that hedgesthis claim

c) Solve the Black-Scholes PDE of Question (b) with the terminal conditionφ(x) = ex x isin R

Hint Search for a solution of the form

C(tx) = exp(minus(T minus t)r+ xh(t) +

σ2

4r (h2(t)minus 1)

) (637)

where h(t) is a function to be determined with h(T ) = 1

236

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

d) Compute the portfolio strategy (ξt ηt)tisin[0T ] that hedges the contingentclaim with payoff exp(ST )

Exercise 612

a) Show that for every fixed value of S the function

d 7minusrarr h(S d) = SΦ(d+ |σ|

radicT)minusK eminusrTΦ(d)

reaches its maximum at dlowast(S) =log(SK) + (rminus σ22)T

|σ|radicT

b) By the differentiation rule

d

dSh(S dlowast(S)) =

parth

partS(S dlowast(S)) + dprimelowast(S)

parth

partd(S dlowast(S))

recover the value of the Black-Scholes Delta

Exercise 613 Compute the Black-Scholes Vega by differentiation of theBlack-Scholes function

gc(tx) = Bl(Kxσ rT minus t) = xΦ(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)

with respect to the volatility parameter σ knowing that

minus12(dminus(T minus t)

)2= minus1

2

(log(xK) + (rminus σ22)(T minus t)

|σ|radicT minus t

)2

= minus12(d+(T minus t)

)2+ (T minus t)r+ log x

K (638)

Exercise 614 Consider the backward induction relation (313) ie

v(tx) = (1minus plowastN )v (t+ 1x(1 + aN )) + plowastN v (t+ 1x(1 + bN ))

using the renormalizations rN = rTN and

aN = (1 + rN )(1minus |σ|radicTN)minus 1 bN = (1 + rN )(1 + |σ|

radicTN)minus 1

of Section 36 N gt 1 with

plowastN =rN minus aNbN minus aN

and plowastN =bN minus rNbN minus aN

a) Show that the Black-Scholes PDE (62) of Proposition 61 can be recoveredfrom the induction relation (313) when the number N of time steps tendsto infinity

237

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

b) Show that the expression of the Delta ξt =partgcpartx

(tSt) can be similarlyrecovered from the finite difference relation (319) ie

ξ(1)t (Stminus1) =

v (t (1 + bN )Stminus1)minus v (t (1 + aN )Stminus1)

Stminus1(bN minus aN )

as N tends to infinity

Problem 615 (Leung and Sircar (2015)) ProShares Ultra SampP500 andProShares UltraShort SampP500 are leveraged investment funds that seek dailyinvestment results before fees and expenses that correspond to β times (βx)the daily performance of the SampP500reg with respectively β = 2 for ProSharesUltra and β = minus2 for ProShares UltraShort Here leveraging with a factorβ 1 aims at multiplying the potential return of an investment by a factorβ The following 10 questions are interdependent and should be treated insequence

a) Consider a risky asset priced S0 = $4 at time t = 0 and taking twopossible values S1 = $5 and S1 = $2 at time t = 1 Compute the twopossible returns (in ) achieved when investing $4 in one share of the assetS and the expected return under the risk-neutral probability measureassuming that the risk-free interest rate is zero

b) Leveraging Still based on an initial $4 investment we decide to leverageby a factor β = 3 by borrowing another (β minus 1) times $4 = 2times $4 at ratezero to purchase a total of β = 3 shares of the asset S Compute thetwo returns (in ) possibly achieved in this case and the expected returnunder the risk-neutral probability measure assuming that the risk-freeinterest rate is zero

c) Denoting by Ft the ProShares value at time t how much should the fundinvest in the underlying asset priced St and how much $ should it borrowor save on the risk-free market at any time t in order to leverage with afactor β 1

d) Find the portfolio allocation (ξt ηt) for the fund value

Ft = ξtSt + ηtAt t isin R+

according to Question (c) where At = A0 ert is the riskless money marketaccount

e) We choose to model the SampP500 index St as the geometric Brownianmotion

dSt = rStdt+ σStdBt t isin R+

under the risk-neutral probability measure Plowast Find the stochastic dif-ferential equation satisfied by (Ft)tisinR+ under the self-financing conditiondFt = ξtdSt + ηtdAt

238

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

f) Is the discounted fund value ( eminusrtFt)tisinR+ a martingale under the risk-neutral probability measure Plowast

g) Find the relation between the fund value Ft and the index St by solvingthe stochastic differential equation obtained for Ft in Question (e) Forsimplicity we normalize F0 = Sβ0

h) Write the price at time t = 0 of the call option with payoff (FT minusK)+ onthe ProShares index using the Black-Scholes formula

i) Show that when β gt 0 the Delta at time t isin [0T ) of the call optionwith payoff (FT minusK)+ on ProShares Ultra is equal to the Delta of thecall option with payoff (ST minusKβ(t))

+ on the SampP500 for a certain strikeprice Kβ(t) to be determined explicitly

j) When β lt 0 find the relation between the Delta at time t isin [0T ) ofthe call option with payoff (FT minusK)+ on ProShares UltraShort and theDelta of the put option with payoff (Kβ(t)minus ST )+ on the SampP500

239

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

  1. pbsARFix223
  2. pbsARFix224
  3. pbsARFix225
  4. pbsARFix226
  5. pbsARFix227
  6. pbsARFix228
  7. pbsARFix229
  8. pbsARFix230
  9. fdrm1
  10. pbsARFix231
  11. 100
  12. 101
  13. 102
  14. 103
  15. 104
  16. 105
  17. 106
  18. 107
  19. 108
  20. 109
  21. 1010
  22. 1011
  23. 1012
  24. 1013
  25. 1014
  26. 1015
  27. 1016
  28. 1017
  29. 1018
  30. 1019
  31. anm10
  32. 10EndLeft
  33. 10StepLeft
  34. 10PauseLeft
  35. 10PlayLeft
  36. 10PlayPauseLeft
  37. 10PauseRight
  38. 10PlayRight
  39. 10PlayPauseRight
  40. 10StepRight
  41. 10EndRight
  42. 10Minus
  43. 10Reset
  44. 10Plus
  45. pbsARFix232
  46. pbsARFix233
  47. pbsARFix234
  48. pbsARFix235
  49. pbsARFix236
  50. pbsARFix237
  51. fdrm2
  52. 110
  53. 111
  54. 112
  55. 113
  56. 114
  57. 115
  58. 116
  59. 117
  60. 118
  61. 119
  62. 1110
  63. 1111
  64. 1112
  65. 1113
  66. 1114
  67. 1115
  68. 1116
  69. 1117
  70. 1118
  71. 1119
  72. anm11
  73. 11EndLeft
  74. 11StepLeft
  75. 11PauseLeft
  76. 11PlayLeft
  77. 11PlayPauseLeft
  78. 11PauseRight
  79. 11PlayRight
  80. 11PlayPauseRight
  81. 11StepRight
  82. 11EndRight
  83. 11Minus
  84. 11Reset
  85. 11Plus
  86. pbsARFix238
  87. pbsARFix239
  88. pbsARFix240
  89. pbsARFix241
  90. pbsARFix242
  91. 120
  92. 121
  93. 122
  94. 123
  95. 124
  96. 125
  97. 126
  98. 127
  99. 128
  100. 129
  101. 1210
  102. anm12
  103. 12EndLeft
  104. 12StepLeft
  105. 12PauseLeft
  106. 12PlayLeft
  107. 12PlayPauseLeft
  108. 12PauseRight
  109. 12PlayRight
  110. 12PlayPauseRight
  111. 12StepRight
  112. 12EndRight
  113. 12Minus
  114. 12Reset
  115. 12Plus
  116. 130
  117. 131
  118. 132
  119. 133
  120. 134
  121. 135
  122. 136
  123. 137
  124. 138
  125. 139
  126. 1310
  127. anm13
  128. 13EndLeft
  129. 13StepLeft
  130. 13PauseLeft
  131. 13PlayLeft
  132. 13PlayPauseLeft
  133. 13PauseRight
  134. 13PlayRight
  135. 13PlayPauseRight
  136. 13StepRight
  137. 13EndRight
  138. 13Minus
  139. 13Reset
  140. 13Plus
  141. pbsARFix243
  142. pbsARFix244
  143. pbsARFix245
  144. pbsARFix246
  145. 140
  146. 141
  147. 142
  148. 143
  149. 144
  150. 145
  151. 146
  152. 147
  153. 148
  154. 149
  155. 1410
  156. 1411
  157. 1412
  158. 1413
  159. 1414
  160. 1415
  161. 1416
  162. 1417
  163. 1418
  164. 1419
  165. 1420
  166. 1421
  167. 1422
  168. 1423
  169. 1424
  170. 1425
  171. 1426
  172. 1427
  173. 1428
  174. 1429
  175. 1430
  176. 1431
  177. 1432
  178. 1433
  179. 1434
  180. 1435
  181. 1436
  182. 1437
  183. 1438
  184. 1439
  185. 1440
  186. 1441
  187. 1442
  188. 1443
  189. 1444
  190. 1445
  191. 1446
  192. 1447
  193. 1448
  194. 1449
  195. 1450
  196. 1451
  197. 1452
  198. 1453
  199. 1454
  200. 1455
  201. 1456
  202. 1457
  203. 1458
  204. 1459
  205. 1460
  206. 1461
  207. 1462
  208. 1463
  209. 1464
  210. 1465
  211. 1466
  212. 1467
  213. 1468
  214. 1469
  215. 1470
  216. 1471
  217. 1472
  218. 1473
  219. 1474
  220. 1475
  221. 1476
  222. 1477
  223. 1478
  224. 1479
  225. 1480
  226. 1481
  227. 1482
  228. 1483
  229. 1484
  230. 1485
  231. 1486
  232. 1487
  233. 1488
  234. 1489
  235. 1490
  236. 1491
  237. 1492
  238. 1493
  239. 1494
  240. 1495
  241. 1496
  242. 1497
  243. 1498
  244. 1499
  245. 14100
  246. 14101
  247. 14102
  248. 14103
  249. 14104
  250. 14105
  251. 14106
  252. 14107
  253. 14108
  254. 14109
  255. 14110
  256. 14111
  257. 14112
  258. 14113
  259. 14114
  260. 14115
  261. 14116
  262. 14117
  263. 14118
  264. 14119
  265. 14120
  266. 14121
  267. 14122
  268. 14123
  269. 14124
  270. 14125
  271. 14126
  272. 14127
  273. 14128
  274. 14129
  275. 14130
  276. 14131
  277. 14132
  278. 14133
  279. 14134
  280. 14135
  281. 14136
  282. 14137
  283. 14138
  284. 14139
  285. 14140
  286. 14141
  287. 14142
  288. 14143
  289. 14144
  290. 14145
  291. 14146
  292. 14147
  293. 14148
  294. 14149
  295. 14150
  296. 14151
  297. 14152
  298. 14153
  299. 14154
  300. 14155
  301. 14156
  302. 14157
  303. 14158
  304. 14159
  305. 14160
  306. 14161
  307. 14162
  308. 14163
  309. 14164
  310. 14165
  311. 14166
  312. 14167
  313. 14168
  314. 14169
  315. 14170
  316. 14171
  317. 14172
  318. 14173
  319. 14174
  320. 14175
  321. 14176
  322. 14177
  323. 14178
  324. 14179
  325. 14180
  326. 14181
  327. 14182
  328. 14183
  329. 14184
  330. 14185
  331. 14186
  332. 14187
  333. 14188
  334. 14189
  335. 14190
  336. 14191
  337. 14192
  338. 14193
  339. 14194
  340. 14195
  341. 14196
  342. 14197
  343. anm14
  344. 14EndLeft
  345. 14StepLeft
  346. 14PauseLeft
  347. 14PlayLeft
  348. 14PlayPauseLeft
  349. 14PauseRight
  350. 14PlayRight
  351. 14PlayPauseRight
  352. 14StepRight
  353. 14EndRight
  354. 14Minus
  355. 14Reset
  356. 14Plus
  357. pbsARFix247
  358. pbsARFix248
  359. 150
  360. 151
  361. 152
  362. 153
  363. 154
  364. 155
  365. 156
  366. 157
  367. 158
  368. 159
  369. 1510
  370. 1511
  371. 1512
  372. 1513
  373. 1514
  374. 1515
  375. 1516
  376. 1517
  377. 1518
  378. 1519
  379. anm15
  380. 15EndLeft
  381. 15StepLeft
  382. 15PauseLeft
  383. 15PlayLeft
  384. 15PlayPauseLeft
  385. 15PauseRight
  386. 15PlayRight
  387. 15PlayPauseRight
  388. 15StepRight
  389. 15EndRight
  390. 15Minus
  391. 15Reset
  392. 15Plus
  393. pbsARFix249
  394. pbsARFix250
  395. pbsARFix251
  396. pbsARFix252
  397. pbsARFix253
  398. pbsARFix254
  399. pbsARFix255
  400. pbsARFix256
  401. pbsARFix257
  402. pbsARFix258
  403. pbsARFix259
  404. pbsARFix260
  405. pbsARFix261
Page 12: Black-ScholesPricingandHedging - NTU · to the Black-Scholes PDE (6.2) in order to price a claim payoff Cof the formC= h(S T).Asinthediscrete-timecase,thearbitragepriceπt(C) at

N Privault

Fig 67 Gamma of a European call option with strike price K = 100

As Gamma is always nonnegative the Black-Scholes hedging strategy is tokeep buying the risky underlying asset when its price increases and to sell itwhen its price decreases as can be checked from Figure 67

Numerical example - hedging of a call option

In Figure 68 we consider the historical stock price of HSBC Holdings(0005HK) over one year

Fig 68 Graph of the stock price of HSBC Holdings

Consider the call option issued by Societe Generale on 31 December 2008 withstrike price K=$63704 maturity T = October 05 2009 and an entitlementratio of 100 meaning that one option contract is divided into 100 warrants cfpage 9 The next graph gives the time evolution of the Black-Scholes portfoliovalue

t 7minusrarr gc(tSt)

driven by the market price t 7minusrarr St of the risky underlying asset as given inFigure 68 in which the number of days is counted from the origin and notfrom maturity

212

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

40 50 60 70 80 90 0 50 100 150 200

0

5

10

15

20

25

30

35

40

Underlying (HK$) Time in days

Fig 69 Path of the Black-Scholes price for a call option on HSBC

As a consequence of Proposition 64 in the Black-Scholes call option hedgingmodel the amount invested in the risky asset is

Stξt = StΦ(d+(T minus t)

)= StΦ

(log(StK) + (r+ σ22)(T minus t)

|σ|radicT minus t

)gt 0

which is always nonnegative ie there is no short selling and the amountinvested on the riskless asset is

ηtAt = minusK eminus(Tminust)rΦ(dminus(T minus t)

)= minusK eminus(Tminust)rΦ

(log(StK) + (rminus σ22)(T minus t)

|σ|radicT minus t

)6 0

which is always nonpositive ie we are constantly borrowing money on theriskless asset as noted in Figure 610

-60

-40

-20

0

20

40

60

80

100

0 50 100 150 200

K

HK$

Black-Scholes priceRisky investment ξtSt

Riskless investment ηtAtUnderlying asset price

Fig 610 Time evolution of a hedging portfolio for a call option on HSBC

213

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

A comparison of Figure 610 with market data can be found in Figures 911and 912 below

Cash settlement In the case of a cash settlement the option issuer will sat-isfy the option contract by selling ξT = 1 stock at the price ST = $83refund the K = $63 risk-free investment and hand in the remaining amountC = (ST minusK)+ = 83minus 63 = $20 to the option holder

Physical delivery In the case of physical delivery of the underlying asset theoption issuer will deliver ξT = 1 stock to the option holder in exchange forK = $63 which will be used together with the portfolio value to refund therisk-free loan

63 European Put Options

Similarly in the case of the European put option with strike price K thepayoff function is given by h(x) = (Kminusx)+ and the Black-Scholes PDE (67)reads

rgp(tx) =partgppartt

(tx) + rxpartgppartx

(tx) + 12σ

2x2 part2gppartx2 (tx)

gp(T x) = (K minus x)+(617)

The next proposition can be proved as in Sections 65 and 66 see Proposi-tion 611

Proposition 65 The solution of the PDE (617) is given by the Black-Scholes formula for put options

gp(tx) = K eminus(Tminust)rΦ(minus dminus(T minus t)

)minus xΦ

(minus d+(T minus t)

) (618)

withd+(T minus t) =

log(xK) + (r+ σ22)(T minus t)|σ|radicT minus t

(619)

dminus(T minus t) =log(xK) + (rminus σ22)(T minus t)

|σ|radicT minus t

(620)

as illustrated in Figure 611

214

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

Fig 611 Graph of the Black-Scholes put price function with strike price K = 100lowast

In other words the European put option with strike price K and maturityT is priced at time t isin [0T ] as

gp(tSt) = K eminus(Tminust)rΦ(minus dminus(T minus t)

)minus StΦ

(minus d+(T minus t)

) 0 6 t 6 T

Fig 612 Time-dependent solution of the Black-Scholes PDE (put option)dagger

The following R script is an implementation of the Black-Scholes formula forEuropean put options in R

1 BSPut lt- function(S K r T sigma)d1 = (log(SK)+(r+sigma^22)T)(sigmasqrt(T))

3 d2 = d1 - sigma sqrt(T)BSPut = Kexp(-rT) pnorm(-d2) - Spnorm(-d1)

5 BSPut

Call-put parity

lowast Right-click on the figure for interaction and ldquoFull Screen Multimediardquo viewdagger The animation works in Acrobat Reader on the entire pdf file

215

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

(C) 2012--today Alexander Grahn 3Dmenujs version 20140923 3D JavaScript used by media9sty Extended functionality of the (right click) context menu of 3D annotations 1) Adds the following items to the 3D context menu `Generate Default View Finds good default camera settings returned as options for use with the includemedia command `Get Current View Determines camera cross section and part settings of the current view returned as `VIEW section that can be copied into a views file of additional views The views file is inserted using the `3Dviews option of includemedia `Cross Section Toggle switch to add or remove a cross section into or from the current view The cross section can be moved in the x y z directions using x y z and X Y Z keys on the keyboard be tilted against and spun around the upright Z axis using the UpDown and LeftRight arrow keys and caled using the s and S keys 2) Enables manipulation of position and orientation of indiviual parts and groups of parts in the 3D scene Parts which have been selected with the mouse can be scaled moved around and rotated like the cross section as described above To spin the parts around their local up-axis keep Control key pressed while using the UpDown and LeftRight arrow keys This work may be distributed andor modified under the conditions of the LaTeX Project Public License The latest version of this license is in httpmirrorsctanorgmacroslatexbaselppltxt This work has the LPPL maintenance status `maintained The Current Maintainer of this work is A Grahn The code borrows heavily from Bernd Gaertners `Miniball software originally written in C++ for computing the smallest enclosing ball of a set of points see httpwwwinfethzchpersonalgaertnerminiballhtmlhostconsoleshow()constructor for doubly linked listfunction List() thisfirst_node=null thislast_node=new Node(undefined)Listprototypepush_back=function(x) var new_node=new Node(x) if(thisfirst_node==null) thisfirst_node=new_node new_nodeprev=null else new_nodeprev=thislast_nodeprev new_nodeprevnext=new_node new_nodenext=thislast_node thislast_nodeprev=new_nodeListprototypemove_to_front=function(it) var node=itget() if(nodenext=null ampamp nodeprev=null) nodenextprev=nodeprev nodeprevnext=nodenext nodeprev=null nodenext=thisfirst_node thisfirst_nodeprev=node thisfirst_node=node Listprototypebegin=function() var i=new Iterator() itarget=thisfirst_node return(i)Listprototypeend=function() var i=new Iterator() itarget=thislast_node return(i)function Iterator(it) if( it=undefined ) thistarget=ittarget else thistarget=null Iteratorprototypeset=function(it)thistarget=ittargetIteratorprototypeget=function()return(thistarget)Iteratorprototypederef=function()return(thistargetdata)Iteratorprototypeincr=function() if(thistargetnext=null) thistarget=thistargetnextconstructor for node objects that populate the linked listfunction Node(x) thisprev=null thisnext=null thisdata=xfunction sqr(r)return(rr)helper functionMiniball algorithm by B Gaertnerfunction Basis() thism=0 thisq0=new Array(3) thisz=new Array(4) thisf=new Array(4) thisv=new Array(new Array(3) new Array(3) new Array(3) new Array(3)) thisa=new Array(new Array(3) new Array(3) new Array(3) new Array(3)) thisc=new Array(new Array(3) new Array(3) new Array(3) new Array(3)) thissqr_r=new Array(4) thiscurrent_c=thisc[0] thiscurrent_sqr_r=0 thisreset()Basisprototypecenter=function()return(thiscurrent_c)Basisprototypesize=function()return(thism)Basisprototypepop=function()--thismBasisprototypeexcess=function(p) var e=-thiscurrent_sqr_r for(var k=0klt3++k) e+=sqr(p[k]-thiscurrent_c[k]) return(e)Basisprototypereset=function() thism=0 for(var j=0jlt3++j) thisc[0][j]=0 thiscurrent_c=thisc[0] thiscurrent_sqr_r=-1Basisprototypepush=function(p) var i j var eps=1e-32 if(thism==0) for(i=0ilt3++i) thisq0[i]=p[i] for(i=0ilt3++i) thisc[0][i]=thisq0[i] thissqr_r[0]=0 else for(i=0ilt3++i) thisv[thism][i]=p[i]-thisq0[i] for(i=1iltthism++i) thisa[thism][i]=0 for(j=0jlt3++j) thisa[thism][i]+=thisv[i][j]thisv[thism][j] thisa[thism][i]=(2thisz[i]) for(i=1iltthism++i) for(j=0jlt3++j) thisv[thism][j]-=thisa[thism][i]thisv[i][j] thisz[thism]=0 for(j=0jlt3++j) thisz[thism]+=sqr(thisv[thism][j]) thisz[thism]=2 if(thisz[thism]ltepsthiscurrent_sqr_r) return(false) var e=-thissqr_r[thism-1] for(i=0ilt3++i) e+=sqr(p[i]-thisc[thism-1][i]) thisf[thism]=ethisz[thism] for(i=0ilt3++i) thisc[thism][i]=thisc[thism-1][i]+thisf[thism]thisv[thism][i] thissqr_r[thism]=thissqr_r[thism-1]+ethisf[thism]2 thiscurrent_c=thisc[thism] thiscurrent_sqr_r=thissqr_r[thism] ++thism return(true)function Miniball() thisL=new List() thisB=new Basis() thissupport_end=new Iterator()Miniballprototypemtf_mb=function(it) var i=new Iterator(it) thissupport_endset(thisLbegin()) if((thisBsize())==4) return for(var k=new Iterator(thisLbegin())kget()=iget()) var j=new Iterator(k) kincr() if(thisBexcess(jderef()) gt 0) if(thisBpush(jderef())) thismtf_mb(j) thisBpop() if(thissupport_endget()==jget()) thissupport_endincr() thisLmove_to_front(j) Miniballprototypecheck_in=function(b) thisLpush_back(b)Miniballprototypebuild=function() thisBreset() thissupport_endset(thisLbegin()) thismtf_mb(thisLend())Miniballprototypecenter=function() return(thisBcenter())Miniballprototyperadius=function() return(Mathsqrt(thisBcurrent_sqr_r))functions called by menu itemsfunction calc3Dopts () create Miniball object var mb=new Miniball() auxiliary vector var corner=new Vector3() iterate over all visible mesh nodes in the scene for(i=0iltscenemeshescounti++) var mesh=scenemeshesgetByIndex(i) if(meshvisible) continue local to parent transformation matrix var trans=meshtransform build local to world transformation matrix by recursively multiplying the parents transf matrix on the right var parent=meshparent while(parenttransform) trans=transmultiply(parenttransform) parent=parentparent get the bbox of the mesh (local coordinates) var bbox=meshcomputeBoundingBox() transform the local bounding box corner coordinates to world coordinates for bounding sphere determination BBoxmin cornerset(bboxmin) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) BBoxmax cornerset(bboxmax) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) remaining six BBox corners cornerset(bboxminx bboxmaxy bboxmaxz) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) cornerset(bboxminx bboxminy bboxmaxz) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) cornerset(bboxminx bboxmaxy bboxminz) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) cornerset(bboxmaxx bboxminy bboxminz) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) cornerset(bboxmaxx bboxminy bboxmaxz) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) cornerset(bboxmaxx bboxmaxy bboxminz) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) compute the smallest enclosing bounding sphere mbbuild() current camera settings var camera=scenecamerasgetByIndex(0) var res= initialize result string aperture angle of the virtual camera (perspective projection) or orthographic scale (orthographic projection) if(cameraprojectionType==cameraTYPE_PERSPECTIVE) var aac=camerafov180MathPI if(hostutilprintf(4f aac)=30) res+=hostutilprintf(n3Daac=s aac) else cameraviewPlaneSize=2mbradius() res+=hostutilprintf(n3Dortho=s 1cameraviewPlaneSize) camera roll var roll = cameraroll180MathPI if(hostutilprintf(4f roll)=0) res+=hostutilprintf(n3Droll=sroll) target to camera vector var c2c=new Vector3() c2cset(cameraposition) c2csubtractInPlace(cameratargetPosition) c2cnormalize() if((c2cx==0 ampamp c2cy==-1 ampamp c2cz==0)) res+=hostutilprintf(n3Dc2c=s s s c2cx c2cy c2cz) new camera settings bounding sphere centre --gt new camera target var coo=new Vector3() cooset((mbcenter())[0] (mbcenter())[1] (mbcenter())[2]) if(coolength) res+=hostutilprintf(n3Dcoo=s s s coox cooy cooz) radius of orbit if(cameraprojectionType==cameraTYPE_PERSPECTIVE) var roo=mbradius() Mathsin(aac MathPI 360) else orthographic projection var roo=mbradius() res+=hostutilprintf(n3Droo=s roo) update camera settings in the viewer var currol=cameraroll cameratargetPositionset(coo) camerapositionset(cooadd(c2cscale(roo))) cameraroll=currol determine background colour rgb=scenebackgroundgetColor() if((rgbr==1 ampamp rgbg==1 ampamp rgbb==1)) res+=hostutilprintf(n3Dbg=s s s rgbr rgbg rgbb) determine lighting scheme switch(scenelightScheme) case sceneLIGHT_MODE_FILE curlights=Artworkbreak case sceneLIGHT_MODE_NONE curlights=Nonebreak case sceneLIGHT_MODE_WHITE curlights=Whitebreak case sceneLIGHT_MODE_DAY curlights=Daybreak case sceneLIGHT_MODE_NIGHT curlights=Nightbreak case sceneLIGHT_MODE_BRIGHT curlights=Hardbreak case sceneLIGHT_MODE_RGB curlights=Primarybreak case sceneLIGHT_MODE_BLUE curlights=Bluebreak case sceneLIGHT_MODE_RED curlights=Redbreak case sceneLIGHT_MODE_CUBE curlights=Cubebreak case sceneLIGHT_MODE_CAD curlights=CADbreak case sceneLIGHT_MODE_HEADLAMP curlights=Headlampbreak if(curlights=Artwork) res+=hostutilprintf(n3Dlights=s curlights) determine global render mode switch(scenerenderMode) case sceneRENDER_MODE_BOUNDING_BOX currender=BoundingBoxbreak case sceneRENDER_MODE_TRANSPARENT_BOUNDING_BOX currender=TransparentBoundingBoxbreak case sceneRENDER_MODE_TRANSPARENT_BOUNDING_BOX_OUTLINE currender=TransparentBoundingBoxOutlinebreak case sceneRENDER_MODE_VERTICES currender=Verticesbreak case sceneRENDER_MODE_SHADED_VERTICES currender=ShadedVerticesbreak case sceneRENDER_MODE_WIREFRAME currender=Wireframebreak case sceneRENDER_MODE_SHADED_WIREFRAME currender=ShadedWireframebreak case sceneRENDER_MODE_SOLID currender=Solidbreak case sceneRENDER_MODE_TRANSPARENT currender=Transparentbreak case sceneRENDER_MODE_SOLID_WIREFRAME currender=SolidWireframebreak case sceneRENDER_MODE_TRANSPARENT_WIREFRAME currender=TransparentWireframebreak case sceneRENDER_MODE_ILLUSTRATION currender=Illustrationbreak case sceneRENDER_MODE_SOLID_OUTLINE currender=SolidOutlinebreak case sceneRENDER_MODE_SHADED_ILLUSTRATION currender=ShadedIllustrationbreak case sceneRENDER_MODE_HIDDEN_WIREFRAME currender=HiddenWireframebreak if(currender=Solid) res+=hostutilprintf(n3Drender=s currender) write result string to the console hostconsoleshow() hostconsoleclear() hostconsoleprintln(n Copy and paste the following text to then+ option list of includemedian + res + n)function get3Dview () var camera=scenecamerasgetByIndex(0) var coo=cameratargetPosition var c2c=camerapositionsubtract(coo) var roo=c2clength c2cnormalize() var res=VIEW=insert optional name heren if((coox==0 ampamp cooy==0 ampamp cooz==0)) res+=hostutilprintf( COO=s s sn coox cooy cooz) if((c2cx==0 ampamp c2cy==-1 ampamp c2cz==0)) res+=hostutilprintf( C2C=s s sn c2cx c2cy c2cz) if(roo gt 1e-9) res+=hostutilprintf( ROO=sn roo) var roll = cameraroll180MathPI if(hostutilprintf(4f roll)=0) res+=hostutilprintf( ROLL=sn roll) if(cameraprojectionType==cameraTYPE_PERSPECTIVE) var aac=camerafov 180MathPI if(hostutilprintf(4f aac)=30) res+=hostutilprintf( AAC=sn aac) else if(hostutilprintf(4f cameraviewPlaneSize)=1) res+=hostutilprintf( ORTHO=sn 1cameraviewPlaneSize) rgb=scenebackgroundgetColor() if((rgbr==1 ampamp rgbg==1 ampamp rgbb==1)) res+=hostutilprintf( BGCOLOR=s s sn rgbr rgbg rgbb) switch(scenelightScheme) case sceneLIGHT_MODE_FILE curlights=Artworkbreak case sceneLIGHT_MODE_NONE curlights=Nonebreak case sceneLIGHT_MODE_WHITE curlights=Whitebreak case sceneLIGHT_MODE_DAY curlights=Daybreak case sceneLIGHT_MODE_NIGHT curlights=Nightbreak case sceneLIGHT_MODE_BRIGHT curlights=Hardbreak case sceneLIGHT_MODE_RGB curlights=Primarybreak case sceneLIGHT_MODE_BLUE curlights=Bluebreak case sceneLIGHT_MODE_RED curlights=Redbreak case sceneLIGHT_MODE_CUBE curlights=Cubebreak case sceneLIGHT_MODE_CAD curlights=CADbreak case sceneLIGHT_MODE_HEADLAMP curlights=Headlampbreak if(curlights=Artwork) res+= LIGHTS=+curlights+n switch(scenerenderMode) case sceneRENDER_MODE_BOUNDING_BOX defaultrender=BoundingBoxbreak case sceneRENDER_MODE_TRANSPARENT_BOUNDING_BOX defaultrender=TransparentBoundingBoxbreak case sceneRENDER_MODE_TRANSPARENT_BOUNDING_BOX_OUTLINE defaultrender=TransparentBoundingBoxOutlinebreak case sceneRENDER_MODE_VERTICES defaultrender=Verticesbreak case sceneRENDER_MODE_SHADED_VERTICES defaultrender=ShadedVerticesbreak case sceneRENDER_MODE_WIREFRAME defaultrender=Wireframebreak case sceneRENDER_MODE_SHADED_WIREFRAME defaultrender=ShadedWireframebreak case sceneRENDER_MODE_SOLID defaultrender=Solidbreak case sceneRENDER_MODE_TRANSPARENT defaultrender=Transparentbreak case sceneRENDER_MODE_SOLID_WIREFRAME defaultrender=SolidWireframebreak case sceneRENDER_MODE_TRANSPARENT_WIREFRAME defaultrender=TransparentWireframebreak case sceneRENDER_MODE_ILLUSTRATION defaultrender=Illustrationbreak case sceneRENDER_MODE_SOLID_OUTLINE defaultrender=SolidOutlinebreak case sceneRENDER_MODE_SHADED_ILLUSTRATION defaultrender=ShadedIllustrationbreak case sceneRENDER_MODE_HIDDEN_WIREFRAME defaultrender=HiddenWireframebreak if(defaultrender=Solid) res+= RENDERMODE=+defaultrender+n detect existing Clipping Plane (3D Cross Section) var clip=null if( clip=scenenodesgetByName($$$$$$)|| clip=scenenodesgetByName(Clipping Plane) ) for(var i=0iltscenenodescounti++) var nd=scenenodesgetByIndex(i) if(nd==clip||ndname==) continue var ndUTFName= for (var j=0 jltndnamelength j++) var theUnicode = ndnamecharCodeAt(j)toString(16) while (theUnicodelengthlt4) theUnicode = 0 + theUnicode ndUTFName += theUnicode var end=ndnamelastIndexOf() if(endgt0) var ndUserName=ndnamesubstr(0end) else var ndUserName=ndname respart= PART=+ndUserName+n respart+= UTF16NAME=+ndUTFName+n defaultvals=true if(ndvisible) respart+= VISIBLE=falsen defaultvals=false if(ndopacitylt10) respart+= OPACITY=+ndopacity+n defaultvals=false if(ndconstructorname==Mesh) currender=defaultrender switch(ndrenderMode) case sceneRENDER_MODE_BOUNDING_BOX currender=BoundingBoxbreak case sceneRENDER_MODE_TRANSPARENT_BOUNDING_BOX currender=TransparentBoundingBoxbreak case sceneRENDER_MODE_TRANSPARENT_BOUNDING_BOX_OUTLINE currender=TransparentBoundingBoxOutlinebreak case sceneRENDER_MODE_VERTICES currender=Verticesbreak case sceneRENDER_MODE_SHADED_VERTICES currender=ShadedVerticesbreak case sceneRENDER_MODE_WIREFRAME currender=Wireframebreak case sceneRENDER_MODE_SHADED_WIREFRAME currender=ShadedWireframebreak case sceneRENDER_MODE_SOLID currender=Solidbreak case sceneRENDER_MODE_TRANSPARENT currender=Transparentbreak case sceneRENDER_MODE_SOLID_WIREFRAME currender=SolidWireframebreak case sceneRENDER_MODE_TRANSPARENT_WIREFRAME currender=TransparentWireframebreak case sceneRENDER_MODE_ILLUSTRATION currender=Illustrationbreak case sceneRENDER_MODE_SOLID_OUTLINE currender=SolidOutlinebreak case sceneRENDER_MODE_SHADED_ILLUSTRATION currender=ShadedIllustrationbreak case sceneRENDER_MODE_HIDDEN_WIREFRAME currender=HiddenWireframebreak case sceneRENDER_MODE_DEFAULT currender=Defaultbreak if(currender=defaultrender) respart+= RENDERMODE=+currender+n defaultvals=false if(origtrans[ndname]ampampndtransformisEqual(origtrans[ndname])) var lvec=ndtransformtransformDirection(new Vector3(100)) var uvec=ndtransformtransformDirection(new Vector3(010)) var vvec=ndtransformtransformDirection(new Vector3(001)) respart+= TRANSFORM= +lvecx+ +lvecy+ +lvecz+ +uvecx+ +uvecy+ +uvecz+ +vvecx+ +vvecy+ +vvecz+ +ndtransformtranslationx+ +ndtransformtranslationy+ +ndtransformtranslationz+n defaultvals=false respart+= ENDn if(defaultvals) res+=respart if(clip) var centre=cliptransformtranslation var normal=cliptransformtransformDirection(new Vector3(001)) res+= CROSSSECTn if((centrex==0 ampamp centrey==0 ampamp centrez==0)) res+=hostutilprintf( CENTER=s s sn centrex centrey centrez) if((normalx==1 ampamp normaly==0 ampamp normalz==0)) res+=hostutilprintf( NORMAL=s s sn normalx normaly normalz) res+=hostutilprintf( VISIBLE=sn clipvisible) res+=hostutilprintf( PLANECOLOR=s s sn clipmaterialemissiveColorr clipmaterialemissiveColorg clipmaterialemissiveColorb) res+=hostutilprintf( OPACITY=sn clipopacity) res+=hostutilprintf( INTERSECTIONCOLOR=s s sn clipwireframeColorr clipwireframeColorg clipwireframeColorb) res+= ENDn for(var propt in clip) consoleprintln(propt++clip[propt]) res+=ENDn hostconsoleshow() hostconsoleclear() hostconsoleprintln(n Add the following VIEW section to a file ofn+ predefined views (See option 3Dviews)nn + The view may be given a name after VIEW=n + (Remove in front of =)n) hostconsoleprintln(res + n)add items to 3D context menuruntimeaddCustomMenuItem(dfltview Generate Default View default 0)runtimeaddCustomMenuItem(currview Get Current View default 0)runtimeaddCustomMenuItem(csection Cross Section checked 0)menu event handlersmenuEventHandler = new MenuEventHandler()menuEventHandleronEvent = function(e) switch(emenuItemName) case dfltview calc3Dopts() break case currview get3Dview() break case csection addremoveClipPlane(emenuItemChecked) break runtimeaddEventHandler(menuEventHandler)global variable taking reference to currently selected nodevar target=nullselectionEventHandler=new SelectionEventHandler()selectionEventHandleronEvent=function(e) if(eselectedampampenodename=) target=enode else target=null runtimeaddEventHandler(selectionEventHandler)cameraEventHandler=new CameraEventHandler()cameraEventHandleronEvent=function(e) var clip=null runtimeremoveCustomMenuItem(csection) runtimeaddCustomMenuItem(csection Cross Section checked 0) if(clip=scenenodesgetByName($$$$$$)|| predefined scenenodesgetByName(Clipping Plane)) added via context menu runtimeremoveCustomMenuItem(csection) runtimeaddCustomMenuItem(csection Cross Section checked 1) if(clip)plane in predefined views must be rotated by 90 deg around normal cliptransformrotateAboutLineInPlace( MathPI2cliptransformtranslation cliptransformtransformDirection(new Vector3(001)) ) for(var i=0 iltrot4x4length i++)rot4x4[i]setIdentity() target=nullruntimeaddEventHandler(cameraEventHandler)var rot4x4=new Array() keeps track of spin and tilt axes transformationskey event handler for scaling moving spinning and tilting objectskeyEventHandler=new KeyEventHandler()keyEventHandleronEvent=function(e) var backtrans=new Matrix4x4() var trgt=null if(target) trgt=target var backtrans=new Matrix4x4() var trans=trgttransform var parent=trgtparent while(parenttransform) build local to world transformation matrix transmultiplyInPlace(parenttransform) also build world to local back-transformation matrix backtransmultiplyInPlace(parenttransforminversetranspose) parent=parentparent backtranstransposeInPlace() else if( trgt=scenenodesgetByName($$$$$$)|| trgt=scenenodesgetByName(Clipping Plane) ) var trans=trgttransform if(trgt) return var tname=trgtname if(typeof(rot4x4[tname])==undefined) rot4x4[tname]=new Matrix4x4() if(target) var tiltAxis=rot4x4[tname]transformDirection(new Vector3(010)) else var tiltAxis=transtransformDirection(new Vector3(010)) var spinAxis=rot4x4[tname]transformDirection(new Vector3(001)) get the centre of the mesh if(targetampamptrgtconstructorname==Mesh) var centre=transtransformPosition(trgtcomputeBoundingBox()center) else part group (Node3 parent node clipping plane) var centre=new Vector3(transtranslation) switch(echaracterCode) case 30tilt up rot4x4[tname]rotateAboutLineInPlace( -MathPI900rot4x4[tname]translationtiltAxis) transrotateAboutLineInPlace(-MathPI900centretiltAxis) break case 31tilt down rot4x4[tname]rotateAboutLineInPlace( MathPI900rot4x4[tname]translationtiltAxis) transrotateAboutLineInPlace(MathPI900centretiltAxis) break case 28spin right if(ectrlKeyDownampamptarget) transrotateAboutLineInPlace(-MathPI900centrespinAxis) else rot4x4[tname]rotateAboutLineInPlace( -MathPI900rot4x4[tname]translationnew Vector3(001)) transrotateAboutLineInPlace(-MathPI900centrenew Vector3(001)) break case 29spin left if(ectrlKeyDownampamptarget) transrotateAboutLineInPlace(MathPI900centrespinAxis) else rot4x4[tname]rotateAboutLineInPlace( MathPI900rot4x4[tname]translationnew Vector3(001)) transrotateAboutLineInPlace(MathPI900centrenew Vector3(001)) break case 120 x translateTarget(trans new Vector3(100) e) break case 121 y translateTarget(trans new Vector3(010) e) break case 122 z translateTarget(trans new Vector3(001) e) break case 88 shift + x translateTarget(trans new Vector3(-100) e) break case 89 shift + y translateTarget(trans new Vector3(0-10) e) break case 90 shift + z translateTarget(trans new Vector3(00-1) e) break case 115 s transtranslateInPlace(centrescale(-1)) transscaleInPlace(101) transtranslateInPlace(centrescale(1)) break case 83 shift + s transtranslateInPlace(centrescale(-1)) transscaleInPlace(1101) transtranslateInPlace(centrescale(1)) break transmultiplyInPlace(backtrans)runtimeaddEventHandler(keyEventHandler)translates object by amount calculated from Canvas sizefunction translateTarget(t d e) var cam=scenecamerasgetByIndex(0) if(camprojectionType==camTYPE_PERSPECTIVE) var scale=Mathtan(camfov2) camtargetPositionsubtract(camposition)length Mathmin(ecanvasPixelWidthecanvasPixelHeight) else var scale=camviewPlaneSize2 Mathmin(ecanvasPixelWidthecanvasPixelHeight) ttranslateInPlace(dscale(scale))function addremoveClipPlane(chk) var curTrans=getCurTrans() var clip=scenecreateClippingPlane() if(chk) add Clipping Plane and place its center either into the camera target position or into the centre of the currently selected mesh node var centre=new Vector3() if(target) var trans=targettransform var parent=targetparent while(parenttransform) trans=transmultiply(parenttransform) parent=parentparent if(targetconstructorname==Mesh) var centre=transtransformPosition(targetcomputeBoundingBox()center) else var centre=new Vector3(transtranslation) target=null else centreset(scenecamerasgetByIndex(0)targetPosition) cliptransformsetView( new Vector3(000) new Vector3(100) new Vector3(010)) cliptransformtranslateInPlace(centre) else if( scenenodesgetByName($$$$$$)|| scenenodesgetByName(Clipping Plane) ) clipremove()clip=null restoreTrans(curTrans) return clipfunction to store current transformation matrix of all nodes in the scenefunction getCurTrans() var tA=new Array() for(var i=0 iltscenenodescount i++) var nd=scenenodesgetByIndex(i) if(ndname==) continue tA[ndname]=new Matrix4x4(ndtransform) return tAfunction to restore transformation matrices given as argfunction restoreTrans(tA) for(var i=0 iltscenenodescount i++) var nd=scenenodesgetByIndex(i) if(tA[ndname]) ndtransformset(tA[ndname]) store original transformation matrix of all mesh nodes in the scenevar origtrans=getCurTrans()set initial state of Cross Section menu entrycameraEventHandleronEvent(1)hostconsoleclear()

var ocgs=hostgetOCGs(hostpageNum)for(var i=0iltocgslengthi++)if(ocgs[i]name==MediaPlayButton2)ocgs[i]state=false

(C) 2012 Michail Vidiassov John C Bowman Alexander Grahn asylabelsjs version 20120912 3D JavaScript to be used with media9sty (option `add3Djscript) for Asymptote generated PRC files adds billboard behaviour to text labels in Asymptote PRC files so that they always face the camera under 3D rotation This work may be distributed andor modified under the conditions of the LaTeX Project Public License The latest version of this license is in httpmirrorsctanorgmacroslatexbaselppltxt This work has the LPPL maintenance status `maintained The Current Maintainer of this work is A Grahnvar bbnodes=new Array() billboard meshesvar bbtrans=new Array() billboard transformsfunction fulltransform(mesh) var t=new Matrix4x4(meshtransform) if(meshparentname = ) var parentTransform=fulltransform(meshparent) tmultiplyInPlace(parentTransform) return t else return t find all text labels in the scene and determine pivoting pointsvar nodes=scenenodesvar nodescount=nodescountvar third=1030for(var i=0 i lt nodescount i++) var node=nodesgetByIndex(i) var name=nodename var end=namelastIndexOf()-1 if(end gt 0) if(namecharAt(end) == 001) var start=namelastIndexOf(-)+1 if(end gt start) nodename=namesubstr(0start-1) var nodeMatrix=fulltransform(nodeparent) var c=nodeMatrixtranslation position var d=Mathpow(Mathabs(nodeMatrixdeterminant)third) scale bbnodespush(node) bbtranspush(Matrix4x4()scale(ddd)translate(c)multiply(nodeMatrixinverse)) var camera=scenecamerasgetByIndex(0) var zero=new Vector3(000)var bbcount=bbnodeslength event handler to maintain camera-facing text labelsbillboardHandler=new RenderEventHandler()billboardHandleronEvent=function(event) var T=new Matrix4x4() TsetView(zerocamerapositionsubtract(cameratargetPosition) cameraupsubtract(cameraposition)) for(var j=0 j lt bbcount j++) bbnodes[j]transformset(Tmultiply(bbtrans[j])) runtimerefresh() runtimeaddEventHandler(billboardHandler)runtimerefresh()

(C) 2012 Alexander Grahn 3Dspintooljs version 20120301 3D JavaScript to be used with media9sty (option `add3Djscript) enables the Spin tool (also accessible via 3D toolbar or context menu) upon activation of the 3D scene the scene then rotates around the upright axis while dragging with the mouse This work may be distributed andor modified under the conditions of the LaTeX Project Public License The latest version of this license is in httpmirrorsctanorgmacroslatexbaselppltxt This work has the LPPL maintenance status `maintained The Current Maintainer of this work is A GrahnruntimesetCurrentTool(runtimeTOOL_NAME_SPIN)

N Privault

Proposition 66 Call-put parity We have the call-put parity relation

gc(tSt)minus gp(tSt) = St minusK eminus(Tminust)r 0 6 t 6 T (621)

between the Black-Scholes prices of call and put options in terms of theforward contract price St minusK eminus(Tminust)r

Proof The call-put parity (621) is a consequence of the relation

xminusK = (xminusK)+ minus (K minus x)+

satisfied by the terminal call and put payoff functions in the Black-ScholesPDE (67) It can also be verified directly from (610) and (618) as

gc(tx)minus gp(tx) = xΦ(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)minus(K eminus(Tminust)rΦ

(minus dminus(T minus t)

)minus xΦ

(minus d+(T minus t)

))= xΦ

(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)minusK eminus(Tminust)r

(1minusΦ

(dminus(T minus t)

))+ x

(1minusΦ

(d+(T minus t)

))= xminusK

The Delta of the Black-Scholes put option can be obtained by differentiationof the call-put parity relation (621) and Proposition 64

Proposition 67 The Delta of the Black-Scholes put option is given by

ξt = minus(1minusΦ(d+(T minus t)

)) = minusΦ

(minus d+(T minus t)

)isin [minus1 0] 0 6 t 6 T

Proof By the call-put parity relation (621) and Proposition 64 we have

partgppartx

(tSt) =partgcpartx

(tSt)minus 1

= Φ(d+(T minus t))minus 1= minusΦ(minusd+(T minus t)) 0 6 t 6 T

where we applied (614)

As a consequence of Proposition 67 the Black-Scholes put price splitsinto a risky component minusStΦ

(minus d+(T minus t)

)and a riskless component

K eminus(Tminust)rΦ(minus dminus(T minus t)

) as follows

gp(tSt) = K eminus(Tminust)rΦ(minus dminus(T minus t)

)︸ ︷︷ ︸riskminusfree investment (savings)

minus StΦ(minus d+(T minus t)

)︸ ︷︷ ︸

risky investment (short)

0 6 t 6 T

216

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

In Figure 613 we plot the Delta of the European put option as a function ofthe underlying asset price and of the time remaining until maturity

Payoff function (x-K)+

0

50

100

150

200

Underlying

0

5

10

15 Time to maturity T-t

-1

-075

-05

-025

0

Fig 613 Delta of a European put option with strike price K = 100 r = 3 σ = 10

Numerical example - hedging of a put option

For one more example we consider a put option issued by BNP Paribas on04 November 2008 with strike price K=$77667 maturity T = October 052009 and entitlement ratio 92593 cf page 9 In the next Figure 614 thenumber of days is counted from the origin not from maturity

40 50 60 70 80 90 100

0 50 100 150 200

0 5

10 15 20 25 30 35 40 45

Underlying (HK$)Time in days

Fig 614 Path of the Black-Scholes price for a put option on HSBC

As a consequence of Proposition 67 the amount invested on the risky assetfor the hedging of a put option is

minusStΦ(minus d+(T minus t)

)= minusStΦ

(minus log(StK) + (r+ σ22)(T minus t)

|σ|radicT minus t

)6 0

217

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

ie there is always short selling and the amount invested on the riskless assetpriced At = ert t isin [0T ] is

ηtAt = K eminus(Tminust)rΦ(minus dminus(T minus t)

)= K eminus(Tminust)rΦ

(minus log(StK) + (rminus σ22)(T minus t)

|σ|radicT minus t

)gt 0

which is always nonnegative ie we are constantly saving money on theriskless asset as noted in Figure 615

-60

-40

-20

0

20

40

60

80

100

0 50 100 150 200

K

HK$

Black-Scholes priceRisky investment ξtSt

Riskless investment ηtAtUnderlying asset price

Fig 615 Time evolution of the hedging portfolio for a put option on HSBC

In the above example the put option finished out of the money (OTM) so thatno cash settlement or physical delivery occurs A comparison of Figure 610with market data can be found in Figures 913 and 914 below

64 Market Terms and Data

The following Table 61 provides a summary of formulas for the computationof Black-Scholes sensitivities also called Greekslowast

lowast ldquoEvery class feels like attending a Greek lessonrdquo (AY2018-2019 student feedback)

218

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

Call option Put option

Option price g(tSt) StΦ(d+(T minus t))minusK eminus(Tminust)rΦ(dminus(T minus t)) K eminus(Tminust)rΦ(minusdminus(T minus t))minus StΦ(minusd+(T minus t))

Delta (∆) partg

partx(tSt) Φ(d+(T minus t)) gt 0 minusΦ(minusd+(T minus t)) 6 0

Gamma (Γ) part2g

partx2 (tSt)Φprime(d+(T minus t))St|σ|

radicT minus t

gt 0

Vega partg

partσ(tSt) St

radicT minus tΦprime(d+(T minus t)) gt 0

Theta (Θ) partg

partt(tSt) minusSt|σ|Φ

prime(d+(T minus t))2radicT minus t

minus rK eminus(Tminust)rΦ(dminus(T minus t)) 6 0 minusSt|σ|Φprime(d+(T minus t))

2radicT minus t

+ rK eminus(Tminust)rΦ(minusdminus(T minus t))

Rho (ρ) partg

partr(tSt) K(T minus t) eminus(Tminust)rΦ(dminus(T minus t)) minusK(T minus t) eminus(Tminust)rΦ(minusdminus(T minus t))

Table 61 Black-Scholes Greeks (Wikipedia)

From Table 61 we can conclude that call option prices are increasing func-tions of the underlying asset price St of the interest rate r and of the volatil-ity parameter σ Similarly put option prices are decreasing functions of theunderlying asset price St of the interest rate r and increasing functions ofthe volatility parameter σ

Parameter Variation of call option prices Variation of put option prices

Underlying St increasing decreasing

Volatility σ increasing increasing

Time t decreasing depends on the underlying price level

Interest rate r increasing decreasing

Table 62 Variations of Black-Scholes prices

The change of sign of the sensitivity Theta (Θ) with respect to time t can beverified in the following Figure 616

219

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

(a) Black-Scholes call price maps (b) Black-Scholes put price maps

Fig 616 Time-dependent solutions of the Black-Scholes PDElowast

Intrinsic value The intrinsic value at time t isin [0T ] of the option withpayoff C = h

(S(1)T

)is given by the immediate exercise payoff h

(S(1)t

) The

extrinsic value at time t isin [0T ] of the option is the remaining differenceπt(C) minus h

(S(1)t

)between the option price πt(C) and the immediate ex-

ercise payoff h(S(1)t

) In general the option price πt(C) decomposes as

πt(C) = h(S(1)t

)︸ ︷︷ ︸intrinsic value

+ πt(C)minus h(S(1)t

)︸ ︷︷ ︸

extrinsic value

0 6 t 6 T ]

Gearing The gearing at time t isin [0T ] of the option with payoff C = h(ST )is defined as the ratio

Gt =St

πt(C)=

Stg(tSt)

0 6 t 6 T

Effective gearing The effective gearing at time t isin [0T ] of the option withpayoff C = h(ST ) is defined as the ratio

Get = Gtξt

=ξtStπt(C)

=St

πt(C)

partg

partx(tSt)

=St

g(tSt)partg

partx(tSt)

= Stpart

partxlog g(tSt) 0 6 t 6 T

lowast The animation works in Acrobat Reader on the entire pdf file

220

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

The effective gearingGet =

ξtStπt(C)

can be interpreted as the hedge ratio ie the percentage of the portfoliowhich is invested on the risky asset When written as

∆g(tSt)g(tSt)

= Get times

∆StSt

the effective gearing gives the relative variation or percentage change∆g(tSt)g(tSt) of the option price g(tSt) from the relative variation∆StSt in the underlying asset price

The ratio Get = Stpart log g(tSt)partx can also be interpreted as an elasticity

coefficient

Break-even price The break-even price BEPt of the underlying asset is thevalue of S for which the intrinsic option value h(S) equals the option priceπt(C) at time t isin [0T ] For European call options it is given by

BEPt = K + πt(C) = K + g(tSt) t = 0 1 N

whereas for European put options it is given by

BEPt = K minus πt(C) = K minus g(tSt) 0 6 t 6 T

Premium The option premium OPt can be defined as the variation requiredfrom the underlying asset price in order to reach the break-even price iewe have

OPt =BEPt minus St

St=K + g(tSt)minus St

St 0 6 t 6 T

for European call options and

OPt =St minusBEPt

St=St + g(tSt)minusK

St 0 6 t 6 T

for European put options see Figure 617 below The term ldquopremiumrdquo issometimes also used to denote the arbitrage price g(tSt) of the option

221

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

f (tx σ)100

=

x =

K =

xpart log f

partx=

σ =

partf

partt(tx σ)=

T=

=(xminusK)x

∆ = = partf

partx(tx σ)

= partf

partσ(tx σ)

=K+f (txσ)minusx

x

=K+f (tx σ)

rf=

partf

partt+rxpartf

partx+

σ2 2x2part2f

partx2

Fig 617 Warrant terms and data

The R package bizdays (requires to install QuantLib) can be used to computecalendar time vs business time to maturity1 installpackages(bizdays)

library(bizdays)3 load_quantlib_calendars(HongKong from=2018-01-01 to=2018-12-31)

load_quantlib_calendars(Singapore from=2018-01-01 to=2018-12-31)5 bizdays(2018-03-10 2018-04-03 QuantLibHongKong)

bizdays(2018-03-10 2018-04-03 QuantLibSingapore)

65 The Heat Equation

In the next proposition we notice that the solution f(tx) of the Black-Scholes PDE (67) can be transformed into a solution g(t y) of the simplerheat equation by a change of variable and a time inversion t 7minusrarr T minus t onthe interval [0T ] so that the terminal condition at time T in the Black-Scholes equation (622) becomes an initial condition at time t = 0 in theheat equation (625) See also here for a related discussion on changes ofvariables for the Black-Scholes PDE

222

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

Proposition 68 Assume that f(tx) solves the Black-Scholes PDErf(tx) = partf

partt(tx) + rx

partf

partx(tx) + 1

2σ2x2 part

2f

partx2 (tx)

f(T x) = (xminusK)+(622)

with terminal condition h(x) = (xminusK)+ x gt 0 Then the function g(t y)defined by

g(t y) = ertf(T minus t e|σ|y+(σ22minusr)t) (623)

solves the heat equation (625) with initial condition

ψ(y) = h(

e|σ|y) y isin R (624)

ie we have partg

partt(t y) = 1

2part2g

party2 (t y)

g(0 y) = h(

e|σ|y)

(625)

Proposition 68 will be proved in Section 66 It will allow us to solve theBlack-Scholes PDE (622) based on the solution of the heat equation (625)with initial condition ψ(y) = h

(e|σ|y

) y isin R by inversion of Relation (623)

with s = T minus t x = e|σ|y+(σ22minusr)t ie

f(sx) = eminus(Tminuss)rg(T minus s minus(σ

22minus r)(T minus s) + log x|σ|

)

Next we focus on the heat equation

partϕ

partt(t y) = 1

2part2ϕ

party2 (t y) (626)

which is used to model the diffusion of heat over time through solids Herethe data of g(x t) represents the temperature measured at time t and pointx We refer the reader to Widder (1975) for a complete treatment of thistopic

223

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

Fig 618 Time-dependent solution of the heat equationlowast

Proposition 69 The fundamental solution of the heat equation (626) isgiven by the Gaussian probability density function

ϕ(t y) =1radic2πt

eminusy2(2t) y isin R

with variance t gt 0

Proof The proof is done by a direct calculation as follows

partϕ

partt(t y) = part

partt

(eminusy2(2t)radic

2πt

)

= minus eminusy2(2t)

2t32radic

2π+

y2

2t2eminusy2(2t)radic

2πt

=

(minus 1

2t +y2

2t2

)ϕ(t y)

and

12part2ϕ

party2 (t y) = minus12part

party

(y

t

eminusy2(2t)radic

2πt

)

= minus eminusy2(2t)

2tradic

2πt+

y2

2t2eminusy2(2t)radic

2πt

=

(minus 1

2t +y2

2t2

)ϕ(t y) t gt 0 y isin R

lowast The animation works in Acrobat Reader on the entire pdf file

224

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

In Section 66 the heat equation (626) will be shown to be equivalent to theBlack-Scholes PDE after a change of variables In particular this will lead tothe explicit solution of the Black-Scholes PDE

Proposition 610 The heat equationpartg

partt(t y) = 1

2part2g

party2 (t y)

g(0 y) = ψ(y)

(627)

with continuous initial condition

g(0 y) = ψ(y)

has the solution

g(t y) =winfinminusinfin

ψ(z) eminus(yminusz)2(2t) dzradic2πt

y isin R t gt 0 (628)

Proof We have

partg

partt(t y) = part

partt

winfinminusinfin

ψ(z) eminus(yminusz)2(2t) dzradic2πt

=winfinminusinfin

ψ(z)part

partt

(eminus(yminusz)2(2t)radic

2πt

)dz

=12winfinminusinfin

ψ(z)

((yminus z)2

t2minus 1t

)eminus(yminusz)2(2t) dzradic

2πt

=12winfinminusinfin

ψ(z)part2

partz2 eminus(yminusz)2(2t) dzradic2πt

=12winfinminusinfin

ψ(z)part2

party2 eminus(yminusz)2(2t) dzradic2πt

=12part2

party2

winfinminusinfin

ψ(z) eminus(yminusz)2(2t) dzradic2πt

=12part2g

party2 (t y)

On the other hand it can be checked that at time t = 0 we have

limtrarr0

winfinminusinfin

ψ(z) eminus(yminusz)2(2t) dzradic2πt

= limtrarr0

winfinminusinfin

ψ(y+ z) eminusz2(2t) dzradic2πt

= ψ(y) y isin R

225

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

The next Figure 619 shows the evolution of g(tx) with initial conditionbased on the European call payoff function h(x) = (xminusK)+ ie

g(0 y) = ψ(y) = h(

e|σ|y)=(

e|σ|y minusK)+ y isin R

Fig 619 Time-dependent solution of the heat equationlowast

Let us provide a second proof of Proposition 610 this time using Brownianmotion and stochastic calculus

Proof of Proposition 610 First note that under the change of variable x =z minus y we have

g(t y) =winfinminusinfin

ψ(z) eminus(yminusz)2(2t) dzradic2πt

=winfinminusinfin

ψ(y+ x) eminusx2(2t) dxradic2πt

= IE[ψ(y+Bt)]

= IE[ψ(yminusBt)]

where (Bt)tisinR+ is a standard Brownian motion and Bt N (0 t) t isin R+Applying Itocircrsquos formula and using the fact that the expectation of the stochas-tic integral with respect to Brownian motion is zero see Relation (417) inProposition 420 we find

g(t y) = IE[ψ(yminusBt)]

= ψ(y)minus IE[w t

0ψprime(yminusBs)dBs

]+

12 IE

[w t0ψprimeprime(yminusBs)ds

]= ψ(y) +

12w t

0IE[ψprimeprime(yminusBs)

]ds

lowast The animation works in Acrobat Reader on the entire pdf file

226

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

= ψ(y) +12w t

0part2

party2 IE [ψ(yminusBs)] ds

= ψ(y) +12w t

0part2g

party2 (s y)ds

Hence we have

partg

partt(t y) = part

parttIE[ψ(yminusBt)]

=12part2

party2 IE [ψ(yminusBt)]

=12part2g

party2 (t y)

Regarding the initial condition we check that

g(0 y) = IE[ψ(yminusB0)] = IE[ψ(y)] = ψ(y)

The expression g(t y) = IE[ψ(yminusBt)] provides a probabilistic interpreta-tion of the heat diffusion phenomenon based on Brownian motion Namelywhen ψε(y) = 1[minusεε](y) we find that

gε(t y) = IE[ψε(yminusBt)]= IE[1[minusεε](yminusBt)]= P

(yminusBt isin [minusε ε]

)= P

(yminus ε 6 Bt 6 y+ ε

)represents the probability of finding Bt within a neighborhood [y minus ε y + ε]of the point y isin R

66 Solution of the Black-Scholes PDE

In this section we solve the Black-Scholes PDE by the kernel method of Sec-tion 65 and a change of variables This solution method uses the change ofvariables (623) of Proposition 68 and a time inversion from which the ter-minal condition at time T in the Black-Scholes equation becomes an initialcondition at time t = 0 in the heat equation

Next we state the proof Proposition 68

Proof Letting s = T minus t and x = e|σ|y+(σ22minusr)t and using Relation (623)ie

g(t y) = ertf(T minus t e|σ|y+(σ22minusr)t)

227

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

we have

partg

partt(t y) = r ertf

(T minus t e|σ|y+(σ22minusr)t)minus ert partf

parts

(T minus t e|σ|y+(σ22minusr)t)

+

(σ2

2 minus r)

ert e|σ|y+(σ22minusr)t partf

partx

(T minus t e|σ|y+(σ22minusr)t)

= r ertf(T minus tx)minus ert partfparts

(T minus tx) +(σ2

2 minus r)

ertxpartfpartx

(T minus tx)

=12 ertx2σ2 part

2f

partx2 (T minus tx) +σ2

2 ertxpartfpartx

(T minus tx) (629)

where on the last step we used the Black-Scholes PDE On the other handwe have

partg

party(t y) = |σ| ert e|σ|y+(σ22minusr)t partf

partx

(T minus t e|σ|y+(σ22minusr)t)

and

12partg2

party2 (t y) =σ2

2 ert e|σ|y+(σ22minusr)t partf

partx

(T minus t e|σ|y+(σ22minusr)t)

+σ2

2 ert e2|σ|y+2(σ22minusr)t part2f

partx2(T minus t e|σ|y+(σ22minusr)t)

=σ2

2 ertxpartfpartx

(T minus tx) + σ2

2 ertx2 part2f

partx2 (T minus tx) (630)

We conclude by comparing (629) with (630) which shows that g(tx) solvesthe heat equation (627) with initial condition

g(0 y) = f(T e|σ|y

)= h

(e|σ|y

)

In the next proposition we derive the Black-Scholes formula (610) by solv-ing the PDE (622) The Black-Scholes formula will also be recovered by aprobabilistic argument via the computation of an expected value in Proposi-tion 77

Proposition 611 When h(x) = (x minusK)+ the solution of the Black-Scholes PDE (622) is given by

f(tx) = xΦ(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

) x gt 0

whereΦ(x) =

1radic2π

w xminusinfin

eminusy22dy x isin R

and

228

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

d+(T minus t) =

log(xK) + (r+ σ22)(T minus t)|σ|radicT minus t

dminus(T minus t) =log(xK) + (rminus σ22)(T minus t)

|σ|radicT minus t

x gt 0 t isin [0T )

Proof By inversion of Relation (623) with s = T minus t and x = e|σ|y+(σ22minusr)twe get

f(sx) = eminus(Tminuss)rg(T minus s minus(σ

22minus r)(T minus s) + log x|σ|

)and

h(x) = ψ

(log x|σ|

) x gt 0 or ψ(y) = h

(e|σ|y

) y isin R

Hence using the solution (628) and Relation (624) we get

f(tx) = eminus(Tminust)rg(T minus t minus(σ

22minus r)(T minus t) + log x|σ|

)= eminus(Tminust)r

winfinminusinfin

ψ

(minus(σ22minus r)(T minus t) + log x

|σ|+ z

)eminusz2(2(Tminust)) dzradic

2(T minus t)π

= eminus(Tminust)rwinfinminusinfin

h(x e|σ|zminus(σ22minusr)(Tminust)) eminusz2(2(Tminust)) dzradic

2(T minus t)π

= eminus(Tminust)rwinfinminusinfin

(x e|σ|zminus(σ22minusr)(Tminust) minusK

)+ eminusz2(2(Tminust)) dzradic2(T minus t)π

= eminus(Tminust)r

timeswinfin

(minusr+σ22)(Tminust)+log(Kx)|σ|

(x e|σ|zminus(σ22minusr)(Tminust) minusK

)eminusz2(2(Tminust)) dzradic

2(T minus t)π

= x eminus(Tminust)rwinfinminusdminus(Tminust)

radicTminust

e|σ|zminus(σ22minusr)(Tminust) eminusz2(2(Tminust)) dzradic2(T minus t)π

minusK eminus(Tminust)rwinfinminusdminus(Tminust)

radicTminust

eminusz2(2(Tminust)) dzradic2(T minus t)π

= xwinfinminusdminus(Tminust)

radicTminust

e|σ|zminus(Tminust)σ22minusz2(2(Tminust)) dzradic2(T minus t)π

minusK eminus(Tminust)rwinfinminusdminus(Tminust)

radicTminust

eminusz2(2(Tminust)) dzradic2(T minus t)π

= xwinfinminusdminus(Tminust)

radicTminust

eminus(zminus(Tminust)|σ|)2(2(Tminust)) dzradic2(T minus t)π

229

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

minusK eminus(Tminust)rwinfinminusdminus(Tminust)

radicTminust

eminusz2(2(Tminust)) dzradic2(T minus t)π

= xwinfinminusdminus(Tminust)

radicTminustminus(Tminust)|σ|

eminusz2(2(Tminust)) dzradic2(T minus t)π

minusK eminus(Tminust)rwinfinminusdminus(Tminust)

radicTminust

eminusz2(2(Tminust)) dzradic2(T minus t)π

= xwinfinminusdminus(Tminust)minus|σ|

radicTminust

eminusz22 dzradic2πminusK eminus(Tminust)r

winfinminusdminus(Tminust)

eminusz22 dzradic2π

= x(1minusΦ

(minus d+(T minus t)

))minusK eminus(Tminust)r

(1minusΦ

(minus dminus(T minus t)

))= xΦ

(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)

where we used the relation (614) ie

1minusΦ(a) = Φ(minusa) a isin R

Exercises

Exercise 61 Bachelier (1900) model Consider a market made of a risklessasset valued At = A0 with zero interest rate t isin R+ and a risky asset whoseprice St is modeled by a standard Brownian motion as St = Bt t isin R+

a) Show that the price g(tBt) of the option with payoff C = B2T satisfies

the heat equationpartϕ

partt(t y) = minus1

2part2ϕ

party2 (t y)

with terminal condition g(T x) = x2b) Find the function g(tx) by solving the PDE of Question (a)

Hint Try a solution of the form g(tx) = x2 + f(t)

See Exercises 611 713 and 714 for extensions to nonzero interest rates

Exercise 62 Consider a risky asset price (St)tisinR modeled in the Cox et al(1985) (CIR) model as

dSt = β(αminus St)dt+ σradicStdBt αβσ gt 0 (631)

and let (ηt ξt)tisinR+ be a portfolio strategy whose value Vt = ηtAt + ξtSttakes the form Vt = g(tSt) t isin R+ Figure 620 presents a random simula-tion of the solution to (631) with α = 0025 β = 1 and σ = 13230

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

0

1

2

3

4

5

6

7

8

0 01 02 03 04 05 06 07 08 09 1

St

t

Fig 620 Graph of the CIR short rate t 7rarr rt with α = 25 β = 1 and σ = 13

N=10000 t lt- 0(N-1) dt lt- 10Na=0025 b=2 sigma=0052 X lt- rnorm(Nmean=0sd=sqrt(dt))R lt- rep(0N)R[1]=001

for (j in 2N)R[j]=max(0R[j-1]+(a-bR[j-1])dt+sigmasqrt(R[j-1])X[j])4 plot(t R xlab = t ylab = type = l ylim = c(0002) col = blue)

Based on the self-financing condition written as

dVt = rVtdtminus rξtStdt+ ξtdSt

= rVtdtminus rξtStdt+ β(αminus St)ξtdt+ σξtradicStdBt t isin R+ (632)

derive the PDE satisfied by the function g(tx) using the Itocirc formula

Exercise 63 Black-Scholes PDE with dividends Consider a riskless as-set with price At = A0 ert t isin R+ and an underlying asset price process(St)tisinR+ modeled as

dSt = (microminus δ)Stdt+ σStdBt

where (Bt)tisinR+ is a standard Brownian motion and δ gt 0 is a continuous-time dividend rate By absence of arbitrage the payment of a dividend entailsa drop in the stock price by the same amount occuring generally on the ex-dividend date on which the purchase of the security no longer entitles theinvestor to the dividend amount The list of investors entitled to dividendpayment is consolidated on the date of record and payment is made on thepayable date

library(quantmod)2 getSymbols(0005HKfrom=2010-01-01to=SysDate()src=yahoo)

getDividends(0005HKfrom=2010-01-01to=SysDate()src=yahoo)

a) Assuming that the portfolio with value Vt = ξtSt + ηtAt at time t is self-financing and that dividends are continuously reinvested write down theportfolio variation dVt

231

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

b) Assuming that the portfolio value Vt takes the form Vt = g(tSt) at timet derive the Black-Scholes PDE for the function g(tx) with its terminalcondition

c) Compute the price at time t isin [0T ] of the European call option withstrike price K by solving the corresponding Black-Scholes PDE

d) Compute the Delta of the option

Exercise 64

a) Check that the Black-Scholes formula (610) for European call options

gc(tx) = xΦ(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)

satisfies the following boundary conditions

i) at x = 0 gc(t 0) = 0ii) at maturity t = T

gc(T x) = (xminusK)+ =

xminusK x gt K

0 x 6 K

iii) as time to maturity tends to infinity

limTrarrinfin

Bl(Kxσ rT minus t) = x t isin R+

b) Check that the Black-Scholes formula (618) for European put options

gp(tx) = K eminus(Tminust)rΦ(minus dminus(T minus t)

)minus xΦ

(minus d+(T minus t)

)satisfies the following boundary conditions

i) at x = 0 gp(t 0) = K eminus(Tminust)rii) as x tends to infinity gp(tinfin) = 0 for all t isin [0T )iii) at maturity t = T

gp(T x) = (K minus x)+ =

0 x gt K

K minus x x 6 K

iv) as time to maturity tends to infinity

limTrarrinfin

Blp(KStσ rT minus t) = 0 t isin R+

Exercise 65 Power option (Exercise 314 continued)

232

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

a) Solve the Black-Scholes PDE

rg(x t) = partg

partt(x t) + rx

partg

partx(x t) + σ2

2 x2 part2g

partx2 (x t) (633)

with terminal condition g(xT ) = x2 x gt 0 t isin [0T ]

Hint Try a solution of the form g(x t) = x2f(t) and find f(t)b) Find the respective quantities ξt and ηt of the risky asset St and riskless

asset At = ert in the portfolio with value

Vt = g(St t) = ξtSt + ηtAt 0 6 t 6 T

hedging the contract with payoff S2T at maturity

Exercise 66 On December 18 2007 a call warrant has been issued byFortis Bank on the stock price S of the MTR Corporation with maturityT = 23122008 strike price K = HK$ 3608 and entitlement ratio=10Recall that in the Black-Scholes model the price at time t of the Europeanclaim on the underlying asset priced St with strike price K maturity T interest rate r and volatility σ gt 0 is given by the Black-Scholes formula as

f(tSt) = StΦ(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)

wheredminus(T minus t) =

(rminus σ22)(T minus t) + log(StK)

|σ|radicT minus t

d+(T minus t) = dminus(T minus t) + |σ|radicT minus t = (r+ σ22)(T minus t) + log(StK)

|σ|radicT minus t

Recall that by Proposition 64 we have

partf

partx(tSt) = Φ

(d+(T minus t)

) 0 6 t 6 T

a) Using the values of the Gaussian cumulative distribution function com-pute the Black-Scholes price of the corresponding call option at timet =November 07 2008 with St = HK$ 17200 assuming a volatility σ =90 = 090 and an annual risk-free interest rate r = 4377 = 004377

b) Still using the Gaussian cumulative distribution function compute thequantity of the risky asset required in your portfolio at time t =November07 2008 in order to hedge one such option at maturity T = 23122008

c) Figure 1 represents the Black-Scholes price of the call option as a functionof σ isin [05 15] = [50 150]

233

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

0

01

02

03

04

05

06

05 06 07 08 09 1 11 12 13 14 15σimp

Optio

n pr

ice

σ

Market price

Fig 621 Option price as a function of the volatility σ gt 0

1 BSCall lt- function(S K r T sigma)d1 lt- (log(SK)+(r+sigma^22)T)(sigmasqrt(T))d2 lt- d1 - sigma sqrt(T)

3 BSCall = Spnorm(d1) - Kexp(-rT)pnorm(d2)BSCallsigma lt- seq(0515 length=100)

5 plot(sigmaBSCall(172360800437746365sigma) type=llty=1 xlab=Sigmaylab=Black-Scholes Call Price ylim = c(006)col=bluelwd=3)grid()

abline(h=023col=redlwd=3)

Knowing that the closing price of the warrant on November 07 2008 wasHK$ 0023 which value can you infer for the implied volatility σ at thisdatelowast

Exercise 67 Forward contracts Recall that the price πt(C) of a claimpayoff C = h(ST ) of maturity T can be written as πt(C) = g(tSt) wherethe function g(tx) satisfies the Black-Scholes PDE

rg(tx) = partg

partt(tx) + rx

partg

partx(tx) + 1

2σ2x2 part

2g

partx2 (tx)

g(T x) = h(x) (1)

with terminal condition g(T x) = h(x) x gt 0

a) Assume that C is a forward contract with payoff

C = ST minusK

at time T Find the function h(x) in (1)b) Find the solution g(tx) of the above PDE and compute the price πt(C)

at time t isin [0T ]Hint search for a solution of the form g(tx) = xminus α(t) where α(t) is afunction of t to be determined

lowast Download the corresponding or the that can be runhere

234

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

BS lt- function(S K T r sig)d1 lt- (log(SK) + (r + sig^22)T) (sigsqrt(T))d2 lt- d1 - sigsqrt(T)return(Spnorm(d1) - Kexp(-rT)pnorm(d2))impliedvol lt- function(S K T r market)sig lt- 020sigup lt- 1sigdown lt- 0001count lt- 0err lt- BS(S K T r sig) - marketwhile(abs(err) gt 000001 ampamp countlt1000)if(err lt 0)sigdown lt- sigsig lt- (sigup + sig)2elsesigup lt- sigsig lt- (sigdown + sig)2err lt- BS(S K T r sig) - marketcount lt- count + 1if(count==2000)return(NA)elsereturn(sig)market = 083K = 628T = 7 365S = 634r = 002impliedvol(S K T r market)

cells [ cell_type code execution_count null metadata outputs [] source [ from IPythoncoredisplay import display HTMLn display(HTML( )) ] cell_type code execution_count null metadata collapsed true outputs [] source [ import numpy as npn import scipystats as ssn import time n n Black and Scholesn def d1(S0 K r sigma T)n return (nplog(S0K) + (r + sigma2 2) T)(sigma npsqrt(T))n n def d2(S0 K r sigma T)n return (nplog(S0 K) + (r - sigma2 2) T) (sigma npsqrt(T))n n def BlackScholes(typeS0 K r sigma T)n if type==Cn return S0 ssnormcdf(d1(S0 K r sigma T)) - K npexp(-r T) ssnormcdf(d2(S0 K r sigma T))n elsen return K npexp(-r T) ssnormcdf(-d2(S0 K r sigma T)) - S0 ssnormcdf(-d1(S0 K r sigma T)) ] cell_type code execution_count null metadata outputs [] source [ BlackScholes(C1000 1200 002 015 10) ] cell_type code execution_count null metadata outputs [] source [ def difference(x p S K r t)n return BlackScholes(CS K r x t) - p ] cell_type code execution_count null metadata outputs [] source [ from scipyoptimize import bisectn bisect(difference00011args=(11541763731112766 1000 1200 002 10)) ] ] metadata anaconda-cloud kernelspec display_name Python 3 language python name python3 language_info codemirror_mode name ipython version 3 file_extension py mimetype textx-python name python nbconvert_exporter python pygments_lexer ipython3 version 375rc1 nbformat 4 nbformat_minor 1

Black-Scholes Pricing and Hedging

c) Compute the quantityξt =

partg

partx(tSt)

of risky assets in a self-financing portfolio hedging Cd) Repeat the above questions with the terminal condition g(T x) = x

Exercise 68a) Solve the Black-Scholes PDE

rg(tx) = partg

partt(tx) + rx

partg

partx(tx) + σ2

2 x2 part2g

partx2 (tx) (634)

with terminal condition g(T x) = 1 x gt 0

Hint Try a solution of the form g(tx) = f(t) and find f(t)

b) Find the respective quantities ξt and ηt of the risky asset St and risklessasset At = ert in the portfolio with value

Vt = g(tSt) = ξtSt + ηtAt

hedging the contract with payoff $1 at maturity

Exercise 69 Log-contracts see also Exercise 84a) Solve the PDE

0 =partg

partt(x t) + rx

partg

partx(x t) + σ2

2 x2 part2g

partx2 (x t)

with the terminal condition g(xT ) = log x x gt 0

Hint Try a solution of the form g(x t) = f(t) + log x and find f(t)b) Solve the Black-Scholes PDE

rh(x t) = parth

partt(x t) + rx

parth

partx(x t) + σ2

2 x2 part2h

partx2 (x t) (635)

with the terminal condition h(xT ) = log x x gt 0

Hint Try a solution of the form h(x t) = u(t)g(x t) and find u(t)c) Find the respective quantities ξt and ηt of the risky asset St and riskless

asset At = ert in the portfolio with value

Vt = g(St t) = ξtSt + ηtAt

hedging a log-contract with payoff logST at maturity 235

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

Exercise 610 Binary options Consider a price process (St)tisinR+ given by

dStSt

= rdt+ σdBt S0 = 1

under the risk-neutral probability measure Plowast The binary (or digital) calloption is a contract with maturity T strike price K and payoff

Cd = 1[Kinfin)(ST ) =

$1 if ST gt K

0 if ST lt K

a) Derive the Black-Schole PDE satisfied by the pricing function Cd(tSt) ofthe binary call option together with its terminal condition

b) Show that the solution Cd(tx) of the Black-Scholes PDE of Question (a)is given by

Cd(tx) = eminus(Tminust)rΦ((rminus σ22)(T minus t) + log(xK)

|σ|radicT minus t

)= eminus(Tminust)rΦ

(dminus(T minus t)

)

where

dminus(T minus t) =(rminus σ22)(T minus t) + log(StK)

|σ|radicT minus t

0 6 t lt T

Exercise 611

a) Bachelier (1900) model Solve the stochastic differential equation

dSt = αStdt+ σdBt (636)

in terms of ασ isin R and the initial condition S0b) Write down the Bachelier PDE satisfied by the function C(tx) where

C(tSt) is the price at time t isin [0T ] of the contingent claim with payoffφ(ST ) = exp(ST ) and identify the process Delta (ξt)tisin[0T ] that hedgesthis claim

c) Solve the Black-Scholes PDE of Question (b) with the terminal conditionφ(x) = ex x isin R

Hint Search for a solution of the form

C(tx) = exp(minus(T minus t)r+ xh(t) +

σ2

4r (h2(t)minus 1)

) (637)

where h(t) is a function to be determined with h(T ) = 1

236

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

d) Compute the portfolio strategy (ξt ηt)tisin[0T ] that hedges the contingentclaim with payoff exp(ST )

Exercise 612

a) Show that for every fixed value of S the function

d 7minusrarr h(S d) = SΦ(d+ |σ|

radicT)minusK eminusrTΦ(d)

reaches its maximum at dlowast(S) =log(SK) + (rminus σ22)T

|σ|radicT

b) By the differentiation rule

d

dSh(S dlowast(S)) =

parth

partS(S dlowast(S)) + dprimelowast(S)

parth

partd(S dlowast(S))

recover the value of the Black-Scholes Delta

Exercise 613 Compute the Black-Scholes Vega by differentiation of theBlack-Scholes function

gc(tx) = Bl(Kxσ rT minus t) = xΦ(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)

with respect to the volatility parameter σ knowing that

minus12(dminus(T minus t)

)2= minus1

2

(log(xK) + (rminus σ22)(T minus t)

|σ|radicT minus t

)2

= minus12(d+(T minus t)

)2+ (T minus t)r+ log x

K (638)

Exercise 614 Consider the backward induction relation (313) ie

v(tx) = (1minus plowastN )v (t+ 1x(1 + aN )) + plowastN v (t+ 1x(1 + bN ))

using the renormalizations rN = rTN and

aN = (1 + rN )(1minus |σ|radicTN)minus 1 bN = (1 + rN )(1 + |σ|

radicTN)minus 1

of Section 36 N gt 1 with

plowastN =rN minus aNbN minus aN

and plowastN =bN minus rNbN minus aN

a) Show that the Black-Scholes PDE (62) of Proposition 61 can be recoveredfrom the induction relation (313) when the number N of time steps tendsto infinity

237

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

b) Show that the expression of the Delta ξt =partgcpartx

(tSt) can be similarlyrecovered from the finite difference relation (319) ie

ξ(1)t (Stminus1) =

v (t (1 + bN )Stminus1)minus v (t (1 + aN )Stminus1)

Stminus1(bN minus aN )

as N tends to infinity

Problem 615 (Leung and Sircar (2015)) ProShares Ultra SampP500 andProShares UltraShort SampP500 are leveraged investment funds that seek dailyinvestment results before fees and expenses that correspond to β times (βx)the daily performance of the SampP500reg with respectively β = 2 for ProSharesUltra and β = minus2 for ProShares UltraShort Here leveraging with a factorβ 1 aims at multiplying the potential return of an investment by a factorβ The following 10 questions are interdependent and should be treated insequence

a) Consider a risky asset priced S0 = $4 at time t = 0 and taking twopossible values S1 = $5 and S1 = $2 at time t = 1 Compute the twopossible returns (in ) achieved when investing $4 in one share of the assetS and the expected return under the risk-neutral probability measureassuming that the risk-free interest rate is zero

b) Leveraging Still based on an initial $4 investment we decide to leverageby a factor β = 3 by borrowing another (β minus 1) times $4 = 2times $4 at ratezero to purchase a total of β = 3 shares of the asset S Compute thetwo returns (in ) possibly achieved in this case and the expected returnunder the risk-neutral probability measure assuming that the risk-freeinterest rate is zero

c) Denoting by Ft the ProShares value at time t how much should the fundinvest in the underlying asset priced St and how much $ should it borrowor save on the risk-free market at any time t in order to leverage with afactor β 1

d) Find the portfolio allocation (ξt ηt) for the fund value

Ft = ξtSt + ηtAt t isin R+

according to Question (c) where At = A0 ert is the riskless money marketaccount

e) We choose to model the SampP500 index St as the geometric Brownianmotion

dSt = rStdt+ σStdBt t isin R+

under the risk-neutral probability measure Plowast Find the stochastic dif-ferential equation satisfied by (Ft)tisinR+ under the self-financing conditiondFt = ξtdSt + ηtdAt

238

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

f) Is the discounted fund value ( eminusrtFt)tisinR+ a martingale under the risk-neutral probability measure Plowast

g) Find the relation between the fund value Ft and the index St by solvingthe stochastic differential equation obtained for Ft in Question (e) Forsimplicity we normalize F0 = Sβ0

h) Write the price at time t = 0 of the call option with payoff (FT minusK)+ onthe ProShares index using the Black-Scholes formula

i) Show that when β gt 0 the Delta at time t isin [0T ) of the call optionwith payoff (FT minusK)+ on ProShares Ultra is equal to the Delta of thecall option with payoff (ST minusKβ(t))

+ on the SampP500 for a certain strikeprice Kβ(t) to be determined explicitly

j) When β lt 0 find the relation between the Delta at time t isin [0T ) ofthe call option with payoff (FT minusK)+ on ProShares UltraShort and theDelta of the put option with payoff (Kβ(t)minus ST )+ on the SampP500

239

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

  1. pbsARFix223
  2. pbsARFix224
  3. pbsARFix225
  4. pbsARFix226
  5. pbsARFix227
  6. pbsARFix228
  7. pbsARFix229
  8. pbsARFix230
  9. fdrm1
  10. pbsARFix231
  11. 100
  12. 101
  13. 102
  14. 103
  15. 104
  16. 105
  17. 106
  18. 107
  19. 108
  20. 109
  21. 1010
  22. 1011
  23. 1012
  24. 1013
  25. 1014
  26. 1015
  27. 1016
  28. 1017
  29. 1018
  30. 1019
  31. anm10
  32. 10EndLeft
  33. 10StepLeft
  34. 10PauseLeft
  35. 10PlayLeft
  36. 10PlayPauseLeft
  37. 10PauseRight
  38. 10PlayRight
  39. 10PlayPauseRight
  40. 10StepRight
  41. 10EndRight
  42. 10Minus
  43. 10Reset
  44. 10Plus
  45. pbsARFix232
  46. pbsARFix233
  47. pbsARFix234
  48. pbsARFix235
  49. pbsARFix236
  50. pbsARFix237
  51. fdrm2
  52. 110
  53. 111
  54. 112
  55. 113
  56. 114
  57. 115
  58. 116
  59. 117
  60. 118
  61. 119
  62. 1110
  63. 1111
  64. 1112
  65. 1113
  66. 1114
  67. 1115
  68. 1116
  69. 1117
  70. 1118
  71. 1119
  72. anm11
  73. 11EndLeft
  74. 11StepLeft
  75. 11PauseLeft
  76. 11PlayLeft
  77. 11PlayPauseLeft
  78. 11PauseRight
  79. 11PlayRight
  80. 11PlayPauseRight
  81. 11StepRight
  82. 11EndRight
  83. 11Minus
  84. 11Reset
  85. 11Plus
  86. pbsARFix238
  87. pbsARFix239
  88. pbsARFix240
  89. pbsARFix241
  90. pbsARFix242
  91. 120
  92. 121
  93. 122
  94. 123
  95. 124
  96. 125
  97. 126
  98. 127
  99. 128
  100. 129
  101. 1210
  102. anm12
  103. 12EndLeft
  104. 12StepLeft
  105. 12PauseLeft
  106. 12PlayLeft
  107. 12PlayPauseLeft
  108. 12PauseRight
  109. 12PlayRight
  110. 12PlayPauseRight
  111. 12StepRight
  112. 12EndRight
  113. 12Minus
  114. 12Reset
  115. 12Plus
  116. 130
  117. 131
  118. 132
  119. 133
  120. 134
  121. 135
  122. 136
  123. 137
  124. 138
  125. 139
  126. 1310
  127. anm13
  128. 13EndLeft
  129. 13StepLeft
  130. 13PauseLeft
  131. 13PlayLeft
  132. 13PlayPauseLeft
  133. 13PauseRight
  134. 13PlayRight
  135. 13PlayPauseRight
  136. 13StepRight
  137. 13EndRight
  138. 13Minus
  139. 13Reset
  140. 13Plus
  141. pbsARFix243
  142. pbsARFix244
  143. pbsARFix245
  144. pbsARFix246
  145. 140
  146. 141
  147. 142
  148. 143
  149. 144
  150. 145
  151. 146
  152. 147
  153. 148
  154. 149
  155. 1410
  156. 1411
  157. 1412
  158. 1413
  159. 1414
  160. 1415
  161. 1416
  162. 1417
  163. 1418
  164. 1419
  165. 1420
  166. 1421
  167. 1422
  168. 1423
  169. 1424
  170. 1425
  171. 1426
  172. 1427
  173. 1428
  174. 1429
  175. 1430
  176. 1431
  177. 1432
  178. 1433
  179. 1434
  180. 1435
  181. 1436
  182. 1437
  183. 1438
  184. 1439
  185. 1440
  186. 1441
  187. 1442
  188. 1443
  189. 1444
  190. 1445
  191. 1446
  192. 1447
  193. 1448
  194. 1449
  195. 1450
  196. 1451
  197. 1452
  198. 1453
  199. 1454
  200. 1455
  201. 1456
  202. 1457
  203. 1458
  204. 1459
  205. 1460
  206. 1461
  207. 1462
  208. 1463
  209. 1464
  210. 1465
  211. 1466
  212. 1467
  213. 1468
  214. 1469
  215. 1470
  216. 1471
  217. 1472
  218. 1473
  219. 1474
  220. 1475
  221. 1476
  222. 1477
  223. 1478
  224. 1479
  225. 1480
  226. 1481
  227. 1482
  228. 1483
  229. 1484
  230. 1485
  231. 1486
  232. 1487
  233. 1488
  234. 1489
  235. 1490
  236. 1491
  237. 1492
  238. 1493
  239. 1494
  240. 1495
  241. 1496
  242. 1497
  243. 1498
  244. 1499
  245. 14100
  246. 14101
  247. 14102
  248. 14103
  249. 14104
  250. 14105
  251. 14106
  252. 14107
  253. 14108
  254. 14109
  255. 14110
  256. 14111
  257. 14112
  258. 14113
  259. 14114
  260. 14115
  261. 14116
  262. 14117
  263. 14118
  264. 14119
  265. 14120
  266. 14121
  267. 14122
  268. 14123
  269. 14124
  270. 14125
  271. 14126
  272. 14127
  273. 14128
  274. 14129
  275. 14130
  276. 14131
  277. 14132
  278. 14133
  279. 14134
  280. 14135
  281. 14136
  282. 14137
  283. 14138
  284. 14139
  285. 14140
  286. 14141
  287. 14142
  288. 14143
  289. 14144
  290. 14145
  291. 14146
  292. 14147
  293. 14148
  294. 14149
  295. 14150
  296. 14151
  297. 14152
  298. 14153
  299. 14154
  300. 14155
  301. 14156
  302. 14157
  303. 14158
  304. 14159
  305. 14160
  306. 14161
  307. 14162
  308. 14163
  309. 14164
  310. 14165
  311. 14166
  312. 14167
  313. 14168
  314. 14169
  315. 14170
  316. 14171
  317. 14172
  318. 14173
  319. 14174
  320. 14175
  321. 14176
  322. 14177
  323. 14178
  324. 14179
  325. 14180
  326. 14181
  327. 14182
  328. 14183
  329. 14184
  330. 14185
  331. 14186
  332. 14187
  333. 14188
  334. 14189
  335. 14190
  336. 14191
  337. 14192
  338. 14193
  339. 14194
  340. 14195
  341. 14196
  342. 14197
  343. anm14
  344. 14EndLeft
  345. 14StepLeft
  346. 14PauseLeft
  347. 14PlayLeft
  348. 14PlayPauseLeft
  349. 14PauseRight
  350. 14PlayRight
  351. 14PlayPauseRight
  352. 14StepRight
  353. 14EndRight
  354. 14Minus
  355. 14Reset
  356. 14Plus
  357. pbsARFix247
  358. pbsARFix248
  359. 150
  360. 151
  361. 152
  362. 153
  363. 154
  364. 155
  365. 156
  366. 157
  367. 158
  368. 159
  369. 1510
  370. 1511
  371. 1512
  372. 1513
  373. 1514
  374. 1515
  375. 1516
  376. 1517
  377. 1518
  378. 1519
  379. anm15
  380. 15EndLeft
  381. 15StepLeft
  382. 15PauseLeft
  383. 15PlayLeft
  384. 15PlayPauseLeft
  385. 15PauseRight
  386. 15PlayRight
  387. 15PlayPauseRight
  388. 15StepRight
  389. 15EndRight
  390. 15Minus
  391. 15Reset
  392. 15Plus
  393. pbsARFix249
  394. pbsARFix250
  395. pbsARFix251
  396. pbsARFix252
  397. pbsARFix253
  398. pbsARFix254
  399. pbsARFix255
  400. pbsARFix256
  401. pbsARFix257
  402. pbsARFix258
  403. pbsARFix259
  404. pbsARFix260
  405. pbsARFix261
Page 13: Black-ScholesPricingandHedging - NTU · to the Black-Scholes PDE (6.2) in order to price a claim payoff Cof the formC= h(S T).Asinthediscrete-timecase,thearbitragepriceπt(C) at

Black-Scholes Pricing and Hedging

40 50 60 70 80 90 0 50 100 150 200

0

5

10

15

20

25

30

35

40

Underlying (HK$) Time in days

Fig 69 Path of the Black-Scholes price for a call option on HSBC

As a consequence of Proposition 64 in the Black-Scholes call option hedgingmodel the amount invested in the risky asset is

Stξt = StΦ(d+(T minus t)

)= StΦ

(log(StK) + (r+ σ22)(T minus t)

|σ|radicT minus t

)gt 0

which is always nonnegative ie there is no short selling and the amountinvested on the riskless asset is

ηtAt = minusK eminus(Tminust)rΦ(dminus(T minus t)

)= minusK eminus(Tminust)rΦ

(log(StK) + (rminus σ22)(T minus t)

|σ|radicT minus t

)6 0

which is always nonpositive ie we are constantly borrowing money on theriskless asset as noted in Figure 610

-60

-40

-20

0

20

40

60

80

100

0 50 100 150 200

K

HK$

Black-Scholes priceRisky investment ξtSt

Riskless investment ηtAtUnderlying asset price

Fig 610 Time evolution of a hedging portfolio for a call option on HSBC

213

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

A comparison of Figure 610 with market data can be found in Figures 911and 912 below

Cash settlement In the case of a cash settlement the option issuer will sat-isfy the option contract by selling ξT = 1 stock at the price ST = $83refund the K = $63 risk-free investment and hand in the remaining amountC = (ST minusK)+ = 83minus 63 = $20 to the option holder

Physical delivery In the case of physical delivery of the underlying asset theoption issuer will deliver ξT = 1 stock to the option holder in exchange forK = $63 which will be used together with the portfolio value to refund therisk-free loan

63 European Put Options

Similarly in the case of the European put option with strike price K thepayoff function is given by h(x) = (Kminusx)+ and the Black-Scholes PDE (67)reads

rgp(tx) =partgppartt

(tx) + rxpartgppartx

(tx) + 12σ

2x2 part2gppartx2 (tx)

gp(T x) = (K minus x)+(617)

The next proposition can be proved as in Sections 65 and 66 see Proposi-tion 611

Proposition 65 The solution of the PDE (617) is given by the Black-Scholes formula for put options

gp(tx) = K eminus(Tminust)rΦ(minus dminus(T minus t)

)minus xΦ

(minus d+(T minus t)

) (618)

withd+(T minus t) =

log(xK) + (r+ σ22)(T minus t)|σ|radicT minus t

(619)

dminus(T minus t) =log(xK) + (rminus σ22)(T minus t)

|σ|radicT minus t

(620)

as illustrated in Figure 611

214

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

Fig 611 Graph of the Black-Scholes put price function with strike price K = 100lowast

In other words the European put option with strike price K and maturityT is priced at time t isin [0T ] as

gp(tSt) = K eminus(Tminust)rΦ(minus dminus(T minus t)

)minus StΦ

(minus d+(T minus t)

) 0 6 t 6 T

Fig 612 Time-dependent solution of the Black-Scholes PDE (put option)dagger

The following R script is an implementation of the Black-Scholes formula forEuropean put options in R

1 BSPut lt- function(S K r T sigma)d1 = (log(SK)+(r+sigma^22)T)(sigmasqrt(T))

3 d2 = d1 - sigma sqrt(T)BSPut = Kexp(-rT) pnorm(-d2) - Spnorm(-d1)

5 BSPut

Call-put parity

lowast Right-click on the figure for interaction and ldquoFull Screen Multimediardquo viewdagger The animation works in Acrobat Reader on the entire pdf file

215

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

(C) 2012--today Alexander Grahn 3Dmenujs version 20140923 3D JavaScript used by media9sty Extended functionality of the (right click) context menu of 3D annotations 1) Adds the following items to the 3D context menu `Generate Default View Finds good default camera settings returned as options for use with the includemedia command `Get Current View Determines camera cross section and part settings of the current view returned as `VIEW section that can be copied into a views file of additional views The views file is inserted using the `3Dviews option of includemedia `Cross Section Toggle switch to add or remove a cross section into or from the current view The cross section can be moved in the x y z directions using x y z and X Y Z keys on the keyboard be tilted against and spun around the upright Z axis using the UpDown and LeftRight arrow keys and caled using the s and S keys 2) Enables manipulation of position and orientation of indiviual parts and groups of parts in the 3D scene Parts which have been selected with the mouse can be scaled moved around and rotated like the cross section as described above To spin the parts around their local up-axis keep Control key pressed while using the UpDown and LeftRight arrow keys This work may be distributed andor modified under the conditions of the LaTeX Project Public License The latest version of this license is in httpmirrorsctanorgmacroslatexbaselppltxt This work has the LPPL maintenance status `maintained The Current Maintainer of this work is A Grahn The code borrows heavily from Bernd Gaertners `Miniball software originally written in C++ for computing the smallest enclosing ball of a set of points see httpwwwinfethzchpersonalgaertnerminiballhtmlhostconsoleshow()constructor for doubly linked listfunction List() thisfirst_node=null thislast_node=new Node(undefined)Listprototypepush_back=function(x) var new_node=new Node(x) if(thisfirst_node==null) thisfirst_node=new_node new_nodeprev=null else new_nodeprev=thislast_nodeprev new_nodeprevnext=new_node new_nodenext=thislast_node thislast_nodeprev=new_nodeListprototypemove_to_front=function(it) var node=itget() if(nodenext=null ampamp nodeprev=null) nodenextprev=nodeprev nodeprevnext=nodenext nodeprev=null nodenext=thisfirst_node thisfirst_nodeprev=node thisfirst_node=node Listprototypebegin=function() var i=new Iterator() itarget=thisfirst_node return(i)Listprototypeend=function() var i=new Iterator() itarget=thislast_node return(i)function Iterator(it) if( it=undefined ) thistarget=ittarget else thistarget=null Iteratorprototypeset=function(it)thistarget=ittargetIteratorprototypeget=function()return(thistarget)Iteratorprototypederef=function()return(thistargetdata)Iteratorprototypeincr=function() if(thistargetnext=null) thistarget=thistargetnextconstructor for node objects that populate the linked listfunction Node(x) thisprev=null thisnext=null thisdata=xfunction sqr(r)return(rr)helper functionMiniball algorithm by B Gaertnerfunction Basis() thism=0 thisq0=new Array(3) thisz=new Array(4) thisf=new Array(4) thisv=new Array(new Array(3) new Array(3) new Array(3) new Array(3)) thisa=new Array(new Array(3) new Array(3) new Array(3) new Array(3)) thisc=new Array(new Array(3) new Array(3) new Array(3) new Array(3)) thissqr_r=new Array(4) thiscurrent_c=thisc[0] thiscurrent_sqr_r=0 thisreset()Basisprototypecenter=function()return(thiscurrent_c)Basisprototypesize=function()return(thism)Basisprototypepop=function()--thismBasisprototypeexcess=function(p) var e=-thiscurrent_sqr_r for(var k=0klt3++k) e+=sqr(p[k]-thiscurrent_c[k]) return(e)Basisprototypereset=function() thism=0 for(var j=0jlt3++j) thisc[0][j]=0 thiscurrent_c=thisc[0] thiscurrent_sqr_r=-1Basisprototypepush=function(p) var i j var eps=1e-32 if(thism==0) for(i=0ilt3++i) thisq0[i]=p[i] for(i=0ilt3++i) thisc[0][i]=thisq0[i] thissqr_r[0]=0 else for(i=0ilt3++i) thisv[thism][i]=p[i]-thisq0[i] for(i=1iltthism++i) thisa[thism][i]=0 for(j=0jlt3++j) thisa[thism][i]+=thisv[i][j]thisv[thism][j] thisa[thism][i]=(2thisz[i]) for(i=1iltthism++i) for(j=0jlt3++j) thisv[thism][j]-=thisa[thism][i]thisv[i][j] thisz[thism]=0 for(j=0jlt3++j) thisz[thism]+=sqr(thisv[thism][j]) thisz[thism]=2 if(thisz[thism]ltepsthiscurrent_sqr_r) return(false) var e=-thissqr_r[thism-1] for(i=0ilt3++i) e+=sqr(p[i]-thisc[thism-1][i]) thisf[thism]=ethisz[thism] for(i=0ilt3++i) thisc[thism][i]=thisc[thism-1][i]+thisf[thism]thisv[thism][i] thissqr_r[thism]=thissqr_r[thism-1]+ethisf[thism]2 thiscurrent_c=thisc[thism] thiscurrent_sqr_r=thissqr_r[thism] ++thism return(true)function Miniball() thisL=new List() thisB=new Basis() thissupport_end=new Iterator()Miniballprototypemtf_mb=function(it) var i=new Iterator(it) thissupport_endset(thisLbegin()) if((thisBsize())==4) return for(var k=new Iterator(thisLbegin())kget()=iget()) var j=new Iterator(k) kincr() if(thisBexcess(jderef()) gt 0) if(thisBpush(jderef())) thismtf_mb(j) thisBpop() if(thissupport_endget()==jget()) thissupport_endincr() thisLmove_to_front(j) Miniballprototypecheck_in=function(b) thisLpush_back(b)Miniballprototypebuild=function() thisBreset() thissupport_endset(thisLbegin()) thismtf_mb(thisLend())Miniballprototypecenter=function() return(thisBcenter())Miniballprototyperadius=function() return(Mathsqrt(thisBcurrent_sqr_r))functions called by menu itemsfunction calc3Dopts () create Miniball object var mb=new Miniball() auxiliary vector var corner=new Vector3() iterate over all visible mesh nodes in the scene for(i=0iltscenemeshescounti++) var mesh=scenemeshesgetByIndex(i) if(meshvisible) continue local to parent transformation matrix var trans=meshtransform build local to world transformation matrix by recursively multiplying the parents transf matrix on the right var parent=meshparent while(parenttransform) trans=transmultiply(parenttransform) parent=parentparent get the bbox of the mesh (local coordinates) var bbox=meshcomputeBoundingBox() transform the local bounding box corner coordinates to world coordinates for bounding sphere determination BBoxmin cornerset(bboxmin) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) BBoxmax cornerset(bboxmax) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) remaining six BBox corners cornerset(bboxminx bboxmaxy bboxmaxz) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) cornerset(bboxminx bboxminy bboxmaxz) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) cornerset(bboxminx bboxmaxy bboxminz) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) cornerset(bboxmaxx bboxminy bboxminz) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) cornerset(bboxmaxx bboxminy bboxmaxz) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) cornerset(bboxmaxx bboxmaxy bboxminz) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) compute the smallest enclosing bounding sphere mbbuild() current camera settings var camera=scenecamerasgetByIndex(0) var res= initialize result string aperture angle of the virtual camera (perspective projection) or orthographic scale (orthographic projection) if(cameraprojectionType==cameraTYPE_PERSPECTIVE) var aac=camerafov180MathPI if(hostutilprintf(4f aac)=30) res+=hostutilprintf(n3Daac=s aac) else cameraviewPlaneSize=2mbradius() res+=hostutilprintf(n3Dortho=s 1cameraviewPlaneSize) camera roll var roll = cameraroll180MathPI if(hostutilprintf(4f roll)=0) res+=hostutilprintf(n3Droll=sroll) target to camera vector var c2c=new Vector3() c2cset(cameraposition) c2csubtractInPlace(cameratargetPosition) c2cnormalize() if((c2cx==0 ampamp c2cy==-1 ampamp c2cz==0)) res+=hostutilprintf(n3Dc2c=s s s c2cx c2cy c2cz) new camera settings bounding sphere centre --gt new camera target var coo=new Vector3() cooset((mbcenter())[0] (mbcenter())[1] (mbcenter())[2]) if(coolength) res+=hostutilprintf(n3Dcoo=s s s coox cooy cooz) radius of orbit if(cameraprojectionType==cameraTYPE_PERSPECTIVE) var roo=mbradius() Mathsin(aac MathPI 360) else orthographic projection var roo=mbradius() res+=hostutilprintf(n3Droo=s roo) update camera settings in the viewer var currol=cameraroll cameratargetPositionset(coo) camerapositionset(cooadd(c2cscale(roo))) cameraroll=currol determine background colour rgb=scenebackgroundgetColor() if((rgbr==1 ampamp rgbg==1 ampamp rgbb==1)) res+=hostutilprintf(n3Dbg=s s s rgbr rgbg rgbb) determine lighting scheme switch(scenelightScheme) case sceneLIGHT_MODE_FILE curlights=Artworkbreak case sceneLIGHT_MODE_NONE curlights=Nonebreak case sceneLIGHT_MODE_WHITE curlights=Whitebreak case sceneLIGHT_MODE_DAY curlights=Daybreak case sceneLIGHT_MODE_NIGHT curlights=Nightbreak case sceneLIGHT_MODE_BRIGHT curlights=Hardbreak case sceneLIGHT_MODE_RGB curlights=Primarybreak case sceneLIGHT_MODE_BLUE curlights=Bluebreak case sceneLIGHT_MODE_RED curlights=Redbreak case sceneLIGHT_MODE_CUBE curlights=Cubebreak case sceneLIGHT_MODE_CAD curlights=CADbreak case sceneLIGHT_MODE_HEADLAMP curlights=Headlampbreak if(curlights=Artwork) res+=hostutilprintf(n3Dlights=s curlights) determine global render mode switch(scenerenderMode) case sceneRENDER_MODE_BOUNDING_BOX currender=BoundingBoxbreak case sceneRENDER_MODE_TRANSPARENT_BOUNDING_BOX currender=TransparentBoundingBoxbreak case sceneRENDER_MODE_TRANSPARENT_BOUNDING_BOX_OUTLINE currender=TransparentBoundingBoxOutlinebreak case sceneRENDER_MODE_VERTICES currender=Verticesbreak case sceneRENDER_MODE_SHADED_VERTICES currender=ShadedVerticesbreak case sceneRENDER_MODE_WIREFRAME currender=Wireframebreak case sceneRENDER_MODE_SHADED_WIREFRAME currender=ShadedWireframebreak case sceneRENDER_MODE_SOLID currender=Solidbreak case sceneRENDER_MODE_TRANSPARENT currender=Transparentbreak case sceneRENDER_MODE_SOLID_WIREFRAME currender=SolidWireframebreak case sceneRENDER_MODE_TRANSPARENT_WIREFRAME currender=TransparentWireframebreak case sceneRENDER_MODE_ILLUSTRATION currender=Illustrationbreak case sceneRENDER_MODE_SOLID_OUTLINE currender=SolidOutlinebreak case sceneRENDER_MODE_SHADED_ILLUSTRATION currender=ShadedIllustrationbreak case sceneRENDER_MODE_HIDDEN_WIREFRAME currender=HiddenWireframebreak if(currender=Solid) res+=hostutilprintf(n3Drender=s currender) write result string to the console hostconsoleshow() hostconsoleclear() hostconsoleprintln(n Copy and paste the following text to then+ option list of includemedian + res + n)function get3Dview () var camera=scenecamerasgetByIndex(0) var coo=cameratargetPosition var c2c=camerapositionsubtract(coo) var roo=c2clength c2cnormalize() var res=VIEW=insert optional name heren if((coox==0 ampamp cooy==0 ampamp cooz==0)) res+=hostutilprintf( COO=s s sn coox cooy cooz) if((c2cx==0 ampamp c2cy==-1 ampamp c2cz==0)) res+=hostutilprintf( C2C=s s sn c2cx c2cy c2cz) if(roo gt 1e-9) res+=hostutilprintf( ROO=sn roo) var roll = cameraroll180MathPI if(hostutilprintf(4f roll)=0) res+=hostutilprintf( ROLL=sn roll) if(cameraprojectionType==cameraTYPE_PERSPECTIVE) var aac=camerafov 180MathPI if(hostutilprintf(4f aac)=30) res+=hostutilprintf( AAC=sn aac) else if(hostutilprintf(4f cameraviewPlaneSize)=1) res+=hostutilprintf( ORTHO=sn 1cameraviewPlaneSize) rgb=scenebackgroundgetColor() if((rgbr==1 ampamp rgbg==1 ampamp rgbb==1)) res+=hostutilprintf( BGCOLOR=s s sn rgbr rgbg rgbb) switch(scenelightScheme) case sceneLIGHT_MODE_FILE curlights=Artworkbreak case sceneLIGHT_MODE_NONE curlights=Nonebreak case sceneLIGHT_MODE_WHITE curlights=Whitebreak case sceneLIGHT_MODE_DAY curlights=Daybreak case sceneLIGHT_MODE_NIGHT curlights=Nightbreak case sceneLIGHT_MODE_BRIGHT curlights=Hardbreak case sceneLIGHT_MODE_RGB curlights=Primarybreak case sceneLIGHT_MODE_BLUE curlights=Bluebreak case sceneLIGHT_MODE_RED curlights=Redbreak case sceneLIGHT_MODE_CUBE curlights=Cubebreak case sceneLIGHT_MODE_CAD curlights=CADbreak case sceneLIGHT_MODE_HEADLAMP curlights=Headlampbreak if(curlights=Artwork) res+= LIGHTS=+curlights+n switch(scenerenderMode) case sceneRENDER_MODE_BOUNDING_BOX defaultrender=BoundingBoxbreak case sceneRENDER_MODE_TRANSPARENT_BOUNDING_BOX defaultrender=TransparentBoundingBoxbreak case sceneRENDER_MODE_TRANSPARENT_BOUNDING_BOX_OUTLINE defaultrender=TransparentBoundingBoxOutlinebreak case sceneRENDER_MODE_VERTICES defaultrender=Verticesbreak case sceneRENDER_MODE_SHADED_VERTICES defaultrender=ShadedVerticesbreak case sceneRENDER_MODE_WIREFRAME defaultrender=Wireframebreak case sceneRENDER_MODE_SHADED_WIREFRAME defaultrender=ShadedWireframebreak case sceneRENDER_MODE_SOLID defaultrender=Solidbreak case sceneRENDER_MODE_TRANSPARENT defaultrender=Transparentbreak case sceneRENDER_MODE_SOLID_WIREFRAME defaultrender=SolidWireframebreak case sceneRENDER_MODE_TRANSPARENT_WIREFRAME defaultrender=TransparentWireframebreak case sceneRENDER_MODE_ILLUSTRATION defaultrender=Illustrationbreak case sceneRENDER_MODE_SOLID_OUTLINE defaultrender=SolidOutlinebreak case sceneRENDER_MODE_SHADED_ILLUSTRATION defaultrender=ShadedIllustrationbreak case sceneRENDER_MODE_HIDDEN_WIREFRAME defaultrender=HiddenWireframebreak if(defaultrender=Solid) res+= RENDERMODE=+defaultrender+n detect existing Clipping Plane (3D Cross Section) var clip=null if( clip=scenenodesgetByName($$$$$$)|| clip=scenenodesgetByName(Clipping Plane) ) for(var i=0iltscenenodescounti++) var nd=scenenodesgetByIndex(i) if(nd==clip||ndname==) continue var ndUTFName= for (var j=0 jltndnamelength j++) var theUnicode = ndnamecharCodeAt(j)toString(16) while (theUnicodelengthlt4) theUnicode = 0 + theUnicode ndUTFName += theUnicode var end=ndnamelastIndexOf() if(endgt0) var ndUserName=ndnamesubstr(0end) else var ndUserName=ndname respart= PART=+ndUserName+n respart+= UTF16NAME=+ndUTFName+n defaultvals=true if(ndvisible) respart+= VISIBLE=falsen defaultvals=false if(ndopacitylt10) respart+= OPACITY=+ndopacity+n defaultvals=false if(ndconstructorname==Mesh) currender=defaultrender switch(ndrenderMode) case sceneRENDER_MODE_BOUNDING_BOX currender=BoundingBoxbreak case sceneRENDER_MODE_TRANSPARENT_BOUNDING_BOX currender=TransparentBoundingBoxbreak case sceneRENDER_MODE_TRANSPARENT_BOUNDING_BOX_OUTLINE currender=TransparentBoundingBoxOutlinebreak case sceneRENDER_MODE_VERTICES currender=Verticesbreak case sceneRENDER_MODE_SHADED_VERTICES currender=ShadedVerticesbreak case sceneRENDER_MODE_WIREFRAME currender=Wireframebreak case sceneRENDER_MODE_SHADED_WIREFRAME currender=ShadedWireframebreak case sceneRENDER_MODE_SOLID currender=Solidbreak case sceneRENDER_MODE_TRANSPARENT currender=Transparentbreak case sceneRENDER_MODE_SOLID_WIREFRAME currender=SolidWireframebreak case sceneRENDER_MODE_TRANSPARENT_WIREFRAME currender=TransparentWireframebreak case sceneRENDER_MODE_ILLUSTRATION currender=Illustrationbreak case sceneRENDER_MODE_SOLID_OUTLINE currender=SolidOutlinebreak case sceneRENDER_MODE_SHADED_ILLUSTRATION currender=ShadedIllustrationbreak case sceneRENDER_MODE_HIDDEN_WIREFRAME currender=HiddenWireframebreak case sceneRENDER_MODE_DEFAULT currender=Defaultbreak if(currender=defaultrender) respart+= RENDERMODE=+currender+n defaultvals=false if(origtrans[ndname]ampampndtransformisEqual(origtrans[ndname])) var lvec=ndtransformtransformDirection(new Vector3(100)) var uvec=ndtransformtransformDirection(new Vector3(010)) var vvec=ndtransformtransformDirection(new Vector3(001)) respart+= TRANSFORM= +lvecx+ +lvecy+ +lvecz+ +uvecx+ +uvecy+ +uvecz+ +vvecx+ +vvecy+ +vvecz+ +ndtransformtranslationx+ +ndtransformtranslationy+ +ndtransformtranslationz+n defaultvals=false respart+= ENDn if(defaultvals) res+=respart if(clip) var centre=cliptransformtranslation var normal=cliptransformtransformDirection(new Vector3(001)) res+= CROSSSECTn if((centrex==0 ampamp centrey==0 ampamp centrez==0)) res+=hostutilprintf( CENTER=s s sn centrex centrey centrez) if((normalx==1 ampamp normaly==0 ampamp normalz==0)) res+=hostutilprintf( NORMAL=s s sn normalx normaly normalz) res+=hostutilprintf( VISIBLE=sn clipvisible) res+=hostutilprintf( PLANECOLOR=s s sn clipmaterialemissiveColorr clipmaterialemissiveColorg clipmaterialemissiveColorb) res+=hostutilprintf( OPACITY=sn clipopacity) res+=hostutilprintf( INTERSECTIONCOLOR=s s sn clipwireframeColorr clipwireframeColorg clipwireframeColorb) res+= ENDn for(var propt in clip) consoleprintln(propt++clip[propt]) res+=ENDn hostconsoleshow() hostconsoleclear() hostconsoleprintln(n Add the following VIEW section to a file ofn+ predefined views (See option 3Dviews)nn + The view may be given a name after VIEW=n + (Remove in front of =)n) hostconsoleprintln(res + n)add items to 3D context menuruntimeaddCustomMenuItem(dfltview Generate Default View default 0)runtimeaddCustomMenuItem(currview Get Current View default 0)runtimeaddCustomMenuItem(csection Cross Section checked 0)menu event handlersmenuEventHandler = new MenuEventHandler()menuEventHandleronEvent = function(e) switch(emenuItemName) case dfltview calc3Dopts() break case currview get3Dview() break case csection addremoveClipPlane(emenuItemChecked) break runtimeaddEventHandler(menuEventHandler)global variable taking reference to currently selected nodevar target=nullselectionEventHandler=new SelectionEventHandler()selectionEventHandleronEvent=function(e) if(eselectedampampenodename=) target=enode else target=null runtimeaddEventHandler(selectionEventHandler)cameraEventHandler=new CameraEventHandler()cameraEventHandleronEvent=function(e) var clip=null runtimeremoveCustomMenuItem(csection) runtimeaddCustomMenuItem(csection Cross Section checked 0) if(clip=scenenodesgetByName($$$$$$)|| predefined scenenodesgetByName(Clipping Plane)) added via context menu runtimeremoveCustomMenuItem(csection) runtimeaddCustomMenuItem(csection Cross Section checked 1) if(clip)plane in predefined views must be rotated by 90 deg around normal cliptransformrotateAboutLineInPlace( MathPI2cliptransformtranslation cliptransformtransformDirection(new Vector3(001)) ) for(var i=0 iltrot4x4length i++)rot4x4[i]setIdentity() target=nullruntimeaddEventHandler(cameraEventHandler)var rot4x4=new Array() keeps track of spin and tilt axes transformationskey event handler for scaling moving spinning and tilting objectskeyEventHandler=new KeyEventHandler()keyEventHandleronEvent=function(e) var backtrans=new Matrix4x4() var trgt=null if(target) trgt=target var backtrans=new Matrix4x4() var trans=trgttransform var parent=trgtparent while(parenttransform) build local to world transformation matrix transmultiplyInPlace(parenttransform) also build world to local back-transformation matrix backtransmultiplyInPlace(parenttransforminversetranspose) parent=parentparent backtranstransposeInPlace() else if( trgt=scenenodesgetByName($$$$$$)|| trgt=scenenodesgetByName(Clipping Plane) ) var trans=trgttransform if(trgt) return var tname=trgtname if(typeof(rot4x4[tname])==undefined) rot4x4[tname]=new Matrix4x4() if(target) var tiltAxis=rot4x4[tname]transformDirection(new Vector3(010)) else var tiltAxis=transtransformDirection(new Vector3(010)) var spinAxis=rot4x4[tname]transformDirection(new Vector3(001)) get the centre of the mesh if(targetampamptrgtconstructorname==Mesh) var centre=transtransformPosition(trgtcomputeBoundingBox()center) else part group (Node3 parent node clipping plane) var centre=new Vector3(transtranslation) switch(echaracterCode) case 30tilt up rot4x4[tname]rotateAboutLineInPlace( -MathPI900rot4x4[tname]translationtiltAxis) transrotateAboutLineInPlace(-MathPI900centretiltAxis) break case 31tilt down rot4x4[tname]rotateAboutLineInPlace( MathPI900rot4x4[tname]translationtiltAxis) transrotateAboutLineInPlace(MathPI900centretiltAxis) break case 28spin right if(ectrlKeyDownampamptarget) transrotateAboutLineInPlace(-MathPI900centrespinAxis) else rot4x4[tname]rotateAboutLineInPlace( -MathPI900rot4x4[tname]translationnew Vector3(001)) transrotateAboutLineInPlace(-MathPI900centrenew Vector3(001)) break case 29spin left if(ectrlKeyDownampamptarget) transrotateAboutLineInPlace(MathPI900centrespinAxis) else rot4x4[tname]rotateAboutLineInPlace( MathPI900rot4x4[tname]translationnew Vector3(001)) transrotateAboutLineInPlace(MathPI900centrenew Vector3(001)) break case 120 x translateTarget(trans new Vector3(100) e) break case 121 y translateTarget(trans new Vector3(010) e) break case 122 z translateTarget(trans new Vector3(001) e) break case 88 shift + x translateTarget(trans new Vector3(-100) e) break case 89 shift + y translateTarget(trans new Vector3(0-10) e) break case 90 shift + z translateTarget(trans new Vector3(00-1) e) break case 115 s transtranslateInPlace(centrescale(-1)) transscaleInPlace(101) transtranslateInPlace(centrescale(1)) break case 83 shift + s transtranslateInPlace(centrescale(-1)) transscaleInPlace(1101) transtranslateInPlace(centrescale(1)) break transmultiplyInPlace(backtrans)runtimeaddEventHandler(keyEventHandler)translates object by amount calculated from Canvas sizefunction translateTarget(t d e) var cam=scenecamerasgetByIndex(0) if(camprojectionType==camTYPE_PERSPECTIVE) var scale=Mathtan(camfov2) camtargetPositionsubtract(camposition)length Mathmin(ecanvasPixelWidthecanvasPixelHeight) else var scale=camviewPlaneSize2 Mathmin(ecanvasPixelWidthecanvasPixelHeight) ttranslateInPlace(dscale(scale))function addremoveClipPlane(chk) var curTrans=getCurTrans() var clip=scenecreateClippingPlane() if(chk) add Clipping Plane and place its center either into the camera target position or into the centre of the currently selected mesh node var centre=new Vector3() if(target) var trans=targettransform var parent=targetparent while(parenttransform) trans=transmultiply(parenttransform) parent=parentparent if(targetconstructorname==Mesh) var centre=transtransformPosition(targetcomputeBoundingBox()center) else var centre=new Vector3(transtranslation) target=null else centreset(scenecamerasgetByIndex(0)targetPosition) cliptransformsetView( new Vector3(000) new Vector3(100) new Vector3(010)) cliptransformtranslateInPlace(centre) else if( scenenodesgetByName($$$$$$)|| scenenodesgetByName(Clipping Plane) ) clipremove()clip=null restoreTrans(curTrans) return clipfunction to store current transformation matrix of all nodes in the scenefunction getCurTrans() var tA=new Array() for(var i=0 iltscenenodescount i++) var nd=scenenodesgetByIndex(i) if(ndname==) continue tA[ndname]=new Matrix4x4(ndtransform) return tAfunction to restore transformation matrices given as argfunction restoreTrans(tA) for(var i=0 iltscenenodescount i++) var nd=scenenodesgetByIndex(i) if(tA[ndname]) ndtransformset(tA[ndname]) store original transformation matrix of all mesh nodes in the scenevar origtrans=getCurTrans()set initial state of Cross Section menu entrycameraEventHandleronEvent(1)hostconsoleclear()

var ocgs=hostgetOCGs(hostpageNum)for(var i=0iltocgslengthi++)if(ocgs[i]name==MediaPlayButton2)ocgs[i]state=false

(C) 2012 Michail Vidiassov John C Bowman Alexander Grahn asylabelsjs version 20120912 3D JavaScript to be used with media9sty (option `add3Djscript) for Asymptote generated PRC files adds billboard behaviour to text labels in Asymptote PRC files so that they always face the camera under 3D rotation This work may be distributed andor modified under the conditions of the LaTeX Project Public License The latest version of this license is in httpmirrorsctanorgmacroslatexbaselppltxt This work has the LPPL maintenance status `maintained The Current Maintainer of this work is A Grahnvar bbnodes=new Array() billboard meshesvar bbtrans=new Array() billboard transformsfunction fulltransform(mesh) var t=new Matrix4x4(meshtransform) if(meshparentname = ) var parentTransform=fulltransform(meshparent) tmultiplyInPlace(parentTransform) return t else return t find all text labels in the scene and determine pivoting pointsvar nodes=scenenodesvar nodescount=nodescountvar third=1030for(var i=0 i lt nodescount i++) var node=nodesgetByIndex(i) var name=nodename var end=namelastIndexOf()-1 if(end gt 0) if(namecharAt(end) == 001) var start=namelastIndexOf(-)+1 if(end gt start) nodename=namesubstr(0start-1) var nodeMatrix=fulltransform(nodeparent) var c=nodeMatrixtranslation position var d=Mathpow(Mathabs(nodeMatrixdeterminant)third) scale bbnodespush(node) bbtranspush(Matrix4x4()scale(ddd)translate(c)multiply(nodeMatrixinverse)) var camera=scenecamerasgetByIndex(0) var zero=new Vector3(000)var bbcount=bbnodeslength event handler to maintain camera-facing text labelsbillboardHandler=new RenderEventHandler()billboardHandleronEvent=function(event) var T=new Matrix4x4() TsetView(zerocamerapositionsubtract(cameratargetPosition) cameraupsubtract(cameraposition)) for(var j=0 j lt bbcount j++) bbnodes[j]transformset(Tmultiply(bbtrans[j])) runtimerefresh() runtimeaddEventHandler(billboardHandler)runtimerefresh()

(C) 2012 Alexander Grahn 3Dspintooljs version 20120301 3D JavaScript to be used with media9sty (option `add3Djscript) enables the Spin tool (also accessible via 3D toolbar or context menu) upon activation of the 3D scene the scene then rotates around the upright axis while dragging with the mouse This work may be distributed andor modified under the conditions of the LaTeX Project Public License The latest version of this license is in httpmirrorsctanorgmacroslatexbaselppltxt This work has the LPPL maintenance status `maintained The Current Maintainer of this work is A GrahnruntimesetCurrentTool(runtimeTOOL_NAME_SPIN)

N Privault

Proposition 66 Call-put parity We have the call-put parity relation

gc(tSt)minus gp(tSt) = St minusK eminus(Tminust)r 0 6 t 6 T (621)

between the Black-Scholes prices of call and put options in terms of theforward contract price St minusK eminus(Tminust)r

Proof The call-put parity (621) is a consequence of the relation

xminusK = (xminusK)+ minus (K minus x)+

satisfied by the terminal call and put payoff functions in the Black-ScholesPDE (67) It can also be verified directly from (610) and (618) as

gc(tx)minus gp(tx) = xΦ(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)minus(K eminus(Tminust)rΦ

(minus dminus(T minus t)

)minus xΦ

(minus d+(T minus t)

))= xΦ

(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)minusK eminus(Tminust)r

(1minusΦ

(dminus(T minus t)

))+ x

(1minusΦ

(d+(T minus t)

))= xminusK

The Delta of the Black-Scholes put option can be obtained by differentiationof the call-put parity relation (621) and Proposition 64

Proposition 67 The Delta of the Black-Scholes put option is given by

ξt = minus(1minusΦ(d+(T minus t)

)) = minusΦ

(minus d+(T minus t)

)isin [minus1 0] 0 6 t 6 T

Proof By the call-put parity relation (621) and Proposition 64 we have

partgppartx

(tSt) =partgcpartx

(tSt)minus 1

= Φ(d+(T minus t))minus 1= minusΦ(minusd+(T minus t)) 0 6 t 6 T

where we applied (614)

As a consequence of Proposition 67 the Black-Scholes put price splitsinto a risky component minusStΦ

(minus d+(T minus t)

)and a riskless component

K eminus(Tminust)rΦ(minus dminus(T minus t)

) as follows

gp(tSt) = K eminus(Tminust)rΦ(minus dminus(T minus t)

)︸ ︷︷ ︸riskminusfree investment (savings)

minus StΦ(minus d+(T minus t)

)︸ ︷︷ ︸

risky investment (short)

0 6 t 6 T

216

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

In Figure 613 we plot the Delta of the European put option as a function ofthe underlying asset price and of the time remaining until maturity

Payoff function (x-K)+

0

50

100

150

200

Underlying

0

5

10

15 Time to maturity T-t

-1

-075

-05

-025

0

Fig 613 Delta of a European put option with strike price K = 100 r = 3 σ = 10

Numerical example - hedging of a put option

For one more example we consider a put option issued by BNP Paribas on04 November 2008 with strike price K=$77667 maturity T = October 052009 and entitlement ratio 92593 cf page 9 In the next Figure 614 thenumber of days is counted from the origin not from maturity

40 50 60 70 80 90 100

0 50 100 150 200

0 5

10 15 20 25 30 35 40 45

Underlying (HK$)Time in days

Fig 614 Path of the Black-Scholes price for a put option on HSBC

As a consequence of Proposition 67 the amount invested on the risky assetfor the hedging of a put option is

minusStΦ(minus d+(T minus t)

)= minusStΦ

(minus log(StK) + (r+ σ22)(T minus t)

|σ|radicT minus t

)6 0

217

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

ie there is always short selling and the amount invested on the riskless assetpriced At = ert t isin [0T ] is

ηtAt = K eminus(Tminust)rΦ(minus dminus(T minus t)

)= K eminus(Tminust)rΦ

(minus log(StK) + (rminus σ22)(T minus t)

|σ|radicT minus t

)gt 0

which is always nonnegative ie we are constantly saving money on theriskless asset as noted in Figure 615

-60

-40

-20

0

20

40

60

80

100

0 50 100 150 200

K

HK$

Black-Scholes priceRisky investment ξtSt

Riskless investment ηtAtUnderlying asset price

Fig 615 Time evolution of the hedging portfolio for a put option on HSBC

In the above example the put option finished out of the money (OTM) so thatno cash settlement or physical delivery occurs A comparison of Figure 610with market data can be found in Figures 913 and 914 below

64 Market Terms and Data

The following Table 61 provides a summary of formulas for the computationof Black-Scholes sensitivities also called Greekslowast

lowast ldquoEvery class feels like attending a Greek lessonrdquo (AY2018-2019 student feedback)

218

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

Call option Put option

Option price g(tSt) StΦ(d+(T minus t))minusK eminus(Tminust)rΦ(dminus(T minus t)) K eminus(Tminust)rΦ(minusdminus(T minus t))minus StΦ(minusd+(T minus t))

Delta (∆) partg

partx(tSt) Φ(d+(T minus t)) gt 0 minusΦ(minusd+(T minus t)) 6 0

Gamma (Γ) part2g

partx2 (tSt)Φprime(d+(T minus t))St|σ|

radicT minus t

gt 0

Vega partg

partσ(tSt) St

radicT minus tΦprime(d+(T minus t)) gt 0

Theta (Θ) partg

partt(tSt) minusSt|σ|Φ

prime(d+(T minus t))2radicT minus t

minus rK eminus(Tminust)rΦ(dminus(T minus t)) 6 0 minusSt|σ|Φprime(d+(T minus t))

2radicT minus t

+ rK eminus(Tminust)rΦ(minusdminus(T minus t))

Rho (ρ) partg

partr(tSt) K(T minus t) eminus(Tminust)rΦ(dminus(T minus t)) minusK(T minus t) eminus(Tminust)rΦ(minusdminus(T minus t))

Table 61 Black-Scholes Greeks (Wikipedia)

From Table 61 we can conclude that call option prices are increasing func-tions of the underlying asset price St of the interest rate r and of the volatil-ity parameter σ Similarly put option prices are decreasing functions of theunderlying asset price St of the interest rate r and increasing functions ofthe volatility parameter σ

Parameter Variation of call option prices Variation of put option prices

Underlying St increasing decreasing

Volatility σ increasing increasing

Time t decreasing depends on the underlying price level

Interest rate r increasing decreasing

Table 62 Variations of Black-Scholes prices

The change of sign of the sensitivity Theta (Θ) with respect to time t can beverified in the following Figure 616

219

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

(a) Black-Scholes call price maps (b) Black-Scholes put price maps

Fig 616 Time-dependent solutions of the Black-Scholes PDElowast

Intrinsic value The intrinsic value at time t isin [0T ] of the option withpayoff C = h

(S(1)T

)is given by the immediate exercise payoff h

(S(1)t

) The

extrinsic value at time t isin [0T ] of the option is the remaining differenceπt(C) minus h

(S(1)t

)between the option price πt(C) and the immediate ex-

ercise payoff h(S(1)t

) In general the option price πt(C) decomposes as

πt(C) = h(S(1)t

)︸ ︷︷ ︸intrinsic value

+ πt(C)minus h(S(1)t

)︸ ︷︷ ︸

extrinsic value

0 6 t 6 T ]

Gearing The gearing at time t isin [0T ] of the option with payoff C = h(ST )is defined as the ratio

Gt =St

πt(C)=

Stg(tSt)

0 6 t 6 T

Effective gearing The effective gearing at time t isin [0T ] of the option withpayoff C = h(ST ) is defined as the ratio

Get = Gtξt

=ξtStπt(C)

=St

πt(C)

partg

partx(tSt)

=St

g(tSt)partg

partx(tSt)

= Stpart

partxlog g(tSt) 0 6 t 6 T

lowast The animation works in Acrobat Reader on the entire pdf file

220

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

The effective gearingGet =

ξtStπt(C)

can be interpreted as the hedge ratio ie the percentage of the portfoliowhich is invested on the risky asset When written as

∆g(tSt)g(tSt)

= Get times

∆StSt

the effective gearing gives the relative variation or percentage change∆g(tSt)g(tSt) of the option price g(tSt) from the relative variation∆StSt in the underlying asset price

The ratio Get = Stpart log g(tSt)partx can also be interpreted as an elasticity

coefficient

Break-even price The break-even price BEPt of the underlying asset is thevalue of S for which the intrinsic option value h(S) equals the option priceπt(C) at time t isin [0T ] For European call options it is given by

BEPt = K + πt(C) = K + g(tSt) t = 0 1 N

whereas for European put options it is given by

BEPt = K minus πt(C) = K minus g(tSt) 0 6 t 6 T

Premium The option premium OPt can be defined as the variation requiredfrom the underlying asset price in order to reach the break-even price iewe have

OPt =BEPt minus St

St=K + g(tSt)minus St

St 0 6 t 6 T

for European call options and

OPt =St minusBEPt

St=St + g(tSt)minusK

St 0 6 t 6 T

for European put options see Figure 617 below The term ldquopremiumrdquo issometimes also used to denote the arbitrage price g(tSt) of the option

221

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

f (tx σ)100

=

x =

K =

xpart log f

partx=

σ =

partf

partt(tx σ)=

T=

=(xminusK)x

∆ = = partf

partx(tx σ)

= partf

partσ(tx σ)

=K+f (txσ)minusx

x

=K+f (tx σ)

rf=

partf

partt+rxpartf

partx+

σ2 2x2part2f

partx2

Fig 617 Warrant terms and data

The R package bizdays (requires to install QuantLib) can be used to computecalendar time vs business time to maturity1 installpackages(bizdays)

library(bizdays)3 load_quantlib_calendars(HongKong from=2018-01-01 to=2018-12-31)

load_quantlib_calendars(Singapore from=2018-01-01 to=2018-12-31)5 bizdays(2018-03-10 2018-04-03 QuantLibHongKong)

bizdays(2018-03-10 2018-04-03 QuantLibSingapore)

65 The Heat Equation

In the next proposition we notice that the solution f(tx) of the Black-Scholes PDE (67) can be transformed into a solution g(t y) of the simplerheat equation by a change of variable and a time inversion t 7minusrarr T minus t onthe interval [0T ] so that the terminal condition at time T in the Black-Scholes equation (622) becomes an initial condition at time t = 0 in theheat equation (625) See also here for a related discussion on changes ofvariables for the Black-Scholes PDE

222

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

Proposition 68 Assume that f(tx) solves the Black-Scholes PDErf(tx) = partf

partt(tx) + rx

partf

partx(tx) + 1

2σ2x2 part

2f

partx2 (tx)

f(T x) = (xminusK)+(622)

with terminal condition h(x) = (xminusK)+ x gt 0 Then the function g(t y)defined by

g(t y) = ertf(T minus t e|σ|y+(σ22minusr)t) (623)

solves the heat equation (625) with initial condition

ψ(y) = h(

e|σ|y) y isin R (624)

ie we have partg

partt(t y) = 1

2part2g

party2 (t y)

g(0 y) = h(

e|σ|y)

(625)

Proposition 68 will be proved in Section 66 It will allow us to solve theBlack-Scholes PDE (622) based on the solution of the heat equation (625)with initial condition ψ(y) = h

(e|σ|y

) y isin R by inversion of Relation (623)

with s = T minus t x = e|σ|y+(σ22minusr)t ie

f(sx) = eminus(Tminuss)rg(T minus s minus(σ

22minus r)(T minus s) + log x|σ|

)

Next we focus on the heat equation

partϕ

partt(t y) = 1

2part2ϕ

party2 (t y) (626)

which is used to model the diffusion of heat over time through solids Herethe data of g(x t) represents the temperature measured at time t and pointx We refer the reader to Widder (1975) for a complete treatment of thistopic

223

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

Fig 618 Time-dependent solution of the heat equationlowast

Proposition 69 The fundamental solution of the heat equation (626) isgiven by the Gaussian probability density function

ϕ(t y) =1radic2πt

eminusy2(2t) y isin R

with variance t gt 0

Proof The proof is done by a direct calculation as follows

partϕ

partt(t y) = part

partt

(eminusy2(2t)radic

2πt

)

= minus eminusy2(2t)

2t32radic

2π+

y2

2t2eminusy2(2t)radic

2πt

=

(minus 1

2t +y2

2t2

)ϕ(t y)

and

12part2ϕ

party2 (t y) = minus12part

party

(y

t

eminusy2(2t)radic

2πt

)

= minus eminusy2(2t)

2tradic

2πt+

y2

2t2eminusy2(2t)radic

2πt

=

(minus 1

2t +y2

2t2

)ϕ(t y) t gt 0 y isin R

lowast The animation works in Acrobat Reader on the entire pdf file

224

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

In Section 66 the heat equation (626) will be shown to be equivalent to theBlack-Scholes PDE after a change of variables In particular this will lead tothe explicit solution of the Black-Scholes PDE

Proposition 610 The heat equationpartg

partt(t y) = 1

2part2g

party2 (t y)

g(0 y) = ψ(y)

(627)

with continuous initial condition

g(0 y) = ψ(y)

has the solution

g(t y) =winfinminusinfin

ψ(z) eminus(yminusz)2(2t) dzradic2πt

y isin R t gt 0 (628)

Proof We have

partg

partt(t y) = part

partt

winfinminusinfin

ψ(z) eminus(yminusz)2(2t) dzradic2πt

=winfinminusinfin

ψ(z)part

partt

(eminus(yminusz)2(2t)radic

2πt

)dz

=12winfinminusinfin

ψ(z)

((yminus z)2

t2minus 1t

)eminus(yminusz)2(2t) dzradic

2πt

=12winfinminusinfin

ψ(z)part2

partz2 eminus(yminusz)2(2t) dzradic2πt

=12winfinminusinfin

ψ(z)part2

party2 eminus(yminusz)2(2t) dzradic2πt

=12part2

party2

winfinminusinfin

ψ(z) eminus(yminusz)2(2t) dzradic2πt

=12part2g

party2 (t y)

On the other hand it can be checked that at time t = 0 we have

limtrarr0

winfinminusinfin

ψ(z) eminus(yminusz)2(2t) dzradic2πt

= limtrarr0

winfinminusinfin

ψ(y+ z) eminusz2(2t) dzradic2πt

= ψ(y) y isin R

225

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

The next Figure 619 shows the evolution of g(tx) with initial conditionbased on the European call payoff function h(x) = (xminusK)+ ie

g(0 y) = ψ(y) = h(

e|σ|y)=(

e|σ|y minusK)+ y isin R

Fig 619 Time-dependent solution of the heat equationlowast

Let us provide a second proof of Proposition 610 this time using Brownianmotion and stochastic calculus

Proof of Proposition 610 First note that under the change of variable x =z minus y we have

g(t y) =winfinminusinfin

ψ(z) eminus(yminusz)2(2t) dzradic2πt

=winfinminusinfin

ψ(y+ x) eminusx2(2t) dxradic2πt

= IE[ψ(y+Bt)]

= IE[ψ(yminusBt)]

where (Bt)tisinR+ is a standard Brownian motion and Bt N (0 t) t isin R+Applying Itocircrsquos formula and using the fact that the expectation of the stochas-tic integral with respect to Brownian motion is zero see Relation (417) inProposition 420 we find

g(t y) = IE[ψ(yminusBt)]

= ψ(y)minus IE[w t

0ψprime(yminusBs)dBs

]+

12 IE

[w t0ψprimeprime(yminusBs)ds

]= ψ(y) +

12w t

0IE[ψprimeprime(yminusBs)

]ds

lowast The animation works in Acrobat Reader on the entire pdf file

226

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

= ψ(y) +12w t

0part2

party2 IE [ψ(yminusBs)] ds

= ψ(y) +12w t

0part2g

party2 (s y)ds

Hence we have

partg

partt(t y) = part

parttIE[ψ(yminusBt)]

=12part2

party2 IE [ψ(yminusBt)]

=12part2g

party2 (t y)

Regarding the initial condition we check that

g(0 y) = IE[ψ(yminusB0)] = IE[ψ(y)] = ψ(y)

The expression g(t y) = IE[ψ(yminusBt)] provides a probabilistic interpreta-tion of the heat diffusion phenomenon based on Brownian motion Namelywhen ψε(y) = 1[minusεε](y) we find that

gε(t y) = IE[ψε(yminusBt)]= IE[1[minusεε](yminusBt)]= P

(yminusBt isin [minusε ε]

)= P

(yminus ε 6 Bt 6 y+ ε

)represents the probability of finding Bt within a neighborhood [y minus ε y + ε]of the point y isin R

66 Solution of the Black-Scholes PDE

In this section we solve the Black-Scholes PDE by the kernel method of Sec-tion 65 and a change of variables This solution method uses the change ofvariables (623) of Proposition 68 and a time inversion from which the ter-minal condition at time T in the Black-Scholes equation becomes an initialcondition at time t = 0 in the heat equation

Next we state the proof Proposition 68

Proof Letting s = T minus t and x = e|σ|y+(σ22minusr)t and using Relation (623)ie

g(t y) = ertf(T minus t e|σ|y+(σ22minusr)t)

227

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

we have

partg

partt(t y) = r ertf

(T minus t e|σ|y+(σ22minusr)t)minus ert partf

parts

(T minus t e|σ|y+(σ22minusr)t)

+

(σ2

2 minus r)

ert e|σ|y+(σ22minusr)t partf

partx

(T minus t e|σ|y+(σ22minusr)t)

= r ertf(T minus tx)minus ert partfparts

(T minus tx) +(σ2

2 minus r)

ertxpartfpartx

(T minus tx)

=12 ertx2σ2 part

2f

partx2 (T minus tx) +σ2

2 ertxpartfpartx

(T minus tx) (629)

where on the last step we used the Black-Scholes PDE On the other handwe have

partg

party(t y) = |σ| ert e|σ|y+(σ22minusr)t partf

partx

(T minus t e|σ|y+(σ22minusr)t)

and

12partg2

party2 (t y) =σ2

2 ert e|σ|y+(σ22minusr)t partf

partx

(T minus t e|σ|y+(σ22minusr)t)

+σ2

2 ert e2|σ|y+2(σ22minusr)t part2f

partx2(T minus t e|σ|y+(σ22minusr)t)

=σ2

2 ertxpartfpartx

(T minus tx) + σ2

2 ertx2 part2f

partx2 (T minus tx) (630)

We conclude by comparing (629) with (630) which shows that g(tx) solvesthe heat equation (627) with initial condition

g(0 y) = f(T e|σ|y

)= h

(e|σ|y

)

In the next proposition we derive the Black-Scholes formula (610) by solv-ing the PDE (622) The Black-Scholes formula will also be recovered by aprobabilistic argument via the computation of an expected value in Proposi-tion 77

Proposition 611 When h(x) = (x minusK)+ the solution of the Black-Scholes PDE (622) is given by

f(tx) = xΦ(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

) x gt 0

whereΦ(x) =

1radic2π

w xminusinfin

eminusy22dy x isin R

and

228

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

d+(T minus t) =

log(xK) + (r+ σ22)(T minus t)|σ|radicT minus t

dminus(T minus t) =log(xK) + (rminus σ22)(T minus t)

|σ|radicT minus t

x gt 0 t isin [0T )

Proof By inversion of Relation (623) with s = T minus t and x = e|σ|y+(σ22minusr)twe get

f(sx) = eminus(Tminuss)rg(T minus s minus(σ

22minus r)(T minus s) + log x|σ|

)and

h(x) = ψ

(log x|σ|

) x gt 0 or ψ(y) = h

(e|σ|y

) y isin R

Hence using the solution (628) and Relation (624) we get

f(tx) = eminus(Tminust)rg(T minus t minus(σ

22minus r)(T minus t) + log x|σ|

)= eminus(Tminust)r

winfinminusinfin

ψ

(minus(σ22minus r)(T minus t) + log x

|σ|+ z

)eminusz2(2(Tminust)) dzradic

2(T minus t)π

= eminus(Tminust)rwinfinminusinfin

h(x e|σ|zminus(σ22minusr)(Tminust)) eminusz2(2(Tminust)) dzradic

2(T minus t)π

= eminus(Tminust)rwinfinminusinfin

(x e|σ|zminus(σ22minusr)(Tminust) minusK

)+ eminusz2(2(Tminust)) dzradic2(T minus t)π

= eminus(Tminust)r

timeswinfin

(minusr+σ22)(Tminust)+log(Kx)|σ|

(x e|σ|zminus(σ22minusr)(Tminust) minusK

)eminusz2(2(Tminust)) dzradic

2(T minus t)π

= x eminus(Tminust)rwinfinminusdminus(Tminust)

radicTminust

e|σ|zminus(σ22minusr)(Tminust) eminusz2(2(Tminust)) dzradic2(T minus t)π

minusK eminus(Tminust)rwinfinminusdminus(Tminust)

radicTminust

eminusz2(2(Tminust)) dzradic2(T minus t)π

= xwinfinminusdminus(Tminust)

radicTminust

e|σ|zminus(Tminust)σ22minusz2(2(Tminust)) dzradic2(T minus t)π

minusK eminus(Tminust)rwinfinminusdminus(Tminust)

radicTminust

eminusz2(2(Tminust)) dzradic2(T minus t)π

= xwinfinminusdminus(Tminust)

radicTminust

eminus(zminus(Tminust)|σ|)2(2(Tminust)) dzradic2(T minus t)π

229

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

minusK eminus(Tminust)rwinfinminusdminus(Tminust)

radicTminust

eminusz2(2(Tminust)) dzradic2(T minus t)π

= xwinfinminusdminus(Tminust)

radicTminustminus(Tminust)|σ|

eminusz2(2(Tminust)) dzradic2(T minus t)π

minusK eminus(Tminust)rwinfinminusdminus(Tminust)

radicTminust

eminusz2(2(Tminust)) dzradic2(T minus t)π

= xwinfinminusdminus(Tminust)minus|σ|

radicTminust

eminusz22 dzradic2πminusK eminus(Tminust)r

winfinminusdminus(Tminust)

eminusz22 dzradic2π

= x(1minusΦ

(minus d+(T minus t)

))minusK eminus(Tminust)r

(1minusΦ

(minus dminus(T minus t)

))= xΦ

(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)

where we used the relation (614) ie

1minusΦ(a) = Φ(minusa) a isin R

Exercises

Exercise 61 Bachelier (1900) model Consider a market made of a risklessasset valued At = A0 with zero interest rate t isin R+ and a risky asset whoseprice St is modeled by a standard Brownian motion as St = Bt t isin R+

a) Show that the price g(tBt) of the option with payoff C = B2T satisfies

the heat equationpartϕ

partt(t y) = minus1

2part2ϕ

party2 (t y)

with terminal condition g(T x) = x2b) Find the function g(tx) by solving the PDE of Question (a)

Hint Try a solution of the form g(tx) = x2 + f(t)

See Exercises 611 713 and 714 for extensions to nonzero interest rates

Exercise 62 Consider a risky asset price (St)tisinR modeled in the Cox et al(1985) (CIR) model as

dSt = β(αminus St)dt+ σradicStdBt αβσ gt 0 (631)

and let (ηt ξt)tisinR+ be a portfolio strategy whose value Vt = ηtAt + ξtSttakes the form Vt = g(tSt) t isin R+ Figure 620 presents a random simula-tion of the solution to (631) with α = 0025 β = 1 and σ = 13230

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

0

1

2

3

4

5

6

7

8

0 01 02 03 04 05 06 07 08 09 1

St

t

Fig 620 Graph of the CIR short rate t 7rarr rt with α = 25 β = 1 and σ = 13

N=10000 t lt- 0(N-1) dt lt- 10Na=0025 b=2 sigma=0052 X lt- rnorm(Nmean=0sd=sqrt(dt))R lt- rep(0N)R[1]=001

for (j in 2N)R[j]=max(0R[j-1]+(a-bR[j-1])dt+sigmasqrt(R[j-1])X[j])4 plot(t R xlab = t ylab = type = l ylim = c(0002) col = blue)

Based on the self-financing condition written as

dVt = rVtdtminus rξtStdt+ ξtdSt

= rVtdtminus rξtStdt+ β(αminus St)ξtdt+ σξtradicStdBt t isin R+ (632)

derive the PDE satisfied by the function g(tx) using the Itocirc formula

Exercise 63 Black-Scholes PDE with dividends Consider a riskless as-set with price At = A0 ert t isin R+ and an underlying asset price process(St)tisinR+ modeled as

dSt = (microminus δ)Stdt+ σStdBt

where (Bt)tisinR+ is a standard Brownian motion and δ gt 0 is a continuous-time dividend rate By absence of arbitrage the payment of a dividend entailsa drop in the stock price by the same amount occuring generally on the ex-dividend date on which the purchase of the security no longer entitles theinvestor to the dividend amount The list of investors entitled to dividendpayment is consolidated on the date of record and payment is made on thepayable date

library(quantmod)2 getSymbols(0005HKfrom=2010-01-01to=SysDate()src=yahoo)

getDividends(0005HKfrom=2010-01-01to=SysDate()src=yahoo)

a) Assuming that the portfolio with value Vt = ξtSt + ηtAt at time t is self-financing and that dividends are continuously reinvested write down theportfolio variation dVt

231

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

b) Assuming that the portfolio value Vt takes the form Vt = g(tSt) at timet derive the Black-Scholes PDE for the function g(tx) with its terminalcondition

c) Compute the price at time t isin [0T ] of the European call option withstrike price K by solving the corresponding Black-Scholes PDE

d) Compute the Delta of the option

Exercise 64

a) Check that the Black-Scholes formula (610) for European call options

gc(tx) = xΦ(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)

satisfies the following boundary conditions

i) at x = 0 gc(t 0) = 0ii) at maturity t = T

gc(T x) = (xminusK)+ =

xminusK x gt K

0 x 6 K

iii) as time to maturity tends to infinity

limTrarrinfin

Bl(Kxσ rT minus t) = x t isin R+

b) Check that the Black-Scholes formula (618) for European put options

gp(tx) = K eminus(Tminust)rΦ(minus dminus(T minus t)

)minus xΦ

(minus d+(T minus t)

)satisfies the following boundary conditions

i) at x = 0 gp(t 0) = K eminus(Tminust)rii) as x tends to infinity gp(tinfin) = 0 for all t isin [0T )iii) at maturity t = T

gp(T x) = (K minus x)+ =

0 x gt K

K minus x x 6 K

iv) as time to maturity tends to infinity

limTrarrinfin

Blp(KStσ rT minus t) = 0 t isin R+

Exercise 65 Power option (Exercise 314 continued)

232

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

a) Solve the Black-Scholes PDE

rg(x t) = partg

partt(x t) + rx

partg

partx(x t) + σ2

2 x2 part2g

partx2 (x t) (633)

with terminal condition g(xT ) = x2 x gt 0 t isin [0T ]

Hint Try a solution of the form g(x t) = x2f(t) and find f(t)b) Find the respective quantities ξt and ηt of the risky asset St and riskless

asset At = ert in the portfolio with value

Vt = g(St t) = ξtSt + ηtAt 0 6 t 6 T

hedging the contract with payoff S2T at maturity

Exercise 66 On December 18 2007 a call warrant has been issued byFortis Bank on the stock price S of the MTR Corporation with maturityT = 23122008 strike price K = HK$ 3608 and entitlement ratio=10Recall that in the Black-Scholes model the price at time t of the Europeanclaim on the underlying asset priced St with strike price K maturity T interest rate r and volatility σ gt 0 is given by the Black-Scholes formula as

f(tSt) = StΦ(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)

wheredminus(T minus t) =

(rminus σ22)(T minus t) + log(StK)

|σ|radicT minus t

d+(T minus t) = dminus(T minus t) + |σ|radicT minus t = (r+ σ22)(T minus t) + log(StK)

|σ|radicT minus t

Recall that by Proposition 64 we have

partf

partx(tSt) = Φ

(d+(T minus t)

) 0 6 t 6 T

a) Using the values of the Gaussian cumulative distribution function com-pute the Black-Scholes price of the corresponding call option at timet =November 07 2008 with St = HK$ 17200 assuming a volatility σ =90 = 090 and an annual risk-free interest rate r = 4377 = 004377

b) Still using the Gaussian cumulative distribution function compute thequantity of the risky asset required in your portfolio at time t =November07 2008 in order to hedge one such option at maturity T = 23122008

c) Figure 1 represents the Black-Scholes price of the call option as a functionof σ isin [05 15] = [50 150]

233

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

0

01

02

03

04

05

06

05 06 07 08 09 1 11 12 13 14 15σimp

Optio

n pr

ice

σ

Market price

Fig 621 Option price as a function of the volatility σ gt 0

1 BSCall lt- function(S K r T sigma)d1 lt- (log(SK)+(r+sigma^22)T)(sigmasqrt(T))d2 lt- d1 - sigma sqrt(T)

3 BSCall = Spnorm(d1) - Kexp(-rT)pnorm(d2)BSCallsigma lt- seq(0515 length=100)

5 plot(sigmaBSCall(172360800437746365sigma) type=llty=1 xlab=Sigmaylab=Black-Scholes Call Price ylim = c(006)col=bluelwd=3)grid()

abline(h=023col=redlwd=3)

Knowing that the closing price of the warrant on November 07 2008 wasHK$ 0023 which value can you infer for the implied volatility σ at thisdatelowast

Exercise 67 Forward contracts Recall that the price πt(C) of a claimpayoff C = h(ST ) of maturity T can be written as πt(C) = g(tSt) wherethe function g(tx) satisfies the Black-Scholes PDE

rg(tx) = partg

partt(tx) + rx

partg

partx(tx) + 1

2σ2x2 part

2g

partx2 (tx)

g(T x) = h(x) (1)

with terminal condition g(T x) = h(x) x gt 0

a) Assume that C is a forward contract with payoff

C = ST minusK

at time T Find the function h(x) in (1)b) Find the solution g(tx) of the above PDE and compute the price πt(C)

at time t isin [0T ]Hint search for a solution of the form g(tx) = xminus α(t) where α(t) is afunction of t to be determined

lowast Download the corresponding or the that can be runhere

234

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

BS lt- function(S K T r sig)d1 lt- (log(SK) + (r + sig^22)T) (sigsqrt(T))d2 lt- d1 - sigsqrt(T)return(Spnorm(d1) - Kexp(-rT)pnorm(d2))impliedvol lt- function(S K T r market)sig lt- 020sigup lt- 1sigdown lt- 0001count lt- 0err lt- BS(S K T r sig) - marketwhile(abs(err) gt 000001 ampamp countlt1000)if(err lt 0)sigdown lt- sigsig lt- (sigup + sig)2elsesigup lt- sigsig lt- (sigdown + sig)2err lt- BS(S K T r sig) - marketcount lt- count + 1if(count==2000)return(NA)elsereturn(sig)market = 083K = 628T = 7 365S = 634r = 002impliedvol(S K T r market)

cells [ cell_type code execution_count null metadata outputs [] source [ from IPythoncoredisplay import display HTMLn display(HTML( )) ] cell_type code execution_count null metadata collapsed true outputs [] source [ import numpy as npn import scipystats as ssn import time n n Black and Scholesn def d1(S0 K r sigma T)n return (nplog(S0K) + (r + sigma2 2) T)(sigma npsqrt(T))n n def d2(S0 K r sigma T)n return (nplog(S0 K) + (r - sigma2 2) T) (sigma npsqrt(T))n n def BlackScholes(typeS0 K r sigma T)n if type==Cn return S0 ssnormcdf(d1(S0 K r sigma T)) - K npexp(-r T) ssnormcdf(d2(S0 K r sigma T))n elsen return K npexp(-r T) ssnormcdf(-d2(S0 K r sigma T)) - S0 ssnormcdf(-d1(S0 K r sigma T)) ] cell_type code execution_count null metadata outputs [] source [ BlackScholes(C1000 1200 002 015 10) ] cell_type code execution_count null metadata outputs [] source [ def difference(x p S K r t)n return BlackScholes(CS K r x t) - p ] cell_type code execution_count null metadata outputs [] source [ from scipyoptimize import bisectn bisect(difference00011args=(11541763731112766 1000 1200 002 10)) ] ] metadata anaconda-cloud kernelspec display_name Python 3 language python name python3 language_info codemirror_mode name ipython version 3 file_extension py mimetype textx-python name python nbconvert_exporter python pygments_lexer ipython3 version 375rc1 nbformat 4 nbformat_minor 1

Black-Scholes Pricing and Hedging

c) Compute the quantityξt =

partg

partx(tSt)

of risky assets in a self-financing portfolio hedging Cd) Repeat the above questions with the terminal condition g(T x) = x

Exercise 68a) Solve the Black-Scholes PDE

rg(tx) = partg

partt(tx) + rx

partg

partx(tx) + σ2

2 x2 part2g

partx2 (tx) (634)

with terminal condition g(T x) = 1 x gt 0

Hint Try a solution of the form g(tx) = f(t) and find f(t)

b) Find the respective quantities ξt and ηt of the risky asset St and risklessasset At = ert in the portfolio with value

Vt = g(tSt) = ξtSt + ηtAt

hedging the contract with payoff $1 at maturity

Exercise 69 Log-contracts see also Exercise 84a) Solve the PDE

0 =partg

partt(x t) + rx

partg

partx(x t) + σ2

2 x2 part2g

partx2 (x t)

with the terminal condition g(xT ) = log x x gt 0

Hint Try a solution of the form g(x t) = f(t) + log x and find f(t)b) Solve the Black-Scholes PDE

rh(x t) = parth

partt(x t) + rx

parth

partx(x t) + σ2

2 x2 part2h

partx2 (x t) (635)

with the terminal condition h(xT ) = log x x gt 0

Hint Try a solution of the form h(x t) = u(t)g(x t) and find u(t)c) Find the respective quantities ξt and ηt of the risky asset St and riskless

asset At = ert in the portfolio with value

Vt = g(St t) = ξtSt + ηtAt

hedging a log-contract with payoff logST at maturity 235

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

Exercise 610 Binary options Consider a price process (St)tisinR+ given by

dStSt

= rdt+ σdBt S0 = 1

under the risk-neutral probability measure Plowast The binary (or digital) calloption is a contract with maturity T strike price K and payoff

Cd = 1[Kinfin)(ST ) =

$1 if ST gt K

0 if ST lt K

a) Derive the Black-Schole PDE satisfied by the pricing function Cd(tSt) ofthe binary call option together with its terminal condition

b) Show that the solution Cd(tx) of the Black-Scholes PDE of Question (a)is given by

Cd(tx) = eminus(Tminust)rΦ((rminus σ22)(T minus t) + log(xK)

|σ|radicT minus t

)= eminus(Tminust)rΦ

(dminus(T minus t)

)

where

dminus(T minus t) =(rminus σ22)(T minus t) + log(StK)

|σ|radicT minus t

0 6 t lt T

Exercise 611

a) Bachelier (1900) model Solve the stochastic differential equation

dSt = αStdt+ σdBt (636)

in terms of ασ isin R and the initial condition S0b) Write down the Bachelier PDE satisfied by the function C(tx) where

C(tSt) is the price at time t isin [0T ] of the contingent claim with payoffφ(ST ) = exp(ST ) and identify the process Delta (ξt)tisin[0T ] that hedgesthis claim

c) Solve the Black-Scholes PDE of Question (b) with the terminal conditionφ(x) = ex x isin R

Hint Search for a solution of the form

C(tx) = exp(minus(T minus t)r+ xh(t) +

σ2

4r (h2(t)minus 1)

) (637)

where h(t) is a function to be determined with h(T ) = 1

236

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

d) Compute the portfolio strategy (ξt ηt)tisin[0T ] that hedges the contingentclaim with payoff exp(ST )

Exercise 612

a) Show that for every fixed value of S the function

d 7minusrarr h(S d) = SΦ(d+ |σ|

radicT)minusK eminusrTΦ(d)

reaches its maximum at dlowast(S) =log(SK) + (rminus σ22)T

|σ|radicT

b) By the differentiation rule

d

dSh(S dlowast(S)) =

parth

partS(S dlowast(S)) + dprimelowast(S)

parth

partd(S dlowast(S))

recover the value of the Black-Scholes Delta

Exercise 613 Compute the Black-Scholes Vega by differentiation of theBlack-Scholes function

gc(tx) = Bl(Kxσ rT minus t) = xΦ(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)

with respect to the volatility parameter σ knowing that

minus12(dminus(T minus t)

)2= minus1

2

(log(xK) + (rminus σ22)(T minus t)

|σ|radicT minus t

)2

= minus12(d+(T minus t)

)2+ (T minus t)r+ log x

K (638)

Exercise 614 Consider the backward induction relation (313) ie

v(tx) = (1minus plowastN )v (t+ 1x(1 + aN )) + plowastN v (t+ 1x(1 + bN ))

using the renormalizations rN = rTN and

aN = (1 + rN )(1minus |σ|radicTN)minus 1 bN = (1 + rN )(1 + |σ|

radicTN)minus 1

of Section 36 N gt 1 with

plowastN =rN minus aNbN minus aN

and plowastN =bN minus rNbN minus aN

a) Show that the Black-Scholes PDE (62) of Proposition 61 can be recoveredfrom the induction relation (313) when the number N of time steps tendsto infinity

237

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

b) Show that the expression of the Delta ξt =partgcpartx

(tSt) can be similarlyrecovered from the finite difference relation (319) ie

ξ(1)t (Stminus1) =

v (t (1 + bN )Stminus1)minus v (t (1 + aN )Stminus1)

Stminus1(bN minus aN )

as N tends to infinity

Problem 615 (Leung and Sircar (2015)) ProShares Ultra SampP500 andProShares UltraShort SampP500 are leveraged investment funds that seek dailyinvestment results before fees and expenses that correspond to β times (βx)the daily performance of the SampP500reg with respectively β = 2 for ProSharesUltra and β = minus2 for ProShares UltraShort Here leveraging with a factorβ 1 aims at multiplying the potential return of an investment by a factorβ The following 10 questions are interdependent and should be treated insequence

a) Consider a risky asset priced S0 = $4 at time t = 0 and taking twopossible values S1 = $5 and S1 = $2 at time t = 1 Compute the twopossible returns (in ) achieved when investing $4 in one share of the assetS and the expected return under the risk-neutral probability measureassuming that the risk-free interest rate is zero

b) Leveraging Still based on an initial $4 investment we decide to leverageby a factor β = 3 by borrowing another (β minus 1) times $4 = 2times $4 at ratezero to purchase a total of β = 3 shares of the asset S Compute thetwo returns (in ) possibly achieved in this case and the expected returnunder the risk-neutral probability measure assuming that the risk-freeinterest rate is zero

c) Denoting by Ft the ProShares value at time t how much should the fundinvest in the underlying asset priced St and how much $ should it borrowor save on the risk-free market at any time t in order to leverage with afactor β 1

d) Find the portfolio allocation (ξt ηt) for the fund value

Ft = ξtSt + ηtAt t isin R+

according to Question (c) where At = A0 ert is the riskless money marketaccount

e) We choose to model the SampP500 index St as the geometric Brownianmotion

dSt = rStdt+ σStdBt t isin R+

under the risk-neutral probability measure Plowast Find the stochastic dif-ferential equation satisfied by (Ft)tisinR+ under the self-financing conditiondFt = ξtdSt + ηtdAt

238

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

f) Is the discounted fund value ( eminusrtFt)tisinR+ a martingale under the risk-neutral probability measure Plowast

g) Find the relation between the fund value Ft and the index St by solvingthe stochastic differential equation obtained for Ft in Question (e) Forsimplicity we normalize F0 = Sβ0

h) Write the price at time t = 0 of the call option with payoff (FT minusK)+ onthe ProShares index using the Black-Scholes formula

i) Show that when β gt 0 the Delta at time t isin [0T ) of the call optionwith payoff (FT minusK)+ on ProShares Ultra is equal to the Delta of thecall option with payoff (ST minusKβ(t))

+ on the SampP500 for a certain strikeprice Kβ(t) to be determined explicitly

j) When β lt 0 find the relation between the Delta at time t isin [0T ) ofthe call option with payoff (FT minusK)+ on ProShares UltraShort and theDelta of the put option with payoff (Kβ(t)minus ST )+ on the SampP500

239

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

  1. pbsARFix223
  2. pbsARFix224
  3. pbsARFix225
  4. pbsARFix226
  5. pbsARFix227
  6. pbsARFix228
  7. pbsARFix229
  8. pbsARFix230
  9. fdrm1
  10. pbsARFix231
  11. 100
  12. 101
  13. 102
  14. 103
  15. 104
  16. 105
  17. 106
  18. 107
  19. 108
  20. 109
  21. 1010
  22. 1011
  23. 1012
  24. 1013
  25. 1014
  26. 1015
  27. 1016
  28. 1017
  29. 1018
  30. 1019
  31. anm10
  32. 10EndLeft
  33. 10StepLeft
  34. 10PauseLeft
  35. 10PlayLeft
  36. 10PlayPauseLeft
  37. 10PauseRight
  38. 10PlayRight
  39. 10PlayPauseRight
  40. 10StepRight
  41. 10EndRight
  42. 10Minus
  43. 10Reset
  44. 10Plus
  45. pbsARFix232
  46. pbsARFix233
  47. pbsARFix234
  48. pbsARFix235
  49. pbsARFix236
  50. pbsARFix237
  51. fdrm2
  52. 110
  53. 111
  54. 112
  55. 113
  56. 114
  57. 115
  58. 116
  59. 117
  60. 118
  61. 119
  62. 1110
  63. 1111
  64. 1112
  65. 1113
  66. 1114
  67. 1115
  68. 1116
  69. 1117
  70. 1118
  71. 1119
  72. anm11
  73. 11EndLeft
  74. 11StepLeft
  75. 11PauseLeft
  76. 11PlayLeft
  77. 11PlayPauseLeft
  78. 11PauseRight
  79. 11PlayRight
  80. 11PlayPauseRight
  81. 11StepRight
  82. 11EndRight
  83. 11Minus
  84. 11Reset
  85. 11Plus
  86. pbsARFix238
  87. pbsARFix239
  88. pbsARFix240
  89. pbsARFix241
  90. pbsARFix242
  91. 120
  92. 121
  93. 122
  94. 123
  95. 124
  96. 125
  97. 126
  98. 127
  99. 128
  100. 129
  101. 1210
  102. anm12
  103. 12EndLeft
  104. 12StepLeft
  105. 12PauseLeft
  106. 12PlayLeft
  107. 12PlayPauseLeft
  108. 12PauseRight
  109. 12PlayRight
  110. 12PlayPauseRight
  111. 12StepRight
  112. 12EndRight
  113. 12Minus
  114. 12Reset
  115. 12Plus
  116. 130
  117. 131
  118. 132
  119. 133
  120. 134
  121. 135
  122. 136
  123. 137
  124. 138
  125. 139
  126. 1310
  127. anm13
  128. 13EndLeft
  129. 13StepLeft
  130. 13PauseLeft
  131. 13PlayLeft
  132. 13PlayPauseLeft
  133. 13PauseRight
  134. 13PlayRight
  135. 13PlayPauseRight
  136. 13StepRight
  137. 13EndRight
  138. 13Minus
  139. 13Reset
  140. 13Plus
  141. pbsARFix243
  142. pbsARFix244
  143. pbsARFix245
  144. pbsARFix246
  145. 140
  146. 141
  147. 142
  148. 143
  149. 144
  150. 145
  151. 146
  152. 147
  153. 148
  154. 149
  155. 1410
  156. 1411
  157. 1412
  158. 1413
  159. 1414
  160. 1415
  161. 1416
  162. 1417
  163. 1418
  164. 1419
  165. 1420
  166. 1421
  167. 1422
  168. 1423
  169. 1424
  170. 1425
  171. 1426
  172. 1427
  173. 1428
  174. 1429
  175. 1430
  176. 1431
  177. 1432
  178. 1433
  179. 1434
  180. 1435
  181. 1436
  182. 1437
  183. 1438
  184. 1439
  185. 1440
  186. 1441
  187. 1442
  188. 1443
  189. 1444
  190. 1445
  191. 1446
  192. 1447
  193. 1448
  194. 1449
  195. 1450
  196. 1451
  197. 1452
  198. 1453
  199. 1454
  200. 1455
  201. 1456
  202. 1457
  203. 1458
  204. 1459
  205. 1460
  206. 1461
  207. 1462
  208. 1463
  209. 1464
  210. 1465
  211. 1466
  212. 1467
  213. 1468
  214. 1469
  215. 1470
  216. 1471
  217. 1472
  218. 1473
  219. 1474
  220. 1475
  221. 1476
  222. 1477
  223. 1478
  224. 1479
  225. 1480
  226. 1481
  227. 1482
  228. 1483
  229. 1484
  230. 1485
  231. 1486
  232. 1487
  233. 1488
  234. 1489
  235. 1490
  236. 1491
  237. 1492
  238. 1493
  239. 1494
  240. 1495
  241. 1496
  242. 1497
  243. 1498
  244. 1499
  245. 14100
  246. 14101
  247. 14102
  248. 14103
  249. 14104
  250. 14105
  251. 14106
  252. 14107
  253. 14108
  254. 14109
  255. 14110
  256. 14111
  257. 14112
  258. 14113
  259. 14114
  260. 14115
  261. 14116
  262. 14117
  263. 14118
  264. 14119
  265. 14120
  266. 14121
  267. 14122
  268. 14123
  269. 14124
  270. 14125
  271. 14126
  272. 14127
  273. 14128
  274. 14129
  275. 14130
  276. 14131
  277. 14132
  278. 14133
  279. 14134
  280. 14135
  281. 14136
  282. 14137
  283. 14138
  284. 14139
  285. 14140
  286. 14141
  287. 14142
  288. 14143
  289. 14144
  290. 14145
  291. 14146
  292. 14147
  293. 14148
  294. 14149
  295. 14150
  296. 14151
  297. 14152
  298. 14153
  299. 14154
  300. 14155
  301. 14156
  302. 14157
  303. 14158
  304. 14159
  305. 14160
  306. 14161
  307. 14162
  308. 14163
  309. 14164
  310. 14165
  311. 14166
  312. 14167
  313. 14168
  314. 14169
  315. 14170
  316. 14171
  317. 14172
  318. 14173
  319. 14174
  320. 14175
  321. 14176
  322. 14177
  323. 14178
  324. 14179
  325. 14180
  326. 14181
  327. 14182
  328. 14183
  329. 14184
  330. 14185
  331. 14186
  332. 14187
  333. 14188
  334. 14189
  335. 14190
  336. 14191
  337. 14192
  338. 14193
  339. 14194
  340. 14195
  341. 14196
  342. 14197
  343. anm14
  344. 14EndLeft
  345. 14StepLeft
  346. 14PauseLeft
  347. 14PlayLeft
  348. 14PlayPauseLeft
  349. 14PauseRight
  350. 14PlayRight
  351. 14PlayPauseRight
  352. 14StepRight
  353. 14EndRight
  354. 14Minus
  355. 14Reset
  356. 14Plus
  357. pbsARFix247
  358. pbsARFix248
  359. 150
  360. 151
  361. 152
  362. 153
  363. 154
  364. 155
  365. 156
  366. 157
  367. 158
  368. 159
  369. 1510
  370. 1511
  371. 1512
  372. 1513
  373. 1514
  374. 1515
  375. 1516
  376. 1517
  377. 1518
  378. 1519
  379. anm15
  380. 15EndLeft
  381. 15StepLeft
  382. 15PauseLeft
  383. 15PlayLeft
  384. 15PlayPauseLeft
  385. 15PauseRight
  386. 15PlayRight
  387. 15PlayPauseRight
  388. 15StepRight
  389. 15EndRight
  390. 15Minus
  391. 15Reset
  392. 15Plus
  393. pbsARFix249
  394. pbsARFix250
  395. pbsARFix251
  396. pbsARFix252
  397. pbsARFix253
  398. pbsARFix254
  399. pbsARFix255
  400. pbsARFix256
  401. pbsARFix257
  402. pbsARFix258
  403. pbsARFix259
  404. pbsARFix260
  405. pbsARFix261
Page 14: Black-ScholesPricingandHedging - NTU · to the Black-Scholes PDE (6.2) in order to price a claim payoff Cof the formC= h(S T).Asinthediscrete-timecase,thearbitragepriceπt(C) at

N Privault

A comparison of Figure 610 with market data can be found in Figures 911and 912 below

Cash settlement In the case of a cash settlement the option issuer will sat-isfy the option contract by selling ξT = 1 stock at the price ST = $83refund the K = $63 risk-free investment and hand in the remaining amountC = (ST minusK)+ = 83minus 63 = $20 to the option holder

Physical delivery In the case of physical delivery of the underlying asset theoption issuer will deliver ξT = 1 stock to the option holder in exchange forK = $63 which will be used together with the portfolio value to refund therisk-free loan

63 European Put Options

Similarly in the case of the European put option with strike price K thepayoff function is given by h(x) = (Kminusx)+ and the Black-Scholes PDE (67)reads

rgp(tx) =partgppartt

(tx) + rxpartgppartx

(tx) + 12σ

2x2 part2gppartx2 (tx)

gp(T x) = (K minus x)+(617)

The next proposition can be proved as in Sections 65 and 66 see Proposi-tion 611

Proposition 65 The solution of the PDE (617) is given by the Black-Scholes formula for put options

gp(tx) = K eminus(Tminust)rΦ(minus dminus(T minus t)

)minus xΦ

(minus d+(T minus t)

) (618)

withd+(T minus t) =

log(xK) + (r+ σ22)(T minus t)|σ|radicT minus t

(619)

dminus(T minus t) =log(xK) + (rminus σ22)(T minus t)

|σ|radicT minus t

(620)

as illustrated in Figure 611

214

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

Fig 611 Graph of the Black-Scholes put price function with strike price K = 100lowast

In other words the European put option with strike price K and maturityT is priced at time t isin [0T ] as

gp(tSt) = K eminus(Tminust)rΦ(minus dminus(T minus t)

)minus StΦ

(minus d+(T minus t)

) 0 6 t 6 T

Fig 612 Time-dependent solution of the Black-Scholes PDE (put option)dagger

The following R script is an implementation of the Black-Scholes formula forEuropean put options in R

1 BSPut lt- function(S K r T sigma)d1 = (log(SK)+(r+sigma^22)T)(sigmasqrt(T))

3 d2 = d1 - sigma sqrt(T)BSPut = Kexp(-rT) pnorm(-d2) - Spnorm(-d1)

5 BSPut

Call-put parity

lowast Right-click on the figure for interaction and ldquoFull Screen Multimediardquo viewdagger The animation works in Acrobat Reader on the entire pdf file

215

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

(C) 2012--today Alexander Grahn 3Dmenujs version 20140923 3D JavaScript used by media9sty Extended functionality of the (right click) context menu of 3D annotations 1) Adds the following items to the 3D context menu `Generate Default View Finds good default camera settings returned as options for use with the includemedia command `Get Current View Determines camera cross section and part settings of the current view returned as `VIEW section that can be copied into a views file of additional views The views file is inserted using the `3Dviews option of includemedia `Cross Section Toggle switch to add or remove a cross section into or from the current view The cross section can be moved in the x y z directions using x y z and X Y Z keys on the keyboard be tilted against and spun around the upright Z axis using the UpDown and LeftRight arrow keys and caled using the s and S keys 2) Enables manipulation of position and orientation of indiviual parts and groups of parts in the 3D scene Parts which have been selected with the mouse can be scaled moved around and rotated like the cross section as described above To spin the parts around their local up-axis keep Control key pressed while using the UpDown and LeftRight arrow keys This work may be distributed andor modified under the conditions of the LaTeX Project Public License The latest version of this license is in httpmirrorsctanorgmacroslatexbaselppltxt This work has the LPPL maintenance status `maintained The Current Maintainer of this work is A Grahn The code borrows heavily from Bernd Gaertners `Miniball software originally written in C++ for computing the smallest enclosing ball of a set of points see httpwwwinfethzchpersonalgaertnerminiballhtmlhostconsoleshow()constructor for doubly linked listfunction List() thisfirst_node=null thislast_node=new Node(undefined)Listprototypepush_back=function(x) var new_node=new Node(x) if(thisfirst_node==null) thisfirst_node=new_node new_nodeprev=null else new_nodeprev=thislast_nodeprev new_nodeprevnext=new_node new_nodenext=thislast_node thislast_nodeprev=new_nodeListprototypemove_to_front=function(it) var node=itget() if(nodenext=null ampamp nodeprev=null) nodenextprev=nodeprev nodeprevnext=nodenext nodeprev=null nodenext=thisfirst_node thisfirst_nodeprev=node thisfirst_node=node Listprototypebegin=function() var i=new Iterator() itarget=thisfirst_node return(i)Listprototypeend=function() var i=new Iterator() itarget=thislast_node return(i)function Iterator(it) if( it=undefined ) thistarget=ittarget else thistarget=null Iteratorprototypeset=function(it)thistarget=ittargetIteratorprototypeget=function()return(thistarget)Iteratorprototypederef=function()return(thistargetdata)Iteratorprototypeincr=function() if(thistargetnext=null) thistarget=thistargetnextconstructor for node objects that populate the linked listfunction Node(x) thisprev=null thisnext=null thisdata=xfunction sqr(r)return(rr)helper functionMiniball algorithm by B Gaertnerfunction Basis() thism=0 thisq0=new Array(3) thisz=new Array(4) thisf=new Array(4) thisv=new Array(new Array(3) new Array(3) new Array(3) new Array(3)) thisa=new Array(new Array(3) new Array(3) new Array(3) new Array(3)) thisc=new Array(new Array(3) new Array(3) new Array(3) new Array(3)) thissqr_r=new Array(4) thiscurrent_c=thisc[0] thiscurrent_sqr_r=0 thisreset()Basisprototypecenter=function()return(thiscurrent_c)Basisprototypesize=function()return(thism)Basisprototypepop=function()--thismBasisprototypeexcess=function(p) var e=-thiscurrent_sqr_r for(var k=0klt3++k) e+=sqr(p[k]-thiscurrent_c[k]) return(e)Basisprototypereset=function() thism=0 for(var j=0jlt3++j) thisc[0][j]=0 thiscurrent_c=thisc[0] thiscurrent_sqr_r=-1Basisprototypepush=function(p) var i j var eps=1e-32 if(thism==0) for(i=0ilt3++i) thisq0[i]=p[i] for(i=0ilt3++i) thisc[0][i]=thisq0[i] thissqr_r[0]=0 else for(i=0ilt3++i) thisv[thism][i]=p[i]-thisq0[i] for(i=1iltthism++i) thisa[thism][i]=0 for(j=0jlt3++j) thisa[thism][i]+=thisv[i][j]thisv[thism][j] thisa[thism][i]=(2thisz[i]) for(i=1iltthism++i) for(j=0jlt3++j) thisv[thism][j]-=thisa[thism][i]thisv[i][j] thisz[thism]=0 for(j=0jlt3++j) thisz[thism]+=sqr(thisv[thism][j]) thisz[thism]=2 if(thisz[thism]ltepsthiscurrent_sqr_r) return(false) var e=-thissqr_r[thism-1] for(i=0ilt3++i) e+=sqr(p[i]-thisc[thism-1][i]) thisf[thism]=ethisz[thism] for(i=0ilt3++i) thisc[thism][i]=thisc[thism-1][i]+thisf[thism]thisv[thism][i] thissqr_r[thism]=thissqr_r[thism-1]+ethisf[thism]2 thiscurrent_c=thisc[thism] thiscurrent_sqr_r=thissqr_r[thism] ++thism return(true)function Miniball() thisL=new List() thisB=new Basis() thissupport_end=new Iterator()Miniballprototypemtf_mb=function(it) var i=new Iterator(it) thissupport_endset(thisLbegin()) if((thisBsize())==4) return for(var k=new Iterator(thisLbegin())kget()=iget()) var j=new Iterator(k) kincr() if(thisBexcess(jderef()) gt 0) if(thisBpush(jderef())) thismtf_mb(j) thisBpop() if(thissupport_endget()==jget()) thissupport_endincr() thisLmove_to_front(j) Miniballprototypecheck_in=function(b) thisLpush_back(b)Miniballprototypebuild=function() thisBreset() thissupport_endset(thisLbegin()) thismtf_mb(thisLend())Miniballprototypecenter=function() return(thisBcenter())Miniballprototyperadius=function() return(Mathsqrt(thisBcurrent_sqr_r))functions called by menu itemsfunction calc3Dopts () create Miniball object var mb=new Miniball() auxiliary vector var corner=new Vector3() iterate over all visible mesh nodes in the scene for(i=0iltscenemeshescounti++) var mesh=scenemeshesgetByIndex(i) if(meshvisible) continue local to parent transformation matrix var trans=meshtransform build local to world transformation matrix by recursively multiplying the parents transf matrix on the right var parent=meshparent while(parenttransform) trans=transmultiply(parenttransform) parent=parentparent get the bbox of the mesh (local coordinates) var bbox=meshcomputeBoundingBox() transform the local bounding box corner coordinates to world coordinates for bounding sphere determination BBoxmin cornerset(bboxmin) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) BBoxmax cornerset(bboxmax) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) remaining six BBox corners cornerset(bboxminx bboxmaxy bboxmaxz) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) cornerset(bboxminx bboxminy bboxmaxz) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) cornerset(bboxminx bboxmaxy bboxminz) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) cornerset(bboxmaxx bboxminy bboxminz) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) cornerset(bboxmaxx bboxminy bboxmaxz) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) cornerset(bboxmaxx bboxmaxy bboxminz) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) compute the smallest enclosing bounding sphere mbbuild() current camera settings var camera=scenecamerasgetByIndex(0) var res= initialize result string aperture angle of the virtual camera (perspective projection) or orthographic scale (orthographic projection) if(cameraprojectionType==cameraTYPE_PERSPECTIVE) var aac=camerafov180MathPI if(hostutilprintf(4f aac)=30) res+=hostutilprintf(n3Daac=s aac) else cameraviewPlaneSize=2mbradius() res+=hostutilprintf(n3Dortho=s 1cameraviewPlaneSize) camera roll var roll = cameraroll180MathPI if(hostutilprintf(4f roll)=0) res+=hostutilprintf(n3Droll=sroll) target to camera vector var c2c=new Vector3() c2cset(cameraposition) c2csubtractInPlace(cameratargetPosition) c2cnormalize() if((c2cx==0 ampamp c2cy==-1 ampamp c2cz==0)) res+=hostutilprintf(n3Dc2c=s s s c2cx c2cy c2cz) new camera settings bounding sphere centre --gt new camera target var coo=new Vector3() cooset((mbcenter())[0] (mbcenter())[1] (mbcenter())[2]) if(coolength) res+=hostutilprintf(n3Dcoo=s s s coox cooy cooz) radius of orbit if(cameraprojectionType==cameraTYPE_PERSPECTIVE) var roo=mbradius() Mathsin(aac MathPI 360) else orthographic projection var roo=mbradius() res+=hostutilprintf(n3Droo=s roo) update camera settings in the viewer var currol=cameraroll cameratargetPositionset(coo) camerapositionset(cooadd(c2cscale(roo))) cameraroll=currol determine background colour rgb=scenebackgroundgetColor() if((rgbr==1 ampamp rgbg==1 ampamp rgbb==1)) res+=hostutilprintf(n3Dbg=s s s rgbr rgbg rgbb) determine lighting scheme switch(scenelightScheme) case sceneLIGHT_MODE_FILE curlights=Artworkbreak case sceneLIGHT_MODE_NONE curlights=Nonebreak case sceneLIGHT_MODE_WHITE curlights=Whitebreak case sceneLIGHT_MODE_DAY curlights=Daybreak case sceneLIGHT_MODE_NIGHT curlights=Nightbreak case sceneLIGHT_MODE_BRIGHT curlights=Hardbreak case sceneLIGHT_MODE_RGB curlights=Primarybreak case sceneLIGHT_MODE_BLUE curlights=Bluebreak case sceneLIGHT_MODE_RED curlights=Redbreak case sceneLIGHT_MODE_CUBE curlights=Cubebreak case sceneLIGHT_MODE_CAD curlights=CADbreak case sceneLIGHT_MODE_HEADLAMP curlights=Headlampbreak if(curlights=Artwork) res+=hostutilprintf(n3Dlights=s curlights) determine global render mode switch(scenerenderMode) case sceneRENDER_MODE_BOUNDING_BOX currender=BoundingBoxbreak case sceneRENDER_MODE_TRANSPARENT_BOUNDING_BOX currender=TransparentBoundingBoxbreak case sceneRENDER_MODE_TRANSPARENT_BOUNDING_BOX_OUTLINE currender=TransparentBoundingBoxOutlinebreak case sceneRENDER_MODE_VERTICES currender=Verticesbreak case sceneRENDER_MODE_SHADED_VERTICES currender=ShadedVerticesbreak case sceneRENDER_MODE_WIREFRAME currender=Wireframebreak case sceneRENDER_MODE_SHADED_WIREFRAME currender=ShadedWireframebreak case sceneRENDER_MODE_SOLID currender=Solidbreak case sceneRENDER_MODE_TRANSPARENT currender=Transparentbreak case sceneRENDER_MODE_SOLID_WIREFRAME currender=SolidWireframebreak case sceneRENDER_MODE_TRANSPARENT_WIREFRAME currender=TransparentWireframebreak case sceneRENDER_MODE_ILLUSTRATION currender=Illustrationbreak case sceneRENDER_MODE_SOLID_OUTLINE currender=SolidOutlinebreak case sceneRENDER_MODE_SHADED_ILLUSTRATION currender=ShadedIllustrationbreak case sceneRENDER_MODE_HIDDEN_WIREFRAME currender=HiddenWireframebreak if(currender=Solid) res+=hostutilprintf(n3Drender=s currender) write result string to the console hostconsoleshow() hostconsoleclear() hostconsoleprintln(n Copy and paste the following text to then+ option list of includemedian + res + n)function get3Dview () var camera=scenecamerasgetByIndex(0) var coo=cameratargetPosition var c2c=camerapositionsubtract(coo) var roo=c2clength c2cnormalize() var res=VIEW=insert optional name heren if((coox==0 ampamp cooy==0 ampamp cooz==0)) res+=hostutilprintf( COO=s s sn coox cooy cooz) if((c2cx==0 ampamp c2cy==-1 ampamp c2cz==0)) res+=hostutilprintf( C2C=s s sn c2cx c2cy c2cz) if(roo gt 1e-9) res+=hostutilprintf( ROO=sn roo) var roll = cameraroll180MathPI if(hostutilprintf(4f roll)=0) res+=hostutilprintf( ROLL=sn roll) if(cameraprojectionType==cameraTYPE_PERSPECTIVE) var aac=camerafov 180MathPI if(hostutilprintf(4f aac)=30) res+=hostutilprintf( AAC=sn aac) else if(hostutilprintf(4f cameraviewPlaneSize)=1) res+=hostutilprintf( ORTHO=sn 1cameraviewPlaneSize) rgb=scenebackgroundgetColor() if((rgbr==1 ampamp rgbg==1 ampamp rgbb==1)) res+=hostutilprintf( BGCOLOR=s s sn rgbr rgbg rgbb) switch(scenelightScheme) case sceneLIGHT_MODE_FILE curlights=Artworkbreak case sceneLIGHT_MODE_NONE curlights=Nonebreak case sceneLIGHT_MODE_WHITE curlights=Whitebreak case sceneLIGHT_MODE_DAY curlights=Daybreak case sceneLIGHT_MODE_NIGHT curlights=Nightbreak case sceneLIGHT_MODE_BRIGHT curlights=Hardbreak case sceneLIGHT_MODE_RGB curlights=Primarybreak case sceneLIGHT_MODE_BLUE curlights=Bluebreak case sceneLIGHT_MODE_RED curlights=Redbreak case sceneLIGHT_MODE_CUBE curlights=Cubebreak case sceneLIGHT_MODE_CAD curlights=CADbreak case sceneLIGHT_MODE_HEADLAMP curlights=Headlampbreak if(curlights=Artwork) res+= LIGHTS=+curlights+n switch(scenerenderMode) case sceneRENDER_MODE_BOUNDING_BOX defaultrender=BoundingBoxbreak case sceneRENDER_MODE_TRANSPARENT_BOUNDING_BOX defaultrender=TransparentBoundingBoxbreak case sceneRENDER_MODE_TRANSPARENT_BOUNDING_BOX_OUTLINE defaultrender=TransparentBoundingBoxOutlinebreak case sceneRENDER_MODE_VERTICES defaultrender=Verticesbreak case sceneRENDER_MODE_SHADED_VERTICES defaultrender=ShadedVerticesbreak case sceneRENDER_MODE_WIREFRAME defaultrender=Wireframebreak case sceneRENDER_MODE_SHADED_WIREFRAME defaultrender=ShadedWireframebreak case sceneRENDER_MODE_SOLID defaultrender=Solidbreak case sceneRENDER_MODE_TRANSPARENT defaultrender=Transparentbreak case sceneRENDER_MODE_SOLID_WIREFRAME defaultrender=SolidWireframebreak case sceneRENDER_MODE_TRANSPARENT_WIREFRAME defaultrender=TransparentWireframebreak case sceneRENDER_MODE_ILLUSTRATION defaultrender=Illustrationbreak case sceneRENDER_MODE_SOLID_OUTLINE defaultrender=SolidOutlinebreak case sceneRENDER_MODE_SHADED_ILLUSTRATION defaultrender=ShadedIllustrationbreak case sceneRENDER_MODE_HIDDEN_WIREFRAME defaultrender=HiddenWireframebreak if(defaultrender=Solid) res+= RENDERMODE=+defaultrender+n detect existing Clipping Plane (3D Cross Section) var clip=null if( clip=scenenodesgetByName($$$$$$)|| clip=scenenodesgetByName(Clipping Plane) ) for(var i=0iltscenenodescounti++) var nd=scenenodesgetByIndex(i) if(nd==clip||ndname==) continue var ndUTFName= for (var j=0 jltndnamelength j++) var theUnicode = ndnamecharCodeAt(j)toString(16) while (theUnicodelengthlt4) theUnicode = 0 + theUnicode ndUTFName += theUnicode var end=ndnamelastIndexOf() if(endgt0) var ndUserName=ndnamesubstr(0end) else var ndUserName=ndname respart= PART=+ndUserName+n respart+= UTF16NAME=+ndUTFName+n defaultvals=true if(ndvisible) respart+= VISIBLE=falsen defaultvals=false if(ndopacitylt10) respart+= OPACITY=+ndopacity+n defaultvals=false if(ndconstructorname==Mesh) currender=defaultrender switch(ndrenderMode) case sceneRENDER_MODE_BOUNDING_BOX currender=BoundingBoxbreak case sceneRENDER_MODE_TRANSPARENT_BOUNDING_BOX currender=TransparentBoundingBoxbreak case sceneRENDER_MODE_TRANSPARENT_BOUNDING_BOX_OUTLINE currender=TransparentBoundingBoxOutlinebreak case sceneRENDER_MODE_VERTICES currender=Verticesbreak case sceneRENDER_MODE_SHADED_VERTICES currender=ShadedVerticesbreak case sceneRENDER_MODE_WIREFRAME currender=Wireframebreak case sceneRENDER_MODE_SHADED_WIREFRAME currender=ShadedWireframebreak case sceneRENDER_MODE_SOLID currender=Solidbreak case sceneRENDER_MODE_TRANSPARENT currender=Transparentbreak case sceneRENDER_MODE_SOLID_WIREFRAME currender=SolidWireframebreak case sceneRENDER_MODE_TRANSPARENT_WIREFRAME currender=TransparentWireframebreak case sceneRENDER_MODE_ILLUSTRATION currender=Illustrationbreak case sceneRENDER_MODE_SOLID_OUTLINE currender=SolidOutlinebreak case sceneRENDER_MODE_SHADED_ILLUSTRATION currender=ShadedIllustrationbreak case sceneRENDER_MODE_HIDDEN_WIREFRAME currender=HiddenWireframebreak case sceneRENDER_MODE_DEFAULT currender=Defaultbreak if(currender=defaultrender) respart+= RENDERMODE=+currender+n defaultvals=false if(origtrans[ndname]ampampndtransformisEqual(origtrans[ndname])) var lvec=ndtransformtransformDirection(new Vector3(100)) var uvec=ndtransformtransformDirection(new Vector3(010)) var vvec=ndtransformtransformDirection(new Vector3(001)) respart+= TRANSFORM= +lvecx+ +lvecy+ +lvecz+ +uvecx+ +uvecy+ +uvecz+ +vvecx+ +vvecy+ +vvecz+ +ndtransformtranslationx+ +ndtransformtranslationy+ +ndtransformtranslationz+n defaultvals=false respart+= ENDn if(defaultvals) res+=respart if(clip) var centre=cliptransformtranslation var normal=cliptransformtransformDirection(new Vector3(001)) res+= CROSSSECTn if((centrex==0 ampamp centrey==0 ampamp centrez==0)) res+=hostutilprintf( CENTER=s s sn centrex centrey centrez) if((normalx==1 ampamp normaly==0 ampamp normalz==0)) res+=hostutilprintf( NORMAL=s s sn normalx normaly normalz) res+=hostutilprintf( VISIBLE=sn clipvisible) res+=hostutilprintf( PLANECOLOR=s s sn clipmaterialemissiveColorr clipmaterialemissiveColorg clipmaterialemissiveColorb) res+=hostutilprintf( OPACITY=sn clipopacity) res+=hostutilprintf( INTERSECTIONCOLOR=s s sn clipwireframeColorr clipwireframeColorg clipwireframeColorb) res+= ENDn for(var propt in clip) consoleprintln(propt++clip[propt]) res+=ENDn hostconsoleshow() hostconsoleclear() hostconsoleprintln(n Add the following VIEW section to a file ofn+ predefined views (See option 3Dviews)nn + The view may be given a name after VIEW=n + (Remove in front of =)n) hostconsoleprintln(res + n)add items to 3D context menuruntimeaddCustomMenuItem(dfltview Generate Default View default 0)runtimeaddCustomMenuItem(currview Get Current View default 0)runtimeaddCustomMenuItem(csection Cross Section checked 0)menu event handlersmenuEventHandler = new MenuEventHandler()menuEventHandleronEvent = function(e) switch(emenuItemName) case dfltview calc3Dopts() break case currview get3Dview() break case csection addremoveClipPlane(emenuItemChecked) break runtimeaddEventHandler(menuEventHandler)global variable taking reference to currently selected nodevar target=nullselectionEventHandler=new SelectionEventHandler()selectionEventHandleronEvent=function(e) if(eselectedampampenodename=) target=enode else target=null runtimeaddEventHandler(selectionEventHandler)cameraEventHandler=new CameraEventHandler()cameraEventHandleronEvent=function(e) var clip=null runtimeremoveCustomMenuItem(csection) runtimeaddCustomMenuItem(csection Cross Section checked 0) if(clip=scenenodesgetByName($$$$$$)|| predefined scenenodesgetByName(Clipping Plane)) added via context menu runtimeremoveCustomMenuItem(csection) runtimeaddCustomMenuItem(csection Cross Section checked 1) if(clip)plane in predefined views must be rotated by 90 deg around normal cliptransformrotateAboutLineInPlace( MathPI2cliptransformtranslation cliptransformtransformDirection(new Vector3(001)) ) for(var i=0 iltrot4x4length i++)rot4x4[i]setIdentity() target=nullruntimeaddEventHandler(cameraEventHandler)var rot4x4=new Array() keeps track of spin and tilt axes transformationskey event handler for scaling moving spinning and tilting objectskeyEventHandler=new KeyEventHandler()keyEventHandleronEvent=function(e) var backtrans=new Matrix4x4() var trgt=null if(target) trgt=target var backtrans=new Matrix4x4() var trans=trgttransform var parent=trgtparent while(parenttransform) build local to world transformation matrix transmultiplyInPlace(parenttransform) also build world to local back-transformation matrix backtransmultiplyInPlace(parenttransforminversetranspose) parent=parentparent backtranstransposeInPlace() else if( trgt=scenenodesgetByName($$$$$$)|| trgt=scenenodesgetByName(Clipping Plane) ) var trans=trgttransform if(trgt) return var tname=trgtname if(typeof(rot4x4[tname])==undefined) rot4x4[tname]=new Matrix4x4() if(target) var tiltAxis=rot4x4[tname]transformDirection(new Vector3(010)) else var tiltAxis=transtransformDirection(new Vector3(010)) var spinAxis=rot4x4[tname]transformDirection(new Vector3(001)) get the centre of the mesh if(targetampamptrgtconstructorname==Mesh) var centre=transtransformPosition(trgtcomputeBoundingBox()center) else part group (Node3 parent node clipping plane) var centre=new Vector3(transtranslation) switch(echaracterCode) case 30tilt up rot4x4[tname]rotateAboutLineInPlace( -MathPI900rot4x4[tname]translationtiltAxis) transrotateAboutLineInPlace(-MathPI900centretiltAxis) break case 31tilt down rot4x4[tname]rotateAboutLineInPlace( MathPI900rot4x4[tname]translationtiltAxis) transrotateAboutLineInPlace(MathPI900centretiltAxis) break case 28spin right if(ectrlKeyDownampamptarget) transrotateAboutLineInPlace(-MathPI900centrespinAxis) else rot4x4[tname]rotateAboutLineInPlace( -MathPI900rot4x4[tname]translationnew Vector3(001)) transrotateAboutLineInPlace(-MathPI900centrenew Vector3(001)) break case 29spin left if(ectrlKeyDownampamptarget) transrotateAboutLineInPlace(MathPI900centrespinAxis) else rot4x4[tname]rotateAboutLineInPlace( MathPI900rot4x4[tname]translationnew Vector3(001)) transrotateAboutLineInPlace(MathPI900centrenew Vector3(001)) break case 120 x translateTarget(trans new Vector3(100) e) break case 121 y translateTarget(trans new Vector3(010) e) break case 122 z translateTarget(trans new Vector3(001) e) break case 88 shift + x translateTarget(trans new Vector3(-100) e) break case 89 shift + y translateTarget(trans new Vector3(0-10) e) break case 90 shift + z translateTarget(trans new Vector3(00-1) e) break case 115 s transtranslateInPlace(centrescale(-1)) transscaleInPlace(101) transtranslateInPlace(centrescale(1)) break case 83 shift + s transtranslateInPlace(centrescale(-1)) transscaleInPlace(1101) transtranslateInPlace(centrescale(1)) break transmultiplyInPlace(backtrans)runtimeaddEventHandler(keyEventHandler)translates object by amount calculated from Canvas sizefunction translateTarget(t d e) var cam=scenecamerasgetByIndex(0) if(camprojectionType==camTYPE_PERSPECTIVE) var scale=Mathtan(camfov2) camtargetPositionsubtract(camposition)length Mathmin(ecanvasPixelWidthecanvasPixelHeight) else var scale=camviewPlaneSize2 Mathmin(ecanvasPixelWidthecanvasPixelHeight) ttranslateInPlace(dscale(scale))function addremoveClipPlane(chk) var curTrans=getCurTrans() var clip=scenecreateClippingPlane() if(chk) add Clipping Plane and place its center either into the camera target position or into the centre of the currently selected mesh node var centre=new Vector3() if(target) var trans=targettransform var parent=targetparent while(parenttransform) trans=transmultiply(parenttransform) parent=parentparent if(targetconstructorname==Mesh) var centre=transtransformPosition(targetcomputeBoundingBox()center) else var centre=new Vector3(transtranslation) target=null else centreset(scenecamerasgetByIndex(0)targetPosition) cliptransformsetView( new Vector3(000) new Vector3(100) new Vector3(010)) cliptransformtranslateInPlace(centre) else if( scenenodesgetByName($$$$$$)|| scenenodesgetByName(Clipping Plane) ) clipremove()clip=null restoreTrans(curTrans) return clipfunction to store current transformation matrix of all nodes in the scenefunction getCurTrans() var tA=new Array() for(var i=0 iltscenenodescount i++) var nd=scenenodesgetByIndex(i) if(ndname==) continue tA[ndname]=new Matrix4x4(ndtransform) return tAfunction to restore transformation matrices given as argfunction restoreTrans(tA) for(var i=0 iltscenenodescount i++) var nd=scenenodesgetByIndex(i) if(tA[ndname]) ndtransformset(tA[ndname]) store original transformation matrix of all mesh nodes in the scenevar origtrans=getCurTrans()set initial state of Cross Section menu entrycameraEventHandleronEvent(1)hostconsoleclear()

var ocgs=hostgetOCGs(hostpageNum)for(var i=0iltocgslengthi++)if(ocgs[i]name==MediaPlayButton2)ocgs[i]state=false

(C) 2012 Michail Vidiassov John C Bowman Alexander Grahn asylabelsjs version 20120912 3D JavaScript to be used with media9sty (option `add3Djscript) for Asymptote generated PRC files adds billboard behaviour to text labels in Asymptote PRC files so that they always face the camera under 3D rotation This work may be distributed andor modified under the conditions of the LaTeX Project Public License The latest version of this license is in httpmirrorsctanorgmacroslatexbaselppltxt This work has the LPPL maintenance status `maintained The Current Maintainer of this work is A Grahnvar bbnodes=new Array() billboard meshesvar bbtrans=new Array() billboard transformsfunction fulltransform(mesh) var t=new Matrix4x4(meshtransform) if(meshparentname = ) var parentTransform=fulltransform(meshparent) tmultiplyInPlace(parentTransform) return t else return t find all text labels in the scene and determine pivoting pointsvar nodes=scenenodesvar nodescount=nodescountvar third=1030for(var i=0 i lt nodescount i++) var node=nodesgetByIndex(i) var name=nodename var end=namelastIndexOf()-1 if(end gt 0) if(namecharAt(end) == 001) var start=namelastIndexOf(-)+1 if(end gt start) nodename=namesubstr(0start-1) var nodeMatrix=fulltransform(nodeparent) var c=nodeMatrixtranslation position var d=Mathpow(Mathabs(nodeMatrixdeterminant)third) scale bbnodespush(node) bbtranspush(Matrix4x4()scale(ddd)translate(c)multiply(nodeMatrixinverse)) var camera=scenecamerasgetByIndex(0) var zero=new Vector3(000)var bbcount=bbnodeslength event handler to maintain camera-facing text labelsbillboardHandler=new RenderEventHandler()billboardHandleronEvent=function(event) var T=new Matrix4x4() TsetView(zerocamerapositionsubtract(cameratargetPosition) cameraupsubtract(cameraposition)) for(var j=0 j lt bbcount j++) bbnodes[j]transformset(Tmultiply(bbtrans[j])) runtimerefresh() runtimeaddEventHandler(billboardHandler)runtimerefresh()

(C) 2012 Alexander Grahn 3Dspintooljs version 20120301 3D JavaScript to be used with media9sty (option `add3Djscript) enables the Spin tool (also accessible via 3D toolbar or context menu) upon activation of the 3D scene the scene then rotates around the upright axis while dragging with the mouse This work may be distributed andor modified under the conditions of the LaTeX Project Public License The latest version of this license is in httpmirrorsctanorgmacroslatexbaselppltxt This work has the LPPL maintenance status `maintained The Current Maintainer of this work is A GrahnruntimesetCurrentTool(runtimeTOOL_NAME_SPIN)

N Privault

Proposition 66 Call-put parity We have the call-put parity relation

gc(tSt)minus gp(tSt) = St minusK eminus(Tminust)r 0 6 t 6 T (621)

between the Black-Scholes prices of call and put options in terms of theforward contract price St minusK eminus(Tminust)r

Proof The call-put parity (621) is a consequence of the relation

xminusK = (xminusK)+ minus (K minus x)+

satisfied by the terminal call and put payoff functions in the Black-ScholesPDE (67) It can also be verified directly from (610) and (618) as

gc(tx)minus gp(tx) = xΦ(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)minus(K eminus(Tminust)rΦ

(minus dminus(T minus t)

)minus xΦ

(minus d+(T minus t)

))= xΦ

(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)minusK eminus(Tminust)r

(1minusΦ

(dminus(T minus t)

))+ x

(1minusΦ

(d+(T minus t)

))= xminusK

The Delta of the Black-Scholes put option can be obtained by differentiationof the call-put parity relation (621) and Proposition 64

Proposition 67 The Delta of the Black-Scholes put option is given by

ξt = minus(1minusΦ(d+(T minus t)

)) = minusΦ

(minus d+(T minus t)

)isin [minus1 0] 0 6 t 6 T

Proof By the call-put parity relation (621) and Proposition 64 we have

partgppartx

(tSt) =partgcpartx

(tSt)minus 1

= Φ(d+(T minus t))minus 1= minusΦ(minusd+(T minus t)) 0 6 t 6 T

where we applied (614)

As a consequence of Proposition 67 the Black-Scholes put price splitsinto a risky component minusStΦ

(minus d+(T minus t)

)and a riskless component

K eminus(Tminust)rΦ(minus dminus(T minus t)

) as follows

gp(tSt) = K eminus(Tminust)rΦ(minus dminus(T minus t)

)︸ ︷︷ ︸riskminusfree investment (savings)

minus StΦ(minus d+(T minus t)

)︸ ︷︷ ︸

risky investment (short)

0 6 t 6 T

216

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

In Figure 613 we plot the Delta of the European put option as a function ofthe underlying asset price and of the time remaining until maturity

Payoff function (x-K)+

0

50

100

150

200

Underlying

0

5

10

15 Time to maturity T-t

-1

-075

-05

-025

0

Fig 613 Delta of a European put option with strike price K = 100 r = 3 σ = 10

Numerical example - hedging of a put option

For one more example we consider a put option issued by BNP Paribas on04 November 2008 with strike price K=$77667 maturity T = October 052009 and entitlement ratio 92593 cf page 9 In the next Figure 614 thenumber of days is counted from the origin not from maturity

40 50 60 70 80 90 100

0 50 100 150 200

0 5

10 15 20 25 30 35 40 45

Underlying (HK$)Time in days

Fig 614 Path of the Black-Scholes price for a put option on HSBC

As a consequence of Proposition 67 the amount invested on the risky assetfor the hedging of a put option is

minusStΦ(minus d+(T minus t)

)= minusStΦ

(minus log(StK) + (r+ σ22)(T minus t)

|σ|radicT minus t

)6 0

217

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

ie there is always short selling and the amount invested on the riskless assetpriced At = ert t isin [0T ] is

ηtAt = K eminus(Tminust)rΦ(minus dminus(T minus t)

)= K eminus(Tminust)rΦ

(minus log(StK) + (rminus σ22)(T minus t)

|σ|radicT minus t

)gt 0

which is always nonnegative ie we are constantly saving money on theriskless asset as noted in Figure 615

-60

-40

-20

0

20

40

60

80

100

0 50 100 150 200

K

HK$

Black-Scholes priceRisky investment ξtSt

Riskless investment ηtAtUnderlying asset price

Fig 615 Time evolution of the hedging portfolio for a put option on HSBC

In the above example the put option finished out of the money (OTM) so thatno cash settlement or physical delivery occurs A comparison of Figure 610with market data can be found in Figures 913 and 914 below

64 Market Terms and Data

The following Table 61 provides a summary of formulas for the computationof Black-Scholes sensitivities also called Greekslowast

lowast ldquoEvery class feels like attending a Greek lessonrdquo (AY2018-2019 student feedback)

218

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

Call option Put option

Option price g(tSt) StΦ(d+(T minus t))minusK eminus(Tminust)rΦ(dminus(T minus t)) K eminus(Tminust)rΦ(minusdminus(T minus t))minus StΦ(minusd+(T minus t))

Delta (∆) partg

partx(tSt) Φ(d+(T minus t)) gt 0 minusΦ(minusd+(T minus t)) 6 0

Gamma (Γ) part2g

partx2 (tSt)Φprime(d+(T minus t))St|σ|

radicT minus t

gt 0

Vega partg

partσ(tSt) St

radicT minus tΦprime(d+(T minus t)) gt 0

Theta (Θ) partg

partt(tSt) minusSt|σ|Φ

prime(d+(T minus t))2radicT minus t

minus rK eminus(Tminust)rΦ(dminus(T minus t)) 6 0 minusSt|σ|Φprime(d+(T minus t))

2radicT minus t

+ rK eminus(Tminust)rΦ(minusdminus(T minus t))

Rho (ρ) partg

partr(tSt) K(T minus t) eminus(Tminust)rΦ(dminus(T minus t)) minusK(T minus t) eminus(Tminust)rΦ(minusdminus(T minus t))

Table 61 Black-Scholes Greeks (Wikipedia)

From Table 61 we can conclude that call option prices are increasing func-tions of the underlying asset price St of the interest rate r and of the volatil-ity parameter σ Similarly put option prices are decreasing functions of theunderlying asset price St of the interest rate r and increasing functions ofthe volatility parameter σ

Parameter Variation of call option prices Variation of put option prices

Underlying St increasing decreasing

Volatility σ increasing increasing

Time t decreasing depends on the underlying price level

Interest rate r increasing decreasing

Table 62 Variations of Black-Scholes prices

The change of sign of the sensitivity Theta (Θ) with respect to time t can beverified in the following Figure 616

219

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

(a) Black-Scholes call price maps (b) Black-Scholes put price maps

Fig 616 Time-dependent solutions of the Black-Scholes PDElowast

Intrinsic value The intrinsic value at time t isin [0T ] of the option withpayoff C = h

(S(1)T

)is given by the immediate exercise payoff h

(S(1)t

) The

extrinsic value at time t isin [0T ] of the option is the remaining differenceπt(C) minus h

(S(1)t

)between the option price πt(C) and the immediate ex-

ercise payoff h(S(1)t

) In general the option price πt(C) decomposes as

πt(C) = h(S(1)t

)︸ ︷︷ ︸intrinsic value

+ πt(C)minus h(S(1)t

)︸ ︷︷ ︸

extrinsic value

0 6 t 6 T ]

Gearing The gearing at time t isin [0T ] of the option with payoff C = h(ST )is defined as the ratio

Gt =St

πt(C)=

Stg(tSt)

0 6 t 6 T

Effective gearing The effective gearing at time t isin [0T ] of the option withpayoff C = h(ST ) is defined as the ratio

Get = Gtξt

=ξtStπt(C)

=St

πt(C)

partg

partx(tSt)

=St

g(tSt)partg

partx(tSt)

= Stpart

partxlog g(tSt) 0 6 t 6 T

lowast The animation works in Acrobat Reader on the entire pdf file

220

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

The effective gearingGet =

ξtStπt(C)

can be interpreted as the hedge ratio ie the percentage of the portfoliowhich is invested on the risky asset When written as

∆g(tSt)g(tSt)

= Get times

∆StSt

the effective gearing gives the relative variation or percentage change∆g(tSt)g(tSt) of the option price g(tSt) from the relative variation∆StSt in the underlying asset price

The ratio Get = Stpart log g(tSt)partx can also be interpreted as an elasticity

coefficient

Break-even price The break-even price BEPt of the underlying asset is thevalue of S for which the intrinsic option value h(S) equals the option priceπt(C) at time t isin [0T ] For European call options it is given by

BEPt = K + πt(C) = K + g(tSt) t = 0 1 N

whereas for European put options it is given by

BEPt = K minus πt(C) = K minus g(tSt) 0 6 t 6 T

Premium The option premium OPt can be defined as the variation requiredfrom the underlying asset price in order to reach the break-even price iewe have

OPt =BEPt minus St

St=K + g(tSt)minus St

St 0 6 t 6 T

for European call options and

OPt =St minusBEPt

St=St + g(tSt)minusK

St 0 6 t 6 T

for European put options see Figure 617 below The term ldquopremiumrdquo issometimes also used to denote the arbitrage price g(tSt) of the option

221

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

f (tx σ)100

=

x =

K =

xpart log f

partx=

σ =

partf

partt(tx σ)=

T=

=(xminusK)x

∆ = = partf

partx(tx σ)

= partf

partσ(tx σ)

=K+f (txσ)minusx

x

=K+f (tx σ)

rf=

partf

partt+rxpartf

partx+

σ2 2x2part2f

partx2

Fig 617 Warrant terms and data

The R package bizdays (requires to install QuantLib) can be used to computecalendar time vs business time to maturity1 installpackages(bizdays)

library(bizdays)3 load_quantlib_calendars(HongKong from=2018-01-01 to=2018-12-31)

load_quantlib_calendars(Singapore from=2018-01-01 to=2018-12-31)5 bizdays(2018-03-10 2018-04-03 QuantLibHongKong)

bizdays(2018-03-10 2018-04-03 QuantLibSingapore)

65 The Heat Equation

In the next proposition we notice that the solution f(tx) of the Black-Scholes PDE (67) can be transformed into a solution g(t y) of the simplerheat equation by a change of variable and a time inversion t 7minusrarr T minus t onthe interval [0T ] so that the terminal condition at time T in the Black-Scholes equation (622) becomes an initial condition at time t = 0 in theheat equation (625) See also here for a related discussion on changes ofvariables for the Black-Scholes PDE

222

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

Proposition 68 Assume that f(tx) solves the Black-Scholes PDErf(tx) = partf

partt(tx) + rx

partf

partx(tx) + 1

2σ2x2 part

2f

partx2 (tx)

f(T x) = (xminusK)+(622)

with terminal condition h(x) = (xminusK)+ x gt 0 Then the function g(t y)defined by

g(t y) = ertf(T minus t e|σ|y+(σ22minusr)t) (623)

solves the heat equation (625) with initial condition

ψ(y) = h(

e|σ|y) y isin R (624)

ie we have partg

partt(t y) = 1

2part2g

party2 (t y)

g(0 y) = h(

e|σ|y)

(625)

Proposition 68 will be proved in Section 66 It will allow us to solve theBlack-Scholes PDE (622) based on the solution of the heat equation (625)with initial condition ψ(y) = h

(e|σ|y

) y isin R by inversion of Relation (623)

with s = T minus t x = e|σ|y+(σ22minusr)t ie

f(sx) = eminus(Tminuss)rg(T minus s minus(σ

22minus r)(T minus s) + log x|σ|

)

Next we focus on the heat equation

partϕ

partt(t y) = 1

2part2ϕ

party2 (t y) (626)

which is used to model the diffusion of heat over time through solids Herethe data of g(x t) represents the temperature measured at time t and pointx We refer the reader to Widder (1975) for a complete treatment of thistopic

223

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

Fig 618 Time-dependent solution of the heat equationlowast

Proposition 69 The fundamental solution of the heat equation (626) isgiven by the Gaussian probability density function

ϕ(t y) =1radic2πt

eminusy2(2t) y isin R

with variance t gt 0

Proof The proof is done by a direct calculation as follows

partϕ

partt(t y) = part

partt

(eminusy2(2t)radic

2πt

)

= minus eminusy2(2t)

2t32radic

2π+

y2

2t2eminusy2(2t)radic

2πt

=

(minus 1

2t +y2

2t2

)ϕ(t y)

and

12part2ϕ

party2 (t y) = minus12part

party

(y

t

eminusy2(2t)radic

2πt

)

= minus eminusy2(2t)

2tradic

2πt+

y2

2t2eminusy2(2t)radic

2πt

=

(minus 1

2t +y2

2t2

)ϕ(t y) t gt 0 y isin R

lowast The animation works in Acrobat Reader on the entire pdf file

224

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

In Section 66 the heat equation (626) will be shown to be equivalent to theBlack-Scholes PDE after a change of variables In particular this will lead tothe explicit solution of the Black-Scholes PDE

Proposition 610 The heat equationpartg

partt(t y) = 1

2part2g

party2 (t y)

g(0 y) = ψ(y)

(627)

with continuous initial condition

g(0 y) = ψ(y)

has the solution

g(t y) =winfinminusinfin

ψ(z) eminus(yminusz)2(2t) dzradic2πt

y isin R t gt 0 (628)

Proof We have

partg

partt(t y) = part

partt

winfinminusinfin

ψ(z) eminus(yminusz)2(2t) dzradic2πt

=winfinminusinfin

ψ(z)part

partt

(eminus(yminusz)2(2t)radic

2πt

)dz

=12winfinminusinfin

ψ(z)

((yminus z)2

t2minus 1t

)eminus(yminusz)2(2t) dzradic

2πt

=12winfinminusinfin

ψ(z)part2

partz2 eminus(yminusz)2(2t) dzradic2πt

=12winfinminusinfin

ψ(z)part2

party2 eminus(yminusz)2(2t) dzradic2πt

=12part2

party2

winfinminusinfin

ψ(z) eminus(yminusz)2(2t) dzradic2πt

=12part2g

party2 (t y)

On the other hand it can be checked that at time t = 0 we have

limtrarr0

winfinminusinfin

ψ(z) eminus(yminusz)2(2t) dzradic2πt

= limtrarr0

winfinminusinfin

ψ(y+ z) eminusz2(2t) dzradic2πt

= ψ(y) y isin R

225

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

The next Figure 619 shows the evolution of g(tx) with initial conditionbased on the European call payoff function h(x) = (xminusK)+ ie

g(0 y) = ψ(y) = h(

e|σ|y)=(

e|σ|y minusK)+ y isin R

Fig 619 Time-dependent solution of the heat equationlowast

Let us provide a second proof of Proposition 610 this time using Brownianmotion and stochastic calculus

Proof of Proposition 610 First note that under the change of variable x =z minus y we have

g(t y) =winfinminusinfin

ψ(z) eminus(yminusz)2(2t) dzradic2πt

=winfinminusinfin

ψ(y+ x) eminusx2(2t) dxradic2πt

= IE[ψ(y+Bt)]

= IE[ψ(yminusBt)]

where (Bt)tisinR+ is a standard Brownian motion and Bt N (0 t) t isin R+Applying Itocircrsquos formula and using the fact that the expectation of the stochas-tic integral with respect to Brownian motion is zero see Relation (417) inProposition 420 we find

g(t y) = IE[ψ(yminusBt)]

= ψ(y)minus IE[w t

0ψprime(yminusBs)dBs

]+

12 IE

[w t0ψprimeprime(yminusBs)ds

]= ψ(y) +

12w t

0IE[ψprimeprime(yminusBs)

]ds

lowast The animation works in Acrobat Reader on the entire pdf file

226

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

= ψ(y) +12w t

0part2

party2 IE [ψ(yminusBs)] ds

= ψ(y) +12w t

0part2g

party2 (s y)ds

Hence we have

partg

partt(t y) = part

parttIE[ψ(yminusBt)]

=12part2

party2 IE [ψ(yminusBt)]

=12part2g

party2 (t y)

Regarding the initial condition we check that

g(0 y) = IE[ψ(yminusB0)] = IE[ψ(y)] = ψ(y)

The expression g(t y) = IE[ψ(yminusBt)] provides a probabilistic interpreta-tion of the heat diffusion phenomenon based on Brownian motion Namelywhen ψε(y) = 1[minusεε](y) we find that

gε(t y) = IE[ψε(yminusBt)]= IE[1[minusεε](yminusBt)]= P

(yminusBt isin [minusε ε]

)= P

(yminus ε 6 Bt 6 y+ ε

)represents the probability of finding Bt within a neighborhood [y minus ε y + ε]of the point y isin R

66 Solution of the Black-Scholes PDE

In this section we solve the Black-Scholes PDE by the kernel method of Sec-tion 65 and a change of variables This solution method uses the change ofvariables (623) of Proposition 68 and a time inversion from which the ter-minal condition at time T in the Black-Scholes equation becomes an initialcondition at time t = 0 in the heat equation

Next we state the proof Proposition 68

Proof Letting s = T minus t and x = e|σ|y+(σ22minusr)t and using Relation (623)ie

g(t y) = ertf(T minus t e|σ|y+(σ22minusr)t)

227

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

we have

partg

partt(t y) = r ertf

(T minus t e|σ|y+(σ22minusr)t)minus ert partf

parts

(T minus t e|σ|y+(σ22minusr)t)

+

(σ2

2 minus r)

ert e|σ|y+(σ22minusr)t partf

partx

(T minus t e|σ|y+(σ22minusr)t)

= r ertf(T minus tx)minus ert partfparts

(T minus tx) +(σ2

2 minus r)

ertxpartfpartx

(T minus tx)

=12 ertx2σ2 part

2f

partx2 (T minus tx) +σ2

2 ertxpartfpartx

(T minus tx) (629)

where on the last step we used the Black-Scholes PDE On the other handwe have

partg

party(t y) = |σ| ert e|σ|y+(σ22minusr)t partf

partx

(T minus t e|σ|y+(σ22minusr)t)

and

12partg2

party2 (t y) =σ2

2 ert e|σ|y+(σ22minusr)t partf

partx

(T minus t e|σ|y+(σ22minusr)t)

+σ2

2 ert e2|σ|y+2(σ22minusr)t part2f

partx2(T minus t e|σ|y+(σ22minusr)t)

=σ2

2 ertxpartfpartx

(T minus tx) + σ2

2 ertx2 part2f

partx2 (T minus tx) (630)

We conclude by comparing (629) with (630) which shows that g(tx) solvesthe heat equation (627) with initial condition

g(0 y) = f(T e|σ|y

)= h

(e|σ|y

)

In the next proposition we derive the Black-Scholes formula (610) by solv-ing the PDE (622) The Black-Scholes formula will also be recovered by aprobabilistic argument via the computation of an expected value in Proposi-tion 77

Proposition 611 When h(x) = (x minusK)+ the solution of the Black-Scholes PDE (622) is given by

f(tx) = xΦ(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

) x gt 0

whereΦ(x) =

1radic2π

w xminusinfin

eminusy22dy x isin R

and

228

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

d+(T minus t) =

log(xK) + (r+ σ22)(T minus t)|σ|radicT minus t

dminus(T minus t) =log(xK) + (rminus σ22)(T minus t)

|σ|radicT minus t

x gt 0 t isin [0T )

Proof By inversion of Relation (623) with s = T minus t and x = e|σ|y+(σ22minusr)twe get

f(sx) = eminus(Tminuss)rg(T minus s minus(σ

22minus r)(T minus s) + log x|σ|

)and

h(x) = ψ

(log x|σ|

) x gt 0 or ψ(y) = h

(e|σ|y

) y isin R

Hence using the solution (628) and Relation (624) we get

f(tx) = eminus(Tminust)rg(T minus t minus(σ

22minus r)(T minus t) + log x|σ|

)= eminus(Tminust)r

winfinminusinfin

ψ

(minus(σ22minus r)(T minus t) + log x

|σ|+ z

)eminusz2(2(Tminust)) dzradic

2(T minus t)π

= eminus(Tminust)rwinfinminusinfin

h(x e|σ|zminus(σ22minusr)(Tminust)) eminusz2(2(Tminust)) dzradic

2(T minus t)π

= eminus(Tminust)rwinfinminusinfin

(x e|σ|zminus(σ22minusr)(Tminust) minusK

)+ eminusz2(2(Tminust)) dzradic2(T minus t)π

= eminus(Tminust)r

timeswinfin

(minusr+σ22)(Tminust)+log(Kx)|σ|

(x e|σ|zminus(σ22minusr)(Tminust) minusK

)eminusz2(2(Tminust)) dzradic

2(T minus t)π

= x eminus(Tminust)rwinfinminusdminus(Tminust)

radicTminust

e|σ|zminus(σ22minusr)(Tminust) eminusz2(2(Tminust)) dzradic2(T minus t)π

minusK eminus(Tminust)rwinfinminusdminus(Tminust)

radicTminust

eminusz2(2(Tminust)) dzradic2(T minus t)π

= xwinfinminusdminus(Tminust)

radicTminust

e|σ|zminus(Tminust)σ22minusz2(2(Tminust)) dzradic2(T minus t)π

minusK eminus(Tminust)rwinfinminusdminus(Tminust)

radicTminust

eminusz2(2(Tminust)) dzradic2(T minus t)π

= xwinfinminusdminus(Tminust)

radicTminust

eminus(zminus(Tminust)|σ|)2(2(Tminust)) dzradic2(T minus t)π

229

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

minusK eminus(Tminust)rwinfinminusdminus(Tminust)

radicTminust

eminusz2(2(Tminust)) dzradic2(T minus t)π

= xwinfinminusdminus(Tminust)

radicTminustminus(Tminust)|σ|

eminusz2(2(Tminust)) dzradic2(T minus t)π

minusK eminus(Tminust)rwinfinminusdminus(Tminust)

radicTminust

eminusz2(2(Tminust)) dzradic2(T minus t)π

= xwinfinminusdminus(Tminust)minus|σ|

radicTminust

eminusz22 dzradic2πminusK eminus(Tminust)r

winfinminusdminus(Tminust)

eminusz22 dzradic2π

= x(1minusΦ

(minus d+(T minus t)

))minusK eminus(Tminust)r

(1minusΦ

(minus dminus(T minus t)

))= xΦ

(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)

where we used the relation (614) ie

1minusΦ(a) = Φ(minusa) a isin R

Exercises

Exercise 61 Bachelier (1900) model Consider a market made of a risklessasset valued At = A0 with zero interest rate t isin R+ and a risky asset whoseprice St is modeled by a standard Brownian motion as St = Bt t isin R+

a) Show that the price g(tBt) of the option with payoff C = B2T satisfies

the heat equationpartϕ

partt(t y) = minus1

2part2ϕ

party2 (t y)

with terminal condition g(T x) = x2b) Find the function g(tx) by solving the PDE of Question (a)

Hint Try a solution of the form g(tx) = x2 + f(t)

See Exercises 611 713 and 714 for extensions to nonzero interest rates

Exercise 62 Consider a risky asset price (St)tisinR modeled in the Cox et al(1985) (CIR) model as

dSt = β(αminus St)dt+ σradicStdBt αβσ gt 0 (631)

and let (ηt ξt)tisinR+ be a portfolio strategy whose value Vt = ηtAt + ξtSttakes the form Vt = g(tSt) t isin R+ Figure 620 presents a random simula-tion of the solution to (631) with α = 0025 β = 1 and σ = 13230

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

0

1

2

3

4

5

6

7

8

0 01 02 03 04 05 06 07 08 09 1

St

t

Fig 620 Graph of the CIR short rate t 7rarr rt with α = 25 β = 1 and σ = 13

N=10000 t lt- 0(N-1) dt lt- 10Na=0025 b=2 sigma=0052 X lt- rnorm(Nmean=0sd=sqrt(dt))R lt- rep(0N)R[1]=001

for (j in 2N)R[j]=max(0R[j-1]+(a-bR[j-1])dt+sigmasqrt(R[j-1])X[j])4 plot(t R xlab = t ylab = type = l ylim = c(0002) col = blue)

Based on the self-financing condition written as

dVt = rVtdtminus rξtStdt+ ξtdSt

= rVtdtminus rξtStdt+ β(αminus St)ξtdt+ σξtradicStdBt t isin R+ (632)

derive the PDE satisfied by the function g(tx) using the Itocirc formula

Exercise 63 Black-Scholes PDE with dividends Consider a riskless as-set with price At = A0 ert t isin R+ and an underlying asset price process(St)tisinR+ modeled as

dSt = (microminus δ)Stdt+ σStdBt

where (Bt)tisinR+ is a standard Brownian motion and δ gt 0 is a continuous-time dividend rate By absence of arbitrage the payment of a dividend entailsa drop in the stock price by the same amount occuring generally on the ex-dividend date on which the purchase of the security no longer entitles theinvestor to the dividend amount The list of investors entitled to dividendpayment is consolidated on the date of record and payment is made on thepayable date

library(quantmod)2 getSymbols(0005HKfrom=2010-01-01to=SysDate()src=yahoo)

getDividends(0005HKfrom=2010-01-01to=SysDate()src=yahoo)

a) Assuming that the portfolio with value Vt = ξtSt + ηtAt at time t is self-financing and that dividends are continuously reinvested write down theportfolio variation dVt

231

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

b) Assuming that the portfolio value Vt takes the form Vt = g(tSt) at timet derive the Black-Scholes PDE for the function g(tx) with its terminalcondition

c) Compute the price at time t isin [0T ] of the European call option withstrike price K by solving the corresponding Black-Scholes PDE

d) Compute the Delta of the option

Exercise 64

a) Check that the Black-Scholes formula (610) for European call options

gc(tx) = xΦ(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)

satisfies the following boundary conditions

i) at x = 0 gc(t 0) = 0ii) at maturity t = T

gc(T x) = (xminusK)+ =

xminusK x gt K

0 x 6 K

iii) as time to maturity tends to infinity

limTrarrinfin

Bl(Kxσ rT minus t) = x t isin R+

b) Check that the Black-Scholes formula (618) for European put options

gp(tx) = K eminus(Tminust)rΦ(minus dminus(T minus t)

)minus xΦ

(minus d+(T minus t)

)satisfies the following boundary conditions

i) at x = 0 gp(t 0) = K eminus(Tminust)rii) as x tends to infinity gp(tinfin) = 0 for all t isin [0T )iii) at maturity t = T

gp(T x) = (K minus x)+ =

0 x gt K

K minus x x 6 K

iv) as time to maturity tends to infinity

limTrarrinfin

Blp(KStσ rT minus t) = 0 t isin R+

Exercise 65 Power option (Exercise 314 continued)

232

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

a) Solve the Black-Scholes PDE

rg(x t) = partg

partt(x t) + rx

partg

partx(x t) + σ2

2 x2 part2g

partx2 (x t) (633)

with terminal condition g(xT ) = x2 x gt 0 t isin [0T ]

Hint Try a solution of the form g(x t) = x2f(t) and find f(t)b) Find the respective quantities ξt and ηt of the risky asset St and riskless

asset At = ert in the portfolio with value

Vt = g(St t) = ξtSt + ηtAt 0 6 t 6 T

hedging the contract with payoff S2T at maturity

Exercise 66 On December 18 2007 a call warrant has been issued byFortis Bank on the stock price S of the MTR Corporation with maturityT = 23122008 strike price K = HK$ 3608 and entitlement ratio=10Recall that in the Black-Scholes model the price at time t of the Europeanclaim on the underlying asset priced St with strike price K maturity T interest rate r and volatility σ gt 0 is given by the Black-Scholes formula as

f(tSt) = StΦ(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)

wheredminus(T minus t) =

(rminus σ22)(T minus t) + log(StK)

|σ|radicT minus t

d+(T minus t) = dminus(T minus t) + |σ|radicT minus t = (r+ σ22)(T minus t) + log(StK)

|σ|radicT minus t

Recall that by Proposition 64 we have

partf

partx(tSt) = Φ

(d+(T minus t)

) 0 6 t 6 T

a) Using the values of the Gaussian cumulative distribution function com-pute the Black-Scholes price of the corresponding call option at timet =November 07 2008 with St = HK$ 17200 assuming a volatility σ =90 = 090 and an annual risk-free interest rate r = 4377 = 004377

b) Still using the Gaussian cumulative distribution function compute thequantity of the risky asset required in your portfolio at time t =November07 2008 in order to hedge one such option at maturity T = 23122008

c) Figure 1 represents the Black-Scholes price of the call option as a functionof σ isin [05 15] = [50 150]

233

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

0

01

02

03

04

05

06

05 06 07 08 09 1 11 12 13 14 15σimp

Optio

n pr

ice

σ

Market price

Fig 621 Option price as a function of the volatility σ gt 0

1 BSCall lt- function(S K r T sigma)d1 lt- (log(SK)+(r+sigma^22)T)(sigmasqrt(T))d2 lt- d1 - sigma sqrt(T)

3 BSCall = Spnorm(d1) - Kexp(-rT)pnorm(d2)BSCallsigma lt- seq(0515 length=100)

5 plot(sigmaBSCall(172360800437746365sigma) type=llty=1 xlab=Sigmaylab=Black-Scholes Call Price ylim = c(006)col=bluelwd=3)grid()

abline(h=023col=redlwd=3)

Knowing that the closing price of the warrant on November 07 2008 wasHK$ 0023 which value can you infer for the implied volatility σ at thisdatelowast

Exercise 67 Forward contracts Recall that the price πt(C) of a claimpayoff C = h(ST ) of maturity T can be written as πt(C) = g(tSt) wherethe function g(tx) satisfies the Black-Scholes PDE

rg(tx) = partg

partt(tx) + rx

partg

partx(tx) + 1

2σ2x2 part

2g

partx2 (tx)

g(T x) = h(x) (1)

with terminal condition g(T x) = h(x) x gt 0

a) Assume that C is a forward contract with payoff

C = ST minusK

at time T Find the function h(x) in (1)b) Find the solution g(tx) of the above PDE and compute the price πt(C)

at time t isin [0T ]Hint search for a solution of the form g(tx) = xminus α(t) where α(t) is afunction of t to be determined

lowast Download the corresponding or the that can be runhere

234

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

BS lt- function(S K T r sig)d1 lt- (log(SK) + (r + sig^22)T) (sigsqrt(T))d2 lt- d1 - sigsqrt(T)return(Spnorm(d1) - Kexp(-rT)pnorm(d2))impliedvol lt- function(S K T r market)sig lt- 020sigup lt- 1sigdown lt- 0001count lt- 0err lt- BS(S K T r sig) - marketwhile(abs(err) gt 000001 ampamp countlt1000)if(err lt 0)sigdown lt- sigsig lt- (sigup + sig)2elsesigup lt- sigsig lt- (sigdown + sig)2err lt- BS(S K T r sig) - marketcount lt- count + 1if(count==2000)return(NA)elsereturn(sig)market = 083K = 628T = 7 365S = 634r = 002impliedvol(S K T r market)

cells [ cell_type code execution_count null metadata outputs [] source [ from IPythoncoredisplay import display HTMLn display(HTML( )) ] cell_type code execution_count null metadata collapsed true outputs [] source [ import numpy as npn import scipystats as ssn import time n n Black and Scholesn def d1(S0 K r sigma T)n return (nplog(S0K) + (r + sigma2 2) T)(sigma npsqrt(T))n n def d2(S0 K r sigma T)n return (nplog(S0 K) + (r - sigma2 2) T) (sigma npsqrt(T))n n def BlackScholes(typeS0 K r sigma T)n if type==Cn return S0 ssnormcdf(d1(S0 K r sigma T)) - K npexp(-r T) ssnormcdf(d2(S0 K r sigma T))n elsen return K npexp(-r T) ssnormcdf(-d2(S0 K r sigma T)) - S0 ssnormcdf(-d1(S0 K r sigma T)) ] cell_type code execution_count null metadata outputs [] source [ BlackScholes(C1000 1200 002 015 10) ] cell_type code execution_count null metadata outputs [] source [ def difference(x p S K r t)n return BlackScholes(CS K r x t) - p ] cell_type code execution_count null metadata outputs [] source [ from scipyoptimize import bisectn bisect(difference00011args=(11541763731112766 1000 1200 002 10)) ] ] metadata anaconda-cloud kernelspec display_name Python 3 language python name python3 language_info codemirror_mode name ipython version 3 file_extension py mimetype textx-python name python nbconvert_exporter python pygments_lexer ipython3 version 375rc1 nbformat 4 nbformat_minor 1

Black-Scholes Pricing and Hedging

c) Compute the quantityξt =

partg

partx(tSt)

of risky assets in a self-financing portfolio hedging Cd) Repeat the above questions with the terminal condition g(T x) = x

Exercise 68a) Solve the Black-Scholes PDE

rg(tx) = partg

partt(tx) + rx

partg

partx(tx) + σ2

2 x2 part2g

partx2 (tx) (634)

with terminal condition g(T x) = 1 x gt 0

Hint Try a solution of the form g(tx) = f(t) and find f(t)

b) Find the respective quantities ξt and ηt of the risky asset St and risklessasset At = ert in the portfolio with value

Vt = g(tSt) = ξtSt + ηtAt

hedging the contract with payoff $1 at maturity

Exercise 69 Log-contracts see also Exercise 84a) Solve the PDE

0 =partg

partt(x t) + rx

partg

partx(x t) + σ2

2 x2 part2g

partx2 (x t)

with the terminal condition g(xT ) = log x x gt 0

Hint Try a solution of the form g(x t) = f(t) + log x and find f(t)b) Solve the Black-Scholes PDE

rh(x t) = parth

partt(x t) + rx

parth

partx(x t) + σ2

2 x2 part2h

partx2 (x t) (635)

with the terminal condition h(xT ) = log x x gt 0

Hint Try a solution of the form h(x t) = u(t)g(x t) and find u(t)c) Find the respective quantities ξt and ηt of the risky asset St and riskless

asset At = ert in the portfolio with value

Vt = g(St t) = ξtSt + ηtAt

hedging a log-contract with payoff logST at maturity 235

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

Exercise 610 Binary options Consider a price process (St)tisinR+ given by

dStSt

= rdt+ σdBt S0 = 1

under the risk-neutral probability measure Plowast The binary (or digital) calloption is a contract with maturity T strike price K and payoff

Cd = 1[Kinfin)(ST ) =

$1 if ST gt K

0 if ST lt K

a) Derive the Black-Schole PDE satisfied by the pricing function Cd(tSt) ofthe binary call option together with its terminal condition

b) Show that the solution Cd(tx) of the Black-Scholes PDE of Question (a)is given by

Cd(tx) = eminus(Tminust)rΦ((rminus σ22)(T minus t) + log(xK)

|σ|radicT minus t

)= eminus(Tminust)rΦ

(dminus(T minus t)

)

where

dminus(T minus t) =(rminus σ22)(T minus t) + log(StK)

|σ|radicT minus t

0 6 t lt T

Exercise 611

a) Bachelier (1900) model Solve the stochastic differential equation

dSt = αStdt+ σdBt (636)

in terms of ασ isin R and the initial condition S0b) Write down the Bachelier PDE satisfied by the function C(tx) where

C(tSt) is the price at time t isin [0T ] of the contingent claim with payoffφ(ST ) = exp(ST ) and identify the process Delta (ξt)tisin[0T ] that hedgesthis claim

c) Solve the Black-Scholes PDE of Question (b) with the terminal conditionφ(x) = ex x isin R

Hint Search for a solution of the form

C(tx) = exp(minus(T minus t)r+ xh(t) +

σ2

4r (h2(t)minus 1)

) (637)

where h(t) is a function to be determined with h(T ) = 1

236

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

d) Compute the portfolio strategy (ξt ηt)tisin[0T ] that hedges the contingentclaim with payoff exp(ST )

Exercise 612

a) Show that for every fixed value of S the function

d 7minusrarr h(S d) = SΦ(d+ |σ|

radicT)minusK eminusrTΦ(d)

reaches its maximum at dlowast(S) =log(SK) + (rminus σ22)T

|σ|radicT

b) By the differentiation rule

d

dSh(S dlowast(S)) =

parth

partS(S dlowast(S)) + dprimelowast(S)

parth

partd(S dlowast(S))

recover the value of the Black-Scholes Delta

Exercise 613 Compute the Black-Scholes Vega by differentiation of theBlack-Scholes function

gc(tx) = Bl(Kxσ rT minus t) = xΦ(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)

with respect to the volatility parameter σ knowing that

minus12(dminus(T minus t)

)2= minus1

2

(log(xK) + (rminus σ22)(T minus t)

|σ|radicT minus t

)2

= minus12(d+(T minus t)

)2+ (T minus t)r+ log x

K (638)

Exercise 614 Consider the backward induction relation (313) ie

v(tx) = (1minus plowastN )v (t+ 1x(1 + aN )) + plowastN v (t+ 1x(1 + bN ))

using the renormalizations rN = rTN and

aN = (1 + rN )(1minus |σ|radicTN)minus 1 bN = (1 + rN )(1 + |σ|

radicTN)minus 1

of Section 36 N gt 1 with

plowastN =rN minus aNbN minus aN

and plowastN =bN minus rNbN minus aN

a) Show that the Black-Scholes PDE (62) of Proposition 61 can be recoveredfrom the induction relation (313) when the number N of time steps tendsto infinity

237

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

b) Show that the expression of the Delta ξt =partgcpartx

(tSt) can be similarlyrecovered from the finite difference relation (319) ie

ξ(1)t (Stminus1) =

v (t (1 + bN )Stminus1)minus v (t (1 + aN )Stminus1)

Stminus1(bN minus aN )

as N tends to infinity

Problem 615 (Leung and Sircar (2015)) ProShares Ultra SampP500 andProShares UltraShort SampP500 are leveraged investment funds that seek dailyinvestment results before fees and expenses that correspond to β times (βx)the daily performance of the SampP500reg with respectively β = 2 for ProSharesUltra and β = minus2 for ProShares UltraShort Here leveraging with a factorβ 1 aims at multiplying the potential return of an investment by a factorβ The following 10 questions are interdependent and should be treated insequence

a) Consider a risky asset priced S0 = $4 at time t = 0 and taking twopossible values S1 = $5 and S1 = $2 at time t = 1 Compute the twopossible returns (in ) achieved when investing $4 in one share of the assetS and the expected return under the risk-neutral probability measureassuming that the risk-free interest rate is zero

b) Leveraging Still based on an initial $4 investment we decide to leverageby a factor β = 3 by borrowing another (β minus 1) times $4 = 2times $4 at ratezero to purchase a total of β = 3 shares of the asset S Compute thetwo returns (in ) possibly achieved in this case and the expected returnunder the risk-neutral probability measure assuming that the risk-freeinterest rate is zero

c) Denoting by Ft the ProShares value at time t how much should the fundinvest in the underlying asset priced St and how much $ should it borrowor save on the risk-free market at any time t in order to leverage with afactor β 1

d) Find the portfolio allocation (ξt ηt) for the fund value

Ft = ξtSt + ηtAt t isin R+

according to Question (c) where At = A0 ert is the riskless money marketaccount

e) We choose to model the SampP500 index St as the geometric Brownianmotion

dSt = rStdt+ σStdBt t isin R+

under the risk-neutral probability measure Plowast Find the stochastic dif-ferential equation satisfied by (Ft)tisinR+ under the self-financing conditiondFt = ξtdSt + ηtdAt

238

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

f) Is the discounted fund value ( eminusrtFt)tisinR+ a martingale under the risk-neutral probability measure Plowast

g) Find the relation between the fund value Ft and the index St by solvingthe stochastic differential equation obtained for Ft in Question (e) Forsimplicity we normalize F0 = Sβ0

h) Write the price at time t = 0 of the call option with payoff (FT minusK)+ onthe ProShares index using the Black-Scholes formula

i) Show that when β gt 0 the Delta at time t isin [0T ) of the call optionwith payoff (FT minusK)+ on ProShares Ultra is equal to the Delta of thecall option with payoff (ST minusKβ(t))

+ on the SampP500 for a certain strikeprice Kβ(t) to be determined explicitly

j) When β lt 0 find the relation between the Delta at time t isin [0T ) ofthe call option with payoff (FT minusK)+ on ProShares UltraShort and theDelta of the put option with payoff (Kβ(t)minus ST )+ on the SampP500

239

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

  1. pbsARFix223
  2. pbsARFix224
  3. pbsARFix225
  4. pbsARFix226
  5. pbsARFix227
  6. pbsARFix228
  7. pbsARFix229
  8. pbsARFix230
  9. fdrm1
  10. pbsARFix231
  11. 100
  12. 101
  13. 102
  14. 103
  15. 104
  16. 105
  17. 106
  18. 107
  19. 108
  20. 109
  21. 1010
  22. 1011
  23. 1012
  24. 1013
  25. 1014
  26. 1015
  27. 1016
  28. 1017
  29. 1018
  30. 1019
  31. anm10
  32. 10EndLeft
  33. 10StepLeft
  34. 10PauseLeft
  35. 10PlayLeft
  36. 10PlayPauseLeft
  37. 10PauseRight
  38. 10PlayRight
  39. 10PlayPauseRight
  40. 10StepRight
  41. 10EndRight
  42. 10Minus
  43. 10Reset
  44. 10Plus
  45. pbsARFix232
  46. pbsARFix233
  47. pbsARFix234
  48. pbsARFix235
  49. pbsARFix236
  50. pbsARFix237
  51. fdrm2
  52. 110
  53. 111
  54. 112
  55. 113
  56. 114
  57. 115
  58. 116
  59. 117
  60. 118
  61. 119
  62. 1110
  63. 1111
  64. 1112
  65. 1113
  66. 1114
  67. 1115
  68. 1116
  69. 1117
  70. 1118
  71. 1119
  72. anm11
  73. 11EndLeft
  74. 11StepLeft
  75. 11PauseLeft
  76. 11PlayLeft
  77. 11PlayPauseLeft
  78. 11PauseRight
  79. 11PlayRight
  80. 11PlayPauseRight
  81. 11StepRight
  82. 11EndRight
  83. 11Minus
  84. 11Reset
  85. 11Plus
  86. pbsARFix238
  87. pbsARFix239
  88. pbsARFix240
  89. pbsARFix241
  90. pbsARFix242
  91. 120
  92. 121
  93. 122
  94. 123
  95. 124
  96. 125
  97. 126
  98. 127
  99. 128
  100. 129
  101. 1210
  102. anm12
  103. 12EndLeft
  104. 12StepLeft
  105. 12PauseLeft
  106. 12PlayLeft
  107. 12PlayPauseLeft
  108. 12PauseRight
  109. 12PlayRight
  110. 12PlayPauseRight
  111. 12StepRight
  112. 12EndRight
  113. 12Minus
  114. 12Reset
  115. 12Plus
  116. 130
  117. 131
  118. 132
  119. 133
  120. 134
  121. 135
  122. 136
  123. 137
  124. 138
  125. 139
  126. 1310
  127. anm13
  128. 13EndLeft
  129. 13StepLeft
  130. 13PauseLeft
  131. 13PlayLeft
  132. 13PlayPauseLeft
  133. 13PauseRight
  134. 13PlayRight
  135. 13PlayPauseRight
  136. 13StepRight
  137. 13EndRight
  138. 13Minus
  139. 13Reset
  140. 13Plus
  141. pbsARFix243
  142. pbsARFix244
  143. pbsARFix245
  144. pbsARFix246
  145. 140
  146. 141
  147. 142
  148. 143
  149. 144
  150. 145
  151. 146
  152. 147
  153. 148
  154. 149
  155. 1410
  156. 1411
  157. 1412
  158. 1413
  159. 1414
  160. 1415
  161. 1416
  162. 1417
  163. 1418
  164. 1419
  165. 1420
  166. 1421
  167. 1422
  168. 1423
  169. 1424
  170. 1425
  171. 1426
  172. 1427
  173. 1428
  174. 1429
  175. 1430
  176. 1431
  177. 1432
  178. 1433
  179. 1434
  180. 1435
  181. 1436
  182. 1437
  183. 1438
  184. 1439
  185. 1440
  186. 1441
  187. 1442
  188. 1443
  189. 1444
  190. 1445
  191. 1446
  192. 1447
  193. 1448
  194. 1449
  195. 1450
  196. 1451
  197. 1452
  198. 1453
  199. 1454
  200. 1455
  201. 1456
  202. 1457
  203. 1458
  204. 1459
  205. 1460
  206. 1461
  207. 1462
  208. 1463
  209. 1464
  210. 1465
  211. 1466
  212. 1467
  213. 1468
  214. 1469
  215. 1470
  216. 1471
  217. 1472
  218. 1473
  219. 1474
  220. 1475
  221. 1476
  222. 1477
  223. 1478
  224. 1479
  225. 1480
  226. 1481
  227. 1482
  228. 1483
  229. 1484
  230. 1485
  231. 1486
  232. 1487
  233. 1488
  234. 1489
  235. 1490
  236. 1491
  237. 1492
  238. 1493
  239. 1494
  240. 1495
  241. 1496
  242. 1497
  243. 1498
  244. 1499
  245. 14100
  246. 14101
  247. 14102
  248. 14103
  249. 14104
  250. 14105
  251. 14106
  252. 14107
  253. 14108
  254. 14109
  255. 14110
  256. 14111
  257. 14112
  258. 14113
  259. 14114
  260. 14115
  261. 14116
  262. 14117
  263. 14118
  264. 14119
  265. 14120
  266. 14121
  267. 14122
  268. 14123
  269. 14124
  270. 14125
  271. 14126
  272. 14127
  273. 14128
  274. 14129
  275. 14130
  276. 14131
  277. 14132
  278. 14133
  279. 14134
  280. 14135
  281. 14136
  282. 14137
  283. 14138
  284. 14139
  285. 14140
  286. 14141
  287. 14142
  288. 14143
  289. 14144
  290. 14145
  291. 14146
  292. 14147
  293. 14148
  294. 14149
  295. 14150
  296. 14151
  297. 14152
  298. 14153
  299. 14154
  300. 14155
  301. 14156
  302. 14157
  303. 14158
  304. 14159
  305. 14160
  306. 14161
  307. 14162
  308. 14163
  309. 14164
  310. 14165
  311. 14166
  312. 14167
  313. 14168
  314. 14169
  315. 14170
  316. 14171
  317. 14172
  318. 14173
  319. 14174
  320. 14175
  321. 14176
  322. 14177
  323. 14178
  324. 14179
  325. 14180
  326. 14181
  327. 14182
  328. 14183
  329. 14184
  330. 14185
  331. 14186
  332. 14187
  333. 14188
  334. 14189
  335. 14190
  336. 14191
  337. 14192
  338. 14193
  339. 14194
  340. 14195
  341. 14196
  342. 14197
  343. anm14
  344. 14EndLeft
  345. 14StepLeft
  346. 14PauseLeft
  347. 14PlayLeft
  348. 14PlayPauseLeft
  349. 14PauseRight
  350. 14PlayRight
  351. 14PlayPauseRight
  352. 14StepRight
  353. 14EndRight
  354. 14Minus
  355. 14Reset
  356. 14Plus
  357. pbsARFix247
  358. pbsARFix248
  359. 150
  360. 151
  361. 152
  362. 153
  363. 154
  364. 155
  365. 156
  366. 157
  367. 158
  368. 159
  369. 1510
  370. 1511
  371. 1512
  372. 1513
  373. 1514
  374. 1515
  375. 1516
  376. 1517
  377. 1518
  378. 1519
  379. anm15
  380. 15EndLeft
  381. 15StepLeft
  382. 15PauseLeft
  383. 15PlayLeft
  384. 15PlayPauseLeft
  385. 15PauseRight
  386. 15PlayRight
  387. 15PlayPauseRight
  388. 15StepRight
  389. 15EndRight
  390. 15Minus
  391. 15Reset
  392. 15Plus
  393. pbsARFix249
  394. pbsARFix250
  395. pbsARFix251
  396. pbsARFix252
  397. pbsARFix253
  398. pbsARFix254
  399. pbsARFix255
  400. pbsARFix256
  401. pbsARFix257
  402. pbsARFix258
  403. pbsARFix259
  404. pbsARFix260
  405. pbsARFix261
Page 15: Black-ScholesPricingandHedging - NTU · to the Black-Scholes PDE (6.2) in order to price a claim payoff Cof the formC= h(S T).Asinthediscrete-timecase,thearbitragepriceπt(C) at

Black-Scholes Pricing and Hedging

Fig 611 Graph of the Black-Scholes put price function with strike price K = 100lowast

In other words the European put option with strike price K and maturityT is priced at time t isin [0T ] as

gp(tSt) = K eminus(Tminust)rΦ(minus dminus(T minus t)

)minus StΦ

(minus d+(T minus t)

) 0 6 t 6 T

Fig 612 Time-dependent solution of the Black-Scholes PDE (put option)dagger

The following R script is an implementation of the Black-Scholes formula forEuropean put options in R

1 BSPut lt- function(S K r T sigma)d1 = (log(SK)+(r+sigma^22)T)(sigmasqrt(T))

3 d2 = d1 - sigma sqrt(T)BSPut = Kexp(-rT) pnorm(-d2) - Spnorm(-d1)

5 BSPut

Call-put parity

lowast Right-click on the figure for interaction and ldquoFull Screen Multimediardquo viewdagger The animation works in Acrobat Reader on the entire pdf file

215

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

(C) 2012--today Alexander Grahn 3Dmenujs version 20140923 3D JavaScript used by media9sty Extended functionality of the (right click) context menu of 3D annotations 1) Adds the following items to the 3D context menu `Generate Default View Finds good default camera settings returned as options for use with the includemedia command `Get Current View Determines camera cross section and part settings of the current view returned as `VIEW section that can be copied into a views file of additional views The views file is inserted using the `3Dviews option of includemedia `Cross Section Toggle switch to add or remove a cross section into or from the current view The cross section can be moved in the x y z directions using x y z and X Y Z keys on the keyboard be tilted against and spun around the upright Z axis using the UpDown and LeftRight arrow keys and caled using the s and S keys 2) Enables manipulation of position and orientation of indiviual parts and groups of parts in the 3D scene Parts which have been selected with the mouse can be scaled moved around and rotated like the cross section as described above To spin the parts around their local up-axis keep Control key pressed while using the UpDown and LeftRight arrow keys This work may be distributed andor modified under the conditions of the LaTeX Project Public License The latest version of this license is in httpmirrorsctanorgmacroslatexbaselppltxt This work has the LPPL maintenance status `maintained The Current Maintainer of this work is A Grahn The code borrows heavily from Bernd Gaertners `Miniball software originally written in C++ for computing the smallest enclosing ball of a set of points see httpwwwinfethzchpersonalgaertnerminiballhtmlhostconsoleshow()constructor for doubly linked listfunction List() thisfirst_node=null thislast_node=new Node(undefined)Listprototypepush_back=function(x) var new_node=new Node(x) if(thisfirst_node==null) thisfirst_node=new_node new_nodeprev=null else new_nodeprev=thislast_nodeprev new_nodeprevnext=new_node new_nodenext=thislast_node thislast_nodeprev=new_nodeListprototypemove_to_front=function(it) var node=itget() if(nodenext=null ampamp nodeprev=null) nodenextprev=nodeprev nodeprevnext=nodenext nodeprev=null nodenext=thisfirst_node thisfirst_nodeprev=node thisfirst_node=node Listprototypebegin=function() var i=new Iterator() itarget=thisfirst_node return(i)Listprototypeend=function() var i=new Iterator() itarget=thislast_node return(i)function Iterator(it) if( it=undefined ) thistarget=ittarget else thistarget=null Iteratorprototypeset=function(it)thistarget=ittargetIteratorprototypeget=function()return(thistarget)Iteratorprototypederef=function()return(thistargetdata)Iteratorprototypeincr=function() if(thistargetnext=null) thistarget=thistargetnextconstructor for node objects that populate the linked listfunction Node(x) thisprev=null thisnext=null thisdata=xfunction sqr(r)return(rr)helper functionMiniball algorithm by B Gaertnerfunction Basis() thism=0 thisq0=new Array(3) thisz=new Array(4) thisf=new Array(4) thisv=new Array(new Array(3) new Array(3) new Array(3) new Array(3)) thisa=new Array(new Array(3) new Array(3) new Array(3) new Array(3)) thisc=new Array(new Array(3) new Array(3) new Array(3) new Array(3)) thissqr_r=new Array(4) thiscurrent_c=thisc[0] thiscurrent_sqr_r=0 thisreset()Basisprototypecenter=function()return(thiscurrent_c)Basisprototypesize=function()return(thism)Basisprototypepop=function()--thismBasisprototypeexcess=function(p) var e=-thiscurrent_sqr_r for(var k=0klt3++k) e+=sqr(p[k]-thiscurrent_c[k]) return(e)Basisprototypereset=function() thism=0 for(var j=0jlt3++j) thisc[0][j]=0 thiscurrent_c=thisc[0] thiscurrent_sqr_r=-1Basisprototypepush=function(p) var i j var eps=1e-32 if(thism==0) for(i=0ilt3++i) thisq0[i]=p[i] for(i=0ilt3++i) thisc[0][i]=thisq0[i] thissqr_r[0]=0 else for(i=0ilt3++i) thisv[thism][i]=p[i]-thisq0[i] for(i=1iltthism++i) thisa[thism][i]=0 for(j=0jlt3++j) thisa[thism][i]+=thisv[i][j]thisv[thism][j] thisa[thism][i]=(2thisz[i]) for(i=1iltthism++i) for(j=0jlt3++j) thisv[thism][j]-=thisa[thism][i]thisv[i][j] thisz[thism]=0 for(j=0jlt3++j) thisz[thism]+=sqr(thisv[thism][j]) thisz[thism]=2 if(thisz[thism]ltepsthiscurrent_sqr_r) return(false) var e=-thissqr_r[thism-1] for(i=0ilt3++i) e+=sqr(p[i]-thisc[thism-1][i]) thisf[thism]=ethisz[thism] for(i=0ilt3++i) thisc[thism][i]=thisc[thism-1][i]+thisf[thism]thisv[thism][i] thissqr_r[thism]=thissqr_r[thism-1]+ethisf[thism]2 thiscurrent_c=thisc[thism] thiscurrent_sqr_r=thissqr_r[thism] ++thism return(true)function Miniball() thisL=new List() thisB=new Basis() thissupport_end=new Iterator()Miniballprototypemtf_mb=function(it) var i=new Iterator(it) thissupport_endset(thisLbegin()) if((thisBsize())==4) return for(var k=new Iterator(thisLbegin())kget()=iget()) var j=new Iterator(k) kincr() if(thisBexcess(jderef()) gt 0) if(thisBpush(jderef())) thismtf_mb(j) thisBpop() if(thissupport_endget()==jget()) thissupport_endincr() thisLmove_to_front(j) Miniballprototypecheck_in=function(b) thisLpush_back(b)Miniballprototypebuild=function() thisBreset() thissupport_endset(thisLbegin()) thismtf_mb(thisLend())Miniballprototypecenter=function() return(thisBcenter())Miniballprototyperadius=function() return(Mathsqrt(thisBcurrent_sqr_r))functions called by menu itemsfunction calc3Dopts () create Miniball object var mb=new Miniball() auxiliary vector var corner=new Vector3() iterate over all visible mesh nodes in the scene for(i=0iltscenemeshescounti++) var mesh=scenemeshesgetByIndex(i) if(meshvisible) continue local to parent transformation matrix var trans=meshtransform build local to world transformation matrix by recursively multiplying the parents transf matrix on the right var parent=meshparent while(parenttransform) trans=transmultiply(parenttransform) parent=parentparent get the bbox of the mesh (local coordinates) var bbox=meshcomputeBoundingBox() transform the local bounding box corner coordinates to world coordinates for bounding sphere determination BBoxmin cornerset(bboxmin) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) BBoxmax cornerset(bboxmax) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) remaining six BBox corners cornerset(bboxminx bboxmaxy bboxmaxz) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) cornerset(bboxminx bboxminy bboxmaxz) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) cornerset(bboxminx bboxmaxy bboxminz) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) cornerset(bboxmaxx bboxminy bboxminz) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) cornerset(bboxmaxx bboxminy bboxmaxz) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) cornerset(bboxmaxx bboxmaxy bboxminz) cornerset(transtransformPosition(corner)) mbcheck_in(new Array(cornerx cornery cornerz)) compute the smallest enclosing bounding sphere mbbuild() current camera settings var camera=scenecamerasgetByIndex(0) var res= initialize result string aperture angle of the virtual camera (perspective projection) or orthographic scale (orthographic projection) if(cameraprojectionType==cameraTYPE_PERSPECTIVE) var aac=camerafov180MathPI if(hostutilprintf(4f aac)=30) res+=hostutilprintf(n3Daac=s aac) else cameraviewPlaneSize=2mbradius() res+=hostutilprintf(n3Dortho=s 1cameraviewPlaneSize) camera roll var roll = cameraroll180MathPI if(hostutilprintf(4f roll)=0) res+=hostutilprintf(n3Droll=sroll) target to camera vector var c2c=new Vector3() c2cset(cameraposition) c2csubtractInPlace(cameratargetPosition) c2cnormalize() if((c2cx==0 ampamp c2cy==-1 ampamp c2cz==0)) res+=hostutilprintf(n3Dc2c=s s s c2cx c2cy c2cz) new camera settings bounding sphere centre --gt new camera target var coo=new Vector3() cooset((mbcenter())[0] (mbcenter())[1] (mbcenter())[2]) if(coolength) res+=hostutilprintf(n3Dcoo=s s s coox cooy cooz) radius of orbit if(cameraprojectionType==cameraTYPE_PERSPECTIVE) var roo=mbradius() Mathsin(aac MathPI 360) else orthographic projection var roo=mbradius() res+=hostutilprintf(n3Droo=s roo) update camera settings in the viewer var currol=cameraroll cameratargetPositionset(coo) camerapositionset(cooadd(c2cscale(roo))) cameraroll=currol determine background colour rgb=scenebackgroundgetColor() if((rgbr==1 ampamp rgbg==1 ampamp rgbb==1)) res+=hostutilprintf(n3Dbg=s s s rgbr rgbg rgbb) determine lighting scheme switch(scenelightScheme) case sceneLIGHT_MODE_FILE curlights=Artworkbreak case sceneLIGHT_MODE_NONE curlights=Nonebreak case sceneLIGHT_MODE_WHITE curlights=Whitebreak case sceneLIGHT_MODE_DAY curlights=Daybreak case sceneLIGHT_MODE_NIGHT curlights=Nightbreak case sceneLIGHT_MODE_BRIGHT curlights=Hardbreak case sceneLIGHT_MODE_RGB curlights=Primarybreak case sceneLIGHT_MODE_BLUE curlights=Bluebreak case sceneLIGHT_MODE_RED curlights=Redbreak case sceneLIGHT_MODE_CUBE curlights=Cubebreak case sceneLIGHT_MODE_CAD curlights=CADbreak case sceneLIGHT_MODE_HEADLAMP curlights=Headlampbreak if(curlights=Artwork) res+=hostutilprintf(n3Dlights=s curlights) determine global render mode switch(scenerenderMode) case sceneRENDER_MODE_BOUNDING_BOX currender=BoundingBoxbreak case sceneRENDER_MODE_TRANSPARENT_BOUNDING_BOX currender=TransparentBoundingBoxbreak case sceneRENDER_MODE_TRANSPARENT_BOUNDING_BOX_OUTLINE currender=TransparentBoundingBoxOutlinebreak case sceneRENDER_MODE_VERTICES currender=Verticesbreak case sceneRENDER_MODE_SHADED_VERTICES currender=ShadedVerticesbreak case sceneRENDER_MODE_WIREFRAME currender=Wireframebreak case sceneRENDER_MODE_SHADED_WIREFRAME currender=ShadedWireframebreak case sceneRENDER_MODE_SOLID currender=Solidbreak case sceneRENDER_MODE_TRANSPARENT currender=Transparentbreak case sceneRENDER_MODE_SOLID_WIREFRAME currender=SolidWireframebreak case sceneRENDER_MODE_TRANSPARENT_WIREFRAME currender=TransparentWireframebreak case sceneRENDER_MODE_ILLUSTRATION currender=Illustrationbreak case sceneRENDER_MODE_SOLID_OUTLINE currender=SolidOutlinebreak case sceneRENDER_MODE_SHADED_ILLUSTRATION currender=ShadedIllustrationbreak case sceneRENDER_MODE_HIDDEN_WIREFRAME currender=HiddenWireframebreak if(currender=Solid) res+=hostutilprintf(n3Drender=s currender) write result string to the console hostconsoleshow() hostconsoleclear() hostconsoleprintln(n Copy and paste the following text to then+ option list of includemedian + res + n)function get3Dview () var camera=scenecamerasgetByIndex(0) var coo=cameratargetPosition var c2c=camerapositionsubtract(coo) var roo=c2clength c2cnormalize() var res=VIEW=insert optional name heren if((coox==0 ampamp cooy==0 ampamp cooz==0)) res+=hostutilprintf( COO=s s sn coox cooy cooz) if((c2cx==0 ampamp c2cy==-1 ampamp c2cz==0)) res+=hostutilprintf( C2C=s s sn c2cx c2cy c2cz) if(roo gt 1e-9) res+=hostutilprintf( ROO=sn roo) var roll = cameraroll180MathPI if(hostutilprintf(4f roll)=0) res+=hostutilprintf( ROLL=sn roll) if(cameraprojectionType==cameraTYPE_PERSPECTIVE) var aac=camerafov 180MathPI if(hostutilprintf(4f aac)=30) res+=hostutilprintf( AAC=sn aac) else if(hostutilprintf(4f cameraviewPlaneSize)=1) res+=hostutilprintf( ORTHO=sn 1cameraviewPlaneSize) rgb=scenebackgroundgetColor() if((rgbr==1 ampamp rgbg==1 ampamp rgbb==1)) res+=hostutilprintf( BGCOLOR=s s sn rgbr rgbg rgbb) switch(scenelightScheme) case sceneLIGHT_MODE_FILE curlights=Artworkbreak case sceneLIGHT_MODE_NONE curlights=Nonebreak case sceneLIGHT_MODE_WHITE curlights=Whitebreak case sceneLIGHT_MODE_DAY curlights=Daybreak case sceneLIGHT_MODE_NIGHT curlights=Nightbreak case sceneLIGHT_MODE_BRIGHT curlights=Hardbreak case sceneLIGHT_MODE_RGB curlights=Primarybreak case sceneLIGHT_MODE_BLUE curlights=Bluebreak case sceneLIGHT_MODE_RED curlights=Redbreak case sceneLIGHT_MODE_CUBE curlights=Cubebreak case sceneLIGHT_MODE_CAD curlights=CADbreak case sceneLIGHT_MODE_HEADLAMP curlights=Headlampbreak if(curlights=Artwork) res+= LIGHTS=+curlights+n switch(scenerenderMode) case sceneRENDER_MODE_BOUNDING_BOX defaultrender=BoundingBoxbreak case sceneRENDER_MODE_TRANSPARENT_BOUNDING_BOX defaultrender=TransparentBoundingBoxbreak case sceneRENDER_MODE_TRANSPARENT_BOUNDING_BOX_OUTLINE defaultrender=TransparentBoundingBoxOutlinebreak case sceneRENDER_MODE_VERTICES defaultrender=Verticesbreak case sceneRENDER_MODE_SHADED_VERTICES defaultrender=ShadedVerticesbreak case sceneRENDER_MODE_WIREFRAME defaultrender=Wireframebreak case sceneRENDER_MODE_SHADED_WIREFRAME defaultrender=ShadedWireframebreak case sceneRENDER_MODE_SOLID defaultrender=Solidbreak case sceneRENDER_MODE_TRANSPARENT defaultrender=Transparentbreak case sceneRENDER_MODE_SOLID_WIREFRAME defaultrender=SolidWireframebreak case sceneRENDER_MODE_TRANSPARENT_WIREFRAME defaultrender=TransparentWireframebreak case sceneRENDER_MODE_ILLUSTRATION defaultrender=Illustrationbreak case sceneRENDER_MODE_SOLID_OUTLINE defaultrender=SolidOutlinebreak case sceneRENDER_MODE_SHADED_ILLUSTRATION defaultrender=ShadedIllustrationbreak case sceneRENDER_MODE_HIDDEN_WIREFRAME defaultrender=HiddenWireframebreak if(defaultrender=Solid) res+= RENDERMODE=+defaultrender+n detect existing Clipping Plane (3D Cross Section) var clip=null if( clip=scenenodesgetByName($$$$$$)|| clip=scenenodesgetByName(Clipping Plane) ) for(var i=0iltscenenodescounti++) var nd=scenenodesgetByIndex(i) if(nd==clip||ndname==) continue var ndUTFName= for (var j=0 jltndnamelength j++) var theUnicode = ndnamecharCodeAt(j)toString(16) while (theUnicodelengthlt4) theUnicode = 0 + theUnicode ndUTFName += theUnicode var end=ndnamelastIndexOf() if(endgt0) var ndUserName=ndnamesubstr(0end) else var ndUserName=ndname respart= PART=+ndUserName+n respart+= UTF16NAME=+ndUTFName+n defaultvals=true if(ndvisible) respart+= VISIBLE=falsen defaultvals=false if(ndopacitylt10) respart+= OPACITY=+ndopacity+n defaultvals=false if(ndconstructorname==Mesh) currender=defaultrender switch(ndrenderMode) case sceneRENDER_MODE_BOUNDING_BOX currender=BoundingBoxbreak case sceneRENDER_MODE_TRANSPARENT_BOUNDING_BOX currender=TransparentBoundingBoxbreak case sceneRENDER_MODE_TRANSPARENT_BOUNDING_BOX_OUTLINE currender=TransparentBoundingBoxOutlinebreak case sceneRENDER_MODE_VERTICES currender=Verticesbreak case sceneRENDER_MODE_SHADED_VERTICES currender=ShadedVerticesbreak case sceneRENDER_MODE_WIREFRAME currender=Wireframebreak case sceneRENDER_MODE_SHADED_WIREFRAME currender=ShadedWireframebreak case sceneRENDER_MODE_SOLID currender=Solidbreak case sceneRENDER_MODE_TRANSPARENT currender=Transparentbreak case sceneRENDER_MODE_SOLID_WIREFRAME currender=SolidWireframebreak case sceneRENDER_MODE_TRANSPARENT_WIREFRAME currender=TransparentWireframebreak case sceneRENDER_MODE_ILLUSTRATION currender=Illustrationbreak case sceneRENDER_MODE_SOLID_OUTLINE currender=SolidOutlinebreak case sceneRENDER_MODE_SHADED_ILLUSTRATION currender=ShadedIllustrationbreak case sceneRENDER_MODE_HIDDEN_WIREFRAME currender=HiddenWireframebreak case sceneRENDER_MODE_DEFAULT currender=Defaultbreak if(currender=defaultrender) respart+= RENDERMODE=+currender+n defaultvals=false if(origtrans[ndname]ampampndtransformisEqual(origtrans[ndname])) var lvec=ndtransformtransformDirection(new Vector3(100)) var uvec=ndtransformtransformDirection(new Vector3(010)) var vvec=ndtransformtransformDirection(new Vector3(001)) respart+= TRANSFORM= +lvecx+ +lvecy+ +lvecz+ +uvecx+ +uvecy+ +uvecz+ +vvecx+ +vvecy+ +vvecz+ +ndtransformtranslationx+ +ndtransformtranslationy+ +ndtransformtranslationz+n defaultvals=false respart+= ENDn if(defaultvals) res+=respart if(clip) var centre=cliptransformtranslation var normal=cliptransformtransformDirection(new Vector3(001)) res+= CROSSSECTn if((centrex==0 ampamp centrey==0 ampamp centrez==0)) res+=hostutilprintf( CENTER=s s sn centrex centrey centrez) if((normalx==1 ampamp normaly==0 ampamp normalz==0)) res+=hostutilprintf( NORMAL=s s sn normalx normaly normalz) res+=hostutilprintf( VISIBLE=sn clipvisible) res+=hostutilprintf( PLANECOLOR=s s sn clipmaterialemissiveColorr clipmaterialemissiveColorg clipmaterialemissiveColorb) res+=hostutilprintf( OPACITY=sn clipopacity) res+=hostutilprintf( INTERSECTIONCOLOR=s s sn clipwireframeColorr clipwireframeColorg clipwireframeColorb) res+= ENDn for(var propt in clip) consoleprintln(propt++clip[propt]) res+=ENDn hostconsoleshow() hostconsoleclear() hostconsoleprintln(n Add the following VIEW section to a file ofn+ predefined views (See option 3Dviews)nn + The view may be given a name after VIEW=n + (Remove in front of =)n) hostconsoleprintln(res + n)add items to 3D context menuruntimeaddCustomMenuItem(dfltview Generate Default View default 0)runtimeaddCustomMenuItem(currview Get Current View default 0)runtimeaddCustomMenuItem(csection Cross Section checked 0)menu event handlersmenuEventHandler = new MenuEventHandler()menuEventHandleronEvent = function(e) switch(emenuItemName) case dfltview calc3Dopts() break case currview get3Dview() break case csection addremoveClipPlane(emenuItemChecked) break runtimeaddEventHandler(menuEventHandler)global variable taking reference to currently selected nodevar target=nullselectionEventHandler=new SelectionEventHandler()selectionEventHandleronEvent=function(e) if(eselectedampampenodename=) target=enode else target=null runtimeaddEventHandler(selectionEventHandler)cameraEventHandler=new CameraEventHandler()cameraEventHandleronEvent=function(e) var clip=null runtimeremoveCustomMenuItem(csection) runtimeaddCustomMenuItem(csection Cross Section checked 0) if(clip=scenenodesgetByName($$$$$$)|| predefined scenenodesgetByName(Clipping Plane)) added via context menu runtimeremoveCustomMenuItem(csection) runtimeaddCustomMenuItem(csection Cross Section checked 1) if(clip)plane in predefined views must be rotated by 90 deg around normal cliptransformrotateAboutLineInPlace( MathPI2cliptransformtranslation cliptransformtransformDirection(new Vector3(001)) ) for(var i=0 iltrot4x4length i++)rot4x4[i]setIdentity() target=nullruntimeaddEventHandler(cameraEventHandler)var rot4x4=new Array() keeps track of spin and tilt axes transformationskey event handler for scaling moving spinning and tilting objectskeyEventHandler=new KeyEventHandler()keyEventHandleronEvent=function(e) var backtrans=new Matrix4x4() var trgt=null if(target) trgt=target var backtrans=new Matrix4x4() var trans=trgttransform var parent=trgtparent while(parenttransform) build local to world transformation matrix transmultiplyInPlace(parenttransform) also build world to local back-transformation matrix backtransmultiplyInPlace(parenttransforminversetranspose) parent=parentparent backtranstransposeInPlace() else if( trgt=scenenodesgetByName($$$$$$)|| trgt=scenenodesgetByName(Clipping Plane) ) var trans=trgttransform if(trgt) return var tname=trgtname if(typeof(rot4x4[tname])==undefined) rot4x4[tname]=new Matrix4x4() if(target) var tiltAxis=rot4x4[tname]transformDirection(new Vector3(010)) else var tiltAxis=transtransformDirection(new Vector3(010)) var spinAxis=rot4x4[tname]transformDirection(new Vector3(001)) get the centre of the mesh if(targetampamptrgtconstructorname==Mesh) var centre=transtransformPosition(trgtcomputeBoundingBox()center) else part group (Node3 parent node clipping plane) var centre=new Vector3(transtranslation) switch(echaracterCode) case 30tilt up rot4x4[tname]rotateAboutLineInPlace( -MathPI900rot4x4[tname]translationtiltAxis) transrotateAboutLineInPlace(-MathPI900centretiltAxis) break case 31tilt down rot4x4[tname]rotateAboutLineInPlace( MathPI900rot4x4[tname]translationtiltAxis) transrotateAboutLineInPlace(MathPI900centretiltAxis) break case 28spin right if(ectrlKeyDownampamptarget) transrotateAboutLineInPlace(-MathPI900centrespinAxis) else rot4x4[tname]rotateAboutLineInPlace( -MathPI900rot4x4[tname]translationnew Vector3(001)) transrotateAboutLineInPlace(-MathPI900centrenew Vector3(001)) break case 29spin left if(ectrlKeyDownampamptarget) transrotateAboutLineInPlace(MathPI900centrespinAxis) else rot4x4[tname]rotateAboutLineInPlace( MathPI900rot4x4[tname]translationnew Vector3(001)) transrotateAboutLineInPlace(MathPI900centrenew Vector3(001)) break case 120 x translateTarget(trans new Vector3(100) e) break case 121 y translateTarget(trans new Vector3(010) e) break case 122 z translateTarget(trans new Vector3(001) e) break case 88 shift + x translateTarget(trans new Vector3(-100) e) break case 89 shift + y translateTarget(trans new Vector3(0-10) e) break case 90 shift + z translateTarget(trans new Vector3(00-1) e) break case 115 s transtranslateInPlace(centrescale(-1)) transscaleInPlace(101) transtranslateInPlace(centrescale(1)) break case 83 shift + s transtranslateInPlace(centrescale(-1)) transscaleInPlace(1101) transtranslateInPlace(centrescale(1)) break transmultiplyInPlace(backtrans)runtimeaddEventHandler(keyEventHandler)translates object by amount calculated from Canvas sizefunction translateTarget(t d e) var cam=scenecamerasgetByIndex(0) if(camprojectionType==camTYPE_PERSPECTIVE) var scale=Mathtan(camfov2) camtargetPositionsubtract(camposition)length Mathmin(ecanvasPixelWidthecanvasPixelHeight) else var scale=camviewPlaneSize2 Mathmin(ecanvasPixelWidthecanvasPixelHeight) ttranslateInPlace(dscale(scale))function addremoveClipPlane(chk) var curTrans=getCurTrans() var clip=scenecreateClippingPlane() if(chk) add Clipping Plane and place its center either into the camera target position or into the centre of the currently selected mesh node var centre=new Vector3() if(target) var trans=targettransform var parent=targetparent while(parenttransform) trans=transmultiply(parenttransform) parent=parentparent if(targetconstructorname==Mesh) var centre=transtransformPosition(targetcomputeBoundingBox()center) else var centre=new Vector3(transtranslation) target=null else centreset(scenecamerasgetByIndex(0)targetPosition) cliptransformsetView( new Vector3(000) new Vector3(100) new Vector3(010)) cliptransformtranslateInPlace(centre) else if( scenenodesgetByName($$$$$$)|| scenenodesgetByName(Clipping Plane) ) clipremove()clip=null restoreTrans(curTrans) return clipfunction to store current transformation matrix of all nodes in the scenefunction getCurTrans() var tA=new Array() for(var i=0 iltscenenodescount i++) var nd=scenenodesgetByIndex(i) if(ndname==) continue tA[ndname]=new Matrix4x4(ndtransform) return tAfunction to restore transformation matrices given as argfunction restoreTrans(tA) for(var i=0 iltscenenodescount i++) var nd=scenenodesgetByIndex(i) if(tA[ndname]) ndtransformset(tA[ndname]) store original transformation matrix of all mesh nodes in the scenevar origtrans=getCurTrans()set initial state of Cross Section menu entrycameraEventHandleronEvent(1)hostconsoleclear()

var ocgs=hostgetOCGs(hostpageNum)for(var i=0iltocgslengthi++)if(ocgs[i]name==MediaPlayButton2)ocgs[i]state=false

(C) 2012 Michail Vidiassov John C Bowman Alexander Grahn asylabelsjs version 20120912 3D JavaScript to be used with media9sty (option `add3Djscript) for Asymptote generated PRC files adds billboard behaviour to text labels in Asymptote PRC files so that they always face the camera under 3D rotation This work may be distributed andor modified under the conditions of the LaTeX Project Public License The latest version of this license is in httpmirrorsctanorgmacroslatexbaselppltxt This work has the LPPL maintenance status `maintained The Current Maintainer of this work is A Grahnvar bbnodes=new Array() billboard meshesvar bbtrans=new Array() billboard transformsfunction fulltransform(mesh) var t=new Matrix4x4(meshtransform) if(meshparentname = ) var parentTransform=fulltransform(meshparent) tmultiplyInPlace(parentTransform) return t else return t find all text labels in the scene and determine pivoting pointsvar nodes=scenenodesvar nodescount=nodescountvar third=1030for(var i=0 i lt nodescount i++) var node=nodesgetByIndex(i) var name=nodename var end=namelastIndexOf()-1 if(end gt 0) if(namecharAt(end) == 001) var start=namelastIndexOf(-)+1 if(end gt start) nodename=namesubstr(0start-1) var nodeMatrix=fulltransform(nodeparent) var c=nodeMatrixtranslation position var d=Mathpow(Mathabs(nodeMatrixdeterminant)third) scale bbnodespush(node) bbtranspush(Matrix4x4()scale(ddd)translate(c)multiply(nodeMatrixinverse)) var camera=scenecamerasgetByIndex(0) var zero=new Vector3(000)var bbcount=bbnodeslength event handler to maintain camera-facing text labelsbillboardHandler=new RenderEventHandler()billboardHandleronEvent=function(event) var T=new Matrix4x4() TsetView(zerocamerapositionsubtract(cameratargetPosition) cameraupsubtract(cameraposition)) for(var j=0 j lt bbcount j++) bbnodes[j]transformset(Tmultiply(bbtrans[j])) runtimerefresh() runtimeaddEventHandler(billboardHandler)runtimerefresh()

(C) 2012 Alexander Grahn 3Dspintooljs version 20120301 3D JavaScript to be used with media9sty (option `add3Djscript) enables the Spin tool (also accessible via 3D toolbar or context menu) upon activation of the 3D scene the scene then rotates around the upright axis while dragging with the mouse This work may be distributed andor modified under the conditions of the LaTeX Project Public License The latest version of this license is in httpmirrorsctanorgmacroslatexbaselppltxt This work has the LPPL maintenance status `maintained The Current Maintainer of this work is A GrahnruntimesetCurrentTool(runtimeTOOL_NAME_SPIN)

N Privault

Proposition 66 Call-put parity We have the call-put parity relation

gc(tSt)minus gp(tSt) = St minusK eminus(Tminust)r 0 6 t 6 T (621)

between the Black-Scholes prices of call and put options in terms of theforward contract price St minusK eminus(Tminust)r

Proof The call-put parity (621) is a consequence of the relation

xminusK = (xminusK)+ minus (K minus x)+

satisfied by the terminal call and put payoff functions in the Black-ScholesPDE (67) It can also be verified directly from (610) and (618) as

gc(tx)minus gp(tx) = xΦ(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)minus(K eminus(Tminust)rΦ

(minus dminus(T minus t)

)minus xΦ

(minus d+(T minus t)

))= xΦ

(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)minusK eminus(Tminust)r

(1minusΦ

(dminus(T minus t)

))+ x

(1minusΦ

(d+(T minus t)

))= xminusK

The Delta of the Black-Scholes put option can be obtained by differentiationof the call-put parity relation (621) and Proposition 64

Proposition 67 The Delta of the Black-Scholes put option is given by

ξt = minus(1minusΦ(d+(T minus t)

)) = minusΦ

(minus d+(T minus t)

)isin [minus1 0] 0 6 t 6 T

Proof By the call-put parity relation (621) and Proposition 64 we have

partgppartx

(tSt) =partgcpartx

(tSt)minus 1

= Φ(d+(T minus t))minus 1= minusΦ(minusd+(T minus t)) 0 6 t 6 T

where we applied (614)

As a consequence of Proposition 67 the Black-Scholes put price splitsinto a risky component minusStΦ

(minus d+(T minus t)

)and a riskless component

K eminus(Tminust)rΦ(minus dminus(T minus t)

) as follows

gp(tSt) = K eminus(Tminust)rΦ(minus dminus(T minus t)

)︸ ︷︷ ︸riskminusfree investment (savings)

minus StΦ(minus d+(T minus t)

)︸ ︷︷ ︸

risky investment (short)

0 6 t 6 T

216

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

In Figure 613 we plot the Delta of the European put option as a function ofthe underlying asset price and of the time remaining until maturity

Payoff function (x-K)+

0

50

100

150

200

Underlying

0

5

10

15 Time to maturity T-t

-1

-075

-05

-025

0

Fig 613 Delta of a European put option with strike price K = 100 r = 3 σ = 10

Numerical example - hedging of a put option

For one more example we consider a put option issued by BNP Paribas on04 November 2008 with strike price K=$77667 maturity T = October 052009 and entitlement ratio 92593 cf page 9 In the next Figure 614 thenumber of days is counted from the origin not from maturity

40 50 60 70 80 90 100

0 50 100 150 200

0 5

10 15 20 25 30 35 40 45

Underlying (HK$)Time in days

Fig 614 Path of the Black-Scholes price for a put option on HSBC

As a consequence of Proposition 67 the amount invested on the risky assetfor the hedging of a put option is

minusStΦ(minus d+(T minus t)

)= minusStΦ

(minus log(StK) + (r+ σ22)(T minus t)

|σ|radicT minus t

)6 0

217

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

ie there is always short selling and the amount invested on the riskless assetpriced At = ert t isin [0T ] is

ηtAt = K eminus(Tminust)rΦ(minus dminus(T minus t)

)= K eminus(Tminust)rΦ

(minus log(StK) + (rminus σ22)(T minus t)

|σ|radicT minus t

)gt 0

which is always nonnegative ie we are constantly saving money on theriskless asset as noted in Figure 615

-60

-40

-20

0

20

40

60

80

100

0 50 100 150 200

K

HK$

Black-Scholes priceRisky investment ξtSt

Riskless investment ηtAtUnderlying asset price

Fig 615 Time evolution of the hedging portfolio for a put option on HSBC

In the above example the put option finished out of the money (OTM) so thatno cash settlement or physical delivery occurs A comparison of Figure 610with market data can be found in Figures 913 and 914 below

64 Market Terms and Data

The following Table 61 provides a summary of formulas for the computationof Black-Scholes sensitivities also called Greekslowast

lowast ldquoEvery class feels like attending a Greek lessonrdquo (AY2018-2019 student feedback)

218

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

Call option Put option

Option price g(tSt) StΦ(d+(T minus t))minusK eminus(Tminust)rΦ(dminus(T minus t)) K eminus(Tminust)rΦ(minusdminus(T minus t))minus StΦ(minusd+(T minus t))

Delta (∆) partg

partx(tSt) Φ(d+(T minus t)) gt 0 minusΦ(minusd+(T minus t)) 6 0

Gamma (Γ) part2g

partx2 (tSt)Φprime(d+(T minus t))St|σ|

radicT minus t

gt 0

Vega partg

partσ(tSt) St

radicT minus tΦprime(d+(T minus t)) gt 0

Theta (Θ) partg

partt(tSt) minusSt|σ|Φ

prime(d+(T minus t))2radicT minus t

minus rK eminus(Tminust)rΦ(dminus(T minus t)) 6 0 minusSt|σ|Φprime(d+(T minus t))

2radicT minus t

+ rK eminus(Tminust)rΦ(minusdminus(T minus t))

Rho (ρ) partg

partr(tSt) K(T minus t) eminus(Tminust)rΦ(dminus(T minus t)) minusK(T minus t) eminus(Tminust)rΦ(minusdminus(T minus t))

Table 61 Black-Scholes Greeks (Wikipedia)

From Table 61 we can conclude that call option prices are increasing func-tions of the underlying asset price St of the interest rate r and of the volatil-ity parameter σ Similarly put option prices are decreasing functions of theunderlying asset price St of the interest rate r and increasing functions ofthe volatility parameter σ

Parameter Variation of call option prices Variation of put option prices

Underlying St increasing decreasing

Volatility σ increasing increasing

Time t decreasing depends on the underlying price level

Interest rate r increasing decreasing

Table 62 Variations of Black-Scholes prices

The change of sign of the sensitivity Theta (Θ) with respect to time t can beverified in the following Figure 616

219

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

(a) Black-Scholes call price maps (b) Black-Scholes put price maps

Fig 616 Time-dependent solutions of the Black-Scholes PDElowast

Intrinsic value The intrinsic value at time t isin [0T ] of the option withpayoff C = h

(S(1)T

)is given by the immediate exercise payoff h

(S(1)t

) The

extrinsic value at time t isin [0T ] of the option is the remaining differenceπt(C) minus h

(S(1)t

)between the option price πt(C) and the immediate ex-

ercise payoff h(S(1)t

) In general the option price πt(C) decomposes as

πt(C) = h(S(1)t

)︸ ︷︷ ︸intrinsic value

+ πt(C)minus h(S(1)t

)︸ ︷︷ ︸

extrinsic value

0 6 t 6 T ]

Gearing The gearing at time t isin [0T ] of the option with payoff C = h(ST )is defined as the ratio

Gt =St

πt(C)=

Stg(tSt)

0 6 t 6 T

Effective gearing The effective gearing at time t isin [0T ] of the option withpayoff C = h(ST ) is defined as the ratio

Get = Gtξt

=ξtStπt(C)

=St

πt(C)

partg

partx(tSt)

=St

g(tSt)partg

partx(tSt)

= Stpart

partxlog g(tSt) 0 6 t 6 T

lowast The animation works in Acrobat Reader on the entire pdf file

220

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

The effective gearingGet =

ξtStπt(C)

can be interpreted as the hedge ratio ie the percentage of the portfoliowhich is invested on the risky asset When written as

∆g(tSt)g(tSt)

= Get times

∆StSt

the effective gearing gives the relative variation or percentage change∆g(tSt)g(tSt) of the option price g(tSt) from the relative variation∆StSt in the underlying asset price

The ratio Get = Stpart log g(tSt)partx can also be interpreted as an elasticity

coefficient

Break-even price The break-even price BEPt of the underlying asset is thevalue of S for which the intrinsic option value h(S) equals the option priceπt(C) at time t isin [0T ] For European call options it is given by

BEPt = K + πt(C) = K + g(tSt) t = 0 1 N

whereas for European put options it is given by

BEPt = K minus πt(C) = K minus g(tSt) 0 6 t 6 T

Premium The option premium OPt can be defined as the variation requiredfrom the underlying asset price in order to reach the break-even price iewe have

OPt =BEPt minus St

St=K + g(tSt)minus St

St 0 6 t 6 T

for European call options and

OPt =St minusBEPt

St=St + g(tSt)minusK

St 0 6 t 6 T

for European put options see Figure 617 below The term ldquopremiumrdquo issometimes also used to denote the arbitrage price g(tSt) of the option

221

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

f (tx σ)100

=

x =

K =

xpart log f

partx=

σ =

partf

partt(tx σ)=

T=

=(xminusK)x

∆ = = partf

partx(tx σ)

= partf

partσ(tx σ)

=K+f (txσ)minusx

x

=K+f (tx σ)

rf=

partf

partt+rxpartf

partx+

σ2 2x2part2f

partx2

Fig 617 Warrant terms and data

The R package bizdays (requires to install QuantLib) can be used to computecalendar time vs business time to maturity1 installpackages(bizdays)

library(bizdays)3 load_quantlib_calendars(HongKong from=2018-01-01 to=2018-12-31)

load_quantlib_calendars(Singapore from=2018-01-01 to=2018-12-31)5 bizdays(2018-03-10 2018-04-03 QuantLibHongKong)

bizdays(2018-03-10 2018-04-03 QuantLibSingapore)

65 The Heat Equation

In the next proposition we notice that the solution f(tx) of the Black-Scholes PDE (67) can be transformed into a solution g(t y) of the simplerheat equation by a change of variable and a time inversion t 7minusrarr T minus t onthe interval [0T ] so that the terminal condition at time T in the Black-Scholes equation (622) becomes an initial condition at time t = 0 in theheat equation (625) See also here for a related discussion on changes ofvariables for the Black-Scholes PDE

222

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

Proposition 68 Assume that f(tx) solves the Black-Scholes PDErf(tx) = partf

partt(tx) + rx

partf

partx(tx) + 1

2σ2x2 part

2f

partx2 (tx)

f(T x) = (xminusK)+(622)

with terminal condition h(x) = (xminusK)+ x gt 0 Then the function g(t y)defined by

g(t y) = ertf(T minus t e|σ|y+(σ22minusr)t) (623)

solves the heat equation (625) with initial condition

ψ(y) = h(

e|σ|y) y isin R (624)

ie we have partg

partt(t y) = 1

2part2g

party2 (t y)

g(0 y) = h(

e|σ|y)

(625)

Proposition 68 will be proved in Section 66 It will allow us to solve theBlack-Scholes PDE (622) based on the solution of the heat equation (625)with initial condition ψ(y) = h

(e|σ|y

) y isin R by inversion of Relation (623)

with s = T minus t x = e|σ|y+(σ22minusr)t ie

f(sx) = eminus(Tminuss)rg(T minus s minus(σ

22minus r)(T minus s) + log x|σ|

)

Next we focus on the heat equation

partϕ

partt(t y) = 1

2part2ϕ

party2 (t y) (626)

which is used to model the diffusion of heat over time through solids Herethe data of g(x t) represents the temperature measured at time t and pointx We refer the reader to Widder (1975) for a complete treatment of thistopic

223

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

Fig 618 Time-dependent solution of the heat equationlowast

Proposition 69 The fundamental solution of the heat equation (626) isgiven by the Gaussian probability density function

ϕ(t y) =1radic2πt

eminusy2(2t) y isin R

with variance t gt 0

Proof The proof is done by a direct calculation as follows

partϕ

partt(t y) = part

partt

(eminusy2(2t)radic

2πt

)

= minus eminusy2(2t)

2t32radic

2π+

y2

2t2eminusy2(2t)radic

2πt

=

(minus 1

2t +y2

2t2

)ϕ(t y)

and

12part2ϕ

party2 (t y) = minus12part

party

(y

t

eminusy2(2t)radic

2πt

)

= minus eminusy2(2t)

2tradic

2πt+

y2

2t2eminusy2(2t)radic

2πt

=

(minus 1

2t +y2

2t2

)ϕ(t y) t gt 0 y isin R

lowast The animation works in Acrobat Reader on the entire pdf file

224

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

In Section 66 the heat equation (626) will be shown to be equivalent to theBlack-Scholes PDE after a change of variables In particular this will lead tothe explicit solution of the Black-Scholes PDE

Proposition 610 The heat equationpartg

partt(t y) = 1

2part2g

party2 (t y)

g(0 y) = ψ(y)

(627)

with continuous initial condition

g(0 y) = ψ(y)

has the solution

g(t y) =winfinminusinfin

ψ(z) eminus(yminusz)2(2t) dzradic2πt

y isin R t gt 0 (628)

Proof We have

partg

partt(t y) = part

partt

winfinminusinfin

ψ(z) eminus(yminusz)2(2t) dzradic2πt

=winfinminusinfin

ψ(z)part

partt

(eminus(yminusz)2(2t)radic

2πt

)dz

=12winfinminusinfin

ψ(z)

((yminus z)2

t2minus 1t

)eminus(yminusz)2(2t) dzradic

2πt

=12winfinminusinfin

ψ(z)part2

partz2 eminus(yminusz)2(2t) dzradic2πt

=12winfinminusinfin

ψ(z)part2

party2 eminus(yminusz)2(2t) dzradic2πt

=12part2

party2

winfinminusinfin

ψ(z) eminus(yminusz)2(2t) dzradic2πt

=12part2g

party2 (t y)

On the other hand it can be checked that at time t = 0 we have

limtrarr0

winfinminusinfin

ψ(z) eminus(yminusz)2(2t) dzradic2πt

= limtrarr0

winfinminusinfin

ψ(y+ z) eminusz2(2t) dzradic2πt

= ψ(y) y isin R

225

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

The next Figure 619 shows the evolution of g(tx) with initial conditionbased on the European call payoff function h(x) = (xminusK)+ ie

g(0 y) = ψ(y) = h(

e|σ|y)=(

e|σ|y minusK)+ y isin R

Fig 619 Time-dependent solution of the heat equationlowast

Let us provide a second proof of Proposition 610 this time using Brownianmotion and stochastic calculus

Proof of Proposition 610 First note that under the change of variable x =z minus y we have

g(t y) =winfinminusinfin

ψ(z) eminus(yminusz)2(2t) dzradic2πt

=winfinminusinfin

ψ(y+ x) eminusx2(2t) dxradic2πt

= IE[ψ(y+Bt)]

= IE[ψ(yminusBt)]

where (Bt)tisinR+ is a standard Brownian motion and Bt N (0 t) t isin R+Applying Itocircrsquos formula and using the fact that the expectation of the stochas-tic integral with respect to Brownian motion is zero see Relation (417) inProposition 420 we find

g(t y) = IE[ψ(yminusBt)]

= ψ(y)minus IE[w t

0ψprime(yminusBs)dBs

]+

12 IE

[w t0ψprimeprime(yminusBs)ds

]= ψ(y) +

12w t

0IE[ψprimeprime(yminusBs)

]ds

lowast The animation works in Acrobat Reader on the entire pdf file

226

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

= ψ(y) +12w t

0part2

party2 IE [ψ(yminusBs)] ds

= ψ(y) +12w t

0part2g

party2 (s y)ds

Hence we have

partg

partt(t y) = part

parttIE[ψ(yminusBt)]

=12part2

party2 IE [ψ(yminusBt)]

=12part2g

party2 (t y)

Regarding the initial condition we check that

g(0 y) = IE[ψ(yminusB0)] = IE[ψ(y)] = ψ(y)

The expression g(t y) = IE[ψ(yminusBt)] provides a probabilistic interpreta-tion of the heat diffusion phenomenon based on Brownian motion Namelywhen ψε(y) = 1[minusεε](y) we find that

gε(t y) = IE[ψε(yminusBt)]= IE[1[minusεε](yminusBt)]= P

(yminusBt isin [minusε ε]

)= P

(yminus ε 6 Bt 6 y+ ε

)represents the probability of finding Bt within a neighborhood [y minus ε y + ε]of the point y isin R

66 Solution of the Black-Scholes PDE

In this section we solve the Black-Scholes PDE by the kernel method of Sec-tion 65 and a change of variables This solution method uses the change ofvariables (623) of Proposition 68 and a time inversion from which the ter-minal condition at time T in the Black-Scholes equation becomes an initialcondition at time t = 0 in the heat equation

Next we state the proof Proposition 68

Proof Letting s = T minus t and x = e|σ|y+(σ22minusr)t and using Relation (623)ie

g(t y) = ertf(T minus t e|σ|y+(σ22minusr)t)

227

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

we have

partg

partt(t y) = r ertf

(T minus t e|σ|y+(σ22minusr)t)minus ert partf

parts

(T minus t e|σ|y+(σ22minusr)t)

+

(σ2

2 minus r)

ert e|σ|y+(σ22minusr)t partf

partx

(T minus t e|σ|y+(σ22minusr)t)

= r ertf(T minus tx)minus ert partfparts

(T minus tx) +(σ2

2 minus r)

ertxpartfpartx

(T minus tx)

=12 ertx2σ2 part

2f

partx2 (T minus tx) +σ2

2 ertxpartfpartx

(T minus tx) (629)

where on the last step we used the Black-Scholes PDE On the other handwe have

partg

party(t y) = |σ| ert e|σ|y+(σ22minusr)t partf

partx

(T minus t e|σ|y+(σ22minusr)t)

and

12partg2

party2 (t y) =σ2

2 ert e|σ|y+(σ22minusr)t partf

partx

(T minus t e|σ|y+(σ22minusr)t)

+σ2

2 ert e2|σ|y+2(σ22minusr)t part2f

partx2(T minus t e|σ|y+(σ22minusr)t)

=σ2

2 ertxpartfpartx

(T minus tx) + σ2

2 ertx2 part2f

partx2 (T minus tx) (630)

We conclude by comparing (629) with (630) which shows that g(tx) solvesthe heat equation (627) with initial condition

g(0 y) = f(T e|σ|y

)= h

(e|σ|y

)

In the next proposition we derive the Black-Scholes formula (610) by solv-ing the PDE (622) The Black-Scholes formula will also be recovered by aprobabilistic argument via the computation of an expected value in Proposi-tion 77

Proposition 611 When h(x) = (x minusK)+ the solution of the Black-Scholes PDE (622) is given by

f(tx) = xΦ(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

) x gt 0

whereΦ(x) =

1radic2π

w xminusinfin

eminusy22dy x isin R

and

228

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

d+(T minus t) =

log(xK) + (r+ σ22)(T minus t)|σ|radicT minus t

dminus(T minus t) =log(xK) + (rminus σ22)(T minus t)

|σ|radicT minus t

x gt 0 t isin [0T )

Proof By inversion of Relation (623) with s = T minus t and x = e|σ|y+(σ22minusr)twe get

f(sx) = eminus(Tminuss)rg(T minus s minus(σ

22minus r)(T minus s) + log x|σ|

)and

h(x) = ψ

(log x|σ|

) x gt 0 or ψ(y) = h

(e|σ|y

) y isin R

Hence using the solution (628) and Relation (624) we get

f(tx) = eminus(Tminust)rg(T minus t minus(σ

22minus r)(T minus t) + log x|σ|

)= eminus(Tminust)r

winfinminusinfin

ψ

(minus(σ22minus r)(T minus t) + log x

|σ|+ z

)eminusz2(2(Tminust)) dzradic

2(T minus t)π

= eminus(Tminust)rwinfinminusinfin

h(x e|σ|zminus(σ22minusr)(Tminust)) eminusz2(2(Tminust)) dzradic

2(T minus t)π

= eminus(Tminust)rwinfinminusinfin

(x e|σ|zminus(σ22minusr)(Tminust) minusK

)+ eminusz2(2(Tminust)) dzradic2(T minus t)π

= eminus(Tminust)r

timeswinfin

(minusr+σ22)(Tminust)+log(Kx)|σ|

(x e|σ|zminus(σ22minusr)(Tminust) minusK

)eminusz2(2(Tminust)) dzradic

2(T minus t)π

= x eminus(Tminust)rwinfinminusdminus(Tminust)

radicTminust

e|σ|zminus(σ22minusr)(Tminust) eminusz2(2(Tminust)) dzradic2(T minus t)π

minusK eminus(Tminust)rwinfinminusdminus(Tminust)

radicTminust

eminusz2(2(Tminust)) dzradic2(T minus t)π

= xwinfinminusdminus(Tminust)

radicTminust

e|σ|zminus(Tminust)σ22minusz2(2(Tminust)) dzradic2(T minus t)π

minusK eminus(Tminust)rwinfinminusdminus(Tminust)

radicTminust

eminusz2(2(Tminust)) dzradic2(T minus t)π

= xwinfinminusdminus(Tminust)

radicTminust

eminus(zminus(Tminust)|σ|)2(2(Tminust)) dzradic2(T minus t)π

229

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

minusK eminus(Tminust)rwinfinminusdminus(Tminust)

radicTminust

eminusz2(2(Tminust)) dzradic2(T minus t)π

= xwinfinminusdminus(Tminust)

radicTminustminus(Tminust)|σ|

eminusz2(2(Tminust)) dzradic2(T minus t)π

minusK eminus(Tminust)rwinfinminusdminus(Tminust)

radicTminust

eminusz2(2(Tminust)) dzradic2(T minus t)π

= xwinfinminusdminus(Tminust)minus|σ|

radicTminust

eminusz22 dzradic2πminusK eminus(Tminust)r

winfinminusdminus(Tminust)

eminusz22 dzradic2π

= x(1minusΦ

(minus d+(T minus t)

))minusK eminus(Tminust)r

(1minusΦ

(minus dminus(T minus t)

))= xΦ

(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)

where we used the relation (614) ie

1minusΦ(a) = Φ(minusa) a isin R

Exercises

Exercise 61 Bachelier (1900) model Consider a market made of a risklessasset valued At = A0 with zero interest rate t isin R+ and a risky asset whoseprice St is modeled by a standard Brownian motion as St = Bt t isin R+

a) Show that the price g(tBt) of the option with payoff C = B2T satisfies

the heat equationpartϕ

partt(t y) = minus1

2part2ϕ

party2 (t y)

with terminal condition g(T x) = x2b) Find the function g(tx) by solving the PDE of Question (a)

Hint Try a solution of the form g(tx) = x2 + f(t)

See Exercises 611 713 and 714 for extensions to nonzero interest rates

Exercise 62 Consider a risky asset price (St)tisinR modeled in the Cox et al(1985) (CIR) model as

dSt = β(αminus St)dt+ σradicStdBt αβσ gt 0 (631)

and let (ηt ξt)tisinR+ be a portfolio strategy whose value Vt = ηtAt + ξtSttakes the form Vt = g(tSt) t isin R+ Figure 620 presents a random simula-tion of the solution to (631) with α = 0025 β = 1 and σ = 13230

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

0

1

2

3

4

5

6

7

8

0 01 02 03 04 05 06 07 08 09 1

St

t

Fig 620 Graph of the CIR short rate t 7rarr rt with α = 25 β = 1 and σ = 13

N=10000 t lt- 0(N-1) dt lt- 10Na=0025 b=2 sigma=0052 X lt- rnorm(Nmean=0sd=sqrt(dt))R lt- rep(0N)R[1]=001

for (j in 2N)R[j]=max(0R[j-1]+(a-bR[j-1])dt+sigmasqrt(R[j-1])X[j])4 plot(t R xlab = t ylab = type = l ylim = c(0002) col = blue)

Based on the self-financing condition written as

dVt = rVtdtminus rξtStdt+ ξtdSt

= rVtdtminus rξtStdt+ β(αminus St)ξtdt+ σξtradicStdBt t isin R+ (632)

derive the PDE satisfied by the function g(tx) using the Itocirc formula

Exercise 63 Black-Scholes PDE with dividends Consider a riskless as-set with price At = A0 ert t isin R+ and an underlying asset price process(St)tisinR+ modeled as

dSt = (microminus δ)Stdt+ σStdBt

where (Bt)tisinR+ is a standard Brownian motion and δ gt 0 is a continuous-time dividend rate By absence of arbitrage the payment of a dividend entailsa drop in the stock price by the same amount occuring generally on the ex-dividend date on which the purchase of the security no longer entitles theinvestor to the dividend amount The list of investors entitled to dividendpayment is consolidated on the date of record and payment is made on thepayable date

library(quantmod)2 getSymbols(0005HKfrom=2010-01-01to=SysDate()src=yahoo)

getDividends(0005HKfrom=2010-01-01to=SysDate()src=yahoo)

a) Assuming that the portfolio with value Vt = ξtSt + ηtAt at time t is self-financing and that dividends are continuously reinvested write down theportfolio variation dVt

231

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

b) Assuming that the portfolio value Vt takes the form Vt = g(tSt) at timet derive the Black-Scholes PDE for the function g(tx) with its terminalcondition

c) Compute the price at time t isin [0T ] of the European call option withstrike price K by solving the corresponding Black-Scholes PDE

d) Compute the Delta of the option

Exercise 64

a) Check that the Black-Scholes formula (610) for European call options

gc(tx) = xΦ(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)

satisfies the following boundary conditions

i) at x = 0 gc(t 0) = 0ii) at maturity t = T

gc(T x) = (xminusK)+ =

xminusK x gt K

0 x 6 K

iii) as time to maturity tends to infinity

limTrarrinfin

Bl(Kxσ rT minus t) = x t isin R+

b) Check that the Black-Scholes formula (618) for European put options

gp(tx) = K eminus(Tminust)rΦ(minus dminus(T minus t)

)minus xΦ

(minus d+(T minus t)

)satisfies the following boundary conditions

i) at x = 0 gp(t 0) = K eminus(Tminust)rii) as x tends to infinity gp(tinfin) = 0 for all t isin [0T )iii) at maturity t = T

gp(T x) = (K minus x)+ =

0 x gt K

K minus x x 6 K

iv) as time to maturity tends to infinity

limTrarrinfin

Blp(KStσ rT minus t) = 0 t isin R+

Exercise 65 Power option (Exercise 314 continued)

232

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

a) Solve the Black-Scholes PDE

rg(x t) = partg

partt(x t) + rx

partg

partx(x t) + σ2

2 x2 part2g

partx2 (x t) (633)

with terminal condition g(xT ) = x2 x gt 0 t isin [0T ]

Hint Try a solution of the form g(x t) = x2f(t) and find f(t)b) Find the respective quantities ξt and ηt of the risky asset St and riskless

asset At = ert in the portfolio with value

Vt = g(St t) = ξtSt + ηtAt 0 6 t 6 T

hedging the contract with payoff S2T at maturity

Exercise 66 On December 18 2007 a call warrant has been issued byFortis Bank on the stock price S of the MTR Corporation with maturityT = 23122008 strike price K = HK$ 3608 and entitlement ratio=10Recall that in the Black-Scholes model the price at time t of the Europeanclaim on the underlying asset priced St with strike price K maturity T interest rate r and volatility σ gt 0 is given by the Black-Scholes formula as

f(tSt) = StΦ(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)

wheredminus(T minus t) =

(rminus σ22)(T minus t) + log(StK)

|σ|radicT minus t

d+(T minus t) = dminus(T minus t) + |σ|radicT minus t = (r+ σ22)(T minus t) + log(StK)

|σ|radicT minus t

Recall that by Proposition 64 we have

partf

partx(tSt) = Φ

(d+(T minus t)

) 0 6 t 6 T

a) Using the values of the Gaussian cumulative distribution function com-pute the Black-Scholes price of the corresponding call option at timet =November 07 2008 with St = HK$ 17200 assuming a volatility σ =90 = 090 and an annual risk-free interest rate r = 4377 = 004377

b) Still using the Gaussian cumulative distribution function compute thequantity of the risky asset required in your portfolio at time t =November07 2008 in order to hedge one such option at maturity T = 23122008

c) Figure 1 represents the Black-Scholes price of the call option as a functionof σ isin [05 15] = [50 150]

233

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

0

01

02

03

04

05

06

05 06 07 08 09 1 11 12 13 14 15σimp

Optio

n pr

ice

σ

Market price

Fig 621 Option price as a function of the volatility σ gt 0

1 BSCall lt- function(S K r T sigma)d1 lt- (log(SK)+(r+sigma^22)T)(sigmasqrt(T))d2 lt- d1 - sigma sqrt(T)

3 BSCall = Spnorm(d1) - Kexp(-rT)pnorm(d2)BSCallsigma lt- seq(0515 length=100)

5 plot(sigmaBSCall(172360800437746365sigma) type=llty=1 xlab=Sigmaylab=Black-Scholes Call Price ylim = c(006)col=bluelwd=3)grid()

abline(h=023col=redlwd=3)

Knowing that the closing price of the warrant on November 07 2008 wasHK$ 0023 which value can you infer for the implied volatility σ at thisdatelowast

Exercise 67 Forward contracts Recall that the price πt(C) of a claimpayoff C = h(ST ) of maturity T can be written as πt(C) = g(tSt) wherethe function g(tx) satisfies the Black-Scholes PDE

rg(tx) = partg

partt(tx) + rx

partg

partx(tx) + 1

2σ2x2 part

2g

partx2 (tx)

g(T x) = h(x) (1)

with terminal condition g(T x) = h(x) x gt 0

a) Assume that C is a forward contract with payoff

C = ST minusK

at time T Find the function h(x) in (1)b) Find the solution g(tx) of the above PDE and compute the price πt(C)

at time t isin [0T ]Hint search for a solution of the form g(tx) = xminus α(t) where α(t) is afunction of t to be determined

lowast Download the corresponding or the that can be runhere

234

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

BS lt- function(S K T r sig)d1 lt- (log(SK) + (r + sig^22)T) (sigsqrt(T))d2 lt- d1 - sigsqrt(T)return(Spnorm(d1) - Kexp(-rT)pnorm(d2))impliedvol lt- function(S K T r market)sig lt- 020sigup lt- 1sigdown lt- 0001count lt- 0err lt- BS(S K T r sig) - marketwhile(abs(err) gt 000001 ampamp countlt1000)if(err lt 0)sigdown lt- sigsig lt- (sigup + sig)2elsesigup lt- sigsig lt- (sigdown + sig)2err lt- BS(S K T r sig) - marketcount lt- count + 1if(count==2000)return(NA)elsereturn(sig)market = 083K = 628T = 7 365S = 634r = 002impliedvol(S K T r market)

cells [ cell_type code execution_count null metadata outputs [] source [ from IPythoncoredisplay import display HTMLn display(HTML( )) ] cell_type code execution_count null metadata collapsed true outputs [] source [ import numpy as npn import scipystats as ssn import time n n Black and Scholesn def d1(S0 K r sigma T)n return (nplog(S0K) + (r + sigma2 2) T)(sigma npsqrt(T))n n def d2(S0 K r sigma T)n return (nplog(S0 K) + (r - sigma2 2) T) (sigma npsqrt(T))n n def BlackScholes(typeS0 K r sigma T)n if type==Cn return S0 ssnormcdf(d1(S0 K r sigma T)) - K npexp(-r T) ssnormcdf(d2(S0 K r sigma T))n elsen return K npexp(-r T) ssnormcdf(-d2(S0 K r sigma T)) - S0 ssnormcdf(-d1(S0 K r sigma T)) ] cell_type code execution_count null metadata outputs [] source [ BlackScholes(C1000 1200 002 015 10) ] cell_type code execution_count null metadata outputs [] source [ def difference(x p S K r t)n return BlackScholes(CS K r x t) - p ] cell_type code execution_count null metadata outputs [] source [ from scipyoptimize import bisectn bisect(difference00011args=(11541763731112766 1000 1200 002 10)) ] ] metadata anaconda-cloud kernelspec display_name Python 3 language python name python3 language_info codemirror_mode name ipython version 3 file_extension py mimetype textx-python name python nbconvert_exporter python pygments_lexer ipython3 version 375rc1 nbformat 4 nbformat_minor 1

Black-Scholes Pricing and Hedging

c) Compute the quantityξt =

partg

partx(tSt)

of risky assets in a self-financing portfolio hedging Cd) Repeat the above questions with the terminal condition g(T x) = x

Exercise 68a) Solve the Black-Scholes PDE

rg(tx) = partg

partt(tx) + rx

partg

partx(tx) + σ2

2 x2 part2g

partx2 (tx) (634)

with terminal condition g(T x) = 1 x gt 0

Hint Try a solution of the form g(tx) = f(t) and find f(t)

b) Find the respective quantities ξt and ηt of the risky asset St and risklessasset At = ert in the portfolio with value

Vt = g(tSt) = ξtSt + ηtAt

hedging the contract with payoff $1 at maturity

Exercise 69 Log-contracts see also Exercise 84a) Solve the PDE

0 =partg

partt(x t) + rx

partg

partx(x t) + σ2

2 x2 part2g

partx2 (x t)

with the terminal condition g(xT ) = log x x gt 0

Hint Try a solution of the form g(x t) = f(t) + log x and find f(t)b) Solve the Black-Scholes PDE

rh(x t) = parth

partt(x t) + rx

parth

partx(x t) + σ2

2 x2 part2h

partx2 (x t) (635)

with the terminal condition h(xT ) = log x x gt 0

Hint Try a solution of the form h(x t) = u(t)g(x t) and find u(t)c) Find the respective quantities ξt and ηt of the risky asset St and riskless

asset At = ert in the portfolio with value

Vt = g(St t) = ξtSt + ηtAt

hedging a log-contract with payoff logST at maturity 235

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

Exercise 610 Binary options Consider a price process (St)tisinR+ given by

dStSt

= rdt+ σdBt S0 = 1

under the risk-neutral probability measure Plowast The binary (or digital) calloption is a contract with maturity T strike price K and payoff

Cd = 1[Kinfin)(ST ) =

$1 if ST gt K

0 if ST lt K

a) Derive the Black-Schole PDE satisfied by the pricing function Cd(tSt) ofthe binary call option together with its terminal condition

b) Show that the solution Cd(tx) of the Black-Scholes PDE of Question (a)is given by

Cd(tx) = eminus(Tminust)rΦ((rminus σ22)(T minus t) + log(xK)

|σ|radicT minus t

)= eminus(Tminust)rΦ

(dminus(T minus t)

)

where

dminus(T minus t) =(rminus σ22)(T minus t) + log(StK)

|σ|radicT minus t

0 6 t lt T

Exercise 611

a) Bachelier (1900) model Solve the stochastic differential equation

dSt = αStdt+ σdBt (636)

in terms of ασ isin R and the initial condition S0b) Write down the Bachelier PDE satisfied by the function C(tx) where

C(tSt) is the price at time t isin [0T ] of the contingent claim with payoffφ(ST ) = exp(ST ) and identify the process Delta (ξt)tisin[0T ] that hedgesthis claim

c) Solve the Black-Scholes PDE of Question (b) with the terminal conditionφ(x) = ex x isin R

Hint Search for a solution of the form

C(tx) = exp(minus(T minus t)r+ xh(t) +

σ2

4r (h2(t)minus 1)

) (637)

where h(t) is a function to be determined with h(T ) = 1

236

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

d) Compute the portfolio strategy (ξt ηt)tisin[0T ] that hedges the contingentclaim with payoff exp(ST )

Exercise 612

a) Show that for every fixed value of S the function

d 7minusrarr h(S d) = SΦ(d+ |σ|

radicT)minusK eminusrTΦ(d)

reaches its maximum at dlowast(S) =log(SK) + (rminus σ22)T

|σ|radicT

b) By the differentiation rule

d

dSh(S dlowast(S)) =

parth

partS(S dlowast(S)) + dprimelowast(S)

parth

partd(S dlowast(S))

recover the value of the Black-Scholes Delta

Exercise 613 Compute the Black-Scholes Vega by differentiation of theBlack-Scholes function

gc(tx) = Bl(Kxσ rT minus t) = xΦ(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)

with respect to the volatility parameter σ knowing that

minus12(dminus(T minus t)

)2= minus1

2

(log(xK) + (rminus σ22)(T minus t)

|σ|radicT minus t

)2

= minus12(d+(T minus t)

)2+ (T minus t)r+ log x

K (638)

Exercise 614 Consider the backward induction relation (313) ie

v(tx) = (1minus plowastN )v (t+ 1x(1 + aN )) + plowastN v (t+ 1x(1 + bN ))

using the renormalizations rN = rTN and

aN = (1 + rN )(1minus |σ|radicTN)minus 1 bN = (1 + rN )(1 + |σ|

radicTN)minus 1

of Section 36 N gt 1 with

plowastN =rN minus aNbN minus aN

and plowastN =bN minus rNbN minus aN

a) Show that the Black-Scholes PDE (62) of Proposition 61 can be recoveredfrom the induction relation (313) when the number N of time steps tendsto infinity

237

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

b) Show that the expression of the Delta ξt =partgcpartx

(tSt) can be similarlyrecovered from the finite difference relation (319) ie

ξ(1)t (Stminus1) =

v (t (1 + bN )Stminus1)minus v (t (1 + aN )Stminus1)

Stminus1(bN minus aN )

as N tends to infinity

Problem 615 (Leung and Sircar (2015)) ProShares Ultra SampP500 andProShares UltraShort SampP500 are leveraged investment funds that seek dailyinvestment results before fees and expenses that correspond to β times (βx)the daily performance of the SampP500reg with respectively β = 2 for ProSharesUltra and β = minus2 for ProShares UltraShort Here leveraging with a factorβ 1 aims at multiplying the potential return of an investment by a factorβ The following 10 questions are interdependent and should be treated insequence

a) Consider a risky asset priced S0 = $4 at time t = 0 and taking twopossible values S1 = $5 and S1 = $2 at time t = 1 Compute the twopossible returns (in ) achieved when investing $4 in one share of the assetS and the expected return under the risk-neutral probability measureassuming that the risk-free interest rate is zero

b) Leveraging Still based on an initial $4 investment we decide to leverageby a factor β = 3 by borrowing another (β minus 1) times $4 = 2times $4 at ratezero to purchase a total of β = 3 shares of the asset S Compute thetwo returns (in ) possibly achieved in this case and the expected returnunder the risk-neutral probability measure assuming that the risk-freeinterest rate is zero

c) Denoting by Ft the ProShares value at time t how much should the fundinvest in the underlying asset priced St and how much $ should it borrowor save on the risk-free market at any time t in order to leverage with afactor β 1

d) Find the portfolio allocation (ξt ηt) for the fund value

Ft = ξtSt + ηtAt t isin R+

according to Question (c) where At = A0 ert is the riskless money marketaccount

e) We choose to model the SampP500 index St as the geometric Brownianmotion

dSt = rStdt+ σStdBt t isin R+

under the risk-neutral probability measure Plowast Find the stochastic dif-ferential equation satisfied by (Ft)tisinR+ under the self-financing conditiondFt = ξtdSt + ηtdAt

238

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

f) Is the discounted fund value ( eminusrtFt)tisinR+ a martingale under the risk-neutral probability measure Plowast

g) Find the relation between the fund value Ft and the index St by solvingthe stochastic differential equation obtained for Ft in Question (e) Forsimplicity we normalize F0 = Sβ0

h) Write the price at time t = 0 of the call option with payoff (FT minusK)+ onthe ProShares index using the Black-Scholes formula

i) Show that when β gt 0 the Delta at time t isin [0T ) of the call optionwith payoff (FT minusK)+ on ProShares Ultra is equal to the Delta of thecall option with payoff (ST minusKβ(t))

+ on the SampP500 for a certain strikeprice Kβ(t) to be determined explicitly

j) When β lt 0 find the relation between the Delta at time t isin [0T ) ofthe call option with payoff (FT minusK)+ on ProShares UltraShort and theDelta of the put option with payoff (Kβ(t)minus ST )+ on the SampP500

239

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

  1. pbsARFix223
  2. pbsARFix224
  3. pbsARFix225
  4. pbsARFix226
  5. pbsARFix227
  6. pbsARFix228
  7. pbsARFix229
  8. pbsARFix230
  9. fdrm1
  10. pbsARFix231
  11. 100
  12. 101
  13. 102
  14. 103
  15. 104
  16. 105
  17. 106
  18. 107
  19. 108
  20. 109
  21. 1010
  22. 1011
  23. 1012
  24. 1013
  25. 1014
  26. 1015
  27. 1016
  28. 1017
  29. 1018
  30. 1019
  31. anm10
  32. 10EndLeft
  33. 10StepLeft
  34. 10PauseLeft
  35. 10PlayLeft
  36. 10PlayPauseLeft
  37. 10PauseRight
  38. 10PlayRight
  39. 10PlayPauseRight
  40. 10StepRight
  41. 10EndRight
  42. 10Minus
  43. 10Reset
  44. 10Plus
  45. pbsARFix232
  46. pbsARFix233
  47. pbsARFix234
  48. pbsARFix235
  49. pbsARFix236
  50. pbsARFix237
  51. fdrm2
  52. 110
  53. 111
  54. 112
  55. 113
  56. 114
  57. 115
  58. 116
  59. 117
  60. 118
  61. 119
  62. 1110
  63. 1111
  64. 1112
  65. 1113
  66. 1114
  67. 1115
  68. 1116
  69. 1117
  70. 1118
  71. 1119
  72. anm11
  73. 11EndLeft
  74. 11StepLeft
  75. 11PauseLeft
  76. 11PlayLeft
  77. 11PlayPauseLeft
  78. 11PauseRight
  79. 11PlayRight
  80. 11PlayPauseRight
  81. 11StepRight
  82. 11EndRight
  83. 11Minus
  84. 11Reset
  85. 11Plus
  86. pbsARFix238
  87. pbsARFix239
  88. pbsARFix240
  89. pbsARFix241
  90. pbsARFix242
  91. 120
  92. 121
  93. 122
  94. 123
  95. 124
  96. 125
  97. 126
  98. 127
  99. 128
  100. 129
  101. 1210
  102. anm12
  103. 12EndLeft
  104. 12StepLeft
  105. 12PauseLeft
  106. 12PlayLeft
  107. 12PlayPauseLeft
  108. 12PauseRight
  109. 12PlayRight
  110. 12PlayPauseRight
  111. 12StepRight
  112. 12EndRight
  113. 12Minus
  114. 12Reset
  115. 12Plus
  116. 130
  117. 131
  118. 132
  119. 133
  120. 134
  121. 135
  122. 136
  123. 137
  124. 138
  125. 139
  126. 1310
  127. anm13
  128. 13EndLeft
  129. 13StepLeft
  130. 13PauseLeft
  131. 13PlayLeft
  132. 13PlayPauseLeft
  133. 13PauseRight
  134. 13PlayRight
  135. 13PlayPauseRight
  136. 13StepRight
  137. 13EndRight
  138. 13Minus
  139. 13Reset
  140. 13Plus
  141. pbsARFix243
  142. pbsARFix244
  143. pbsARFix245
  144. pbsARFix246
  145. 140
  146. 141
  147. 142
  148. 143
  149. 144
  150. 145
  151. 146
  152. 147
  153. 148
  154. 149
  155. 1410
  156. 1411
  157. 1412
  158. 1413
  159. 1414
  160. 1415
  161. 1416
  162. 1417
  163. 1418
  164. 1419
  165. 1420
  166. 1421
  167. 1422
  168. 1423
  169. 1424
  170. 1425
  171. 1426
  172. 1427
  173. 1428
  174. 1429
  175. 1430
  176. 1431
  177. 1432
  178. 1433
  179. 1434
  180. 1435
  181. 1436
  182. 1437
  183. 1438
  184. 1439
  185. 1440
  186. 1441
  187. 1442
  188. 1443
  189. 1444
  190. 1445
  191. 1446
  192. 1447
  193. 1448
  194. 1449
  195. 1450
  196. 1451
  197. 1452
  198. 1453
  199. 1454
  200. 1455
  201. 1456
  202. 1457
  203. 1458
  204. 1459
  205. 1460
  206. 1461
  207. 1462
  208. 1463
  209. 1464
  210. 1465
  211. 1466
  212. 1467
  213. 1468
  214. 1469
  215. 1470
  216. 1471
  217. 1472
  218. 1473
  219. 1474
  220. 1475
  221. 1476
  222. 1477
  223. 1478
  224. 1479
  225. 1480
  226. 1481
  227. 1482
  228. 1483
  229. 1484
  230. 1485
  231. 1486
  232. 1487
  233. 1488
  234. 1489
  235. 1490
  236. 1491
  237. 1492
  238. 1493
  239. 1494
  240. 1495
  241. 1496
  242. 1497
  243. 1498
  244. 1499
  245. 14100
  246. 14101
  247. 14102
  248. 14103
  249. 14104
  250. 14105
  251. 14106
  252. 14107
  253. 14108
  254. 14109
  255. 14110
  256. 14111
  257. 14112
  258. 14113
  259. 14114
  260. 14115
  261. 14116
  262. 14117
  263. 14118
  264. 14119
  265. 14120
  266. 14121
  267. 14122
  268. 14123
  269. 14124
  270. 14125
  271. 14126
  272. 14127
  273. 14128
  274. 14129
  275. 14130
  276. 14131
  277. 14132
  278. 14133
  279. 14134
  280. 14135
  281. 14136
  282. 14137
  283. 14138
  284. 14139
  285. 14140
  286. 14141
  287. 14142
  288. 14143
  289. 14144
  290. 14145
  291. 14146
  292. 14147
  293. 14148
  294. 14149
  295. 14150
  296. 14151
  297. 14152
  298. 14153
  299. 14154
  300. 14155
  301. 14156
  302. 14157
  303. 14158
  304. 14159
  305. 14160
  306. 14161
  307. 14162
  308. 14163
  309. 14164
  310. 14165
  311. 14166
  312. 14167
  313. 14168
  314. 14169
  315. 14170
  316. 14171
  317. 14172
  318. 14173
  319. 14174
  320. 14175
  321. 14176
  322. 14177
  323. 14178
  324. 14179
  325. 14180
  326. 14181
  327. 14182
  328. 14183
  329. 14184
  330. 14185
  331. 14186
  332. 14187
  333. 14188
  334. 14189
  335. 14190
  336. 14191
  337. 14192
  338. 14193
  339. 14194
  340. 14195
  341. 14196
  342. 14197
  343. anm14
  344. 14EndLeft
  345. 14StepLeft
  346. 14PauseLeft
  347. 14PlayLeft
  348. 14PlayPauseLeft
  349. 14PauseRight
  350. 14PlayRight
  351. 14PlayPauseRight
  352. 14StepRight
  353. 14EndRight
  354. 14Minus
  355. 14Reset
  356. 14Plus
  357. pbsARFix247
  358. pbsARFix248
  359. 150
  360. 151
  361. 152
  362. 153
  363. 154
  364. 155
  365. 156
  366. 157
  367. 158
  368. 159
  369. 1510
  370. 1511
  371. 1512
  372. 1513
  373. 1514
  374. 1515
  375. 1516
  376. 1517
  377. 1518
  378. 1519
  379. anm15
  380. 15EndLeft
  381. 15StepLeft
  382. 15PauseLeft
  383. 15PlayLeft
  384. 15PlayPauseLeft
  385. 15PauseRight
  386. 15PlayRight
  387. 15PlayPauseRight
  388. 15StepRight
  389. 15EndRight
  390. 15Minus
  391. 15Reset
  392. 15Plus
  393. pbsARFix249
  394. pbsARFix250
  395. pbsARFix251
  396. pbsARFix252
  397. pbsARFix253
  398. pbsARFix254
  399. pbsARFix255
  400. pbsARFix256
  401. pbsARFix257
  402. pbsARFix258
  403. pbsARFix259
  404. pbsARFix260
  405. pbsARFix261
Page 16: Black-ScholesPricingandHedging - NTU · to the Black-Scholes PDE (6.2) in order to price a claim payoff Cof the formC= h(S T).Asinthediscrete-timecase,thearbitragepriceπt(C) at

N Privault

Proposition 66 Call-put parity We have the call-put parity relation

gc(tSt)minus gp(tSt) = St minusK eminus(Tminust)r 0 6 t 6 T (621)

between the Black-Scholes prices of call and put options in terms of theforward contract price St minusK eminus(Tminust)r

Proof The call-put parity (621) is a consequence of the relation

xminusK = (xminusK)+ minus (K minus x)+

satisfied by the terminal call and put payoff functions in the Black-ScholesPDE (67) It can also be verified directly from (610) and (618) as

gc(tx)minus gp(tx) = xΦ(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)minus(K eminus(Tminust)rΦ

(minus dminus(T minus t)

)minus xΦ

(minus d+(T minus t)

))= xΦ

(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)minusK eminus(Tminust)r

(1minusΦ

(dminus(T minus t)

))+ x

(1minusΦ

(d+(T minus t)

))= xminusK

The Delta of the Black-Scholes put option can be obtained by differentiationof the call-put parity relation (621) and Proposition 64

Proposition 67 The Delta of the Black-Scholes put option is given by

ξt = minus(1minusΦ(d+(T minus t)

)) = minusΦ

(minus d+(T minus t)

)isin [minus1 0] 0 6 t 6 T

Proof By the call-put parity relation (621) and Proposition 64 we have

partgppartx

(tSt) =partgcpartx

(tSt)minus 1

= Φ(d+(T minus t))minus 1= minusΦ(minusd+(T minus t)) 0 6 t 6 T

where we applied (614)

As a consequence of Proposition 67 the Black-Scholes put price splitsinto a risky component minusStΦ

(minus d+(T minus t)

)and a riskless component

K eminus(Tminust)rΦ(minus dminus(T minus t)

) as follows

gp(tSt) = K eminus(Tminust)rΦ(minus dminus(T minus t)

)︸ ︷︷ ︸riskminusfree investment (savings)

minus StΦ(minus d+(T minus t)

)︸ ︷︷ ︸

risky investment (short)

0 6 t 6 T

216

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

In Figure 613 we plot the Delta of the European put option as a function ofthe underlying asset price and of the time remaining until maturity

Payoff function (x-K)+

0

50

100

150

200

Underlying

0

5

10

15 Time to maturity T-t

-1

-075

-05

-025

0

Fig 613 Delta of a European put option with strike price K = 100 r = 3 σ = 10

Numerical example - hedging of a put option

For one more example we consider a put option issued by BNP Paribas on04 November 2008 with strike price K=$77667 maturity T = October 052009 and entitlement ratio 92593 cf page 9 In the next Figure 614 thenumber of days is counted from the origin not from maturity

40 50 60 70 80 90 100

0 50 100 150 200

0 5

10 15 20 25 30 35 40 45

Underlying (HK$)Time in days

Fig 614 Path of the Black-Scholes price for a put option on HSBC

As a consequence of Proposition 67 the amount invested on the risky assetfor the hedging of a put option is

minusStΦ(minus d+(T minus t)

)= minusStΦ

(minus log(StK) + (r+ σ22)(T minus t)

|σ|radicT minus t

)6 0

217

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

ie there is always short selling and the amount invested on the riskless assetpriced At = ert t isin [0T ] is

ηtAt = K eminus(Tminust)rΦ(minus dminus(T minus t)

)= K eminus(Tminust)rΦ

(minus log(StK) + (rminus σ22)(T minus t)

|σ|radicT minus t

)gt 0

which is always nonnegative ie we are constantly saving money on theriskless asset as noted in Figure 615

-60

-40

-20

0

20

40

60

80

100

0 50 100 150 200

K

HK$

Black-Scholes priceRisky investment ξtSt

Riskless investment ηtAtUnderlying asset price

Fig 615 Time evolution of the hedging portfolio for a put option on HSBC

In the above example the put option finished out of the money (OTM) so thatno cash settlement or physical delivery occurs A comparison of Figure 610with market data can be found in Figures 913 and 914 below

64 Market Terms and Data

The following Table 61 provides a summary of formulas for the computationof Black-Scholes sensitivities also called Greekslowast

lowast ldquoEvery class feels like attending a Greek lessonrdquo (AY2018-2019 student feedback)

218

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

Call option Put option

Option price g(tSt) StΦ(d+(T minus t))minusK eminus(Tminust)rΦ(dminus(T minus t)) K eminus(Tminust)rΦ(minusdminus(T minus t))minus StΦ(minusd+(T minus t))

Delta (∆) partg

partx(tSt) Φ(d+(T minus t)) gt 0 minusΦ(minusd+(T minus t)) 6 0

Gamma (Γ) part2g

partx2 (tSt)Φprime(d+(T minus t))St|σ|

radicT minus t

gt 0

Vega partg

partσ(tSt) St

radicT minus tΦprime(d+(T minus t)) gt 0

Theta (Θ) partg

partt(tSt) minusSt|σ|Φ

prime(d+(T minus t))2radicT minus t

minus rK eminus(Tminust)rΦ(dminus(T minus t)) 6 0 minusSt|σ|Φprime(d+(T minus t))

2radicT minus t

+ rK eminus(Tminust)rΦ(minusdminus(T minus t))

Rho (ρ) partg

partr(tSt) K(T minus t) eminus(Tminust)rΦ(dminus(T minus t)) minusK(T minus t) eminus(Tminust)rΦ(minusdminus(T minus t))

Table 61 Black-Scholes Greeks (Wikipedia)

From Table 61 we can conclude that call option prices are increasing func-tions of the underlying asset price St of the interest rate r and of the volatil-ity parameter σ Similarly put option prices are decreasing functions of theunderlying asset price St of the interest rate r and increasing functions ofthe volatility parameter σ

Parameter Variation of call option prices Variation of put option prices

Underlying St increasing decreasing

Volatility σ increasing increasing

Time t decreasing depends on the underlying price level

Interest rate r increasing decreasing

Table 62 Variations of Black-Scholes prices

The change of sign of the sensitivity Theta (Θ) with respect to time t can beverified in the following Figure 616

219

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

(a) Black-Scholes call price maps (b) Black-Scholes put price maps

Fig 616 Time-dependent solutions of the Black-Scholes PDElowast

Intrinsic value The intrinsic value at time t isin [0T ] of the option withpayoff C = h

(S(1)T

)is given by the immediate exercise payoff h

(S(1)t

) The

extrinsic value at time t isin [0T ] of the option is the remaining differenceπt(C) minus h

(S(1)t

)between the option price πt(C) and the immediate ex-

ercise payoff h(S(1)t

) In general the option price πt(C) decomposes as

πt(C) = h(S(1)t

)︸ ︷︷ ︸intrinsic value

+ πt(C)minus h(S(1)t

)︸ ︷︷ ︸

extrinsic value

0 6 t 6 T ]

Gearing The gearing at time t isin [0T ] of the option with payoff C = h(ST )is defined as the ratio

Gt =St

πt(C)=

Stg(tSt)

0 6 t 6 T

Effective gearing The effective gearing at time t isin [0T ] of the option withpayoff C = h(ST ) is defined as the ratio

Get = Gtξt

=ξtStπt(C)

=St

πt(C)

partg

partx(tSt)

=St

g(tSt)partg

partx(tSt)

= Stpart

partxlog g(tSt) 0 6 t 6 T

lowast The animation works in Acrobat Reader on the entire pdf file

220

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

The effective gearingGet =

ξtStπt(C)

can be interpreted as the hedge ratio ie the percentage of the portfoliowhich is invested on the risky asset When written as

∆g(tSt)g(tSt)

= Get times

∆StSt

the effective gearing gives the relative variation or percentage change∆g(tSt)g(tSt) of the option price g(tSt) from the relative variation∆StSt in the underlying asset price

The ratio Get = Stpart log g(tSt)partx can also be interpreted as an elasticity

coefficient

Break-even price The break-even price BEPt of the underlying asset is thevalue of S for which the intrinsic option value h(S) equals the option priceπt(C) at time t isin [0T ] For European call options it is given by

BEPt = K + πt(C) = K + g(tSt) t = 0 1 N

whereas for European put options it is given by

BEPt = K minus πt(C) = K minus g(tSt) 0 6 t 6 T

Premium The option premium OPt can be defined as the variation requiredfrom the underlying asset price in order to reach the break-even price iewe have

OPt =BEPt minus St

St=K + g(tSt)minus St

St 0 6 t 6 T

for European call options and

OPt =St minusBEPt

St=St + g(tSt)minusK

St 0 6 t 6 T

for European put options see Figure 617 below The term ldquopremiumrdquo issometimes also used to denote the arbitrage price g(tSt) of the option

221

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

f (tx σ)100

=

x =

K =

xpart log f

partx=

σ =

partf

partt(tx σ)=

T=

=(xminusK)x

∆ = = partf

partx(tx σ)

= partf

partσ(tx σ)

=K+f (txσ)minusx

x

=K+f (tx σ)

rf=

partf

partt+rxpartf

partx+

σ2 2x2part2f

partx2

Fig 617 Warrant terms and data

The R package bizdays (requires to install QuantLib) can be used to computecalendar time vs business time to maturity1 installpackages(bizdays)

library(bizdays)3 load_quantlib_calendars(HongKong from=2018-01-01 to=2018-12-31)

load_quantlib_calendars(Singapore from=2018-01-01 to=2018-12-31)5 bizdays(2018-03-10 2018-04-03 QuantLibHongKong)

bizdays(2018-03-10 2018-04-03 QuantLibSingapore)

65 The Heat Equation

In the next proposition we notice that the solution f(tx) of the Black-Scholes PDE (67) can be transformed into a solution g(t y) of the simplerheat equation by a change of variable and a time inversion t 7minusrarr T minus t onthe interval [0T ] so that the terminal condition at time T in the Black-Scholes equation (622) becomes an initial condition at time t = 0 in theheat equation (625) See also here for a related discussion on changes ofvariables for the Black-Scholes PDE

222

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

Proposition 68 Assume that f(tx) solves the Black-Scholes PDErf(tx) = partf

partt(tx) + rx

partf

partx(tx) + 1

2σ2x2 part

2f

partx2 (tx)

f(T x) = (xminusK)+(622)

with terminal condition h(x) = (xminusK)+ x gt 0 Then the function g(t y)defined by

g(t y) = ertf(T minus t e|σ|y+(σ22minusr)t) (623)

solves the heat equation (625) with initial condition

ψ(y) = h(

e|σ|y) y isin R (624)

ie we have partg

partt(t y) = 1

2part2g

party2 (t y)

g(0 y) = h(

e|σ|y)

(625)

Proposition 68 will be proved in Section 66 It will allow us to solve theBlack-Scholes PDE (622) based on the solution of the heat equation (625)with initial condition ψ(y) = h

(e|σ|y

) y isin R by inversion of Relation (623)

with s = T minus t x = e|σ|y+(σ22minusr)t ie

f(sx) = eminus(Tminuss)rg(T minus s minus(σ

22minus r)(T minus s) + log x|σ|

)

Next we focus on the heat equation

partϕ

partt(t y) = 1

2part2ϕ

party2 (t y) (626)

which is used to model the diffusion of heat over time through solids Herethe data of g(x t) represents the temperature measured at time t and pointx We refer the reader to Widder (1975) for a complete treatment of thistopic

223

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

Fig 618 Time-dependent solution of the heat equationlowast

Proposition 69 The fundamental solution of the heat equation (626) isgiven by the Gaussian probability density function

ϕ(t y) =1radic2πt

eminusy2(2t) y isin R

with variance t gt 0

Proof The proof is done by a direct calculation as follows

partϕ

partt(t y) = part

partt

(eminusy2(2t)radic

2πt

)

= minus eminusy2(2t)

2t32radic

2π+

y2

2t2eminusy2(2t)radic

2πt

=

(minus 1

2t +y2

2t2

)ϕ(t y)

and

12part2ϕ

party2 (t y) = minus12part

party

(y

t

eminusy2(2t)radic

2πt

)

= minus eminusy2(2t)

2tradic

2πt+

y2

2t2eminusy2(2t)radic

2πt

=

(minus 1

2t +y2

2t2

)ϕ(t y) t gt 0 y isin R

lowast The animation works in Acrobat Reader on the entire pdf file

224

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

In Section 66 the heat equation (626) will be shown to be equivalent to theBlack-Scholes PDE after a change of variables In particular this will lead tothe explicit solution of the Black-Scholes PDE

Proposition 610 The heat equationpartg

partt(t y) = 1

2part2g

party2 (t y)

g(0 y) = ψ(y)

(627)

with continuous initial condition

g(0 y) = ψ(y)

has the solution

g(t y) =winfinminusinfin

ψ(z) eminus(yminusz)2(2t) dzradic2πt

y isin R t gt 0 (628)

Proof We have

partg

partt(t y) = part

partt

winfinminusinfin

ψ(z) eminus(yminusz)2(2t) dzradic2πt

=winfinminusinfin

ψ(z)part

partt

(eminus(yminusz)2(2t)radic

2πt

)dz

=12winfinminusinfin

ψ(z)

((yminus z)2

t2minus 1t

)eminus(yminusz)2(2t) dzradic

2πt

=12winfinminusinfin

ψ(z)part2

partz2 eminus(yminusz)2(2t) dzradic2πt

=12winfinminusinfin

ψ(z)part2

party2 eminus(yminusz)2(2t) dzradic2πt

=12part2

party2

winfinminusinfin

ψ(z) eminus(yminusz)2(2t) dzradic2πt

=12part2g

party2 (t y)

On the other hand it can be checked that at time t = 0 we have

limtrarr0

winfinminusinfin

ψ(z) eminus(yminusz)2(2t) dzradic2πt

= limtrarr0

winfinminusinfin

ψ(y+ z) eminusz2(2t) dzradic2πt

= ψ(y) y isin R

225

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

The next Figure 619 shows the evolution of g(tx) with initial conditionbased on the European call payoff function h(x) = (xminusK)+ ie

g(0 y) = ψ(y) = h(

e|σ|y)=(

e|σ|y minusK)+ y isin R

Fig 619 Time-dependent solution of the heat equationlowast

Let us provide a second proof of Proposition 610 this time using Brownianmotion and stochastic calculus

Proof of Proposition 610 First note that under the change of variable x =z minus y we have

g(t y) =winfinminusinfin

ψ(z) eminus(yminusz)2(2t) dzradic2πt

=winfinminusinfin

ψ(y+ x) eminusx2(2t) dxradic2πt

= IE[ψ(y+Bt)]

= IE[ψ(yminusBt)]

where (Bt)tisinR+ is a standard Brownian motion and Bt N (0 t) t isin R+Applying Itocircrsquos formula and using the fact that the expectation of the stochas-tic integral with respect to Brownian motion is zero see Relation (417) inProposition 420 we find

g(t y) = IE[ψ(yminusBt)]

= ψ(y)minus IE[w t

0ψprime(yminusBs)dBs

]+

12 IE

[w t0ψprimeprime(yminusBs)ds

]= ψ(y) +

12w t

0IE[ψprimeprime(yminusBs)

]ds

lowast The animation works in Acrobat Reader on the entire pdf file

226

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

= ψ(y) +12w t

0part2

party2 IE [ψ(yminusBs)] ds

= ψ(y) +12w t

0part2g

party2 (s y)ds

Hence we have

partg

partt(t y) = part

parttIE[ψ(yminusBt)]

=12part2

party2 IE [ψ(yminusBt)]

=12part2g

party2 (t y)

Regarding the initial condition we check that

g(0 y) = IE[ψ(yminusB0)] = IE[ψ(y)] = ψ(y)

The expression g(t y) = IE[ψ(yminusBt)] provides a probabilistic interpreta-tion of the heat diffusion phenomenon based on Brownian motion Namelywhen ψε(y) = 1[minusεε](y) we find that

gε(t y) = IE[ψε(yminusBt)]= IE[1[minusεε](yminusBt)]= P

(yminusBt isin [minusε ε]

)= P

(yminus ε 6 Bt 6 y+ ε

)represents the probability of finding Bt within a neighborhood [y minus ε y + ε]of the point y isin R

66 Solution of the Black-Scholes PDE

In this section we solve the Black-Scholes PDE by the kernel method of Sec-tion 65 and a change of variables This solution method uses the change ofvariables (623) of Proposition 68 and a time inversion from which the ter-minal condition at time T in the Black-Scholes equation becomes an initialcondition at time t = 0 in the heat equation

Next we state the proof Proposition 68

Proof Letting s = T minus t and x = e|σ|y+(σ22minusr)t and using Relation (623)ie

g(t y) = ertf(T minus t e|σ|y+(σ22minusr)t)

227

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

we have

partg

partt(t y) = r ertf

(T minus t e|σ|y+(σ22minusr)t)minus ert partf

parts

(T minus t e|σ|y+(σ22minusr)t)

+

(σ2

2 minus r)

ert e|σ|y+(σ22minusr)t partf

partx

(T minus t e|σ|y+(σ22minusr)t)

= r ertf(T minus tx)minus ert partfparts

(T minus tx) +(σ2

2 minus r)

ertxpartfpartx

(T minus tx)

=12 ertx2σ2 part

2f

partx2 (T minus tx) +σ2

2 ertxpartfpartx

(T minus tx) (629)

where on the last step we used the Black-Scholes PDE On the other handwe have

partg

party(t y) = |σ| ert e|σ|y+(σ22minusr)t partf

partx

(T minus t e|σ|y+(σ22minusr)t)

and

12partg2

party2 (t y) =σ2

2 ert e|σ|y+(σ22minusr)t partf

partx

(T minus t e|σ|y+(σ22minusr)t)

+σ2

2 ert e2|σ|y+2(σ22minusr)t part2f

partx2(T minus t e|σ|y+(σ22minusr)t)

=σ2

2 ertxpartfpartx

(T minus tx) + σ2

2 ertx2 part2f

partx2 (T minus tx) (630)

We conclude by comparing (629) with (630) which shows that g(tx) solvesthe heat equation (627) with initial condition

g(0 y) = f(T e|σ|y

)= h

(e|σ|y

)

In the next proposition we derive the Black-Scholes formula (610) by solv-ing the PDE (622) The Black-Scholes formula will also be recovered by aprobabilistic argument via the computation of an expected value in Proposi-tion 77

Proposition 611 When h(x) = (x minusK)+ the solution of the Black-Scholes PDE (622) is given by

f(tx) = xΦ(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

) x gt 0

whereΦ(x) =

1radic2π

w xminusinfin

eminusy22dy x isin R

and

228

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

d+(T minus t) =

log(xK) + (r+ σ22)(T minus t)|σ|radicT minus t

dminus(T minus t) =log(xK) + (rminus σ22)(T minus t)

|σ|radicT minus t

x gt 0 t isin [0T )

Proof By inversion of Relation (623) with s = T minus t and x = e|σ|y+(σ22minusr)twe get

f(sx) = eminus(Tminuss)rg(T minus s minus(σ

22minus r)(T minus s) + log x|σ|

)and

h(x) = ψ

(log x|σ|

) x gt 0 or ψ(y) = h

(e|σ|y

) y isin R

Hence using the solution (628) and Relation (624) we get

f(tx) = eminus(Tminust)rg(T minus t minus(σ

22minus r)(T minus t) + log x|σ|

)= eminus(Tminust)r

winfinminusinfin

ψ

(minus(σ22minus r)(T minus t) + log x

|σ|+ z

)eminusz2(2(Tminust)) dzradic

2(T minus t)π

= eminus(Tminust)rwinfinminusinfin

h(x e|σ|zminus(σ22minusr)(Tminust)) eminusz2(2(Tminust)) dzradic

2(T minus t)π

= eminus(Tminust)rwinfinminusinfin

(x e|σ|zminus(σ22minusr)(Tminust) minusK

)+ eminusz2(2(Tminust)) dzradic2(T minus t)π

= eminus(Tminust)r

timeswinfin

(minusr+σ22)(Tminust)+log(Kx)|σ|

(x e|σ|zminus(σ22minusr)(Tminust) minusK

)eminusz2(2(Tminust)) dzradic

2(T minus t)π

= x eminus(Tminust)rwinfinminusdminus(Tminust)

radicTminust

e|σ|zminus(σ22minusr)(Tminust) eminusz2(2(Tminust)) dzradic2(T minus t)π

minusK eminus(Tminust)rwinfinminusdminus(Tminust)

radicTminust

eminusz2(2(Tminust)) dzradic2(T minus t)π

= xwinfinminusdminus(Tminust)

radicTminust

e|σ|zminus(Tminust)σ22minusz2(2(Tminust)) dzradic2(T minus t)π

minusK eminus(Tminust)rwinfinminusdminus(Tminust)

radicTminust

eminusz2(2(Tminust)) dzradic2(T minus t)π

= xwinfinminusdminus(Tminust)

radicTminust

eminus(zminus(Tminust)|σ|)2(2(Tminust)) dzradic2(T minus t)π

229

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

minusK eminus(Tminust)rwinfinminusdminus(Tminust)

radicTminust

eminusz2(2(Tminust)) dzradic2(T minus t)π

= xwinfinminusdminus(Tminust)

radicTminustminus(Tminust)|σ|

eminusz2(2(Tminust)) dzradic2(T minus t)π

minusK eminus(Tminust)rwinfinminusdminus(Tminust)

radicTminust

eminusz2(2(Tminust)) dzradic2(T minus t)π

= xwinfinminusdminus(Tminust)minus|σ|

radicTminust

eminusz22 dzradic2πminusK eminus(Tminust)r

winfinminusdminus(Tminust)

eminusz22 dzradic2π

= x(1minusΦ

(minus d+(T minus t)

))minusK eminus(Tminust)r

(1minusΦ

(minus dminus(T minus t)

))= xΦ

(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)

where we used the relation (614) ie

1minusΦ(a) = Φ(minusa) a isin R

Exercises

Exercise 61 Bachelier (1900) model Consider a market made of a risklessasset valued At = A0 with zero interest rate t isin R+ and a risky asset whoseprice St is modeled by a standard Brownian motion as St = Bt t isin R+

a) Show that the price g(tBt) of the option with payoff C = B2T satisfies

the heat equationpartϕ

partt(t y) = minus1

2part2ϕ

party2 (t y)

with terminal condition g(T x) = x2b) Find the function g(tx) by solving the PDE of Question (a)

Hint Try a solution of the form g(tx) = x2 + f(t)

See Exercises 611 713 and 714 for extensions to nonzero interest rates

Exercise 62 Consider a risky asset price (St)tisinR modeled in the Cox et al(1985) (CIR) model as

dSt = β(αminus St)dt+ σradicStdBt αβσ gt 0 (631)

and let (ηt ξt)tisinR+ be a portfolio strategy whose value Vt = ηtAt + ξtSttakes the form Vt = g(tSt) t isin R+ Figure 620 presents a random simula-tion of the solution to (631) with α = 0025 β = 1 and σ = 13230

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

0

1

2

3

4

5

6

7

8

0 01 02 03 04 05 06 07 08 09 1

St

t

Fig 620 Graph of the CIR short rate t 7rarr rt with α = 25 β = 1 and σ = 13

N=10000 t lt- 0(N-1) dt lt- 10Na=0025 b=2 sigma=0052 X lt- rnorm(Nmean=0sd=sqrt(dt))R lt- rep(0N)R[1]=001

for (j in 2N)R[j]=max(0R[j-1]+(a-bR[j-1])dt+sigmasqrt(R[j-1])X[j])4 plot(t R xlab = t ylab = type = l ylim = c(0002) col = blue)

Based on the self-financing condition written as

dVt = rVtdtminus rξtStdt+ ξtdSt

= rVtdtminus rξtStdt+ β(αminus St)ξtdt+ σξtradicStdBt t isin R+ (632)

derive the PDE satisfied by the function g(tx) using the Itocirc formula

Exercise 63 Black-Scholes PDE with dividends Consider a riskless as-set with price At = A0 ert t isin R+ and an underlying asset price process(St)tisinR+ modeled as

dSt = (microminus δ)Stdt+ σStdBt

where (Bt)tisinR+ is a standard Brownian motion and δ gt 0 is a continuous-time dividend rate By absence of arbitrage the payment of a dividend entailsa drop in the stock price by the same amount occuring generally on the ex-dividend date on which the purchase of the security no longer entitles theinvestor to the dividend amount The list of investors entitled to dividendpayment is consolidated on the date of record and payment is made on thepayable date

library(quantmod)2 getSymbols(0005HKfrom=2010-01-01to=SysDate()src=yahoo)

getDividends(0005HKfrom=2010-01-01to=SysDate()src=yahoo)

a) Assuming that the portfolio with value Vt = ξtSt + ηtAt at time t is self-financing and that dividends are continuously reinvested write down theportfolio variation dVt

231

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

b) Assuming that the portfolio value Vt takes the form Vt = g(tSt) at timet derive the Black-Scholes PDE for the function g(tx) with its terminalcondition

c) Compute the price at time t isin [0T ] of the European call option withstrike price K by solving the corresponding Black-Scholes PDE

d) Compute the Delta of the option

Exercise 64

a) Check that the Black-Scholes formula (610) for European call options

gc(tx) = xΦ(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)

satisfies the following boundary conditions

i) at x = 0 gc(t 0) = 0ii) at maturity t = T

gc(T x) = (xminusK)+ =

xminusK x gt K

0 x 6 K

iii) as time to maturity tends to infinity

limTrarrinfin

Bl(Kxσ rT minus t) = x t isin R+

b) Check that the Black-Scholes formula (618) for European put options

gp(tx) = K eminus(Tminust)rΦ(minus dminus(T minus t)

)minus xΦ

(minus d+(T minus t)

)satisfies the following boundary conditions

i) at x = 0 gp(t 0) = K eminus(Tminust)rii) as x tends to infinity gp(tinfin) = 0 for all t isin [0T )iii) at maturity t = T

gp(T x) = (K minus x)+ =

0 x gt K

K minus x x 6 K

iv) as time to maturity tends to infinity

limTrarrinfin

Blp(KStσ rT minus t) = 0 t isin R+

Exercise 65 Power option (Exercise 314 continued)

232

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

a) Solve the Black-Scholes PDE

rg(x t) = partg

partt(x t) + rx

partg

partx(x t) + σ2

2 x2 part2g

partx2 (x t) (633)

with terminal condition g(xT ) = x2 x gt 0 t isin [0T ]

Hint Try a solution of the form g(x t) = x2f(t) and find f(t)b) Find the respective quantities ξt and ηt of the risky asset St and riskless

asset At = ert in the portfolio with value

Vt = g(St t) = ξtSt + ηtAt 0 6 t 6 T

hedging the contract with payoff S2T at maturity

Exercise 66 On December 18 2007 a call warrant has been issued byFortis Bank on the stock price S of the MTR Corporation with maturityT = 23122008 strike price K = HK$ 3608 and entitlement ratio=10Recall that in the Black-Scholes model the price at time t of the Europeanclaim on the underlying asset priced St with strike price K maturity T interest rate r and volatility σ gt 0 is given by the Black-Scholes formula as

f(tSt) = StΦ(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)

wheredminus(T minus t) =

(rminus σ22)(T minus t) + log(StK)

|σ|radicT minus t

d+(T minus t) = dminus(T minus t) + |σ|radicT minus t = (r+ σ22)(T minus t) + log(StK)

|σ|radicT minus t

Recall that by Proposition 64 we have

partf

partx(tSt) = Φ

(d+(T minus t)

) 0 6 t 6 T

a) Using the values of the Gaussian cumulative distribution function com-pute the Black-Scholes price of the corresponding call option at timet =November 07 2008 with St = HK$ 17200 assuming a volatility σ =90 = 090 and an annual risk-free interest rate r = 4377 = 004377

b) Still using the Gaussian cumulative distribution function compute thequantity of the risky asset required in your portfolio at time t =November07 2008 in order to hedge one such option at maturity T = 23122008

c) Figure 1 represents the Black-Scholes price of the call option as a functionof σ isin [05 15] = [50 150]

233

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

0

01

02

03

04

05

06

05 06 07 08 09 1 11 12 13 14 15σimp

Optio

n pr

ice

σ

Market price

Fig 621 Option price as a function of the volatility σ gt 0

1 BSCall lt- function(S K r T sigma)d1 lt- (log(SK)+(r+sigma^22)T)(sigmasqrt(T))d2 lt- d1 - sigma sqrt(T)

3 BSCall = Spnorm(d1) - Kexp(-rT)pnorm(d2)BSCallsigma lt- seq(0515 length=100)

5 plot(sigmaBSCall(172360800437746365sigma) type=llty=1 xlab=Sigmaylab=Black-Scholes Call Price ylim = c(006)col=bluelwd=3)grid()

abline(h=023col=redlwd=3)

Knowing that the closing price of the warrant on November 07 2008 wasHK$ 0023 which value can you infer for the implied volatility σ at thisdatelowast

Exercise 67 Forward contracts Recall that the price πt(C) of a claimpayoff C = h(ST ) of maturity T can be written as πt(C) = g(tSt) wherethe function g(tx) satisfies the Black-Scholes PDE

rg(tx) = partg

partt(tx) + rx

partg

partx(tx) + 1

2σ2x2 part

2g

partx2 (tx)

g(T x) = h(x) (1)

with terminal condition g(T x) = h(x) x gt 0

a) Assume that C is a forward contract with payoff

C = ST minusK

at time T Find the function h(x) in (1)b) Find the solution g(tx) of the above PDE and compute the price πt(C)

at time t isin [0T ]Hint search for a solution of the form g(tx) = xminus α(t) where α(t) is afunction of t to be determined

lowast Download the corresponding or the that can be runhere

234

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

BS lt- function(S K T r sig)d1 lt- (log(SK) + (r + sig^22)T) (sigsqrt(T))d2 lt- d1 - sigsqrt(T)return(Spnorm(d1) - Kexp(-rT)pnorm(d2))impliedvol lt- function(S K T r market)sig lt- 020sigup lt- 1sigdown lt- 0001count lt- 0err lt- BS(S K T r sig) - marketwhile(abs(err) gt 000001 ampamp countlt1000)if(err lt 0)sigdown lt- sigsig lt- (sigup + sig)2elsesigup lt- sigsig lt- (sigdown + sig)2err lt- BS(S K T r sig) - marketcount lt- count + 1if(count==2000)return(NA)elsereturn(sig)market = 083K = 628T = 7 365S = 634r = 002impliedvol(S K T r market)

cells [ cell_type code execution_count null metadata outputs [] source [ from IPythoncoredisplay import display HTMLn display(HTML( )) ] cell_type code execution_count null metadata collapsed true outputs [] source [ import numpy as npn import scipystats as ssn import time n n Black and Scholesn def d1(S0 K r sigma T)n return (nplog(S0K) + (r + sigma2 2) T)(sigma npsqrt(T))n n def d2(S0 K r sigma T)n return (nplog(S0 K) + (r - sigma2 2) T) (sigma npsqrt(T))n n def BlackScholes(typeS0 K r sigma T)n if type==Cn return S0 ssnormcdf(d1(S0 K r sigma T)) - K npexp(-r T) ssnormcdf(d2(S0 K r sigma T))n elsen return K npexp(-r T) ssnormcdf(-d2(S0 K r sigma T)) - S0 ssnormcdf(-d1(S0 K r sigma T)) ] cell_type code execution_count null metadata outputs [] source [ BlackScholes(C1000 1200 002 015 10) ] cell_type code execution_count null metadata outputs [] source [ def difference(x p S K r t)n return BlackScholes(CS K r x t) - p ] cell_type code execution_count null metadata outputs [] source [ from scipyoptimize import bisectn bisect(difference00011args=(11541763731112766 1000 1200 002 10)) ] ] metadata anaconda-cloud kernelspec display_name Python 3 language python name python3 language_info codemirror_mode name ipython version 3 file_extension py mimetype textx-python name python nbconvert_exporter python pygments_lexer ipython3 version 375rc1 nbformat 4 nbformat_minor 1

Black-Scholes Pricing and Hedging

c) Compute the quantityξt =

partg

partx(tSt)

of risky assets in a self-financing portfolio hedging Cd) Repeat the above questions with the terminal condition g(T x) = x

Exercise 68a) Solve the Black-Scholes PDE

rg(tx) = partg

partt(tx) + rx

partg

partx(tx) + σ2

2 x2 part2g

partx2 (tx) (634)

with terminal condition g(T x) = 1 x gt 0

Hint Try a solution of the form g(tx) = f(t) and find f(t)

b) Find the respective quantities ξt and ηt of the risky asset St and risklessasset At = ert in the portfolio with value

Vt = g(tSt) = ξtSt + ηtAt

hedging the contract with payoff $1 at maturity

Exercise 69 Log-contracts see also Exercise 84a) Solve the PDE

0 =partg

partt(x t) + rx

partg

partx(x t) + σ2

2 x2 part2g

partx2 (x t)

with the terminal condition g(xT ) = log x x gt 0

Hint Try a solution of the form g(x t) = f(t) + log x and find f(t)b) Solve the Black-Scholes PDE

rh(x t) = parth

partt(x t) + rx

parth

partx(x t) + σ2

2 x2 part2h

partx2 (x t) (635)

with the terminal condition h(xT ) = log x x gt 0

Hint Try a solution of the form h(x t) = u(t)g(x t) and find u(t)c) Find the respective quantities ξt and ηt of the risky asset St and riskless

asset At = ert in the portfolio with value

Vt = g(St t) = ξtSt + ηtAt

hedging a log-contract with payoff logST at maturity 235

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

Exercise 610 Binary options Consider a price process (St)tisinR+ given by

dStSt

= rdt+ σdBt S0 = 1

under the risk-neutral probability measure Plowast The binary (or digital) calloption is a contract with maturity T strike price K and payoff

Cd = 1[Kinfin)(ST ) =

$1 if ST gt K

0 if ST lt K

a) Derive the Black-Schole PDE satisfied by the pricing function Cd(tSt) ofthe binary call option together with its terminal condition

b) Show that the solution Cd(tx) of the Black-Scholes PDE of Question (a)is given by

Cd(tx) = eminus(Tminust)rΦ((rminus σ22)(T minus t) + log(xK)

|σ|radicT minus t

)= eminus(Tminust)rΦ

(dminus(T minus t)

)

where

dminus(T minus t) =(rminus σ22)(T minus t) + log(StK)

|σ|radicT minus t

0 6 t lt T

Exercise 611

a) Bachelier (1900) model Solve the stochastic differential equation

dSt = αStdt+ σdBt (636)

in terms of ασ isin R and the initial condition S0b) Write down the Bachelier PDE satisfied by the function C(tx) where

C(tSt) is the price at time t isin [0T ] of the contingent claim with payoffφ(ST ) = exp(ST ) and identify the process Delta (ξt)tisin[0T ] that hedgesthis claim

c) Solve the Black-Scholes PDE of Question (b) with the terminal conditionφ(x) = ex x isin R

Hint Search for a solution of the form

C(tx) = exp(minus(T minus t)r+ xh(t) +

σ2

4r (h2(t)minus 1)

) (637)

where h(t) is a function to be determined with h(T ) = 1

236

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

d) Compute the portfolio strategy (ξt ηt)tisin[0T ] that hedges the contingentclaim with payoff exp(ST )

Exercise 612

a) Show that for every fixed value of S the function

d 7minusrarr h(S d) = SΦ(d+ |σ|

radicT)minusK eminusrTΦ(d)

reaches its maximum at dlowast(S) =log(SK) + (rminus σ22)T

|σ|radicT

b) By the differentiation rule

d

dSh(S dlowast(S)) =

parth

partS(S dlowast(S)) + dprimelowast(S)

parth

partd(S dlowast(S))

recover the value of the Black-Scholes Delta

Exercise 613 Compute the Black-Scholes Vega by differentiation of theBlack-Scholes function

gc(tx) = Bl(Kxσ rT minus t) = xΦ(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)

with respect to the volatility parameter σ knowing that

minus12(dminus(T minus t)

)2= minus1

2

(log(xK) + (rminus σ22)(T minus t)

|σ|radicT minus t

)2

= minus12(d+(T minus t)

)2+ (T minus t)r+ log x

K (638)

Exercise 614 Consider the backward induction relation (313) ie

v(tx) = (1minus plowastN )v (t+ 1x(1 + aN )) + plowastN v (t+ 1x(1 + bN ))

using the renormalizations rN = rTN and

aN = (1 + rN )(1minus |σ|radicTN)minus 1 bN = (1 + rN )(1 + |σ|

radicTN)minus 1

of Section 36 N gt 1 with

plowastN =rN minus aNbN minus aN

and plowastN =bN minus rNbN minus aN

a) Show that the Black-Scholes PDE (62) of Proposition 61 can be recoveredfrom the induction relation (313) when the number N of time steps tendsto infinity

237

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

b) Show that the expression of the Delta ξt =partgcpartx

(tSt) can be similarlyrecovered from the finite difference relation (319) ie

ξ(1)t (Stminus1) =

v (t (1 + bN )Stminus1)minus v (t (1 + aN )Stminus1)

Stminus1(bN minus aN )

as N tends to infinity

Problem 615 (Leung and Sircar (2015)) ProShares Ultra SampP500 andProShares UltraShort SampP500 are leveraged investment funds that seek dailyinvestment results before fees and expenses that correspond to β times (βx)the daily performance of the SampP500reg with respectively β = 2 for ProSharesUltra and β = minus2 for ProShares UltraShort Here leveraging with a factorβ 1 aims at multiplying the potential return of an investment by a factorβ The following 10 questions are interdependent and should be treated insequence

a) Consider a risky asset priced S0 = $4 at time t = 0 and taking twopossible values S1 = $5 and S1 = $2 at time t = 1 Compute the twopossible returns (in ) achieved when investing $4 in one share of the assetS and the expected return under the risk-neutral probability measureassuming that the risk-free interest rate is zero

b) Leveraging Still based on an initial $4 investment we decide to leverageby a factor β = 3 by borrowing another (β minus 1) times $4 = 2times $4 at ratezero to purchase a total of β = 3 shares of the asset S Compute thetwo returns (in ) possibly achieved in this case and the expected returnunder the risk-neutral probability measure assuming that the risk-freeinterest rate is zero

c) Denoting by Ft the ProShares value at time t how much should the fundinvest in the underlying asset priced St and how much $ should it borrowor save on the risk-free market at any time t in order to leverage with afactor β 1

d) Find the portfolio allocation (ξt ηt) for the fund value

Ft = ξtSt + ηtAt t isin R+

according to Question (c) where At = A0 ert is the riskless money marketaccount

e) We choose to model the SampP500 index St as the geometric Brownianmotion

dSt = rStdt+ σStdBt t isin R+

under the risk-neutral probability measure Plowast Find the stochastic dif-ferential equation satisfied by (Ft)tisinR+ under the self-financing conditiondFt = ξtdSt + ηtdAt

238

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

f) Is the discounted fund value ( eminusrtFt)tisinR+ a martingale under the risk-neutral probability measure Plowast

g) Find the relation between the fund value Ft and the index St by solvingthe stochastic differential equation obtained for Ft in Question (e) Forsimplicity we normalize F0 = Sβ0

h) Write the price at time t = 0 of the call option with payoff (FT minusK)+ onthe ProShares index using the Black-Scholes formula

i) Show that when β gt 0 the Delta at time t isin [0T ) of the call optionwith payoff (FT minusK)+ on ProShares Ultra is equal to the Delta of thecall option with payoff (ST minusKβ(t))

+ on the SampP500 for a certain strikeprice Kβ(t) to be determined explicitly

j) When β lt 0 find the relation between the Delta at time t isin [0T ) ofthe call option with payoff (FT minusK)+ on ProShares UltraShort and theDelta of the put option with payoff (Kβ(t)minus ST )+ on the SampP500

239

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

  1. pbsARFix223
  2. pbsARFix224
  3. pbsARFix225
  4. pbsARFix226
  5. pbsARFix227
  6. pbsARFix228
  7. pbsARFix229
  8. pbsARFix230
  9. fdrm1
  10. pbsARFix231
  11. 100
  12. 101
  13. 102
  14. 103
  15. 104
  16. 105
  17. 106
  18. 107
  19. 108
  20. 109
  21. 1010
  22. 1011
  23. 1012
  24. 1013
  25. 1014
  26. 1015
  27. 1016
  28. 1017
  29. 1018
  30. 1019
  31. anm10
  32. 10EndLeft
  33. 10StepLeft
  34. 10PauseLeft
  35. 10PlayLeft
  36. 10PlayPauseLeft
  37. 10PauseRight
  38. 10PlayRight
  39. 10PlayPauseRight
  40. 10StepRight
  41. 10EndRight
  42. 10Minus
  43. 10Reset
  44. 10Plus
  45. pbsARFix232
  46. pbsARFix233
  47. pbsARFix234
  48. pbsARFix235
  49. pbsARFix236
  50. pbsARFix237
  51. fdrm2
  52. 110
  53. 111
  54. 112
  55. 113
  56. 114
  57. 115
  58. 116
  59. 117
  60. 118
  61. 119
  62. 1110
  63. 1111
  64. 1112
  65. 1113
  66. 1114
  67. 1115
  68. 1116
  69. 1117
  70. 1118
  71. 1119
  72. anm11
  73. 11EndLeft
  74. 11StepLeft
  75. 11PauseLeft
  76. 11PlayLeft
  77. 11PlayPauseLeft
  78. 11PauseRight
  79. 11PlayRight
  80. 11PlayPauseRight
  81. 11StepRight
  82. 11EndRight
  83. 11Minus
  84. 11Reset
  85. 11Plus
  86. pbsARFix238
  87. pbsARFix239
  88. pbsARFix240
  89. pbsARFix241
  90. pbsARFix242
  91. 120
  92. 121
  93. 122
  94. 123
  95. 124
  96. 125
  97. 126
  98. 127
  99. 128
  100. 129
  101. 1210
  102. anm12
  103. 12EndLeft
  104. 12StepLeft
  105. 12PauseLeft
  106. 12PlayLeft
  107. 12PlayPauseLeft
  108. 12PauseRight
  109. 12PlayRight
  110. 12PlayPauseRight
  111. 12StepRight
  112. 12EndRight
  113. 12Minus
  114. 12Reset
  115. 12Plus
  116. 130
  117. 131
  118. 132
  119. 133
  120. 134
  121. 135
  122. 136
  123. 137
  124. 138
  125. 139
  126. 1310
  127. anm13
  128. 13EndLeft
  129. 13StepLeft
  130. 13PauseLeft
  131. 13PlayLeft
  132. 13PlayPauseLeft
  133. 13PauseRight
  134. 13PlayRight
  135. 13PlayPauseRight
  136. 13StepRight
  137. 13EndRight
  138. 13Minus
  139. 13Reset
  140. 13Plus
  141. pbsARFix243
  142. pbsARFix244
  143. pbsARFix245
  144. pbsARFix246
  145. 140
  146. 141
  147. 142
  148. 143
  149. 144
  150. 145
  151. 146
  152. 147
  153. 148
  154. 149
  155. 1410
  156. 1411
  157. 1412
  158. 1413
  159. 1414
  160. 1415
  161. 1416
  162. 1417
  163. 1418
  164. 1419
  165. 1420
  166. 1421
  167. 1422
  168. 1423
  169. 1424
  170. 1425
  171. 1426
  172. 1427
  173. 1428
  174. 1429
  175. 1430
  176. 1431
  177. 1432
  178. 1433
  179. 1434
  180. 1435
  181. 1436
  182. 1437
  183. 1438
  184. 1439
  185. 1440
  186. 1441
  187. 1442
  188. 1443
  189. 1444
  190. 1445
  191. 1446
  192. 1447
  193. 1448
  194. 1449
  195. 1450
  196. 1451
  197. 1452
  198. 1453
  199. 1454
  200. 1455
  201. 1456
  202. 1457
  203. 1458
  204. 1459
  205. 1460
  206. 1461
  207. 1462
  208. 1463
  209. 1464
  210. 1465
  211. 1466
  212. 1467
  213. 1468
  214. 1469
  215. 1470
  216. 1471
  217. 1472
  218. 1473
  219. 1474
  220. 1475
  221. 1476
  222. 1477
  223. 1478
  224. 1479
  225. 1480
  226. 1481
  227. 1482
  228. 1483
  229. 1484
  230. 1485
  231. 1486
  232. 1487
  233. 1488
  234. 1489
  235. 1490
  236. 1491
  237. 1492
  238. 1493
  239. 1494
  240. 1495
  241. 1496
  242. 1497
  243. 1498
  244. 1499
  245. 14100
  246. 14101
  247. 14102
  248. 14103
  249. 14104
  250. 14105
  251. 14106
  252. 14107
  253. 14108
  254. 14109
  255. 14110
  256. 14111
  257. 14112
  258. 14113
  259. 14114
  260. 14115
  261. 14116
  262. 14117
  263. 14118
  264. 14119
  265. 14120
  266. 14121
  267. 14122
  268. 14123
  269. 14124
  270. 14125
  271. 14126
  272. 14127
  273. 14128
  274. 14129
  275. 14130
  276. 14131
  277. 14132
  278. 14133
  279. 14134
  280. 14135
  281. 14136
  282. 14137
  283. 14138
  284. 14139
  285. 14140
  286. 14141
  287. 14142
  288. 14143
  289. 14144
  290. 14145
  291. 14146
  292. 14147
  293. 14148
  294. 14149
  295. 14150
  296. 14151
  297. 14152
  298. 14153
  299. 14154
  300. 14155
  301. 14156
  302. 14157
  303. 14158
  304. 14159
  305. 14160
  306. 14161
  307. 14162
  308. 14163
  309. 14164
  310. 14165
  311. 14166
  312. 14167
  313. 14168
  314. 14169
  315. 14170
  316. 14171
  317. 14172
  318. 14173
  319. 14174
  320. 14175
  321. 14176
  322. 14177
  323. 14178
  324. 14179
  325. 14180
  326. 14181
  327. 14182
  328. 14183
  329. 14184
  330. 14185
  331. 14186
  332. 14187
  333. 14188
  334. 14189
  335. 14190
  336. 14191
  337. 14192
  338. 14193
  339. 14194
  340. 14195
  341. 14196
  342. 14197
  343. anm14
  344. 14EndLeft
  345. 14StepLeft
  346. 14PauseLeft
  347. 14PlayLeft
  348. 14PlayPauseLeft
  349. 14PauseRight
  350. 14PlayRight
  351. 14PlayPauseRight
  352. 14StepRight
  353. 14EndRight
  354. 14Minus
  355. 14Reset
  356. 14Plus
  357. pbsARFix247
  358. pbsARFix248
  359. 150
  360. 151
  361. 152
  362. 153
  363. 154
  364. 155
  365. 156
  366. 157
  367. 158
  368. 159
  369. 1510
  370. 1511
  371. 1512
  372. 1513
  373. 1514
  374. 1515
  375. 1516
  376. 1517
  377. 1518
  378. 1519
  379. anm15
  380. 15EndLeft
  381. 15StepLeft
  382. 15PauseLeft
  383. 15PlayLeft
  384. 15PlayPauseLeft
  385. 15PauseRight
  386. 15PlayRight
  387. 15PlayPauseRight
  388. 15StepRight
  389. 15EndRight
  390. 15Minus
  391. 15Reset
  392. 15Plus
  393. pbsARFix249
  394. pbsARFix250
  395. pbsARFix251
  396. pbsARFix252
  397. pbsARFix253
  398. pbsARFix254
  399. pbsARFix255
  400. pbsARFix256
  401. pbsARFix257
  402. pbsARFix258
  403. pbsARFix259
  404. pbsARFix260
  405. pbsARFix261
Page 17: Black-ScholesPricingandHedging - NTU · to the Black-Scholes PDE (6.2) in order to price a claim payoff Cof the formC= h(S T).Asinthediscrete-timecase,thearbitragepriceπt(C) at

Black-Scholes Pricing and Hedging

In Figure 613 we plot the Delta of the European put option as a function ofthe underlying asset price and of the time remaining until maturity

Payoff function (x-K)+

0

50

100

150

200

Underlying

0

5

10

15 Time to maturity T-t

-1

-075

-05

-025

0

Fig 613 Delta of a European put option with strike price K = 100 r = 3 σ = 10

Numerical example - hedging of a put option

For one more example we consider a put option issued by BNP Paribas on04 November 2008 with strike price K=$77667 maturity T = October 052009 and entitlement ratio 92593 cf page 9 In the next Figure 614 thenumber of days is counted from the origin not from maturity

40 50 60 70 80 90 100

0 50 100 150 200

0 5

10 15 20 25 30 35 40 45

Underlying (HK$)Time in days

Fig 614 Path of the Black-Scholes price for a put option on HSBC

As a consequence of Proposition 67 the amount invested on the risky assetfor the hedging of a put option is

minusStΦ(minus d+(T minus t)

)= minusStΦ

(minus log(StK) + (r+ σ22)(T minus t)

|σ|radicT minus t

)6 0

217

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

ie there is always short selling and the amount invested on the riskless assetpriced At = ert t isin [0T ] is

ηtAt = K eminus(Tminust)rΦ(minus dminus(T minus t)

)= K eminus(Tminust)rΦ

(minus log(StK) + (rminus σ22)(T minus t)

|σ|radicT minus t

)gt 0

which is always nonnegative ie we are constantly saving money on theriskless asset as noted in Figure 615

-60

-40

-20

0

20

40

60

80

100

0 50 100 150 200

K

HK$

Black-Scholes priceRisky investment ξtSt

Riskless investment ηtAtUnderlying asset price

Fig 615 Time evolution of the hedging portfolio for a put option on HSBC

In the above example the put option finished out of the money (OTM) so thatno cash settlement or physical delivery occurs A comparison of Figure 610with market data can be found in Figures 913 and 914 below

64 Market Terms and Data

The following Table 61 provides a summary of formulas for the computationof Black-Scholes sensitivities also called Greekslowast

lowast ldquoEvery class feels like attending a Greek lessonrdquo (AY2018-2019 student feedback)

218

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

Call option Put option

Option price g(tSt) StΦ(d+(T minus t))minusK eminus(Tminust)rΦ(dminus(T minus t)) K eminus(Tminust)rΦ(minusdminus(T minus t))minus StΦ(minusd+(T minus t))

Delta (∆) partg

partx(tSt) Φ(d+(T minus t)) gt 0 minusΦ(minusd+(T minus t)) 6 0

Gamma (Γ) part2g

partx2 (tSt)Φprime(d+(T minus t))St|σ|

radicT minus t

gt 0

Vega partg

partσ(tSt) St

radicT minus tΦprime(d+(T minus t)) gt 0

Theta (Θ) partg

partt(tSt) minusSt|σ|Φ

prime(d+(T minus t))2radicT minus t

minus rK eminus(Tminust)rΦ(dminus(T minus t)) 6 0 minusSt|σ|Φprime(d+(T minus t))

2radicT minus t

+ rK eminus(Tminust)rΦ(minusdminus(T minus t))

Rho (ρ) partg

partr(tSt) K(T minus t) eminus(Tminust)rΦ(dminus(T minus t)) minusK(T minus t) eminus(Tminust)rΦ(minusdminus(T minus t))

Table 61 Black-Scholes Greeks (Wikipedia)

From Table 61 we can conclude that call option prices are increasing func-tions of the underlying asset price St of the interest rate r and of the volatil-ity parameter σ Similarly put option prices are decreasing functions of theunderlying asset price St of the interest rate r and increasing functions ofthe volatility parameter σ

Parameter Variation of call option prices Variation of put option prices

Underlying St increasing decreasing

Volatility σ increasing increasing

Time t decreasing depends on the underlying price level

Interest rate r increasing decreasing

Table 62 Variations of Black-Scholes prices

The change of sign of the sensitivity Theta (Θ) with respect to time t can beverified in the following Figure 616

219

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

(a) Black-Scholes call price maps (b) Black-Scholes put price maps

Fig 616 Time-dependent solutions of the Black-Scholes PDElowast

Intrinsic value The intrinsic value at time t isin [0T ] of the option withpayoff C = h

(S(1)T

)is given by the immediate exercise payoff h

(S(1)t

) The

extrinsic value at time t isin [0T ] of the option is the remaining differenceπt(C) minus h

(S(1)t

)between the option price πt(C) and the immediate ex-

ercise payoff h(S(1)t

) In general the option price πt(C) decomposes as

πt(C) = h(S(1)t

)︸ ︷︷ ︸intrinsic value

+ πt(C)minus h(S(1)t

)︸ ︷︷ ︸

extrinsic value

0 6 t 6 T ]

Gearing The gearing at time t isin [0T ] of the option with payoff C = h(ST )is defined as the ratio

Gt =St

πt(C)=

Stg(tSt)

0 6 t 6 T

Effective gearing The effective gearing at time t isin [0T ] of the option withpayoff C = h(ST ) is defined as the ratio

Get = Gtξt

=ξtStπt(C)

=St

πt(C)

partg

partx(tSt)

=St

g(tSt)partg

partx(tSt)

= Stpart

partxlog g(tSt) 0 6 t 6 T

lowast The animation works in Acrobat Reader on the entire pdf file

220

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

The effective gearingGet =

ξtStπt(C)

can be interpreted as the hedge ratio ie the percentage of the portfoliowhich is invested on the risky asset When written as

∆g(tSt)g(tSt)

= Get times

∆StSt

the effective gearing gives the relative variation or percentage change∆g(tSt)g(tSt) of the option price g(tSt) from the relative variation∆StSt in the underlying asset price

The ratio Get = Stpart log g(tSt)partx can also be interpreted as an elasticity

coefficient

Break-even price The break-even price BEPt of the underlying asset is thevalue of S for which the intrinsic option value h(S) equals the option priceπt(C) at time t isin [0T ] For European call options it is given by

BEPt = K + πt(C) = K + g(tSt) t = 0 1 N

whereas for European put options it is given by

BEPt = K minus πt(C) = K minus g(tSt) 0 6 t 6 T

Premium The option premium OPt can be defined as the variation requiredfrom the underlying asset price in order to reach the break-even price iewe have

OPt =BEPt minus St

St=K + g(tSt)minus St

St 0 6 t 6 T

for European call options and

OPt =St minusBEPt

St=St + g(tSt)minusK

St 0 6 t 6 T

for European put options see Figure 617 below The term ldquopremiumrdquo issometimes also used to denote the arbitrage price g(tSt) of the option

221

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

f (tx σ)100

=

x =

K =

xpart log f

partx=

σ =

partf

partt(tx σ)=

T=

=(xminusK)x

∆ = = partf

partx(tx σ)

= partf

partσ(tx σ)

=K+f (txσ)minusx

x

=K+f (tx σ)

rf=

partf

partt+rxpartf

partx+

σ2 2x2part2f

partx2

Fig 617 Warrant terms and data

The R package bizdays (requires to install QuantLib) can be used to computecalendar time vs business time to maturity1 installpackages(bizdays)

library(bizdays)3 load_quantlib_calendars(HongKong from=2018-01-01 to=2018-12-31)

load_quantlib_calendars(Singapore from=2018-01-01 to=2018-12-31)5 bizdays(2018-03-10 2018-04-03 QuantLibHongKong)

bizdays(2018-03-10 2018-04-03 QuantLibSingapore)

65 The Heat Equation

In the next proposition we notice that the solution f(tx) of the Black-Scholes PDE (67) can be transformed into a solution g(t y) of the simplerheat equation by a change of variable and a time inversion t 7minusrarr T minus t onthe interval [0T ] so that the terminal condition at time T in the Black-Scholes equation (622) becomes an initial condition at time t = 0 in theheat equation (625) See also here for a related discussion on changes ofvariables for the Black-Scholes PDE

222

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

Proposition 68 Assume that f(tx) solves the Black-Scholes PDErf(tx) = partf

partt(tx) + rx

partf

partx(tx) + 1

2σ2x2 part

2f

partx2 (tx)

f(T x) = (xminusK)+(622)

with terminal condition h(x) = (xminusK)+ x gt 0 Then the function g(t y)defined by

g(t y) = ertf(T minus t e|σ|y+(σ22minusr)t) (623)

solves the heat equation (625) with initial condition

ψ(y) = h(

e|σ|y) y isin R (624)

ie we have partg

partt(t y) = 1

2part2g

party2 (t y)

g(0 y) = h(

e|σ|y)

(625)

Proposition 68 will be proved in Section 66 It will allow us to solve theBlack-Scholes PDE (622) based on the solution of the heat equation (625)with initial condition ψ(y) = h

(e|σ|y

) y isin R by inversion of Relation (623)

with s = T minus t x = e|σ|y+(σ22minusr)t ie

f(sx) = eminus(Tminuss)rg(T minus s minus(σ

22minus r)(T minus s) + log x|σ|

)

Next we focus on the heat equation

partϕ

partt(t y) = 1

2part2ϕ

party2 (t y) (626)

which is used to model the diffusion of heat over time through solids Herethe data of g(x t) represents the temperature measured at time t and pointx We refer the reader to Widder (1975) for a complete treatment of thistopic

223

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

Fig 618 Time-dependent solution of the heat equationlowast

Proposition 69 The fundamental solution of the heat equation (626) isgiven by the Gaussian probability density function

ϕ(t y) =1radic2πt

eminusy2(2t) y isin R

with variance t gt 0

Proof The proof is done by a direct calculation as follows

partϕ

partt(t y) = part

partt

(eminusy2(2t)radic

2πt

)

= minus eminusy2(2t)

2t32radic

2π+

y2

2t2eminusy2(2t)radic

2πt

=

(minus 1

2t +y2

2t2

)ϕ(t y)

and

12part2ϕ

party2 (t y) = minus12part

party

(y

t

eminusy2(2t)radic

2πt

)

= minus eminusy2(2t)

2tradic

2πt+

y2

2t2eminusy2(2t)radic

2πt

=

(minus 1

2t +y2

2t2

)ϕ(t y) t gt 0 y isin R

lowast The animation works in Acrobat Reader on the entire pdf file

224

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

In Section 66 the heat equation (626) will be shown to be equivalent to theBlack-Scholes PDE after a change of variables In particular this will lead tothe explicit solution of the Black-Scholes PDE

Proposition 610 The heat equationpartg

partt(t y) = 1

2part2g

party2 (t y)

g(0 y) = ψ(y)

(627)

with continuous initial condition

g(0 y) = ψ(y)

has the solution

g(t y) =winfinminusinfin

ψ(z) eminus(yminusz)2(2t) dzradic2πt

y isin R t gt 0 (628)

Proof We have

partg

partt(t y) = part

partt

winfinminusinfin

ψ(z) eminus(yminusz)2(2t) dzradic2πt

=winfinminusinfin

ψ(z)part

partt

(eminus(yminusz)2(2t)radic

2πt

)dz

=12winfinminusinfin

ψ(z)

((yminus z)2

t2minus 1t

)eminus(yminusz)2(2t) dzradic

2πt

=12winfinminusinfin

ψ(z)part2

partz2 eminus(yminusz)2(2t) dzradic2πt

=12winfinminusinfin

ψ(z)part2

party2 eminus(yminusz)2(2t) dzradic2πt

=12part2

party2

winfinminusinfin

ψ(z) eminus(yminusz)2(2t) dzradic2πt

=12part2g

party2 (t y)

On the other hand it can be checked that at time t = 0 we have

limtrarr0

winfinminusinfin

ψ(z) eminus(yminusz)2(2t) dzradic2πt

= limtrarr0

winfinminusinfin

ψ(y+ z) eminusz2(2t) dzradic2πt

= ψ(y) y isin R

225

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

The next Figure 619 shows the evolution of g(tx) with initial conditionbased on the European call payoff function h(x) = (xminusK)+ ie

g(0 y) = ψ(y) = h(

e|σ|y)=(

e|σ|y minusK)+ y isin R

Fig 619 Time-dependent solution of the heat equationlowast

Let us provide a second proof of Proposition 610 this time using Brownianmotion and stochastic calculus

Proof of Proposition 610 First note that under the change of variable x =z minus y we have

g(t y) =winfinminusinfin

ψ(z) eminus(yminusz)2(2t) dzradic2πt

=winfinminusinfin

ψ(y+ x) eminusx2(2t) dxradic2πt

= IE[ψ(y+Bt)]

= IE[ψ(yminusBt)]

where (Bt)tisinR+ is a standard Brownian motion and Bt N (0 t) t isin R+Applying Itocircrsquos formula and using the fact that the expectation of the stochas-tic integral with respect to Brownian motion is zero see Relation (417) inProposition 420 we find

g(t y) = IE[ψ(yminusBt)]

= ψ(y)minus IE[w t

0ψprime(yminusBs)dBs

]+

12 IE

[w t0ψprimeprime(yminusBs)ds

]= ψ(y) +

12w t

0IE[ψprimeprime(yminusBs)

]ds

lowast The animation works in Acrobat Reader on the entire pdf file

226

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

= ψ(y) +12w t

0part2

party2 IE [ψ(yminusBs)] ds

= ψ(y) +12w t

0part2g

party2 (s y)ds

Hence we have

partg

partt(t y) = part

parttIE[ψ(yminusBt)]

=12part2

party2 IE [ψ(yminusBt)]

=12part2g

party2 (t y)

Regarding the initial condition we check that

g(0 y) = IE[ψ(yminusB0)] = IE[ψ(y)] = ψ(y)

The expression g(t y) = IE[ψ(yminusBt)] provides a probabilistic interpreta-tion of the heat diffusion phenomenon based on Brownian motion Namelywhen ψε(y) = 1[minusεε](y) we find that

gε(t y) = IE[ψε(yminusBt)]= IE[1[minusεε](yminusBt)]= P

(yminusBt isin [minusε ε]

)= P

(yminus ε 6 Bt 6 y+ ε

)represents the probability of finding Bt within a neighborhood [y minus ε y + ε]of the point y isin R

66 Solution of the Black-Scholes PDE

In this section we solve the Black-Scholes PDE by the kernel method of Sec-tion 65 and a change of variables This solution method uses the change ofvariables (623) of Proposition 68 and a time inversion from which the ter-minal condition at time T in the Black-Scholes equation becomes an initialcondition at time t = 0 in the heat equation

Next we state the proof Proposition 68

Proof Letting s = T minus t and x = e|σ|y+(σ22minusr)t and using Relation (623)ie

g(t y) = ertf(T minus t e|σ|y+(σ22minusr)t)

227

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

we have

partg

partt(t y) = r ertf

(T minus t e|σ|y+(σ22minusr)t)minus ert partf

parts

(T minus t e|σ|y+(σ22minusr)t)

+

(σ2

2 minus r)

ert e|σ|y+(σ22minusr)t partf

partx

(T minus t e|σ|y+(σ22minusr)t)

= r ertf(T minus tx)minus ert partfparts

(T minus tx) +(σ2

2 minus r)

ertxpartfpartx

(T minus tx)

=12 ertx2σ2 part

2f

partx2 (T minus tx) +σ2

2 ertxpartfpartx

(T minus tx) (629)

where on the last step we used the Black-Scholes PDE On the other handwe have

partg

party(t y) = |σ| ert e|σ|y+(σ22minusr)t partf

partx

(T minus t e|σ|y+(σ22minusr)t)

and

12partg2

party2 (t y) =σ2

2 ert e|σ|y+(σ22minusr)t partf

partx

(T minus t e|σ|y+(σ22minusr)t)

+σ2

2 ert e2|σ|y+2(σ22minusr)t part2f

partx2(T minus t e|σ|y+(σ22minusr)t)

=σ2

2 ertxpartfpartx

(T minus tx) + σ2

2 ertx2 part2f

partx2 (T minus tx) (630)

We conclude by comparing (629) with (630) which shows that g(tx) solvesthe heat equation (627) with initial condition

g(0 y) = f(T e|σ|y

)= h

(e|σ|y

)

In the next proposition we derive the Black-Scholes formula (610) by solv-ing the PDE (622) The Black-Scholes formula will also be recovered by aprobabilistic argument via the computation of an expected value in Proposi-tion 77

Proposition 611 When h(x) = (x minusK)+ the solution of the Black-Scholes PDE (622) is given by

f(tx) = xΦ(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

) x gt 0

whereΦ(x) =

1radic2π

w xminusinfin

eminusy22dy x isin R

and

228

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

d+(T minus t) =

log(xK) + (r+ σ22)(T minus t)|σ|radicT minus t

dminus(T minus t) =log(xK) + (rminus σ22)(T minus t)

|σ|radicT minus t

x gt 0 t isin [0T )

Proof By inversion of Relation (623) with s = T minus t and x = e|σ|y+(σ22minusr)twe get

f(sx) = eminus(Tminuss)rg(T minus s minus(σ

22minus r)(T minus s) + log x|σ|

)and

h(x) = ψ

(log x|σ|

) x gt 0 or ψ(y) = h

(e|σ|y

) y isin R

Hence using the solution (628) and Relation (624) we get

f(tx) = eminus(Tminust)rg(T minus t minus(σ

22minus r)(T minus t) + log x|σ|

)= eminus(Tminust)r

winfinminusinfin

ψ

(minus(σ22minus r)(T minus t) + log x

|σ|+ z

)eminusz2(2(Tminust)) dzradic

2(T minus t)π

= eminus(Tminust)rwinfinminusinfin

h(x e|σ|zminus(σ22minusr)(Tminust)) eminusz2(2(Tminust)) dzradic

2(T minus t)π

= eminus(Tminust)rwinfinminusinfin

(x e|σ|zminus(σ22minusr)(Tminust) minusK

)+ eminusz2(2(Tminust)) dzradic2(T minus t)π

= eminus(Tminust)r

timeswinfin

(minusr+σ22)(Tminust)+log(Kx)|σ|

(x e|σ|zminus(σ22minusr)(Tminust) minusK

)eminusz2(2(Tminust)) dzradic

2(T minus t)π

= x eminus(Tminust)rwinfinminusdminus(Tminust)

radicTminust

e|σ|zminus(σ22minusr)(Tminust) eminusz2(2(Tminust)) dzradic2(T minus t)π

minusK eminus(Tminust)rwinfinminusdminus(Tminust)

radicTminust

eminusz2(2(Tminust)) dzradic2(T minus t)π

= xwinfinminusdminus(Tminust)

radicTminust

e|σ|zminus(Tminust)σ22minusz2(2(Tminust)) dzradic2(T minus t)π

minusK eminus(Tminust)rwinfinminusdminus(Tminust)

radicTminust

eminusz2(2(Tminust)) dzradic2(T minus t)π

= xwinfinminusdminus(Tminust)

radicTminust

eminus(zminus(Tminust)|σ|)2(2(Tminust)) dzradic2(T minus t)π

229

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

minusK eminus(Tminust)rwinfinminusdminus(Tminust)

radicTminust

eminusz2(2(Tminust)) dzradic2(T minus t)π

= xwinfinminusdminus(Tminust)

radicTminustminus(Tminust)|σ|

eminusz2(2(Tminust)) dzradic2(T minus t)π

minusK eminus(Tminust)rwinfinminusdminus(Tminust)

radicTminust

eminusz2(2(Tminust)) dzradic2(T minus t)π

= xwinfinminusdminus(Tminust)minus|σ|

radicTminust

eminusz22 dzradic2πminusK eminus(Tminust)r

winfinminusdminus(Tminust)

eminusz22 dzradic2π

= x(1minusΦ

(minus d+(T minus t)

))minusK eminus(Tminust)r

(1minusΦ

(minus dminus(T minus t)

))= xΦ

(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)

where we used the relation (614) ie

1minusΦ(a) = Φ(minusa) a isin R

Exercises

Exercise 61 Bachelier (1900) model Consider a market made of a risklessasset valued At = A0 with zero interest rate t isin R+ and a risky asset whoseprice St is modeled by a standard Brownian motion as St = Bt t isin R+

a) Show that the price g(tBt) of the option with payoff C = B2T satisfies

the heat equationpartϕ

partt(t y) = minus1

2part2ϕ

party2 (t y)

with terminal condition g(T x) = x2b) Find the function g(tx) by solving the PDE of Question (a)

Hint Try a solution of the form g(tx) = x2 + f(t)

See Exercises 611 713 and 714 for extensions to nonzero interest rates

Exercise 62 Consider a risky asset price (St)tisinR modeled in the Cox et al(1985) (CIR) model as

dSt = β(αminus St)dt+ σradicStdBt αβσ gt 0 (631)

and let (ηt ξt)tisinR+ be a portfolio strategy whose value Vt = ηtAt + ξtSttakes the form Vt = g(tSt) t isin R+ Figure 620 presents a random simula-tion of the solution to (631) with α = 0025 β = 1 and σ = 13230

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

0

1

2

3

4

5

6

7

8

0 01 02 03 04 05 06 07 08 09 1

St

t

Fig 620 Graph of the CIR short rate t 7rarr rt with α = 25 β = 1 and σ = 13

N=10000 t lt- 0(N-1) dt lt- 10Na=0025 b=2 sigma=0052 X lt- rnorm(Nmean=0sd=sqrt(dt))R lt- rep(0N)R[1]=001

for (j in 2N)R[j]=max(0R[j-1]+(a-bR[j-1])dt+sigmasqrt(R[j-1])X[j])4 plot(t R xlab = t ylab = type = l ylim = c(0002) col = blue)

Based on the self-financing condition written as

dVt = rVtdtminus rξtStdt+ ξtdSt

= rVtdtminus rξtStdt+ β(αminus St)ξtdt+ σξtradicStdBt t isin R+ (632)

derive the PDE satisfied by the function g(tx) using the Itocirc formula

Exercise 63 Black-Scholes PDE with dividends Consider a riskless as-set with price At = A0 ert t isin R+ and an underlying asset price process(St)tisinR+ modeled as

dSt = (microminus δ)Stdt+ σStdBt

where (Bt)tisinR+ is a standard Brownian motion and δ gt 0 is a continuous-time dividend rate By absence of arbitrage the payment of a dividend entailsa drop in the stock price by the same amount occuring generally on the ex-dividend date on which the purchase of the security no longer entitles theinvestor to the dividend amount The list of investors entitled to dividendpayment is consolidated on the date of record and payment is made on thepayable date

library(quantmod)2 getSymbols(0005HKfrom=2010-01-01to=SysDate()src=yahoo)

getDividends(0005HKfrom=2010-01-01to=SysDate()src=yahoo)

a) Assuming that the portfolio with value Vt = ξtSt + ηtAt at time t is self-financing and that dividends are continuously reinvested write down theportfolio variation dVt

231

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

b) Assuming that the portfolio value Vt takes the form Vt = g(tSt) at timet derive the Black-Scholes PDE for the function g(tx) with its terminalcondition

c) Compute the price at time t isin [0T ] of the European call option withstrike price K by solving the corresponding Black-Scholes PDE

d) Compute the Delta of the option

Exercise 64

a) Check that the Black-Scholes formula (610) for European call options

gc(tx) = xΦ(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)

satisfies the following boundary conditions

i) at x = 0 gc(t 0) = 0ii) at maturity t = T

gc(T x) = (xminusK)+ =

xminusK x gt K

0 x 6 K

iii) as time to maturity tends to infinity

limTrarrinfin

Bl(Kxσ rT minus t) = x t isin R+

b) Check that the Black-Scholes formula (618) for European put options

gp(tx) = K eminus(Tminust)rΦ(minus dminus(T minus t)

)minus xΦ

(minus d+(T minus t)

)satisfies the following boundary conditions

i) at x = 0 gp(t 0) = K eminus(Tminust)rii) as x tends to infinity gp(tinfin) = 0 for all t isin [0T )iii) at maturity t = T

gp(T x) = (K minus x)+ =

0 x gt K

K minus x x 6 K

iv) as time to maturity tends to infinity

limTrarrinfin

Blp(KStσ rT minus t) = 0 t isin R+

Exercise 65 Power option (Exercise 314 continued)

232

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

a) Solve the Black-Scholes PDE

rg(x t) = partg

partt(x t) + rx

partg

partx(x t) + σ2

2 x2 part2g

partx2 (x t) (633)

with terminal condition g(xT ) = x2 x gt 0 t isin [0T ]

Hint Try a solution of the form g(x t) = x2f(t) and find f(t)b) Find the respective quantities ξt and ηt of the risky asset St and riskless

asset At = ert in the portfolio with value

Vt = g(St t) = ξtSt + ηtAt 0 6 t 6 T

hedging the contract with payoff S2T at maturity

Exercise 66 On December 18 2007 a call warrant has been issued byFortis Bank on the stock price S of the MTR Corporation with maturityT = 23122008 strike price K = HK$ 3608 and entitlement ratio=10Recall that in the Black-Scholes model the price at time t of the Europeanclaim on the underlying asset priced St with strike price K maturity T interest rate r and volatility σ gt 0 is given by the Black-Scholes formula as

f(tSt) = StΦ(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)

wheredminus(T minus t) =

(rminus σ22)(T minus t) + log(StK)

|σ|radicT minus t

d+(T minus t) = dminus(T minus t) + |σ|radicT minus t = (r+ σ22)(T minus t) + log(StK)

|σ|radicT minus t

Recall that by Proposition 64 we have

partf

partx(tSt) = Φ

(d+(T minus t)

) 0 6 t 6 T

a) Using the values of the Gaussian cumulative distribution function com-pute the Black-Scholes price of the corresponding call option at timet =November 07 2008 with St = HK$ 17200 assuming a volatility σ =90 = 090 and an annual risk-free interest rate r = 4377 = 004377

b) Still using the Gaussian cumulative distribution function compute thequantity of the risky asset required in your portfolio at time t =November07 2008 in order to hedge one such option at maturity T = 23122008

c) Figure 1 represents the Black-Scholes price of the call option as a functionof σ isin [05 15] = [50 150]

233

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

0

01

02

03

04

05

06

05 06 07 08 09 1 11 12 13 14 15σimp

Optio

n pr

ice

σ

Market price

Fig 621 Option price as a function of the volatility σ gt 0

1 BSCall lt- function(S K r T sigma)d1 lt- (log(SK)+(r+sigma^22)T)(sigmasqrt(T))d2 lt- d1 - sigma sqrt(T)

3 BSCall = Spnorm(d1) - Kexp(-rT)pnorm(d2)BSCallsigma lt- seq(0515 length=100)

5 plot(sigmaBSCall(172360800437746365sigma) type=llty=1 xlab=Sigmaylab=Black-Scholes Call Price ylim = c(006)col=bluelwd=3)grid()

abline(h=023col=redlwd=3)

Knowing that the closing price of the warrant on November 07 2008 wasHK$ 0023 which value can you infer for the implied volatility σ at thisdatelowast

Exercise 67 Forward contracts Recall that the price πt(C) of a claimpayoff C = h(ST ) of maturity T can be written as πt(C) = g(tSt) wherethe function g(tx) satisfies the Black-Scholes PDE

rg(tx) = partg

partt(tx) + rx

partg

partx(tx) + 1

2σ2x2 part

2g

partx2 (tx)

g(T x) = h(x) (1)

with terminal condition g(T x) = h(x) x gt 0

a) Assume that C is a forward contract with payoff

C = ST minusK

at time T Find the function h(x) in (1)b) Find the solution g(tx) of the above PDE and compute the price πt(C)

at time t isin [0T ]Hint search for a solution of the form g(tx) = xminus α(t) where α(t) is afunction of t to be determined

lowast Download the corresponding or the that can be runhere

234

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

BS lt- function(S K T r sig)d1 lt- (log(SK) + (r + sig^22)T) (sigsqrt(T))d2 lt- d1 - sigsqrt(T)return(Spnorm(d1) - Kexp(-rT)pnorm(d2))impliedvol lt- function(S K T r market)sig lt- 020sigup lt- 1sigdown lt- 0001count lt- 0err lt- BS(S K T r sig) - marketwhile(abs(err) gt 000001 ampamp countlt1000)if(err lt 0)sigdown lt- sigsig lt- (sigup + sig)2elsesigup lt- sigsig lt- (sigdown + sig)2err lt- BS(S K T r sig) - marketcount lt- count + 1if(count==2000)return(NA)elsereturn(sig)market = 083K = 628T = 7 365S = 634r = 002impliedvol(S K T r market)

cells [ cell_type code execution_count null metadata outputs [] source [ from IPythoncoredisplay import display HTMLn display(HTML( )) ] cell_type code execution_count null metadata collapsed true outputs [] source [ import numpy as npn import scipystats as ssn import time n n Black and Scholesn def d1(S0 K r sigma T)n return (nplog(S0K) + (r + sigma2 2) T)(sigma npsqrt(T))n n def d2(S0 K r sigma T)n return (nplog(S0 K) + (r - sigma2 2) T) (sigma npsqrt(T))n n def BlackScholes(typeS0 K r sigma T)n if type==Cn return S0 ssnormcdf(d1(S0 K r sigma T)) - K npexp(-r T) ssnormcdf(d2(S0 K r sigma T))n elsen return K npexp(-r T) ssnormcdf(-d2(S0 K r sigma T)) - S0 ssnormcdf(-d1(S0 K r sigma T)) ] cell_type code execution_count null metadata outputs [] source [ BlackScholes(C1000 1200 002 015 10) ] cell_type code execution_count null metadata outputs [] source [ def difference(x p S K r t)n return BlackScholes(CS K r x t) - p ] cell_type code execution_count null metadata outputs [] source [ from scipyoptimize import bisectn bisect(difference00011args=(11541763731112766 1000 1200 002 10)) ] ] metadata anaconda-cloud kernelspec display_name Python 3 language python name python3 language_info codemirror_mode name ipython version 3 file_extension py mimetype textx-python name python nbconvert_exporter python pygments_lexer ipython3 version 375rc1 nbformat 4 nbformat_minor 1

Black-Scholes Pricing and Hedging

c) Compute the quantityξt =

partg

partx(tSt)

of risky assets in a self-financing portfolio hedging Cd) Repeat the above questions with the terminal condition g(T x) = x

Exercise 68a) Solve the Black-Scholes PDE

rg(tx) = partg

partt(tx) + rx

partg

partx(tx) + σ2

2 x2 part2g

partx2 (tx) (634)

with terminal condition g(T x) = 1 x gt 0

Hint Try a solution of the form g(tx) = f(t) and find f(t)

b) Find the respective quantities ξt and ηt of the risky asset St and risklessasset At = ert in the portfolio with value

Vt = g(tSt) = ξtSt + ηtAt

hedging the contract with payoff $1 at maturity

Exercise 69 Log-contracts see also Exercise 84a) Solve the PDE

0 =partg

partt(x t) + rx

partg

partx(x t) + σ2

2 x2 part2g

partx2 (x t)

with the terminal condition g(xT ) = log x x gt 0

Hint Try a solution of the form g(x t) = f(t) + log x and find f(t)b) Solve the Black-Scholes PDE

rh(x t) = parth

partt(x t) + rx

parth

partx(x t) + σ2

2 x2 part2h

partx2 (x t) (635)

with the terminal condition h(xT ) = log x x gt 0

Hint Try a solution of the form h(x t) = u(t)g(x t) and find u(t)c) Find the respective quantities ξt and ηt of the risky asset St and riskless

asset At = ert in the portfolio with value

Vt = g(St t) = ξtSt + ηtAt

hedging a log-contract with payoff logST at maturity 235

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

Exercise 610 Binary options Consider a price process (St)tisinR+ given by

dStSt

= rdt+ σdBt S0 = 1

under the risk-neutral probability measure Plowast The binary (or digital) calloption is a contract with maturity T strike price K and payoff

Cd = 1[Kinfin)(ST ) =

$1 if ST gt K

0 if ST lt K

a) Derive the Black-Schole PDE satisfied by the pricing function Cd(tSt) ofthe binary call option together with its terminal condition

b) Show that the solution Cd(tx) of the Black-Scholes PDE of Question (a)is given by

Cd(tx) = eminus(Tminust)rΦ((rminus σ22)(T minus t) + log(xK)

|σ|radicT minus t

)= eminus(Tminust)rΦ

(dminus(T minus t)

)

where

dminus(T minus t) =(rminus σ22)(T minus t) + log(StK)

|σ|radicT minus t

0 6 t lt T

Exercise 611

a) Bachelier (1900) model Solve the stochastic differential equation

dSt = αStdt+ σdBt (636)

in terms of ασ isin R and the initial condition S0b) Write down the Bachelier PDE satisfied by the function C(tx) where

C(tSt) is the price at time t isin [0T ] of the contingent claim with payoffφ(ST ) = exp(ST ) and identify the process Delta (ξt)tisin[0T ] that hedgesthis claim

c) Solve the Black-Scholes PDE of Question (b) with the terminal conditionφ(x) = ex x isin R

Hint Search for a solution of the form

C(tx) = exp(minus(T minus t)r+ xh(t) +

σ2

4r (h2(t)minus 1)

) (637)

where h(t) is a function to be determined with h(T ) = 1

236

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

d) Compute the portfolio strategy (ξt ηt)tisin[0T ] that hedges the contingentclaim with payoff exp(ST )

Exercise 612

a) Show that for every fixed value of S the function

d 7minusrarr h(S d) = SΦ(d+ |σ|

radicT)minusK eminusrTΦ(d)

reaches its maximum at dlowast(S) =log(SK) + (rminus σ22)T

|σ|radicT

b) By the differentiation rule

d

dSh(S dlowast(S)) =

parth

partS(S dlowast(S)) + dprimelowast(S)

parth

partd(S dlowast(S))

recover the value of the Black-Scholes Delta

Exercise 613 Compute the Black-Scholes Vega by differentiation of theBlack-Scholes function

gc(tx) = Bl(Kxσ rT minus t) = xΦ(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)

with respect to the volatility parameter σ knowing that

minus12(dminus(T minus t)

)2= minus1

2

(log(xK) + (rminus σ22)(T minus t)

|σ|radicT minus t

)2

= minus12(d+(T minus t)

)2+ (T minus t)r+ log x

K (638)

Exercise 614 Consider the backward induction relation (313) ie

v(tx) = (1minus plowastN )v (t+ 1x(1 + aN )) + plowastN v (t+ 1x(1 + bN ))

using the renormalizations rN = rTN and

aN = (1 + rN )(1minus |σ|radicTN)minus 1 bN = (1 + rN )(1 + |σ|

radicTN)minus 1

of Section 36 N gt 1 with

plowastN =rN minus aNbN minus aN

and plowastN =bN minus rNbN minus aN

a) Show that the Black-Scholes PDE (62) of Proposition 61 can be recoveredfrom the induction relation (313) when the number N of time steps tendsto infinity

237

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

b) Show that the expression of the Delta ξt =partgcpartx

(tSt) can be similarlyrecovered from the finite difference relation (319) ie

ξ(1)t (Stminus1) =

v (t (1 + bN )Stminus1)minus v (t (1 + aN )Stminus1)

Stminus1(bN minus aN )

as N tends to infinity

Problem 615 (Leung and Sircar (2015)) ProShares Ultra SampP500 andProShares UltraShort SampP500 are leveraged investment funds that seek dailyinvestment results before fees and expenses that correspond to β times (βx)the daily performance of the SampP500reg with respectively β = 2 for ProSharesUltra and β = minus2 for ProShares UltraShort Here leveraging with a factorβ 1 aims at multiplying the potential return of an investment by a factorβ The following 10 questions are interdependent and should be treated insequence

a) Consider a risky asset priced S0 = $4 at time t = 0 and taking twopossible values S1 = $5 and S1 = $2 at time t = 1 Compute the twopossible returns (in ) achieved when investing $4 in one share of the assetS and the expected return under the risk-neutral probability measureassuming that the risk-free interest rate is zero

b) Leveraging Still based on an initial $4 investment we decide to leverageby a factor β = 3 by borrowing another (β minus 1) times $4 = 2times $4 at ratezero to purchase a total of β = 3 shares of the asset S Compute thetwo returns (in ) possibly achieved in this case and the expected returnunder the risk-neutral probability measure assuming that the risk-freeinterest rate is zero

c) Denoting by Ft the ProShares value at time t how much should the fundinvest in the underlying asset priced St and how much $ should it borrowor save on the risk-free market at any time t in order to leverage with afactor β 1

d) Find the portfolio allocation (ξt ηt) for the fund value

Ft = ξtSt + ηtAt t isin R+

according to Question (c) where At = A0 ert is the riskless money marketaccount

e) We choose to model the SampP500 index St as the geometric Brownianmotion

dSt = rStdt+ σStdBt t isin R+

under the risk-neutral probability measure Plowast Find the stochastic dif-ferential equation satisfied by (Ft)tisinR+ under the self-financing conditiondFt = ξtdSt + ηtdAt

238

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

f) Is the discounted fund value ( eminusrtFt)tisinR+ a martingale under the risk-neutral probability measure Plowast

g) Find the relation between the fund value Ft and the index St by solvingthe stochastic differential equation obtained for Ft in Question (e) Forsimplicity we normalize F0 = Sβ0

h) Write the price at time t = 0 of the call option with payoff (FT minusK)+ onthe ProShares index using the Black-Scholes formula

i) Show that when β gt 0 the Delta at time t isin [0T ) of the call optionwith payoff (FT minusK)+ on ProShares Ultra is equal to the Delta of thecall option with payoff (ST minusKβ(t))

+ on the SampP500 for a certain strikeprice Kβ(t) to be determined explicitly

j) When β lt 0 find the relation between the Delta at time t isin [0T ) ofthe call option with payoff (FT minusK)+ on ProShares UltraShort and theDelta of the put option with payoff (Kβ(t)minus ST )+ on the SampP500

239

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

  1. pbsARFix223
  2. pbsARFix224
  3. pbsARFix225
  4. pbsARFix226
  5. pbsARFix227
  6. pbsARFix228
  7. pbsARFix229
  8. pbsARFix230
  9. fdrm1
  10. pbsARFix231
  11. 100
  12. 101
  13. 102
  14. 103
  15. 104
  16. 105
  17. 106
  18. 107
  19. 108
  20. 109
  21. 1010
  22. 1011
  23. 1012
  24. 1013
  25. 1014
  26. 1015
  27. 1016
  28. 1017
  29. 1018
  30. 1019
  31. anm10
  32. 10EndLeft
  33. 10StepLeft
  34. 10PauseLeft
  35. 10PlayLeft
  36. 10PlayPauseLeft
  37. 10PauseRight
  38. 10PlayRight
  39. 10PlayPauseRight
  40. 10StepRight
  41. 10EndRight
  42. 10Minus
  43. 10Reset
  44. 10Plus
  45. pbsARFix232
  46. pbsARFix233
  47. pbsARFix234
  48. pbsARFix235
  49. pbsARFix236
  50. pbsARFix237
  51. fdrm2
  52. 110
  53. 111
  54. 112
  55. 113
  56. 114
  57. 115
  58. 116
  59. 117
  60. 118
  61. 119
  62. 1110
  63. 1111
  64. 1112
  65. 1113
  66. 1114
  67. 1115
  68. 1116
  69. 1117
  70. 1118
  71. 1119
  72. anm11
  73. 11EndLeft
  74. 11StepLeft
  75. 11PauseLeft
  76. 11PlayLeft
  77. 11PlayPauseLeft
  78. 11PauseRight
  79. 11PlayRight
  80. 11PlayPauseRight
  81. 11StepRight
  82. 11EndRight
  83. 11Minus
  84. 11Reset
  85. 11Plus
  86. pbsARFix238
  87. pbsARFix239
  88. pbsARFix240
  89. pbsARFix241
  90. pbsARFix242
  91. 120
  92. 121
  93. 122
  94. 123
  95. 124
  96. 125
  97. 126
  98. 127
  99. 128
  100. 129
  101. 1210
  102. anm12
  103. 12EndLeft
  104. 12StepLeft
  105. 12PauseLeft
  106. 12PlayLeft
  107. 12PlayPauseLeft
  108. 12PauseRight
  109. 12PlayRight
  110. 12PlayPauseRight
  111. 12StepRight
  112. 12EndRight
  113. 12Minus
  114. 12Reset
  115. 12Plus
  116. 130
  117. 131
  118. 132
  119. 133
  120. 134
  121. 135
  122. 136
  123. 137
  124. 138
  125. 139
  126. 1310
  127. anm13
  128. 13EndLeft
  129. 13StepLeft
  130. 13PauseLeft
  131. 13PlayLeft
  132. 13PlayPauseLeft
  133. 13PauseRight
  134. 13PlayRight
  135. 13PlayPauseRight
  136. 13StepRight
  137. 13EndRight
  138. 13Minus
  139. 13Reset
  140. 13Plus
  141. pbsARFix243
  142. pbsARFix244
  143. pbsARFix245
  144. pbsARFix246
  145. 140
  146. 141
  147. 142
  148. 143
  149. 144
  150. 145
  151. 146
  152. 147
  153. 148
  154. 149
  155. 1410
  156. 1411
  157. 1412
  158. 1413
  159. 1414
  160. 1415
  161. 1416
  162. 1417
  163. 1418
  164. 1419
  165. 1420
  166. 1421
  167. 1422
  168. 1423
  169. 1424
  170. 1425
  171. 1426
  172. 1427
  173. 1428
  174. 1429
  175. 1430
  176. 1431
  177. 1432
  178. 1433
  179. 1434
  180. 1435
  181. 1436
  182. 1437
  183. 1438
  184. 1439
  185. 1440
  186. 1441
  187. 1442
  188. 1443
  189. 1444
  190. 1445
  191. 1446
  192. 1447
  193. 1448
  194. 1449
  195. 1450
  196. 1451
  197. 1452
  198. 1453
  199. 1454
  200. 1455
  201. 1456
  202. 1457
  203. 1458
  204. 1459
  205. 1460
  206. 1461
  207. 1462
  208. 1463
  209. 1464
  210. 1465
  211. 1466
  212. 1467
  213. 1468
  214. 1469
  215. 1470
  216. 1471
  217. 1472
  218. 1473
  219. 1474
  220. 1475
  221. 1476
  222. 1477
  223. 1478
  224. 1479
  225. 1480
  226. 1481
  227. 1482
  228. 1483
  229. 1484
  230. 1485
  231. 1486
  232. 1487
  233. 1488
  234. 1489
  235. 1490
  236. 1491
  237. 1492
  238. 1493
  239. 1494
  240. 1495
  241. 1496
  242. 1497
  243. 1498
  244. 1499
  245. 14100
  246. 14101
  247. 14102
  248. 14103
  249. 14104
  250. 14105
  251. 14106
  252. 14107
  253. 14108
  254. 14109
  255. 14110
  256. 14111
  257. 14112
  258. 14113
  259. 14114
  260. 14115
  261. 14116
  262. 14117
  263. 14118
  264. 14119
  265. 14120
  266. 14121
  267. 14122
  268. 14123
  269. 14124
  270. 14125
  271. 14126
  272. 14127
  273. 14128
  274. 14129
  275. 14130
  276. 14131
  277. 14132
  278. 14133
  279. 14134
  280. 14135
  281. 14136
  282. 14137
  283. 14138
  284. 14139
  285. 14140
  286. 14141
  287. 14142
  288. 14143
  289. 14144
  290. 14145
  291. 14146
  292. 14147
  293. 14148
  294. 14149
  295. 14150
  296. 14151
  297. 14152
  298. 14153
  299. 14154
  300. 14155
  301. 14156
  302. 14157
  303. 14158
  304. 14159
  305. 14160
  306. 14161
  307. 14162
  308. 14163
  309. 14164
  310. 14165
  311. 14166
  312. 14167
  313. 14168
  314. 14169
  315. 14170
  316. 14171
  317. 14172
  318. 14173
  319. 14174
  320. 14175
  321. 14176
  322. 14177
  323. 14178
  324. 14179
  325. 14180
  326. 14181
  327. 14182
  328. 14183
  329. 14184
  330. 14185
  331. 14186
  332. 14187
  333. 14188
  334. 14189
  335. 14190
  336. 14191
  337. 14192
  338. 14193
  339. 14194
  340. 14195
  341. 14196
  342. 14197
  343. anm14
  344. 14EndLeft
  345. 14StepLeft
  346. 14PauseLeft
  347. 14PlayLeft
  348. 14PlayPauseLeft
  349. 14PauseRight
  350. 14PlayRight
  351. 14PlayPauseRight
  352. 14StepRight
  353. 14EndRight
  354. 14Minus
  355. 14Reset
  356. 14Plus
  357. pbsARFix247
  358. pbsARFix248
  359. 150
  360. 151
  361. 152
  362. 153
  363. 154
  364. 155
  365. 156
  366. 157
  367. 158
  368. 159
  369. 1510
  370. 1511
  371. 1512
  372. 1513
  373. 1514
  374. 1515
  375. 1516
  376. 1517
  377. 1518
  378. 1519
  379. anm15
  380. 15EndLeft
  381. 15StepLeft
  382. 15PauseLeft
  383. 15PlayLeft
  384. 15PlayPauseLeft
  385. 15PauseRight
  386. 15PlayRight
  387. 15PlayPauseRight
  388. 15StepRight
  389. 15EndRight
  390. 15Minus
  391. 15Reset
  392. 15Plus
  393. pbsARFix249
  394. pbsARFix250
  395. pbsARFix251
  396. pbsARFix252
  397. pbsARFix253
  398. pbsARFix254
  399. pbsARFix255
  400. pbsARFix256
  401. pbsARFix257
  402. pbsARFix258
  403. pbsARFix259
  404. pbsARFix260
  405. pbsARFix261
Page 18: Black-ScholesPricingandHedging - NTU · to the Black-Scholes PDE (6.2) in order to price a claim payoff Cof the formC= h(S T).Asinthediscrete-timecase,thearbitragepriceπt(C) at

N Privault

ie there is always short selling and the amount invested on the riskless assetpriced At = ert t isin [0T ] is

ηtAt = K eminus(Tminust)rΦ(minus dminus(T minus t)

)= K eminus(Tminust)rΦ

(minus log(StK) + (rminus σ22)(T minus t)

|σ|radicT minus t

)gt 0

which is always nonnegative ie we are constantly saving money on theriskless asset as noted in Figure 615

-60

-40

-20

0

20

40

60

80

100

0 50 100 150 200

K

HK$

Black-Scholes priceRisky investment ξtSt

Riskless investment ηtAtUnderlying asset price

Fig 615 Time evolution of the hedging portfolio for a put option on HSBC

In the above example the put option finished out of the money (OTM) so thatno cash settlement or physical delivery occurs A comparison of Figure 610with market data can be found in Figures 913 and 914 below

64 Market Terms and Data

The following Table 61 provides a summary of formulas for the computationof Black-Scholes sensitivities also called Greekslowast

lowast ldquoEvery class feels like attending a Greek lessonrdquo (AY2018-2019 student feedback)

218

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

Call option Put option

Option price g(tSt) StΦ(d+(T minus t))minusK eminus(Tminust)rΦ(dminus(T minus t)) K eminus(Tminust)rΦ(minusdminus(T minus t))minus StΦ(minusd+(T minus t))

Delta (∆) partg

partx(tSt) Φ(d+(T minus t)) gt 0 minusΦ(minusd+(T minus t)) 6 0

Gamma (Γ) part2g

partx2 (tSt)Φprime(d+(T minus t))St|σ|

radicT minus t

gt 0

Vega partg

partσ(tSt) St

radicT minus tΦprime(d+(T minus t)) gt 0

Theta (Θ) partg

partt(tSt) minusSt|σ|Φ

prime(d+(T minus t))2radicT minus t

minus rK eminus(Tminust)rΦ(dminus(T minus t)) 6 0 minusSt|σ|Φprime(d+(T minus t))

2radicT minus t

+ rK eminus(Tminust)rΦ(minusdminus(T minus t))

Rho (ρ) partg

partr(tSt) K(T minus t) eminus(Tminust)rΦ(dminus(T minus t)) minusK(T minus t) eminus(Tminust)rΦ(minusdminus(T minus t))

Table 61 Black-Scholes Greeks (Wikipedia)

From Table 61 we can conclude that call option prices are increasing func-tions of the underlying asset price St of the interest rate r and of the volatil-ity parameter σ Similarly put option prices are decreasing functions of theunderlying asset price St of the interest rate r and increasing functions ofthe volatility parameter σ

Parameter Variation of call option prices Variation of put option prices

Underlying St increasing decreasing

Volatility σ increasing increasing

Time t decreasing depends on the underlying price level

Interest rate r increasing decreasing

Table 62 Variations of Black-Scholes prices

The change of sign of the sensitivity Theta (Θ) with respect to time t can beverified in the following Figure 616

219

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

(a) Black-Scholes call price maps (b) Black-Scholes put price maps

Fig 616 Time-dependent solutions of the Black-Scholes PDElowast

Intrinsic value The intrinsic value at time t isin [0T ] of the option withpayoff C = h

(S(1)T

)is given by the immediate exercise payoff h

(S(1)t

) The

extrinsic value at time t isin [0T ] of the option is the remaining differenceπt(C) minus h

(S(1)t

)between the option price πt(C) and the immediate ex-

ercise payoff h(S(1)t

) In general the option price πt(C) decomposes as

πt(C) = h(S(1)t

)︸ ︷︷ ︸intrinsic value

+ πt(C)minus h(S(1)t

)︸ ︷︷ ︸

extrinsic value

0 6 t 6 T ]

Gearing The gearing at time t isin [0T ] of the option with payoff C = h(ST )is defined as the ratio

Gt =St

πt(C)=

Stg(tSt)

0 6 t 6 T

Effective gearing The effective gearing at time t isin [0T ] of the option withpayoff C = h(ST ) is defined as the ratio

Get = Gtξt

=ξtStπt(C)

=St

πt(C)

partg

partx(tSt)

=St

g(tSt)partg

partx(tSt)

= Stpart

partxlog g(tSt) 0 6 t 6 T

lowast The animation works in Acrobat Reader on the entire pdf file

220

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

The effective gearingGet =

ξtStπt(C)

can be interpreted as the hedge ratio ie the percentage of the portfoliowhich is invested on the risky asset When written as

∆g(tSt)g(tSt)

= Get times

∆StSt

the effective gearing gives the relative variation or percentage change∆g(tSt)g(tSt) of the option price g(tSt) from the relative variation∆StSt in the underlying asset price

The ratio Get = Stpart log g(tSt)partx can also be interpreted as an elasticity

coefficient

Break-even price The break-even price BEPt of the underlying asset is thevalue of S for which the intrinsic option value h(S) equals the option priceπt(C) at time t isin [0T ] For European call options it is given by

BEPt = K + πt(C) = K + g(tSt) t = 0 1 N

whereas for European put options it is given by

BEPt = K minus πt(C) = K minus g(tSt) 0 6 t 6 T

Premium The option premium OPt can be defined as the variation requiredfrom the underlying asset price in order to reach the break-even price iewe have

OPt =BEPt minus St

St=K + g(tSt)minus St

St 0 6 t 6 T

for European call options and

OPt =St minusBEPt

St=St + g(tSt)minusK

St 0 6 t 6 T

for European put options see Figure 617 below The term ldquopremiumrdquo issometimes also used to denote the arbitrage price g(tSt) of the option

221

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

f (tx σ)100

=

x =

K =

xpart log f

partx=

σ =

partf

partt(tx σ)=

T=

=(xminusK)x

∆ = = partf

partx(tx σ)

= partf

partσ(tx σ)

=K+f (txσ)minusx

x

=K+f (tx σ)

rf=

partf

partt+rxpartf

partx+

σ2 2x2part2f

partx2

Fig 617 Warrant terms and data

The R package bizdays (requires to install QuantLib) can be used to computecalendar time vs business time to maturity1 installpackages(bizdays)

library(bizdays)3 load_quantlib_calendars(HongKong from=2018-01-01 to=2018-12-31)

load_quantlib_calendars(Singapore from=2018-01-01 to=2018-12-31)5 bizdays(2018-03-10 2018-04-03 QuantLibHongKong)

bizdays(2018-03-10 2018-04-03 QuantLibSingapore)

65 The Heat Equation

In the next proposition we notice that the solution f(tx) of the Black-Scholes PDE (67) can be transformed into a solution g(t y) of the simplerheat equation by a change of variable and a time inversion t 7minusrarr T minus t onthe interval [0T ] so that the terminal condition at time T in the Black-Scholes equation (622) becomes an initial condition at time t = 0 in theheat equation (625) See also here for a related discussion on changes ofvariables for the Black-Scholes PDE

222

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

Proposition 68 Assume that f(tx) solves the Black-Scholes PDErf(tx) = partf

partt(tx) + rx

partf

partx(tx) + 1

2σ2x2 part

2f

partx2 (tx)

f(T x) = (xminusK)+(622)

with terminal condition h(x) = (xminusK)+ x gt 0 Then the function g(t y)defined by

g(t y) = ertf(T minus t e|σ|y+(σ22minusr)t) (623)

solves the heat equation (625) with initial condition

ψ(y) = h(

e|σ|y) y isin R (624)

ie we have partg

partt(t y) = 1

2part2g

party2 (t y)

g(0 y) = h(

e|σ|y)

(625)

Proposition 68 will be proved in Section 66 It will allow us to solve theBlack-Scholes PDE (622) based on the solution of the heat equation (625)with initial condition ψ(y) = h

(e|σ|y

) y isin R by inversion of Relation (623)

with s = T minus t x = e|σ|y+(σ22minusr)t ie

f(sx) = eminus(Tminuss)rg(T minus s minus(σ

22minus r)(T minus s) + log x|σ|

)

Next we focus on the heat equation

partϕ

partt(t y) = 1

2part2ϕ

party2 (t y) (626)

which is used to model the diffusion of heat over time through solids Herethe data of g(x t) represents the temperature measured at time t and pointx We refer the reader to Widder (1975) for a complete treatment of thistopic

223

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

Fig 618 Time-dependent solution of the heat equationlowast

Proposition 69 The fundamental solution of the heat equation (626) isgiven by the Gaussian probability density function

ϕ(t y) =1radic2πt

eminusy2(2t) y isin R

with variance t gt 0

Proof The proof is done by a direct calculation as follows

partϕ

partt(t y) = part

partt

(eminusy2(2t)radic

2πt

)

= minus eminusy2(2t)

2t32radic

2π+

y2

2t2eminusy2(2t)radic

2πt

=

(minus 1

2t +y2

2t2

)ϕ(t y)

and

12part2ϕ

party2 (t y) = minus12part

party

(y

t

eminusy2(2t)radic

2πt

)

= minus eminusy2(2t)

2tradic

2πt+

y2

2t2eminusy2(2t)radic

2πt

=

(minus 1

2t +y2

2t2

)ϕ(t y) t gt 0 y isin R

lowast The animation works in Acrobat Reader on the entire pdf file

224

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

In Section 66 the heat equation (626) will be shown to be equivalent to theBlack-Scholes PDE after a change of variables In particular this will lead tothe explicit solution of the Black-Scholes PDE

Proposition 610 The heat equationpartg

partt(t y) = 1

2part2g

party2 (t y)

g(0 y) = ψ(y)

(627)

with continuous initial condition

g(0 y) = ψ(y)

has the solution

g(t y) =winfinminusinfin

ψ(z) eminus(yminusz)2(2t) dzradic2πt

y isin R t gt 0 (628)

Proof We have

partg

partt(t y) = part

partt

winfinminusinfin

ψ(z) eminus(yminusz)2(2t) dzradic2πt

=winfinminusinfin

ψ(z)part

partt

(eminus(yminusz)2(2t)radic

2πt

)dz

=12winfinminusinfin

ψ(z)

((yminus z)2

t2minus 1t

)eminus(yminusz)2(2t) dzradic

2πt

=12winfinminusinfin

ψ(z)part2

partz2 eminus(yminusz)2(2t) dzradic2πt

=12winfinminusinfin

ψ(z)part2

party2 eminus(yminusz)2(2t) dzradic2πt

=12part2

party2

winfinminusinfin

ψ(z) eminus(yminusz)2(2t) dzradic2πt

=12part2g

party2 (t y)

On the other hand it can be checked that at time t = 0 we have

limtrarr0

winfinminusinfin

ψ(z) eminus(yminusz)2(2t) dzradic2πt

= limtrarr0

winfinminusinfin

ψ(y+ z) eminusz2(2t) dzradic2πt

= ψ(y) y isin R

225

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

The next Figure 619 shows the evolution of g(tx) with initial conditionbased on the European call payoff function h(x) = (xminusK)+ ie

g(0 y) = ψ(y) = h(

e|σ|y)=(

e|σ|y minusK)+ y isin R

Fig 619 Time-dependent solution of the heat equationlowast

Let us provide a second proof of Proposition 610 this time using Brownianmotion and stochastic calculus

Proof of Proposition 610 First note that under the change of variable x =z minus y we have

g(t y) =winfinminusinfin

ψ(z) eminus(yminusz)2(2t) dzradic2πt

=winfinminusinfin

ψ(y+ x) eminusx2(2t) dxradic2πt

= IE[ψ(y+Bt)]

= IE[ψ(yminusBt)]

where (Bt)tisinR+ is a standard Brownian motion and Bt N (0 t) t isin R+Applying Itocircrsquos formula and using the fact that the expectation of the stochas-tic integral with respect to Brownian motion is zero see Relation (417) inProposition 420 we find

g(t y) = IE[ψ(yminusBt)]

= ψ(y)minus IE[w t

0ψprime(yminusBs)dBs

]+

12 IE

[w t0ψprimeprime(yminusBs)ds

]= ψ(y) +

12w t

0IE[ψprimeprime(yminusBs)

]ds

lowast The animation works in Acrobat Reader on the entire pdf file

226

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

= ψ(y) +12w t

0part2

party2 IE [ψ(yminusBs)] ds

= ψ(y) +12w t

0part2g

party2 (s y)ds

Hence we have

partg

partt(t y) = part

parttIE[ψ(yminusBt)]

=12part2

party2 IE [ψ(yminusBt)]

=12part2g

party2 (t y)

Regarding the initial condition we check that

g(0 y) = IE[ψ(yminusB0)] = IE[ψ(y)] = ψ(y)

The expression g(t y) = IE[ψ(yminusBt)] provides a probabilistic interpreta-tion of the heat diffusion phenomenon based on Brownian motion Namelywhen ψε(y) = 1[minusεε](y) we find that

gε(t y) = IE[ψε(yminusBt)]= IE[1[minusεε](yminusBt)]= P

(yminusBt isin [minusε ε]

)= P

(yminus ε 6 Bt 6 y+ ε

)represents the probability of finding Bt within a neighborhood [y minus ε y + ε]of the point y isin R

66 Solution of the Black-Scholes PDE

In this section we solve the Black-Scholes PDE by the kernel method of Sec-tion 65 and a change of variables This solution method uses the change ofvariables (623) of Proposition 68 and a time inversion from which the ter-minal condition at time T in the Black-Scholes equation becomes an initialcondition at time t = 0 in the heat equation

Next we state the proof Proposition 68

Proof Letting s = T minus t and x = e|σ|y+(σ22minusr)t and using Relation (623)ie

g(t y) = ertf(T minus t e|σ|y+(σ22minusr)t)

227

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

we have

partg

partt(t y) = r ertf

(T minus t e|σ|y+(σ22minusr)t)minus ert partf

parts

(T minus t e|σ|y+(σ22minusr)t)

+

(σ2

2 minus r)

ert e|σ|y+(σ22minusr)t partf

partx

(T minus t e|σ|y+(σ22minusr)t)

= r ertf(T minus tx)minus ert partfparts

(T minus tx) +(σ2

2 minus r)

ertxpartfpartx

(T minus tx)

=12 ertx2σ2 part

2f

partx2 (T minus tx) +σ2

2 ertxpartfpartx

(T minus tx) (629)

where on the last step we used the Black-Scholes PDE On the other handwe have

partg

party(t y) = |σ| ert e|σ|y+(σ22minusr)t partf

partx

(T minus t e|σ|y+(σ22minusr)t)

and

12partg2

party2 (t y) =σ2

2 ert e|σ|y+(σ22minusr)t partf

partx

(T minus t e|σ|y+(σ22minusr)t)

+σ2

2 ert e2|σ|y+2(σ22minusr)t part2f

partx2(T minus t e|σ|y+(σ22minusr)t)

=σ2

2 ertxpartfpartx

(T minus tx) + σ2

2 ertx2 part2f

partx2 (T minus tx) (630)

We conclude by comparing (629) with (630) which shows that g(tx) solvesthe heat equation (627) with initial condition

g(0 y) = f(T e|σ|y

)= h

(e|σ|y

)

In the next proposition we derive the Black-Scholes formula (610) by solv-ing the PDE (622) The Black-Scholes formula will also be recovered by aprobabilistic argument via the computation of an expected value in Proposi-tion 77

Proposition 611 When h(x) = (x minusK)+ the solution of the Black-Scholes PDE (622) is given by

f(tx) = xΦ(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

) x gt 0

whereΦ(x) =

1radic2π

w xminusinfin

eminusy22dy x isin R

and

228

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

d+(T minus t) =

log(xK) + (r+ σ22)(T minus t)|σ|radicT minus t

dminus(T minus t) =log(xK) + (rminus σ22)(T minus t)

|σ|radicT minus t

x gt 0 t isin [0T )

Proof By inversion of Relation (623) with s = T minus t and x = e|σ|y+(σ22minusr)twe get

f(sx) = eminus(Tminuss)rg(T minus s minus(σ

22minus r)(T minus s) + log x|σ|

)and

h(x) = ψ

(log x|σ|

) x gt 0 or ψ(y) = h

(e|σ|y

) y isin R

Hence using the solution (628) and Relation (624) we get

f(tx) = eminus(Tminust)rg(T minus t minus(σ

22minus r)(T minus t) + log x|σ|

)= eminus(Tminust)r

winfinminusinfin

ψ

(minus(σ22minus r)(T minus t) + log x

|σ|+ z

)eminusz2(2(Tminust)) dzradic

2(T minus t)π

= eminus(Tminust)rwinfinminusinfin

h(x e|σ|zminus(σ22minusr)(Tminust)) eminusz2(2(Tminust)) dzradic

2(T minus t)π

= eminus(Tminust)rwinfinminusinfin

(x e|σ|zminus(σ22minusr)(Tminust) minusK

)+ eminusz2(2(Tminust)) dzradic2(T minus t)π

= eminus(Tminust)r

timeswinfin

(minusr+σ22)(Tminust)+log(Kx)|σ|

(x e|σ|zminus(σ22minusr)(Tminust) minusK

)eminusz2(2(Tminust)) dzradic

2(T minus t)π

= x eminus(Tminust)rwinfinminusdminus(Tminust)

radicTminust

e|σ|zminus(σ22minusr)(Tminust) eminusz2(2(Tminust)) dzradic2(T minus t)π

minusK eminus(Tminust)rwinfinminusdminus(Tminust)

radicTminust

eminusz2(2(Tminust)) dzradic2(T minus t)π

= xwinfinminusdminus(Tminust)

radicTminust

e|σ|zminus(Tminust)σ22minusz2(2(Tminust)) dzradic2(T minus t)π

minusK eminus(Tminust)rwinfinminusdminus(Tminust)

radicTminust

eminusz2(2(Tminust)) dzradic2(T minus t)π

= xwinfinminusdminus(Tminust)

radicTminust

eminus(zminus(Tminust)|σ|)2(2(Tminust)) dzradic2(T minus t)π

229

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

minusK eminus(Tminust)rwinfinminusdminus(Tminust)

radicTminust

eminusz2(2(Tminust)) dzradic2(T minus t)π

= xwinfinminusdminus(Tminust)

radicTminustminus(Tminust)|σ|

eminusz2(2(Tminust)) dzradic2(T minus t)π

minusK eminus(Tminust)rwinfinminusdminus(Tminust)

radicTminust

eminusz2(2(Tminust)) dzradic2(T minus t)π

= xwinfinminusdminus(Tminust)minus|σ|

radicTminust

eminusz22 dzradic2πminusK eminus(Tminust)r

winfinminusdminus(Tminust)

eminusz22 dzradic2π

= x(1minusΦ

(minus d+(T minus t)

))minusK eminus(Tminust)r

(1minusΦ

(minus dminus(T minus t)

))= xΦ

(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)

where we used the relation (614) ie

1minusΦ(a) = Φ(minusa) a isin R

Exercises

Exercise 61 Bachelier (1900) model Consider a market made of a risklessasset valued At = A0 with zero interest rate t isin R+ and a risky asset whoseprice St is modeled by a standard Brownian motion as St = Bt t isin R+

a) Show that the price g(tBt) of the option with payoff C = B2T satisfies

the heat equationpartϕ

partt(t y) = minus1

2part2ϕ

party2 (t y)

with terminal condition g(T x) = x2b) Find the function g(tx) by solving the PDE of Question (a)

Hint Try a solution of the form g(tx) = x2 + f(t)

See Exercises 611 713 and 714 for extensions to nonzero interest rates

Exercise 62 Consider a risky asset price (St)tisinR modeled in the Cox et al(1985) (CIR) model as

dSt = β(αminus St)dt+ σradicStdBt αβσ gt 0 (631)

and let (ηt ξt)tisinR+ be a portfolio strategy whose value Vt = ηtAt + ξtSttakes the form Vt = g(tSt) t isin R+ Figure 620 presents a random simula-tion of the solution to (631) with α = 0025 β = 1 and σ = 13230

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

0

1

2

3

4

5

6

7

8

0 01 02 03 04 05 06 07 08 09 1

St

t

Fig 620 Graph of the CIR short rate t 7rarr rt with α = 25 β = 1 and σ = 13

N=10000 t lt- 0(N-1) dt lt- 10Na=0025 b=2 sigma=0052 X lt- rnorm(Nmean=0sd=sqrt(dt))R lt- rep(0N)R[1]=001

for (j in 2N)R[j]=max(0R[j-1]+(a-bR[j-1])dt+sigmasqrt(R[j-1])X[j])4 plot(t R xlab = t ylab = type = l ylim = c(0002) col = blue)

Based on the self-financing condition written as

dVt = rVtdtminus rξtStdt+ ξtdSt

= rVtdtminus rξtStdt+ β(αminus St)ξtdt+ σξtradicStdBt t isin R+ (632)

derive the PDE satisfied by the function g(tx) using the Itocirc formula

Exercise 63 Black-Scholes PDE with dividends Consider a riskless as-set with price At = A0 ert t isin R+ and an underlying asset price process(St)tisinR+ modeled as

dSt = (microminus δ)Stdt+ σStdBt

where (Bt)tisinR+ is a standard Brownian motion and δ gt 0 is a continuous-time dividend rate By absence of arbitrage the payment of a dividend entailsa drop in the stock price by the same amount occuring generally on the ex-dividend date on which the purchase of the security no longer entitles theinvestor to the dividend amount The list of investors entitled to dividendpayment is consolidated on the date of record and payment is made on thepayable date

library(quantmod)2 getSymbols(0005HKfrom=2010-01-01to=SysDate()src=yahoo)

getDividends(0005HKfrom=2010-01-01to=SysDate()src=yahoo)

a) Assuming that the portfolio with value Vt = ξtSt + ηtAt at time t is self-financing and that dividends are continuously reinvested write down theportfolio variation dVt

231

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

b) Assuming that the portfolio value Vt takes the form Vt = g(tSt) at timet derive the Black-Scholes PDE for the function g(tx) with its terminalcondition

c) Compute the price at time t isin [0T ] of the European call option withstrike price K by solving the corresponding Black-Scholes PDE

d) Compute the Delta of the option

Exercise 64

a) Check that the Black-Scholes formula (610) for European call options

gc(tx) = xΦ(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)

satisfies the following boundary conditions

i) at x = 0 gc(t 0) = 0ii) at maturity t = T

gc(T x) = (xminusK)+ =

xminusK x gt K

0 x 6 K

iii) as time to maturity tends to infinity

limTrarrinfin

Bl(Kxσ rT minus t) = x t isin R+

b) Check that the Black-Scholes formula (618) for European put options

gp(tx) = K eminus(Tminust)rΦ(minus dminus(T minus t)

)minus xΦ

(minus d+(T minus t)

)satisfies the following boundary conditions

i) at x = 0 gp(t 0) = K eminus(Tminust)rii) as x tends to infinity gp(tinfin) = 0 for all t isin [0T )iii) at maturity t = T

gp(T x) = (K minus x)+ =

0 x gt K

K minus x x 6 K

iv) as time to maturity tends to infinity

limTrarrinfin

Blp(KStσ rT minus t) = 0 t isin R+

Exercise 65 Power option (Exercise 314 continued)

232

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

a) Solve the Black-Scholes PDE

rg(x t) = partg

partt(x t) + rx

partg

partx(x t) + σ2

2 x2 part2g

partx2 (x t) (633)

with terminal condition g(xT ) = x2 x gt 0 t isin [0T ]

Hint Try a solution of the form g(x t) = x2f(t) and find f(t)b) Find the respective quantities ξt and ηt of the risky asset St and riskless

asset At = ert in the portfolio with value

Vt = g(St t) = ξtSt + ηtAt 0 6 t 6 T

hedging the contract with payoff S2T at maturity

Exercise 66 On December 18 2007 a call warrant has been issued byFortis Bank on the stock price S of the MTR Corporation with maturityT = 23122008 strike price K = HK$ 3608 and entitlement ratio=10Recall that in the Black-Scholes model the price at time t of the Europeanclaim on the underlying asset priced St with strike price K maturity T interest rate r and volatility σ gt 0 is given by the Black-Scholes formula as

f(tSt) = StΦ(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)

wheredminus(T minus t) =

(rminus σ22)(T minus t) + log(StK)

|σ|radicT minus t

d+(T minus t) = dminus(T minus t) + |σ|radicT minus t = (r+ σ22)(T minus t) + log(StK)

|σ|radicT minus t

Recall that by Proposition 64 we have

partf

partx(tSt) = Φ

(d+(T minus t)

) 0 6 t 6 T

a) Using the values of the Gaussian cumulative distribution function com-pute the Black-Scholes price of the corresponding call option at timet =November 07 2008 with St = HK$ 17200 assuming a volatility σ =90 = 090 and an annual risk-free interest rate r = 4377 = 004377

b) Still using the Gaussian cumulative distribution function compute thequantity of the risky asset required in your portfolio at time t =November07 2008 in order to hedge one such option at maturity T = 23122008

c) Figure 1 represents the Black-Scholes price of the call option as a functionof σ isin [05 15] = [50 150]

233

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

0

01

02

03

04

05

06

05 06 07 08 09 1 11 12 13 14 15σimp

Optio

n pr

ice

σ

Market price

Fig 621 Option price as a function of the volatility σ gt 0

1 BSCall lt- function(S K r T sigma)d1 lt- (log(SK)+(r+sigma^22)T)(sigmasqrt(T))d2 lt- d1 - sigma sqrt(T)

3 BSCall = Spnorm(d1) - Kexp(-rT)pnorm(d2)BSCallsigma lt- seq(0515 length=100)

5 plot(sigmaBSCall(172360800437746365sigma) type=llty=1 xlab=Sigmaylab=Black-Scholes Call Price ylim = c(006)col=bluelwd=3)grid()

abline(h=023col=redlwd=3)

Knowing that the closing price of the warrant on November 07 2008 wasHK$ 0023 which value can you infer for the implied volatility σ at thisdatelowast

Exercise 67 Forward contracts Recall that the price πt(C) of a claimpayoff C = h(ST ) of maturity T can be written as πt(C) = g(tSt) wherethe function g(tx) satisfies the Black-Scholes PDE

rg(tx) = partg

partt(tx) + rx

partg

partx(tx) + 1

2σ2x2 part

2g

partx2 (tx)

g(T x) = h(x) (1)

with terminal condition g(T x) = h(x) x gt 0

a) Assume that C is a forward contract with payoff

C = ST minusK

at time T Find the function h(x) in (1)b) Find the solution g(tx) of the above PDE and compute the price πt(C)

at time t isin [0T ]Hint search for a solution of the form g(tx) = xminus α(t) where α(t) is afunction of t to be determined

lowast Download the corresponding or the that can be runhere

234

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

BS lt- function(S K T r sig)d1 lt- (log(SK) + (r + sig^22)T) (sigsqrt(T))d2 lt- d1 - sigsqrt(T)return(Spnorm(d1) - Kexp(-rT)pnorm(d2))impliedvol lt- function(S K T r market)sig lt- 020sigup lt- 1sigdown lt- 0001count lt- 0err lt- BS(S K T r sig) - marketwhile(abs(err) gt 000001 ampamp countlt1000)if(err lt 0)sigdown lt- sigsig lt- (sigup + sig)2elsesigup lt- sigsig lt- (sigdown + sig)2err lt- BS(S K T r sig) - marketcount lt- count + 1if(count==2000)return(NA)elsereturn(sig)market = 083K = 628T = 7 365S = 634r = 002impliedvol(S K T r market)

cells [ cell_type code execution_count null metadata outputs [] source [ from IPythoncoredisplay import display HTMLn display(HTML( )) ] cell_type code execution_count null metadata collapsed true outputs [] source [ import numpy as npn import scipystats as ssn import time n n Black and Scholesn def d1(S0 K r sigma T)n return (nplog(S0K) + (r + sigma2 2) T)(sigma npsqrt(T))n n def d2(S0 K r sigma T)n return (nplog(S0 K) + (r - sigma2 2) T) (sigma npsqrt(T))n n def BlackScholes(typeS0 K r sigma T)n if type==Cn return S0 ssnormcdf(d1(S0 K r sigma T)) - K npexp(-r T) ssnormcdf(d2(S0 K r sigma T))n elsen return K npexp(-r T) ssnormcdf(-d2(S0 K r sigma T)) - S0 ssnormcdf(-d1(S0 K r sigma T)) ] cell_type code execution_count null metadata outputs [] source [ BlackScholes(C1000 1200 002 015 10) ] cell_type code execution_count null metadata outputs [] source [ def difference(x p S K r t)n return BlackScholes(CS K r x t) - p ] cell_type code execution_count null metadata outputs [] source [ from scipyoptimize import bisectn bisect(difference00011args=(11541763731112766 1000 1200 002 10)) ] ] metadata anaconda-cloud kernelspec display_name Python 3 language python name python3 language_info codemirror_mode name ipython version 3 file_extension py mimetype textx-python name python nbconvert_exporter python pygments_lexer ipython3 version 375rc1 nbformat 4 nbformat_minor 1

Black-Scholes Pricing and Hedging

c) Compute the quantityξt =

partg

partx(tSt)

of risky assets in a self-financing portfolio hedging Cd) Repeat the above questions with the terminal condition g(T x) = x

Exercise 68a) Solve the Black-Scholes PDE

rg(tx) = partg

partt(tx) + rx

partg

partx(tx) + σ2

2 x2 part2g

partx2 (tx) (634)

with terminal condition g(T x) = 1 x gt 0

Hint Try a solution of the form g(tx) = f(t) and find f(t)

b) Find the respective quantities ξt and ηt of the risky asset St and risklessasset At = ert in the portfolio with value

Vt = g(tSt) = ξtSt + ηtAt

hedging the contract with payoff $1 at maturity

Exercise 69 Log-contracts see also Exercise 84a) Solve the PDE

0 =partg

partt(x t) + rx

partg

partx(x t) + σ2

2 x2 part2g

partx2 (x t)

with the terminal condition g(xT ) = log x x gt 0

Hint Try a solution of the form g(x t) = f(t) + log x and find f(t)b) Solve the Black-Scholes PDE

rh(x t) = parth

partt(x t) + rx

parth

partx(x t) + σ2

2 x2 part2h

partx2 (x t) (635)

with the terminal condition h(xT ) = log x x gt 0

Hint Try a solution of the form h(x t) = u(t)g(x t) and find u(t)c) Find the respective quantities ξt and ηt of the risky asset St and riskless

asset At = ert in the portfolio with value

Vt = g(St t) = ξtSt + ηtAt

hedging a log-contract with payoff logST at maturity 235

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

Exercise 610 Binary options Consider a price process (St)tisinR+ given by

dStSt

= rdt+ σdBt S0 = 1

under the risk-neutral probability measure Plowast The binary (or digital) calloption is a contract with maturity T strike price K and payoff

Cd = 1[Kinfin)(ST ) =

$1 if ST gt K

0 if ST lt K

a) Derive the Black-Schole PDE satisfied by the pricing function Cd(tSt) ofthe binary call option together with its terminal condition

b) Show that the solution Cd(tx) of the Black-Scholes PDE of Question (a)is given by

Cd(tx) = eminus(Tminust)rΦ((rminus σ22)(T minus t) + log(xK)

|σ|radicT minus t

)= eminus(Tminust)rΦ

(dminus(T minus t)

)

where

dminus(T minus t) =(rminus σ22)(T minus t) + log(StK)

|σ|radicT minus t

0 6 t lt T

Exercise 611

a) Bachelier (1900) model Solve the stochastic differential equation

dSt = αStdt+ σdBt (636)

in terms of ασ isin R and the initial condition S0b) Write down the Bachelier PDE satisfied by the function C(tx) where

C(tSt) is the price at time t isin [0T ] of the contingent claim with payoffφ(ST ) = exp(ST ) and identify the process Delta (ξt)tisin[0T ] that hedgesthis claim

c) Solve the Black-Scholes PDE of Question (b) with the terminal conditionφ(x) = ex x isin R

Hint Search for a solution of the form

C(tx) = exp(minus(T minus t)r+ xh(t) +

σ2

4r (h2(t)minus 1)

) (637)

where h(t) is a function to be determined with h(T ) = 1

236

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

d) Compute the portfolio strategy (ξt ηt)tisin[0T ] that hedges the contingentclaim with payoff exp(ST )

Exercise 612

a) Show that for every fixed value of S the function

d 7minusrarr h(S d) = SΦ(d+ |σ|

radicT)minusK eminusrTΦ(d)

reaches its maximum at dlowast(S) =log(SK) + (rminus σ22)T

|σ|radicT

b) By the differentiation rule

d

dSh(S dlowast(S)) =

parth

partS(S dlowast(S)) + dprimelowast(S)

parth

partd(S dlowast(S))

recover the value of the Black-Scholes Delta

Exercise 613 Compute the Black-Scholes Vega by differentiation of theBlack-Scholes function

gc(tx) = Bl(Kxσ rT minus t) = xΦ(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)

with respect to the volatility parameter σ knowing that

minus12(dminus(T minus t)

)2= minus1

2

(log(xK) + (rminus σ22)(T minus t)

|σ|radicT minus t

)2

= minus12(d+(T minus t)

)2+ (T minus t)r+ log x

K (638)

Exercise 614 Consider the backward induction relation (313) ie

v(tx) = (1minus plowastN )v (t+ 1x(1 + aN )) + plowastN v (t+ 1x(1 + bN ))

using the renormalizations rN = rTN and

aN = (1 + rN )(1minus |σ|radicTN)minus 1 bN = (1 + rN )(1 + |σ|

radicTN)minus 1

of Section 36 N gt 1 with

plowastN =rN minus aNbN minus aN

and plowastN =bN minus rNbN minus aN

a) Show that the Black-Scholes PDE (62) of Proposition 61 can be recoveredfrom the induction relation (313) when the number N of time steps tendsto infinity

237

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

b) Show that the expression of the Delta ξt =partgcpartx

(tSt) can be similarlyrecovered from the finite difference relation (319) ie

ξ(1)t (Stminus1) =

v (t (1 + bN )Stminus1)minus v (t (1 + aN )Stminus1)

Stminus1(bN minus aN )

as N tends to infinity

Problem 615 (Leung and Sircar (2015)) ProShares Ultra SampP500 andProShares UltraShort SampP500 are leveraged investment funds that seek dailyinvestment results before fees and expenses that correspond to β times (βx)the daily performance of the SampP500reg with respectively β = 2 for ProSharesUltra and β = minus2 for ProShares UltraShort Here leveraging with a factorβ 1 aims at multiplying the potential return of an investment by a factorβ The following 10 questions are interdependent and should be treated insequence

a) Consider a risky asset priced S0 = $4 at time t = 0 and taking twopossible values S1 = $5 and S1 = $2 at time t = 1 Compute the twopossible returns (in ) achieved when investing $4 in one share of the assetS and the expected return under the risk-neutral probability measureassuming that the risk-free interest rate is zero

b) Leveraging Still based on an initial $4 investment we decide to leverageby a factor β = 3 by borrowing another (β minus 1) times $4 = 2times $4 at ratezero to purchase a total of β = 3 shares of the asset S Compute thetwo returns (in ) possibly achieved in this case and the expected returnunder the risk-neutral probability measure assuming that the risk-freeinterest rate is zero

c) Denoting by Ft the ProShares value at time t how much should the fundinvest in the underlying asset priced St and how much $ should it borrowor save on the risk-free market at any time t in order to leverage with afactor β 1

d) Find the portfolio allocation (ξt ηt) for the fund value

Ft = ξtSt + ηtAt t isin R+

according to Question (c) where At = A0 ert is the riskless money marketaccount

e) We choose to model the SampP500 index St as the geometric Brownianmotion

dSt = rStdt+ σStdBt t isin R+

under the risk-neutral probability measure Plowast Find the stochastic dif-ferential equation satisfied by (Ft)tisinR+ under the self-financing conditiondFt = ξtdSt + ηtdAt

238

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

f) Is the discounted fund value ( eminusrtFt)tisinR+ a martingale under the risk-neutral probability measure Plowast

g) Find the relation between the fund value Ft and the index St by solvingthe stochastic differential equation obtained for Ft in Question (e) Forsimplicity we normalize F0 = Sβ0

h) Write the price at time t = 0 of the call option with payoff (FT minusK)+ onthe ProShares index using the Black-Scholes formula

i) Show that when β gt 0 the Delta at time t isin [0T ) of the call optionwith payoff (FT minusK)+ on ProShares Ultra is equal to the Delta of thecall option with payoff (ST minusKβ(t))

+ on the SampP500 for a certain strikeprice Kβ(t) to be determined explicitly

j) When β lt 0 find the relation between the Delta at time t isin [0T ) ofthe call option with payoff (FT minusK)+ on ProShares UltraShort and theDelta of the put option with payoff (Kβ(t)minus ST )+ on the SampP500

239

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

  1. pbsARFix223
  2. pbsARFix224
  3. pbsARFix225
  4. pbsARFix226
  5. pbsARFix227
  6. pbsARFix228
  7. pbsARFix229
  8. pbsARFix230
  9. fdrm1
  10. pbsARFix231
  11. 100
  12. 101
  13. 102
  14. 103
  15. 104
  16. 105
  17. 106
  18. 107
  19. 108
  20. 109
  21. 1010
  22. 1011
  23. 1012
  24. 1013
  25. 1014
  26. 1015
  27. 1016
  28. 1017
  29. 1018
  30. 1019
  31. anm10
  32. 10EndLeft
  33. 10StepLeft
  34. 10PauseLeft
  35. 10PlayLeft
  36. 10PlayPauseLeft
  37. 10PauseRight
  38. 10PlayRight
  39. 10PlayPauseRight
  40. 10StepRight
  41. 10EndRight
  42. 10Minus
  43. 10Reset
  44. 10Plus
  45. pbsARFix232
  46. pbsARFix233
  47. pbsARFix234
  48. pbsARFix235
  49. pbsARFix236
  50. pbsARFix237
  51. fdrm2
  52. 110
  53. 111
  54. 112
  55. 113
  56. 114
  57. 115
  58. 116
  59. 117
  60. 118
  61. 119
  62. 1110
  63. 1111
  64. 1112
  65. 1113
  66. 1114
  67. 1115
  68. 1116
  69. 1117
  70. 1118
  71. 1119
  72. anm11
  73. 11EndLeft
  74. 11StepLeft
  75. 11PauseLeft
  76. 11PlayLeft
  77. 11PlayPauseLeft
  78. 11PauseRight
  79. 11PlayRight
  80. 11PlayPauseRight
  81. 11StepRight
  82. 11EndRight
  83. 11Minus
  84. 11Reset
  85. 11Plus
  86. pbsARFix238
  87. pbsARFix239
  88. pbsARFix240
  89. pbsARFix241
  90. pbsARFix242
  91. 120
  92. 121
  93. 122
  94. 123
  95. 124
  96. 125
  97. 126
  98. 127
  99. 128
  100. 129
  101. 1210
  102. anm12
  103. 12EndLeft
  104. 12StepLeft
  105. 12PauseLeft
  106. 12PlayLeft
  107. 12PlayPauseLeft
  108. 12PauseRight
  109. 12PlayRight
  110. 12PlayPauseRight
  111. 12StepRight
  112. 12EndRight
  113. 12Minus
  114. 12Reset
  115. 12Plus
  116. 130
  117. 131
  118. 132
  119. 133
  120. 134
  121. 135
  122. 136
  123. 137
  124. 138
  125. 139
  126. 1310
  127. anm13
  128. 13EndLeft
  129. 13StepLeft
  130. 13PauseLeft
  131. 13PlayLeft
  132. 13PlayPauseLeft
  133. 13PauseRight
  134. 13PlayRight
  135. 13PlayPauseRight
  136. 13StepRight
  137. 13EndRight
  138. 13Minus
  139. 13Reset
  140. 13Plus
  141. pbsARFix243
  142. pbsARFix244
  143. pbsARFix245
  144. pbsARFix246
  145. 140
  146. 141
  147. 142
  148. 143
  149. 144
  150. 145
  151. 146
  152. 147
  153. 148
  154. 149
  155. 1410
  156. 1411
  157. 1412
  158. 1413
  159. 1414
  160. 1415
  161. 1416
  162. 1417
  163. 1418
  164. 1419
  165. 1420
  166. 1421
  167. 1422
  168. 1423
  169. 1424
  170. 1425
  171. 1426
  172. 1427
  173. 1428
  174. 1429
  175. 1430
  176. 1431
  177. 1432
  178. 1433
  179. 1434
  180. 1435
  181. 1436
  182. 1437
  183. 1438
  184. 1439
  185. 1440
  186. 1441
  187. 1442
  188. 1443
  189. 1444
  190. 1445
  191. 1446
  192. 1447
  193. 1448
  194. 1449
  195. 1450
  196. 1451
  197. 1452
  198. 1453
  199. 1454
  200. 1455
  201. 1456
  202. 1457
  203. 1458
  204. 1459
  205. 1460
  206. 1461
  207. 1462
  208. 1463
  209. 1464
  210. 1465
  211. 1466
  212. 1467
  213. 1468
  214. 1469
  215. 1470
  216. 1471
  217. 1472
  218. 1473
  219. 1474
  220. 1475
  221. 1476
  222. 1477
  223. 1478
  224. 1479
  225. 1480
  226. 1481
  227. 1482
  228. 1483
  229. 1484
  230. 1485
  231. 1486
  232. 1487
  233. 1488
  234. 1489
  235. 1490
  236. 1491
  237. 1492
  238. 1493
  239. 1494
  240. 1495
  241. 1496
  242. 1497
  243. 1498
  244. 1499
  245. 14100
  246. 14101
  247. 14102
  248. 14103
  249. 14104
  250. 14105
  251. 14106
  252. 14107
  253. 14108
  254. 14109
  255. 14110
  256. 14111
  257. 14112
  258. 14113
  259. 14114
  260. 14115
  261. 14116
  262. 14117
  263. 14118
  264. 14119
  265. 14120
  266. 14121
  267. 14122
  268. 14123
  269. 14124
  270. 14125
  271. 14126
  272. 14127
  273. 14128
  274. 14129
  275. 14130
  276. 14131
  277. 14132
  278. 14133
  279. 14134
  280. 14135
  281. 14136
  282. 14137
  283. 14138
  284. 14139
  285. 14140
  286. 14141
  287. 14142
  288. 14143
  289. 14144
  290. 14145
  291. 14146
  292. 14147
  293. 14148
  294. 14149
  295. 14150
  296. 14151
  297. 14152
  298. 14153
  299. 14154
  300. 14155
  301. 14156
  302. 14157
  303. 14158
  304. 14159
  305. 14160
  306. 14161
  307. 14162
  308. 14163
  309. 14164
  310. 14165
  311. 14166
  312. 14167
  313. 14168
  314. 14169
  315. 14170
  316. 14171
  317. 14172
  318. 14173
  319. 14174
  320. 14175
  321. 14176
  322. 14177
  323. 14178
  324. 14179
  325. 14180
  326. 14181
  327. 14182
  328. 14183
  329. 14184
  330. 14185
  331. 14186
  332. 14187
  333. 14188
  334. 14189
  335. 14190
  336. 14191
  337. 14192
  338. 14193
  339. 14194
  340. 14195
  341. 14196
  342. 14197
  343. anm14
  344. 14EndLeft
  345. 14StepLeft
  346. 14PauseLeft
  347. 14PlayLeft
  348. 14PlayPauseLeft
  349. 14PauseRight
  350. 14PlayRight
  351. 14PlayPauseRight
  352. 14StepRight
  353. 14EndRight
  354. 14Minus
  355. 14Reset
  356. 14Plus
  357. pbsARFix247
  358. pbsARFix248
  359. 150
  360. 151
  361. 152
  362. 153
  363. 154
  364. 155
  365. 156
  366. 157
  367. 158
  368. 159
  369. 1510
  370. 1511
  371. 1512
  372. 1513
  373. 1514
  374. 1515
  375. 1516
  376. 1517
  377. 1518
  378. 1519
  379. anm15
  380. 15EndLeft
  381. 15StepLeft
  382. 15PauseLeft
  383. 15PlayLeft
  384. 15PlayPauseLeft
  385. 15PauseRight
  386. 15PlayRight
  387. 15PlayPauseRight
  388. 15StepRight
  389. 15EndRight
  390. 15Minus
  391. 15Reset
  392. 15Plus
  393. pbsARFix249
  394. pbsARFix250
  395. pbsARFix251
  396. pbsARFix252
  397. pbsARFix253
  398. pbsARFix254
  399. pbsARFix255
  400. pbsARFix256
  401. pbsARFix257
  402. pbsARFix258
  403. pbsARFix259
  404. pbsARFix260
  405. pbsARFix261
Page 19: Black-ScholesPricingandHedging - NTU · to the Black-Scholes PDE (6.2) in order to price a claim payoff Cof the formC= h(S T).Asinthediscrete-timecase,thearbitragepriceπt(C) at

Black-Scholes Pricing and Hedging

Call option Put option

Option price g(tSt) StΦ(d+(T minus t))minusK eminus(Tminust)rΦ(dminus(T minus t)) K eminus(Tminust)rΦ(minusdminus(T minus t))minus StΦ(minusd+(T minus t))

Delta (∆) partg

partx(tSt) Φ(d+(T minus t)) gt 0 minusΦ(minusd+(T minus t)) 6 0

Gamma (Γ) part2g

partx2 (tSt)Φprime(d+(T minus t))St|σ|

radicT minus t

gt 0

Vega partg

partσ(tSt) St

radicT minus tΦprime(d+(T minus t)) gt 0

Theta (Θ) partg

partt(tSt) minusSt|σ|Φ

prime(d+(T minus t))2radicT minus t

minus rK eminus(Tminust)rΦ(dminus(T minus t)) 6 0 minusSt|σ|Φprime(d+(T minus t))

2radicT minus t

+ rK eminus(Tminust)rΦ(minusdminus(T minus t))

Rho (ρ) partg

partr(tSt) K(T minus t) eminus(Tminust)rΦ(dminus(T minus t)) minusK(T minus t) eminus(Tminust)rΦ(minusdminus(T minus t))

Table 61 Black-Scholes Greeks (Wikipedia)

From Table 61 we can conclude that call option prices are increasing func-tions of the underlying asset price St of the interest rate r and of the volatil-ity parameter σ Similarly put option prices are decreasing functions of theunderlying asset price St of the interest rate r and increasing functions ofthe volatility parameter σ

Parameter Variation of call option prices Variation of put option prices

Underlying St increasing decreasing

Volatility σ increasing increasing

Time t decreasing depends on the underlying price level

Interest rate r increasing decreasing

Table 62 Variations of Black-Scholes prices

The change of sign of the sensitivity Theta (Θ) with respect to time t can beverified in the following Figure 616

219

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

(a) Black-Scholes call price maps (b) Black-Scholes put price maps

Fig 616 Time-dependent solutions of the Black-Scholes PDElowast

Intrinsic value The intrinsic value at time t isin [0T ] of the option withpayoff C = h

(S(1)T

)is given by the immediate exercise payoff h

(S(1)t

) The

extrinsic value at time t isin [0T ] of the option is the remaining differenceπt(C) minus h

(S(1)t

)between the option price πt(C) and the immediate ex-

ercise payoff h(S(1)t

) In general the option price πt(C) decomposes as

πt(C) = h(S(1)t

)︸ ︷︷ ︸intrinsic value

+ πt(C)minus h(S(1)t

)︸ ︷︷ ︸

extrinsic value

0 6 t 6 T ]

Gearing The gearing at time t isin [0T ] of the option with payoff C = h(ST )is defined as the ratio

Gt =St

πt(C)=

Stg(tSt)

0 6 t 6 T

Effective gearing The effective gearing at time t isin [0T ] of the option withpayoff C = h(ST ) is defined as the ratio

Get = Gtξt

=ξtStπt(C)

=St

πt(C)

partg

partx(tSt)

=St

g(tSt)partg

partx(tSt)

= Stpart

partxlog g(tSt) 0 6 t 6 T

lowast The animation works in Acrobat Reader on the entire pdf file

220

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

The effective gearingGet =

ξtStπt(C)

can be interpreted as the hedge ratio ie the percentage of the portfoliowhich is invested on the risky asset When written as

∆g(tSt)g(tSt)

= Get times

∆StSt

the effective gearing gives the relative variation or percentage change∆g(tSt)g(tSt) of the option price g(tSt) from the relative variation∆StSt in the underlying asset price

The ratio Get = Stpart log g(tSt)partx can also be interpreted as an elasticity

coefficient

Break-even price The break-even price BEPt of the underlying asset is thevalue of S for which the intrinsic option value h(S) equals the option priceπt(C) at time t isin [0T ] For European call options it is given by

BEPt = K + πt(C) = K + g(tSt) t = 0 1 N

whereas for European put options it is given by

BEPt = K minus πt(C) = K minus g(tSt) 0 6 t 6 T

Premium The option premium OPt can be defined as the variation requiredfrom the underlying asset price in order to reach the break-even price iewe have

OPt =BEPt minus St

St=K + g(tSt)minus St

St 0 6 t 6 T

for European call options and

OPt =St minusBEPt

St=St + g(tSt)minusK

St 0 6 t 6 T

for European put options see Figure 617 below The term ldquopremiumrdquo issometimes also used to denote the arbitrage price g(tSt) of the option

221

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

f (tx σ)100

=

x =

K =

xpart log f

partx=

σ =

partf

partt(tx σ)=

T=

=(xminusK)x

∆ = = partf

partx(tx σ)

= partf

partσ(tx σ)

=K+f (txσ)minusx

x

=K+f (tx σ)

rf=

partf

partt+rxpartf

partx+

σ2 2x2part2f

partx2

Fig 617 Warrant terms and data

The R package bizdays (requires to install QuantLib) can be used to computecalendar time vs business time to maturity1 installpackages(bizdays)

library(bizdays)3 load_quantlib_calendars(HongKong from=2018-01-01 to=2018-12-31)

load_quantlib_calendars(Singapore from=2018-01-01 to=2018-12-31)5 bizdays(2018-03-10 2018-04-03 QuantLibHongKong)

bizdays(2018-03-10 2018-04-03 QuantLibSingapore)

65 The Heat Equation

In the next proposition we notice that the solution f(tx) of the Black-Scholes PDE (67) can be transformed into a solution g(t y) of the simplerheat equation by a change of variable and a time inversion t 7minusrarr T minus t onthe interval [0T ] so that the terminal condition at time T in the Black-Scholes equation (622) becomes an initial condition at time t = 0 in theheat equation (625) See also here for a related discussion on changes ofvariables for the Black-Scholes PDE

222

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

Proposition 68 Assume that f(tx) solves the Black-Scholes PDErf(tx) = partf

partt(tx) + rx

partf

partx(tx) + 1

2σ2x2 part

2f

partx2 (tx)

f(T x) = (xminusK)+(622)

with terminal condition h(x) = (xminusK)+ x gt 0 Then the function g(t y)defined by

g(t y) = ertf(T minus t e|σ|y+(σ22minusr)t) (623)

solves the heat equation (625) with initial condition

ψ(y) = h(

e|σ|y) y isin R (624)

ie we have partg

partt(t y) = 1

2part2g

party2 (t y)

g(0 y) = h(

e|σ|y)

(625)

Proposition 68 will be proved in Section 66 It will allow us to solve theBlack-Scholes PDE (622) based on the solution of the heat equation (625)with initial condition ψ(y) = h

(e|σ|y

) y isin R by inversion of Relation (623)

with s = T minus t x = e|σ|y+(σ22minusr)t ie

f(sx) = eminus(Tminuss)rg(T minus s minus(σ

22minus r)(T minus s) + log x|σ|

)

Next we focus on the heat equation

partϕ

partt(t y) = 1

2part2ϕ

party2 (t y) (626)

which is used to model the diffusion of heat over time through solids Herethe data of g(x t) represents the temperature measured at time t and pointx We refer the reader to Widder (1975) for a complete treatment of thistopic

223

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

Fig 618 Time-dependent solution of the heat equationlowast

Proposition 69 The fundamental solution of the heat equation (626) isgiven by the Gaussian probability density function

ϕ(t y) =1radic2πt

eminusy2(2t) y isin R

with variance t gt 0

Proof The proof is done by a direct calculation as follows

partϕ

partt(t y) = part

partt

(eminusy2(2t)radic

2πt

)

= minus eminusy2(2t)

2t32radic

2π+

y2

2t2eminusy2(2t)radic

2πt

=

(minus 1

2t +y2

2t2

)ϕ(t y)

and

12part2ϕ

party2 (t y) = minus12part

party

(y

t

eminusy2(2t)radic

2πt

)

= minus eminusy2(2t)

2tradic

2πt+

y2

2t2eminusy2(2t)radic

2πt

=

(minus 1

2t +y2

2t2

)ϕ(t y) t gt 0 y isin R

lowast The animation works in Acrobat Reader on the entire pdf file

224

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

In Section 66 the heat equation (626) will be shown to be equivalent to theBlack-Scholes PDE after a change of variables In particular this will lead tothe explicit solution of the Black-Scholes PDE

Proposition 610 The heat equationpartg

partt(t y) = 1

2part2g

party2 (t y)

g(0 y) = ψ(y)

(627)

with continuous initial condition

g(0 y) = ψ(y)

has the solution

g(t y) =winfinminusinfin

ψ(z) eminus(yminusz)2(2t) dzradic2πt

y isin R t gt 0 (628)

Proof We have

partg

partt(t y) = part

partt

winfinminusinfin

ψ(z) eminus(yminusz)2(2t) dzradic2πt

=winfinminusinfin

ψ(z)part

partt

(eminus(yminusz)2(2t)radic

2πt

)dz

=12winfinminusinfin

ψ(z)

((yminus z)2

t2minus 1t

)eminus(yminusz)2(2t) dzradic

2πt

=12winfinminusinfin

ψ(z)part2

partz2 eminus(yminusz)2(2t) dzradic2πt

=12winfinminusinfin

ψ(z)part2

party2 eminus(yminusz)2(2t) dzradic2πt

=12part2

party2

winfinminusinfin

ψ(z) eminus(yminusz)2(2t) dzradic2πt

=12part2g

party2 (t y)

On the other hand it can be checked that at time t = 0 we have

limtrarr0

winfinminusinfin

ψ(z) eminus(yminusz)2(2t) dzradic2πt

= limtrarr0

winfinminusinfin

ψ(y+ z) eminusz2(2t) dzradic2πt

= ψ(y) y isin R

225

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

The next Figure 619 shows the evolution of g(tx) with initial conditionbased on the European call payoff function h(x) = (xminusK)+ ie

g(0 y) = ψ(y) = h(

e|σ|y)=(

e|σ|y minusK)+ y isin R

Fig 619 Time-dependent solution of the heat equationlowast

Let us provide a second proof of Proposition 610 this time using Brownianmotion and stochastic calculus

Proof of Proposition 610 First note that under the change of variable x =z minus y we have

g(t y) =winfinminusinfin

ψ(z) eminus(yminusz)2(2t) dzradic2πt

=winfinminusinfin

ψ(y+ x) eminusx2(2t) dxradic2πt

= IE[ψ(y+Bt)]

= IE[ψ(yminusBt)]

where (Bt)tisinR+ is a standard Brownian motion and Bt N (0 t) t isin R+Applying Itocircrsquos formula and using the fact that the expectation of the stochas-tic integral with respect to Brownian motion is zero see Relation (417) inProposition 420 we find

g(t y) = IE[ψ(yminusBt)]

= ψ(y)minus IE[w t

0ψprime(yminusBs)dBs

]+

12 IE

[w t0ψprimeprime(yminusBs)ds

]= ψ(y) +

12w t

0IE[ψprimeprime(yminusBs)

]ds

lowast The animation works in Acrobat Reader on the entire pdf file

226

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

= ψ(y) +12w t

0part2

party2 IE [ψ(yminusBs)] ds

= ψ(y) +12w t

0part2g

party2 (s y)ds

Hence we have

partg

partt(t y) = part

parttIE[ψ(yminusBt)]

=12part2

party2 IE [ψ(yminusBt)]

=12part2g

party2 (t y)

Regarding the initial condition we check that

g(0 y) = IE[ψ(yminusB0)] = IE[ψ(y)] = ψ(y)

The expression g(t y) = IE[ψ(yminusBt)] provides a probabilistic interpreta-tion of the heat diffusion phenomenon based on Brownian motion Namelywhen ψε(y) = 1[minusεε](y) we find that

gε(t y) = IE[ψε(yminusBt)]= IE[1[minusεε](yminusBt)]= P

(yminusBt isin [minusε ε]

)= P

(yminus ε 6 Bt 6 y+ ε

)represents the probability of finding Bt within a neighborhood [y minus ε y + ε]of the point y isin R

66 Solution of the Black-Scholes PDE

In this section we solve the Black-Scholes PDE by the kernel method of Sec-tion 65 and a change of variables This solution method uses the change ofvariables (623) of Proposition 68 and a time inversion from which the ter-minal condition at time T in the Black-Scholes equation becomes an initialcondition at time t = 0 in the heat equation

Next we state the proof Proposition 68

Proof Letting s = T minus t and x = e|σ|y+(σ22minusr)t and using Relation (623)ie

g(t y) = ertf(T minus t e|σ|y+(σ22minusr)t)

227

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

we have

partg

partt(t y) = r ertf

(T minus t e|σ|y+(σ22minusr)t)minus ert partf

parts

(T minus t e|σ|y+(σ22minusr)t)

+

(σ2

2 minus r)

ert e|σ|y+(σ22minusr)t partf

partx

(T minus t e|σ|y+(σ22minusr)t)

= r ertf(T minus tx)minus ert partfparts

(T minus tx) +(σ2

2 minus r)

ertxpartfpartx

(T minus tx)

=12 ertx2σ2 part

2f

partx2 (T minus tx) +σ2

2 ertxpartfpartx

(T minus tx) (629)

where on the last step we used the Black-Scholes PDE On the other handwe have

partg

party(t y) = |σ| ert e|σ|y+(σ22minusr)t partf

partx

(T minus t e|σ|y+(σ22minusr)t)

and

12partg2

party2 (t y) =σ2

2 ert e|σ|y+(σ22minusr)t partf

partx

(T minus t e|σ|y+(σ22minusr)t)

+σ2

2 ert e2|σ|y+2(σ22minusr)t part2f

partx2(T minus t e|σ|y+(σ22minusr)t)

=σ2

2 ertxpartfpartx

(T minus tx) + σ2

2 ertx2 part2f

partx2 (T minus tx) (630)

We conclude by comparing (629) with (630) which shows that g(tx) solvesthe heat equation (627) with initial condition

g(0 y) = f(T e|σ|y

)= h

(e|σ|y

)

In the next proposition we derive the Black-Scholes formula (610) by solv-ing the PDE (622) The Black-Scholes formula will also be recovered by aprobabilistic argument via the computation of an expected value in Proposi-tion 77

Proposition 611 When h(x) = (x minusK)+ the solution of the Black-Scholes PDE (622) is given by

f(tx) = xΦ(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

) x gt 0

whereΦ(x) =

1radic2π

w xminusinfin

eminusy22dy x isin R

and

228

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

d+(T minus t) =

log(xK) + (r+ σ22)(T minus t)|σ|radicT minus t

dminus(T minus t) =log(xK) + (rminus σ22)(T minus t)

|σ|radicT minus t

x gt 0 t isin [0T )

Proof By inversion of Relation (623) with s = T minus t and x = e|σ|y+(σ22minusr)twe get

f(sx) = eminus(Tminuss)rg(T minus s minus(σ

22minus r)(T minus s) + log x|σ|

)and

h(x) = ψ

(log x|σ|

) x gt 0 or ψ(y) = h

(e|σ|y

) y isin R

Hence using the solution (628) and Relation (624) we get

f(tx) = eminus(Tminust)rg(T minus t minus(σ

22minus r)(T minus t) + log x|σ|

)= eminus(Tminust)r

winfinminusinfin

ψ

(minus(σ22minus r)(T minus t) + log x

|σ|+ z

)eminusz2(2(Tminust)) dzradic

2(T minus t)π

= eminus(Tminust)rwinfinminusinfin

h(x e|σ|zminus(σ22minusr)(Tminust)) eminusz2(2(Tminust)) dzradic

2(T minus t)π

= eminus(Tminust)rwinfinminusinfin

(x e|σ|zminus(σ22minusr)(Tminust) minusK

)+ eminusz2(2(Tminust)) dzradic2(T minus t)π

= eminus(Tminust)r

timeswinfin

(minusr+σ22)(Tminust)+log(Kx)|σ|

(x e|σ|zminus(σ22minusr)(Tminust) minusK

)eminusz2(2(Tminust)) dzradic

2(T minus t)π

= x eminus(Tminust)rwinfinminusdminus(Tminust)

radicTminust

e|σ|zminus(σ22minusr)(Tminust) eminusz2(2(Tminust)) dzradic2(T minus t)π

minusK eminus(Tminust)rwinfinminusdminus(Tminust)

radicTminust

eminusz2(2(Tminust)) dzradic2(T minus t)π

= xwinfinminusdminus(Tminust)

radicTminust

e|σ|zminus(Tminust)σ22minusz2(2(Tminust)) dzradic2(T minus t)π

minusK eminus(Tminust)rwinfinminusdminus(Tminust)

radicTminust

eminusz2(2(Tminust)) dzradic2(T minus t)π

= xwinfinminusdminus(Tminust)

radicTminust

eminus(zminus(Tminust)|σ|)2(2(Tminust)) dzradic2(T minus t)π

229

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

minusK eminus(Tminust)rwinfinminusdminus(Tminust)

radicTminust

eminusz2(2(Tminust)) dzradic2(T minus t)π

= xwinfinminusdminus(Tminust)

radicTminustminus(Tminust)|σ|

eminusz2(2(Tminust)) dzradic2(T minus t)π

minusK eminus(Tminust)rwinfinminusdminus(Tminust)

radicTminust

eminusz2(2(Tminust)) dzradic2(T minus t)π

= xwinfinminusdminus(Tminust)minus|σ|

radicTminust

eminusz22 dzradic2πminusK eminus(Tminust)r

winfinminusdminus(Tminust)

eminusz22 dzradic2π

= x(1minusΦ

(minus d+(T minus t)

))minusK eminus(Tminust)r

(1minusΦ

(minus dminus(T minus t)

))= xΦ

(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)

where we used the relation (614) ie

1minusΦ(a) = Φ(minusa) a isin R

Exercises

Exercise 61 Bachelier (1900) model Consider a market made of a risklessasset valued At = A0 with zero interest rate t isin R+ and a risky asset whoseprice St is modeled by a standard Brownian motion as St = Bt t isin R+

a) Show that the price g(tBt) of the option with payoff C = B2T satisfies

the heat equationpartϕ

partt(t y) = minus1

2part2ϕ

party2 (t y)

with terminal condition g(T x) = x2b) Find the function g(tx) by solving the PDE of Question (a)

Hint Try a solution of the form g(tx) = x2 + f(t)

See Exercises 611 713 and 714 for extensions to nonzero interest rates

Exercise 62 Consider a risky asset price (St)tisinR modeled in the Cox et al(1985) (CIR) model as

dSt = β(αminus St)dt+ σradicStdBt αβσ gt 0 (631)

and let (ηt ξt)tisinR+ be a portfolio strategy whose value Vt = ηtAt + ξtSttakes the form Vt = g(tSt) t isin R+ Figure 620 presents a random simula-tion of the solution to (631) with α = 0025 β = 1 and σ = 13230

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

0

1

2

3

4

5

6

7

8

0 01 02 03 04 05 06 07 08 09 1

St

t

Fig 620 Graph of the CIR short rate t 7rarr rt with α = 25 β = 1 and σ = 13

N=10000 t lt- 0(N-1) dt lt- 10Na=0025 b=2 sigma=0052 X lt- rnorm(Nmean=0sd=sqrt(dt))R lt- rep(0N)R[1]=001

for (j in 2N)R[j]=max(0R[j-1]+(a-bR[j-1])dt+sigmasqrt(R[j-1])X[j])4 plot(t R xlab = t ylab = type = l ylim = c(0002) col = blue)

Based on the self-financing condition written as

dVt = rVtdtminus rξtStdt+ ξtdSt

= rVtdtminus rξtStdt+ β(αminus St)ξtdt+ σξtradicStdBt t isin R+ (632)

derive the PDE satisfied by the function g(tx) using the Itocirc formula

Exercise 63 Black-Scholes PDE with dividends Consider a riskless as-set with price At = A0 ert t isin R+ and an underlying asset price process(St)tisinR+ modeled as

dSt = (microminus δ)Stdt+ σStdBt

where (Bt)tisinR+ is a standard Brownian motion and δ gt 0 is a continuous-time dividend rate By absence of arbitrage the payment of a dividend entailsa drop in the stock price by the same amount occuring generally on the ex-dividend date on which the purchase of the security no longer entitles theinvestor to the dividend amount The list of investors entitled to dividendpayment is consolidated on the date of record and payment is made on thepayable date

library(quantmod)2 getSymbols(0005HKfrom=2010-01-01to=SysDate()src=yahoo)

getDividends(0005HKfrom=2010-01-01to=SysDate()src=yahoo)

a) Assuming that the portfolio with value Vt = ξtSt + ηtAt at time t is self-financing and that dividends are continuously reinvested write down theportfolio variation dVt

231

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

b) Assuming that the portfolio value Vt takes the form Vt = g(tSt) at timet derive the Black-Scholes PDE for the function g(tx) with its terminalcondition

c) Compute the price at time t isin [0T ] of the European call option withstrike price K by solving the corresponding Black-Scholes PDE

d) Compute the Delta of the option

Exercise 64

a) Check that the Black-Scholes formula (610) for European call options

gc(tx) = xΦ(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)

satisfies the following boundary conditions

i) at x = 0 gc(t 0) = 0ii) at maturity t = T

gc(T x) = (xminusK)+ =

xminusK x gt K

0 x 6 K

iii) as time to maturity tends to infinity

limTrarrinfin

Bl(Kxσ rT minus t) = x t isin R+

b) Check that the Black-Scholes formula (618) for European put options

gp(tx) = K eminus(Tminust)rΦ(minus dminus(T minus t)

)minus xΦ

(minus d+(T minus t)

)satisfies the following boundary conditions

i) at x = 0 gp(t 0) = K eminus(Tminust)rii) as x tends to infinity gp(tinfin) = 0 for all t isin [0T )iii) at maturity t = T

gp(T x) = (K minus x)+ =

0 x gt K

K minus x x 6 K

iv) as time to maturity tends to infinity

limTrarrinfin

Blp(KStσ rT minus t) = 0 t isin R+

Exercise 65 Power option (Exercise 314 continued)

232

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

a) Solve the Black-Scholes PDE

rg(x t) = partg

partt(x t) + rx

partg

partx(x t) + σ2

2 x2 part2g

partx2 (x t) (633)

with terminal condition g(xT ) = x2 x gt 0 t isin [0T ]

Hint Try a solution of the form g(x t) = x2f(t) and find f(t)b) Find the respective quantities ξt and ηt of the risky asset St and riskless

asset At = ert in the portfolio with value

Vt = g(St t) = ξtSt + ηtAt 0 6 t 6 T

hedging the contract with payoff S2T at maturity

Exercise 66 On December 18 2007 a call warrant has been issued byFortis Bank on the stock price S of the MTR Corporation with maturityT = 23122008 strike price K = HK$ 3608 and entitlement ratio=10Recall that in the Black-Scholes model the price at time t of the Europeanclaim on the underlying asset priced St with strike price K maturity T interest rate r and volatility σ gt 0 is given by the Black-Scholes formula as

f(tSt) = StΦ(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)

wheredminus(T minus t) =

(rminus σ22)(T minus t) + log(StK)

|σ|radicT minus t

d+(T minus t) = dminus(T minus t) + |σ|radicT minus t = (r+ σ22)(T minus t) + log(StK)

|σ|radicT minus t

Recall that by Proposition 64 we have

partf

partx(tSt) = Φ

(d+(T minus t)

) 0 6 t 6 T

a) Using the values of the Gaussian cumulative distribution function com-pute the Black-Scholes price of the corresponding call option at timet =November 07 2008 with St = HK$ 17200 assuming a volatility σ =90 = 090 and an annual risk-free interest rate r = 4377 = 004377

b) Still using the Gaussian cumulative distribution function compute thequantity of the risky asset required in your portfolio at time t =November07 2008 in order to hedge one such option at maturity T = 23122008

c) Figure 1 represents the Black-Scholes price of the call option as a functionof σ isin [05 15] = [50 150]

233

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

0

01

02

03

04

05

06

05 06 07 08 09 1 11 12 13 14 15σimp

Optio

n pr

ice

σ

Market price

Fig 621 Option price as a function of the volatility σ gt 0

1 BSCall lt- function(S K r T sigma)d1 lt- (log(SK)+(r+sigma^22)T)(sigmasqrt(T))d2 lt- d1 - sigma sqrt(T)

3 BSCall = Spnorm(d1) - Kexp(-rT)pnorm(d2)BSCallsigma lt- seq(0515 length=100)

5 plot(sigmaBSCall(172360800437746365sigma) type=llty=1 xlab=Sigmaylab=Black-Scholes Call Price ylim = c(006)col=bluelwd=3)grid()

abline(h=023col=redlwd=3)

Knowing that the closing price of the warrant on November 07 2008 wasHK$ 0023 which value can you infer for the implied volatility σ at thisdatelowast

Exercise 67 Forward contracts Recall that the price πt(C) of a claimpayoff C = h(ST ) of maturity T can be written as πt(C) = g(tSt) wherethe function g(tx) satisfies the Black-Scholes PDE

rg(tx) = partg

partt(tx) + rx

partg

partx(tx) + 1

2σ2x2 part

2g

partx2 (tx)

g(T x) = h(x) (1)

with terminal condition g(T x) = h(x) x gt 0

a) Assume that C is a forward contract with payoff

C = ST minusK

at time T Find the function h(x) in (1)b) Find the solution g(tx) of the above PDE and compute the price πt(C)

at time t isin [0T ]Hint search for a solution of the form g(tx) = xminus α(t) where α(t) is afunction of t to be determined

lowast Download the corresponding or the that can be runhere

234

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

BS lt- function(S K T r sig)d1 lt- (log(SK) + (r + sig^22)T) (sigsqrt(T))d2 lt- d1 - sigsqrt(T)return(Spnorm(d1) - Kexp(-rT)pnorm(d2))impliedvol lt- function(S K T r market)sig lt- 020sigup lt- 1sigdown lt- 0001count lt- 0err lt- BS(S K T r sig) - marketwhile(abs(err) gt 000001 ampamp countlt1000)if(err lt 0)sigdown lt- sigsig lt- (sigup + sig)2elsesigup lt- sigsig lt- (sigdown + sig)2err lt- BS(S K T r sig) - marketcount lt- count + 1if(count==2000)return(NA)elsereturn(sig)market = 083K = 628T = 7 365S = 634r = 002impliedvol(S K T r market)

cells [ cell_type code execution_count null metadata outputs [] source [ from IPythoncoredisplay import display HTMLn display(HTML( )) ] cell_type code execution_count null metadata collapsed true outputs [] source [ import numpy as npn import scipystats as ssn import time n n Black and Scholesn def d1(S0 K r sigma T)n return (nplog(S0K) + (r + sigma2 2) T)(sigma npsqrt(T))n n def d2(S0 K r sigma T)n return (nplog(S0 K) + (r - sigma2 2) T) (sigma npsqrt(T))n n def BlackScholes(typeS0 K r sigma T)n if type==Cn return S0 ssnormcdf(d1(S0 K r sigma T)) - K npexp(-r T) ssnormcdf(d2(S0 K r sigma T))n elsen return K npexp(-r T) ssnormcdf(-d2(S0 K r sigma T)) - S0 ssnormcdf(-d1(S0 K r sigma T)) ] cell_type code execution_count null metadata outputs [] source [ BlackScholes(C1000 1200 002 015 10) ] cell_type code execution_count null metadata outputs [] source [ def difference(x p S K r t)n return BlackScholes(CS K r x t) - p ] cell_type code execution_count null metadata outputs [] source [ from scipyoptimize import bisectn bisect(difference00011args=(11541763731112766 1000 1200 002 10)) ] ] metadata anaconda-cloud kernelspec display_name Python 3 language python name python3 language_info codemirror_mode name ipython version 3 file_extension py mimetype textx-python name python nbconvert_exporter python pygments_lexer ipython3 version 375rc1 nbformat 4 nbformat_minor 1

Black-Scholes Pricing and Hedging

c) Compute the quantityξt =

partg

partx(tSt)

of risky assets in a self-financing portfolio hedging Cd) Repeat the above questions with the terminal condition g(T x) = x

Exercise 68a) Solve the Black-Scholes PDE

rg(tx) = partg

partt(tx) + rx

partg

partx(tx) + σ2

2 x2 part2g

partx2 (tx) (634)

with terminal condition g(T x) = 1 x gt 0

Hint Try a solution of the form g(tx) = f(t) and find f(t)

b) Find the respective quantities ξt and ηt of the risky asset St and risklessasset At = ert in the portfolio with value

Vt = g(tSt) = ξtSt + ηtAt

hedging the contract with payoff $1 at maturity

Exercise 69 Log-contracts see also Exercise 84a) Solve the PDE

0 =partg

partt(x t) + rx

partg

partx(x t) + σ2

2 x2 part2g

partx2 (x t)

with the terminal condition g(xT ) = log x x gt 0

Hint Try a solution of the form g(x t) = f(t) + log x and find f(t)b) Solve the Black-Scholes PDE

rh(x t) = parth

partt(x t) + rx

parth

partx(x t) + σ2

2 x2 part2h

partx2 (x t) (635)

with the terminal condition h(xT ) = log x x gt 0

Hint Try a solution of the form h(x t) = u(t)g(x t) and find u(t)c) Find the respective quantities ξt and ηt of the risky asset St and riskless

asset At = ert in the portfolio with value

Vt = g(St t) = ξtSt + ηtAt

hedging a log-contract with payoff logST at maturity 235

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

Exercise 610 Binary options Consider a price process (St)tisinR+ given by

dStSt

= rdt+ σdBt S0 = 1

under the risk-neutral probability measure Plowast The binary (or digital) calloption is a contract with maturity T strike price K and payoff

Cd = 1[Kinfin)(ST ) =

$1 if ST gt K

0 if ST lt K

a) Derive the Black-Schole PDE satisfied by the pricing function Cd(tSt) ofthe binary call option together with its terminal condition

b) Show that the solution Cd(tx) of the Black-Scholes PDE of Question (a)is given by

Cd(tx) = eminus(Tminust)rΦ((rminus σ22)(T minus t) + log(xK)

|σ|radicT minus t

)= eminus(Tminust)rΦ

(dminus(T minus t)

)

where

dminus(T minus t) =(rminus σ22)(T minus t) + log(StK)

|σ|radicT minus t

0 6 t lt T

Exercise 611

a) Bachelier (1900) model Solve the stochastic differential equation

dSt = αStdt+ σdBt (636)

in terms of ασ isin R and the initial condition S0b) Write down the Bachelier PDE satisfied by the function C(tx) where

C(tSt) is the price at time t isin [0T ] of the contingent claim with payoffφ(ST ) = exp(ST ) and identify the process Delta (ξt)tisin[0T ] that hedgesthis claim

c) Solve the Black-Scholes PDE of Question (b) with the terminal conditionφ(x) = ex x isin R

Hint Search for a solution of the form

C(tx) = exp(minus(T minus t)r+ xh(t) +

σ2

4r (h2(t)minus 1)

) (637)

where h(t) is a function to be determined with h(T ) = 1

236

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

d) Compute the portfolio strategy (ξt ηt)tisin[0T ] that hedges the contingentclaim with payoff exp(ST )

Exercise 612

a) Show that for every fixed value of S the function

d 7minusrarr h(S d) = SΦ(d+ |σ|

radicT)minusK eminusrTΦ(d)

reaches its maximum at dlowast(S) =log(SK) + (rminus σ22)T

|σ|radicT

b) By the differentiation rule

d

dSh(S dlowast(S)) =

parth

partS(S dlowast(S)) + dprimelowast(S)

parth

partd(S dlowast(S))

recover the value of the Black-Scholes Delta

Exercise 613 Compute the Black-Scholes Vega by differentiation of theBlack-Scholes function

gc(tx) = Bl(Kxσ rT minus t) = xΦ(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)

with respect to the volatility parameter σ knowing that

minus12(dminus(T minus t)

)2= minus1

2

(log(xK) + (rminus σ22)(T minus t)

|σ|radicT minus t

)2

= minus12(d+(T minus t)

)2+ (T minus t)r+ log x

K (638)

Exercise 614 Consider the backward induction relation (313) ie

v(tx) = (1minus plowastN )v (t+ 1x(1 + aN )) + plowastN v (t+ 1x(1 + bN ))

using the renormalizations rN = rTN and

aN = (1 + rN )(1minus |σ|radicTN)minus 1 bN = (1 + rN )(1 + |σ|

radicTN)minus 1

of Section 36 N gt 1 with

plowastN =rN minus aNbN minus aN

and plowastN =bN minus rNbN minus aN

a) Show that the Black-Scholes PDE (62) of Proposition 61 can be recoveredfrom the induction relation (313) when the number N of time steps tendsto infinity

237

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

b) Show that the expression of the Delta ξt =partgcpartx

(tSt) can be similarlyrecovered from the finite difference relation (319) ie

ξ(1)t (Stminus1) =

v (t (1 + bN )Stminus1)minus v (t (1 + aN )Stminus1)

Stminus1(bN minus aN )

as N tends to infinity

Problem 615 (Leung and Sircar (2015)) ProShares Ultra SampP500 andProShares UltraShort SampP500 are leveraged investment funds that seek dailyinvestment results before fees and expenses that correspond to β times (βx)the daily performance of the SampP500reg with respectively β = 2 for ProSharesUltra and β = minus2 for ProShares UltraShort Here leveraging with a factorβ 1 aims at multiplying the potential return of an investment by a factorβ The following 10 questions are interdependent and should be treated insequence

a) Consider a risky asset priced S0 = $4 at time t = 0 and taking twopossible values S1 = $5 and S1 = $2 at time t = 1 Compute the twopossible returns (in ) achieved when investing $4 in one share of the assetS and the expected return under the risk-neutral probability measureassuming that the risk-free interest rate is zero

b) Leveraging Still based on an initial $4 investment we decide to leverageby a factor β = 3 by borrowing another (β minus 1) times $4 = 2times $4 at ratezero to purchase a total of β = 3 shares of the asset S Compute thetwo returns (in ) possibly achieved in this case and the expected returnunder the risk-neutral probability measure assuming that the risk-freeinterest rate is zero

c) Denoting by Ft the ProShares value at time t how much should the fundinvest in the underlying asset priced St and how much $ should it borrowor save on the risk-free market at any time t in order to leverage with afactor β 1

d) Find the portfolio allocation (ξt ηt) for the fund value

Ft = ξtSt + ηtAt t isin R+

according to Question (c) where At = A0 ert is the riskless money marketaccount

e) We choose to model the SampP500 index St as the geometric Brownianmotion

dSt = rStdt+ σStdBt t isin R+

under the risk-neutral probability measure Plowast Find the stochastic dif-ferential equation satisfied by (Ft)tisinR+ under the self-financing conditiondFt = ξtdSt + ηtdAt

238

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

f) Is the discounted fund value ( eminusrtFt)tisinR+ a martingale under the risk-neutral probability measure Plowast

g) Find the relation between the fund value Ft and the index St by solvingthe stochastic differential equation obtained for Ft in Question (e) Forsimplicity we normalize F0 = Sβ0

h) Write the price at time t = 0 of the call option with payoff (FT minusK)+ onthe ProShares index using the Black-Scholes formula

i) Show that when β gt 0 the Delta at time t isin [0T ) of the call optionwith payoff (FT minusK)+ on ProShares Ultra is equal to the Delta of thecall option with payoff (ST minusKβ(t))

+ on the SampP500 for a certain strikeprice Kβ(t) to be determined explicitly

j) When β lt 0 find the relation between the Delta at time t isin [0T ) ofthe call option with payoff (FT minusK)+ on ProShares UltraShort and theDelta of the put option with payoff (Kβ(t)minus ST )+ on the SampP500

239

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

  1. pbsARFix223
  2. pbsARFix224
  3. pbsARFix225
  4. pbsARFix226
  5. pbsARFix227
  6. pbsARFix228
  7. pbsARFix229
  8. pbsARFix230
  9. fdrm1
  10. pbsARFix231
  11. 100
  12. 101
  13. 102
  14. 103
  15. 104
  16. 105
  17. 106
  18. 107
  19. 108
  20. 109
  21. 1010
  22. 1011
  23. 1012
  24. 1013
  25. 1014
  26. 1015
  27. 1016
  28. 1017
  29. 1018
  30. 1019
  31. anm10
  32. 10EndLeft
  33. 10StepLeft
  34. 10PauseLeft
  35. 10PlayLeft
  36. 10PlayPauseLeft
  37. 10PauseRight
  38. 10PlayRight
  39. 10PlayPauseRight
  40. 10StepRight
  41. 10EndRight
  42. 10Minus
  43. 10Reset
  44. 10Plus
  45. pbsARFix232
  46. pbsARFix233
  47. pbsARFix234
  48. pbsARFix235
  49. pbsARFix236
  50. pbsARFix237
  51. fdrm2
  52. 110
  53. 111
  54. 112
  55. 113
  56. 114
  57. 115
  58. 116
  59. 117
  60. 118
  61. 119
  62. 1110
  63. 1111
  64. 1112
  65. 1113
  66. 1114
  67. 1115
  68. 1116
  69. 1117
  70. 1118
  71. 1119
  72. anm11
  73. 11EndLeft
  74. 11StepLeft
  75. 11PauseLeft
  76. 11PlayLeft
  77. 11PlayPauseLeft
  78. 11PauseRight
  79. 11PlayRight
  80. 11PlayPauseRight
  81. 11StepRight
  82. 11EndRight
  83. 11Minus
  84. 11Reset
  85. 11Plus
  86. pbsARFix238
  87. pbsARFix239
  88. pbsARFix240
  89. pbsARFix241
  90. pbsARFix242
  91. 120
  92. 121
  93. 122
  94. 123
  95. 124
  96. 125
  97. 126
  98. 127
  99. 128
  100. 129
  101. 1210
  102. anm12
  103. 12EndLeft
  104. 12StepLeft
  105. 12PauseLeft
  106. 12PlayLeft
  107. 12PlayPauseLeft
  108. 12PauseRight
  109. 12PlayRight
  110. 12PlayPauseRight
  111. 12StepRight
  112. 12EndRight
  113. 12Minus
  114. 12Reset
  115. 12Plus
  116. 130
  117. 131
  118. 132
  119. 133
  120. 134
  121. 135
  122. 136
  123. 137
  124. 138
  125. 139
  126. 1310
  127. anm13
  128. 13EndLeft
  129. 13StepLeft
  130. 13PauseLeft
  131. 13PlayLeft
  132. 13PlayPauseLeft
  133. 13PauseRight
  134. 13PlayRight
  135. 13PlayPauseRight
  136. 13StepRight
  137. 13EndRight
  138. 13Minus
  139. 13Reset
  140. 13Plus
  141. pbsARFix243
  142. pbsARFix244
  143. pbsARFix245
  144. pbsARFix246
  145. 140
  146. 141
  147. 142
  148. 143
  149. 144
  150. 145
  151. 146
  152. 147
  153. 148
  154. 149
  155. 1410
  156. 1411
  157. 1412
  158. 1413
  159. 1414
  160. 1415
  161. 1416
  162. 1417
  163. 1418
  164. 1419
  165. 1420
  166. 1421
  167. 1422
  168. 1423
  169. 1424
  170. 1425
  171. 1426
  172. 1427
  173. 1428
  174. 1429
  175. 1430
  176. 1431
  177. 1432
  178. 1433
  179. 1434
  180. 1435
  181. 1436
  182. 1437
  183. 1438
  184. 1439
  185. 1440
  186. 1441
  187. 1442
  188. 1443
  189. 1444
  190. 1445
  191. 1446
  192. 1447
  193. 1448
  194. 1449
  195. 1450
  196. 1451
  197. 1452
  198. 1453
  199. 1454
  200. 1455
  201. 1456
  202. 1457
  203. 1458
  204. 1459
  205. 1460
  206. 1461
  207. 1462
  208. 1463
  209. 1464
  210. 1465
  211. 1466
  212. 1467
  213. 1468
  214. 1469
  215. 1470
  216. 1471
  217. 1472
  218. 1473
  219. 1474
  220. 1475
  221. 1476
  222. 1477
  223. 1478
  224. 1479
  225. 1480
  226. 1481
  227. 1482
  228. 1483
  229. 1484
  230. 1485
  231. 1486
  232. 1487
  233. 1488
  234. 1489
  235. 1490
  236. 1491
  237. 1492
  238. 1493
  239. 1494
  240. 1495
  241. 1496
  242. 1497
  243. 1498
  244. 1499
  245. 14100
  246. 14101
  247. 14102
  248. 14103
  249. 14104
  250. 14105
  251. 14106
  252. 14107
  253. 14108
  254. 14109
  255. 14110
  256. 14111
  257. 14112
  258. 14113
  259. 14114
  260. 14115
  261. 14116
  262. 14117
  263. 14118
  264. 14119
  265. 14120
  266. 14121
  267. 14122
  268. 14123
  269. 14124
  270. 14125
  271. 14126
  272. 14127
  273. 14128
  274. 14129
  275. 14130
  276. 14131
  277. 14132
  278. 14133
  279. 14134
  280. 14135
  281. 14136
  282. 14137
  283. 14138
  284. 14139
  285. 14140
  286. 14141
  287. 14142
  288. 14143
  289. 14144
  290. 14145
  291. 14146
  292. 14147
  293. 14148
  294. 14149
  295. 14150
  296. 14151
  297. 14152
  298. 14153
  299. 14154
  300. 14155
  301. 14156
  302. 14157
  303. 14158
  304. 14159
  305. 14160
  306. 14161
  307. 14162
  308. 14163
  309. 14164
  310. 14165
  311. 14166
  312. 14167
  313. 14168
  314. 14169
  315. 14170
  316. 14171
  317. 14172
  318. 14173
  319. 14174
  320. 14175
  321. 14176
  322. 14177
  323. 14178
  324. 14179
  325. 14180
  326. 14181
  327. 14182
  328. 14183
  329. 14184
  330. 14185
  331. 14186
  332. 14187
  333. 14188
  334. 14189
  335. 14190
  336. 14191
  337. 14192
  338. 14193
  339. 14194
  340. 14195
  341. 14196
  342. 14197
  343. anm14
  344. 14EndLeft
  345. 14StepLeft
  346. 14PauseLeft
  347. 14PlayLeft
  348. 14PlayPauseLeft
  349. 14PauseRight
  350. 14PlayRight
  351. 14PlayPauseRight
  352. 14StepRight
  353. 14EndRight
  354. 14Minus
  355. 14Reset
  356. 14Plus
  357. pbsARFix247
  358. pbsARFix248
  359. 150
  360. 151
  361. 152
  362. 153
  363. 154
  364. 155
  365. 156
  366. 157
  367. 158
  368. 159
  369. 1510
  370. 1511
  371. 1512
  372. 1513
  373. 1514
  374. 1515
  375. 1516
  376. 1517
  377. 1518
  378. 1519
  379. anm15
  380. 15EndLeft
  381. 15StepLeft
  382. 15PauseLeft
  383. 15PlayLeft
  384. 15PlayPauseLeft
  385. 15PauseRight
  386. 15PlayRight
  387. 15PlayPauseRight
  388. 15StepRight
  389. 15EndRight
  390. 15Minus
  391. 15Reset
  392. 15Plus
  393. pbsARFix249
  394. pbsARFix250
  395. pbsARFix251
  396. pbsARFix252
  397. pbsARFix253
  398. pbsARFix254
  399. pbsARFix255
  400. pbsARFix256
  401. pbsARFix257
  402. pbsARFix258
  403. pbsARFix259
  404. pbsARFix260
  405. pbsARFix261
Page 20: Black-ScholesPricingandHedging - NTU · to the Black-Scholes PDE (6.2) in order to price a claim payoff Cof the formC= h(S T).Asinthediscrete-timecase,thearbitragepriceπt(C) at

N Privault

(a) Black-Scholes call price maps (b) Black-Scholes put price maps

Fig 616 Time-dependent solutions of the Black-Scholes PDElowast

Intrinsic value The intrinsic value at time t isin [0T ] of the option withpayoff C = h

(S(1)T

)is given by the immediate exercise payoff h

(S(1)t

) The

extrinsic value at time t isin [0T ] of the option is the remaining differenceπt(C) minus h

(S(1)t

)between the option price πt(C) and the immediate ex-

ercise payoff h(S(1)t

) In general the option price πt(C) decomposes as

πt(C) = h(S(1)t

)︸ ︷︷ ︸intrinsic value

+ πt(C)minus h(S(1)t

)︸ ︷︷ ︸

extrinsic value

0 6 t 6 T ]

Gearing The gearing at time t isin [0T ] of the option with payoff C = h(ST )is defined as the ratio

Gt =St

πt(C)=

Stg(tSt)

0 6 t 6 T

Effective gearing The effective gearing at time t isin [0T ] of the option withpayoff C = h(ST ) is defined as the ratio

Get = Gtξt

=ξtStπt(C)

=St

πt(C)

partg

partx(tSt)

=St

g(tSt)partg

partx(tSt)

= Stpart

partxlog g(tSt) 0 6 t 6 T

lowast The animation works in Acrobat Reader on the entire pdf file

220

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

The effective gearingGet =

ξtStπt(C)

can be interpreted as the hedge ratio ie the percentage of the portfoliowhich is invested on the risky asset When written as

∆g(tSt)g(tSt)

= Get times

∆StSt

the effective gearing gives the relative variation or percentage change∆g(tSt)g(tSt) of the option price g(tSt) from the relative variation∆StSt in the underlying asset price

The ratio Get = Stpart log g(tSt)partx can also be interpreted as an elasticity

coefficient

Break-even price The break-even price BEPt of the underlying asset is thevalue of S for which the intrinsic option value h(S) equals the option priceπt(C) at time t isin [0T ] For European call options it is given by

BEPt = K + πt(C) = K + g(tSt) t = 0 1 N

whereas for European put options it is given by

BEPt = K minus πt(C) = K minus g(tSt) 0 6 t 6 T

Premium The option premium OPt can be defined as the variation requiredfrom the underlying asset price in order to reach the break-even price iewe have

OPt =BEPt minus St

St=K + g(tSt)minus St

St 0 6 t 6 T

for European call options and

OPt =St minusBEPt

St=St + g(tSt)minusK

St 0 6 t 6 T

for European put options see Figure 617 below The term ldquopremiumrdquo issometimes also used to denote the arbitrage price g(tSt) of the option

221

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

f (tx σ)100

=

x =

K =

xpart log f

partx=

σ =

partf

partt(tx σ)=

T=

=(xminusK)x

∆ = = partf

partx(tx σ)

= partf

partσ(tx σ)

=K+f (txσ)minusx

x

=K+f (tx σ)

rf=

partf

partt+rxpartf

partx+

σ2 2x2part2f

partx2

Fig 617 Warrant terms and data

The R package bizdays (requires to install QuantLib) can be used to computecalendar time vs business time to maturity1 installpackages(bizdays)

library(bizdays)3 load_quantlib_calendars(HongKong from=2018-01-01 to=2018-12-31)

load_quantlib_calendars(Singapore from=2018-01-01 to=2018-12-31)5 bizdays(2018-03-10 2018-04-03 QuantLibHongKong)

bizdays(2018-03-10 2018-04-03 QuantLibSingapore)

65 The Heat Equation

In the next proposition we notice that the solution f(tx) of the Black-Scholes PDE (67) can be transformed into a solution g(t y) of the simplerheat equation by a change of variable and a time inversion t 7minusrarr T minus t onthe interval [0T ] so that the terminal condition at time T in the Black-Scholes equation (622) becomes an initial condition at time t = 0 in theheat equation (625) See also here for a related discussion on changes ofvariables for the Black-Scholes PDE

222

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

Proposition 68 Assume that f(tx) solves the Black-Scholes PDErf(tx) = partf

partt(tx) + rx

partf

partx(tx) + 1

2σ2x2 part

2f

partx2 (tx)

f(T x) = (xminusK)+(622)

with terminal condition h(x) = (xminusK)+ x gt 0 Then the function g(t y)defined by

g(t y) = ertf(T minus t e|σ|y+(σ22minusr)t) (623)

solves the heat equation (625) with initial condition

ψ(y) = h(

e|σ|y) y isin R (624)

ie we have partg

partt(t y) = 1

2part2g

party2 (t y)

g(0 y) = h(

e|σ|y)

(625)

Proposition 68 will be proved in Section 66 It will allow us to solve theBlack-Scholes PDE (622) based on the solution of the heat equation (625)with initial condition ψ(y) = h

(e|σ|y

) y isin R by inversion of Relation (623)

with s = T minus t x = e|σ|y+(σ22minusr)t ie

f(sx) = eminus(Tminuss)rg(T minus s minus(σ

22minus r)(T minus s) + log x|σ|

)

Next we focus on the heat equation

partϕ

partt(t y) = 1

2part2ϕ

party2 (t y) (626)

which is used to model the diffusion of heat over time through solids Herethe data of g(x t) represents the temperature measured at time t and pointx We refer the reader to Widder (1975) for a complete treatment of thistopic

223

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

Fig 618 Time-dependent solution of the heat equationlowast

Proposition 69 The fundamental solution of the heat equation (626) isgiven by the Gaussian probability density function

ϕ(t y) =1radic2πt

eminusy2(2t) y isin R

with variance t gt 0

Proof The proof is done by a direct calculation as follows

partϕ

partt(t y) = part

partt

(eminusy2(2t)radic

2πt

)

= minus eminusy2(2t)

2t32radic

2π+

y2

2t2eminusy2(2t)radic

2πt

=

(minus 1

2t +y2

2t2

)ϕ(t y)

and

12part2ϕ

party2 (t y) = minus12part

party

(y

t

eminusy2(2t)radic

2πt

)

= minus eminusy2(2t)

2tradic

2πt+

y2

2t2eminusy2(2t)radic

2πt

=

(minus 1

2t +y2

2t2

)ϕ(t y) t gt 0 y isin R

lowast The animation works in Acrobat Reader on the entire pdf file

224

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

In Section 66 the heat equation (626) will be shown to be equivalent to theBlack-Scholes PDE after a change of variables In particular this will lead tothe explicit solution of the Black-Scholes PDE

Proposition 610 The heat equationpartg

partt(t y) = 1

2part2g

party2 (t y)

g(0 y) = ψ(y)

(627)

with continuous initial condition

g(0 y) = ψ(y)

has the solution

g(t y) =winfinminusinfin

ψ(z) eminus(yminusz)2(2t) dzradic2πt

y isin R t gt 0 (628)

Proof We have

partg

partt(t y) = part

partt

winfinminusinfin

ψ(z) eminus(yminusz)2(2t) dzradic2πt

=winfinminusinfin

ψ(z)part

partt

(eminus(yminusz)2(2t)radic

2πt

)dz

=12winfinminusinfin

ψ(z)

((yminus z)2

t2minus 1t

)eminus(yminusz)2(2t) dzradic

2πt

=12winfinminusinfin

ψ(z)part2

partz2 eminus(yminusz)2(2t) dzradic2πt

=12winfinminusinfin

ψ(z)part2

party2 eminus(yminusz)2(2t) dzradic2πt

=12part2

party2

winfinminusinfin

ψ(z) eminus(yminusz)2(2t) dzradic2πt

=12part2g

party2 (t y)

On the other hand it can be checked that at time t = 0 we have

limtrarr0

winfinminusinfin

ψ(z) eminus(yminusz)2(2t) dzradic2πt

= limtrarr0

winfinminusinfin

ψ(y+ z) eminusz2(2t) dzradic2πt

= ψ(y) y isin R

225

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

The next Figure 619 shows the evolution of g(tx) with initial conditionbased on the European call payoff function h(x) = (xminusK)+ ie

g(0 y) = ψ(y) = h(

e|σ|y)=(

e|σ|y minusK)+ y isin R

Fig 619 Time-dependent solution of the heat equationlowast

Let us provide a second proof of Proposition 610 this time using Brownianmotion and stochastic calculus

Proof of Proposition 610 First note that under the change of variable x =z minus y we have

g(t y) =winfinminusinfin

ψ(z) eminus(yminusz)2(2t) dzradic2πt

=winfinminusinfin

ψ(y+ x) eminusx2(2t) dxradic2πt

= IE[ψ(y+Bt)]

= IE[ψ(yminusBt)]

where (Bt)tisinR+ is a standard Brownian motion and Bt N (0 t) t isin R+Applying Itocircrsquos formula and using the fact that the expectation of the stochas-tic integral with respect to Brownian motion is zero see Relation (417) inProposition 420 we find

g(t y) = IE[ψ(yminusBt)]

= ψ(y)minus IE[w t

0ψprime(yminusBs)dBs

]+

12 IE

[w t0ψprimeprime(yminusBs)ds

]= ψ(y) +

12w t

0IE[ψprimeprime(yminusBs)

]ds

lowast The animation works in Acrobat Reader on the entire pdf file

226

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

= ψ(y) +12w t

0part2

party2 IE [ψ(yminusBs)] ds

= ψ(y) +12w t

0part2g

party2 (s y)ds

Hence we have

partg

partt(t y) = part

parttIE[ψ(yminusBt)]

=12part2

party2 IE [ψ(yminusBt)]

=12part2g

party2 (t y)

Regarding the initial condition we check that

g(0 y) = IE[ψ(yminusB0)] = IE[ψ(y)] = ψ(y)

The expression g(t y) = IE[ψ(yminusBt)] provides a probabilistic interpreta-tion of the heat diffusion phenomenon based on Brownian motion Namelywhen ψε(y) = 1[minusεε](y) we find that

gε(t y) = IE[ψε(yminusBt)]= IE[1[minusεε](yminusBt)]= P

(yminusBt isin [minusε ε]

)= P

(yminus ε 6 Bt 6 y+ ε

)represents the probability of finding Bt within a neighborhood [y minus ε y + ε]of the point y isin R

66 Solution of the Black-Scholes PDE

In this section we solve the Black-Scholes PDE by the kernel method of Sec-tion 65 and a change of variables This solution method uses the change ofvariables (623) of Proposition 68 and a time inversion from which the ter-minal condition at time T in the Black-Scholes equation becomes an initialcondition at time t = 0 in the heat equation

Next we state the proof Proposition 68

Proof Letting s = T minus t and x = e|σ|y+(σ22minusr)t and using Relation (623)ie

g(t y) = ertf(T minus t e|σ|y+(σ22minusr)t)

227

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

we have

partg

partt(t y) = r ertf

(T minus t e|σ|y+(σ22minusr)t)minus ert partf

parts

(T minus t e|σ|y+(σ22minusr)t)

+

(σ2

2 minus r)

ert e|σ|y+(σ22minusr)t partf

partx

(T minus t e|σ|y+(σ22minusr)t)

= r ertf(T minus tx)minus ert partfparts

(T minus tx) +(σ2

2 minus r)

ertxpartfpartx

(T minus tx)

=12 ertx2σ2 part

2f

partx2 (T minus tx) +σ2

2 ertxpartfpartx

(T minus tx) (629)

where on the last step we used the Black-Scholes PDE On the other handwe have

partg

party(t y) = |σ| ert e|σ|y+(σ22minusr)t partf

partx

(T minus t e|σ|y+(σ22minusr)t)

and

12partg2

party2 (t y) =σ2

2 ert e|σ|y+(σ22minusr)t partf

partx

(T minus t e|σ|y+(σ22minusr)t)

+σ2

2 ert e2|σ|y+2(σ22minusr)t part2f

partx2(T minus t e|σ|y+(σ22minusr)t)

=σ2

2 ertxpartfpartx

(T minus tx) + σ2

2 ertx2 part2f

partx2 (T minus tx) (630)

We conclude by comparing (629) with (630) which shows that g(tx) solvesthe heat equation (627) with initial condition

g(0 y) = f(T e|σ|y

)= h

(e|σ|y

)

In the next proposition we derive the Black-Scholes formula (610) by solv-ing the PDE (622) The Black-Scholes formula will also be recovered by aprobabilistic argument via the computation of an expected value in Proposi-tion 77

Proposition 611 When h(x) = (x minusK)+ the solution of the Black-Scholes PDE (622) is given by

f(tx) = xΦ(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

) x gt 0

whereΦ(x) =

1radic2π

w xminusinfin

eminusy22dy x isin R

and

228

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

d+(T minus t) =

log(xK) + (r+ σ22)(T minus t)|σ|radicT minus t

dminus(T minus t) =log(xK) + (rminus σ22)(T minus t)

|σ|radicT minus t

x gt 0 t isin [0T )

Proof By inversion of Relation (623) with s = T minus t and x = e|σ|y+(σ22minusr)twe get

f(sx) = eminus(Tminuss)rg(T minus s minus(σ

22minus r)(T minus s) + log x|σ|

)and

h(x) = ψ

(log x|σ|

) x gt 0 or ψ(y) = h

(e|σ|y

) y isin R

Hence using the solution (628) and Relation (624) we get

f(tx) = eminus(Tminust)rg(T minus t minus(σ

22minus r)(T minus t) + log x|σ|

)= eminus(Tminust)r

winfinminusinfin

ψ

(minus(σ22minus r)(T minus t) + log x

|σ|+ z

)eminusz2(2(Tminust)) dzradic

2(T minus t)π

= eminus(Tminust)rwinfinminusinfin

h(x e|σ|zminus(σ22minusr)(Tminust)) eminusz2(2(Tminust)) dzradic

2(T minus t)π

= eminus(Tminust)rwinfinminusinfin

(x e|σ|zminus(σ22minusr)(Tminust) minusK

)+ eminusz2(2(Tminust)) dzradic2(T minus t)π

= eminus(Tminust)r

timeswinfin

(minusr+σ22)(Tminust)+log(Kx)|σ|

(x e|σ|zminus(σ22minusr)(Tminust) minusK

)eminusz2(2(Tminust)) dzradic

2(T minus t)π

= x eminus(Tminust)rwinfinminusdminus(Tminust)

radicTminust

e|σ|zminus(σ22minusr)(Tminust) eminusz2(2(Tminust)) dzradic2(T minus t)π

minusK eminus(Tminust)rwinfinminusdminus(Tminust)

radicTminust

eminusz2(2(Tminust)) dzradic2(T minus t)π

= xwinfinminusdminus(Tminust)

radicTminust

e|σ|zminus(Tminust)σ22minusz2(2(Tminust)) dzradic2(T minus t)π

minusK eminus(Tminust)rwinfinminusdminus(Tminust)

radicTminust

eminusz2(2(Tminust)) dzradic2(T minus t)π

= xwinfinminusdminus(Tminust)

radicTminust

eminus(zminus(Tminust)|σ|)2(2(Tminust)) dzradic2(T minus t)π

229

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

minusK eminus(Tminust)rwinfinminusdminus(Tminust)

radicTminust

eminusz2(2(Tminust)) dzradic2(T minus t)π

= xwinfinminusdminus(Tminust)

radicTminustminus(Tminust)|σ|

eminusz2(2(Tminust)) dzradic2(T minus t)π

minusK eminus(Tminust)rwinfinminusdminus(Tminust)

radicTminust

eminusz2(2(Tminust)) dzradic2(T minus t)π

= xwinfinminusdminus(Tminust)minus|σ|

radicTminust

eminusz22 dzradic2πminusK eminus(Tminust)r

winfinminusdminus(Tminust)

eminusz22 dzradic2π

= x(1minusΦ

(minus d+(T minus t)

))minusK eminus(Tminust)r

(1minusΦ

(minus dminus(T minus t)

))= xΦ

(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)

where we used the relation (614) ie

1minusΦ(a) = Φ(minusa) a isin R

Exercises

Exercise 61 Bachelier (1900) model Consider a market made of a risklessasset valued At = A0 with zero interest rate t isin R+ and a risky asset whoseprice St is modeled by a standard Brownian motion as St = Bt t isin R+

a) Show that the price g(tBt) of the option with payoff C = B2T satisfies

the heat equationpartϕ

partt(t y) = minus1

2part2ϕ

party2 (t y)

with terminal condition g(T x) = x2b) Find the function g(tx) by solving the PDE of Question (a)

Hint Try a solution of the form g(tx) = x2 + f(t)

See Exercises 611 713 and 714 for extensions to nonzero interest rates

Exercise 62 Consider a risky asset price (St)tisinR modeled in the Cox et al(1985) (CIR) model as

dSt = β(αminus St)dt+ σradicStdBt αβσ gt 0 (631)

and let (ηt ξt)tisinR+ be a portfolio strategy whose value Vt = ηtAt + ξtSttakes the form Vt = g(tSt) t isin R+ Figure 620 presents a random simula-tion of the solution to (631) with α = 0025 β = 1 and σ = 13230

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

0

1

2

3

4

5

6

7

8

0 01 02 03 04 05 06 07 08 09 1

St

t

Fig 620 Graph of the CIR short rate t 7rarr rt with α = 25 β = 1 and σ = 13

N=10000 t lt- 0(N-1) dt lt- 10Na=0025 b=2 sigma=0052 X lt- rnorm(Nmean=0sd=sqrt(dt))R lt- rep(0N)R[1]=001

for (j in 2N)R[j]=max(0R[j-1]+(a-bR[j-1])dt+sigmasqrt(R[j-1])X[j])4 plot(t R xlab = t ylab = type = l ylim = c(0002) col = blue)

Based on the self-financing condition written as

dVt = rVtdtminus rξtStdt+ ξtdSt

= rVtdtminus rξtStdt+ β(αminus St)ξtdt+ σξtradicStdBt t isin R+ (632)

derive the PDE satisfied by the function g(tx) using the Itocirc formula

Exercise 63 Black-Scholes PDE with dividends Consider a riskless as-set with price At = A0 ert t isin R+ and an underlying asset price process(St)tisinR+ modeled as

dSt = (microminus δ)Stdt+ σStdBt

where (Bt)tisinR+ is a standard Brownian motion and δ gt 0 is a continuous-time dividend rate By absence of arbitrage the payment of a dividend entailsa drop in the stock price by the same amount occuring generally on the ex-dividend date on which the purchase of the security no longer entitles theinvestor to the dividend amount The list of investors entitled to dividendpayment is consolidated on the date of record and payment is made on thepayable date

library(quantmod)2 getSymbols(0005HKfrom=2010-01-01to=SysDate()src=yahoo)

getDividends(0005HKfrom=2010-01-01to=SysDate()src=yahoo)

a) Assuming that the portfolio with value Vt = ξtSt + ηtAt at time t is self-financing and that dividends are continuously reinvested write down theportfolio variation dVt

231

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

b) Assuming that the portfolio value Vt takes the form Vt = g(tSt) at timet derive the Black-Scholes PDE for the function g(tx) with its terminalcondition

c) Compute the price at time t isin [0T ] of the European call option withstrike price K by solving the corresponding Black-Scholes PDE

d) Compute the Delta of the option

Exercise 64

a) Check that the Black-Scholes formula (610) for European call options

gc(tx) = xΦ(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)

satisfies the following boundary conditions

i) at x = 0 gc(t 0) = 0ii) at maturity t = T

gc(T x) = (xminusK)+ =

xminusK x gt K

0 x 6 K

iii) as time to maturity tends to infinity

limTrarrinfin

Bl(Kxσ rT minus t) = x t isin R+

b) Check that the Black-Scholes formula (618) for European put options

gp(tx) = K eminus(Tminust)rΦ(minus dminus(T minus t)

)minus xΦ

(minus d+(T minus t)

)satisfies the following boundary conditions

i) at x = 0 gp(t 0) = K eminus(Tminust)rii) as x tends to infinity gp(tinfin) = 0 for all t isin [0T )iii) at maturity t = T

gp(T x) = (K minus x)+ =

0 x gt K

K minus x x 6 K

iv) as time to maturity tends to infinity

limTrarrinfin

Blp(KStσ rT minus t) = 0 t isin R+

Exercise 65 Power option (Exercise 314 continued)

232

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

a) Solve the Black-Scholes PDE

rg(x t) = partg

partt(x t) + rx

partg

partx(x t) + σ2

2 x2 part2g

partx2 (x t) (633)

with terminal condition g(xT ) = x2 x gt 0 t isin [0T ]

Hint Try a solution of the form g(x t) = x2f(t) and find f(t)b) Find the respective quantities ξt and ηt of the risky asset St and riskless

asset At = ert in the portfolio with value

Vt = g(St t) = ξtSt + ηtAt 0 6 t 6 T

hedging the contract with payoff S2T at maturity

Exercise 66 On December 18 2007 a call warrant has been issued byFortis Bank on the stock price S of the MTR Corporation with maturityT = 23122008 strike price K = HK$ 3608 and entitlement ratio=10Recall that in the Black-Scholes model the price at time t of the Europeanclaim on the underlying asset priced St with strike price K maturity T interest rate r and volatility σ gt 0 is given by the Black-Scholes formula as

f(tSt) = StΦ(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)

wheredminus(T minus t) =

(rminus σ22)(T minus t) + log(StK)

|σ|radicT minus t

d+(T minus t) = dminus(T minus t) + |σ|radicT minus t = (r+ σ22)(T minus t) + log(StK)

|σ|radicT minus t

Recall that by Proposition 64 we have

partf

partx(tSt) = Φ

(d+(T minus t)

) 0 6 t 6 T

a) Using the values of the Gaussian cumulative distribution function com-pute the Black-Scholes price of the corresponding call option at timet =November 07 2008 with St = HK$ 17200 assuming a volatility σ =90 = 090 and an annual risk-free interest rate r = 4377 = 004377

b) Still using the Gaussian cumulative distribution function compute thequantity of the risky asset required in your portfolio at time t =November07 2008 in order to hedge one such option at maturity T = 23122008

c) Figure 1 represents the Black-Scholes price of the call option as a functionof σ isin [05 15] = [50 150]

233

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

0

01

02

03

04

05

06

05 06 07 08 09 1 11 12 13 14 15σimp

Optio

n pr

ice

σ

Market price

Fig 621 Option price as a function of the volatility σ gt 0

1 BSCall lt- function(S K r T sigma)d1 lt- (log(SK)+(r+sigma^22)T)(sigmasqrt(T))d2 lt- d1 - sigma sqrt(T)

3 BSCall = Spnorm(d1) - Kexp(-rT)pnorm(d2)BSCallsigma lt- seq(0515 length=100)

5 plot(sigmaBSCall(172360800437746365sigma) type=llty=1 xlab=Sigmaylab=Black-Scholes Call Price ylim = c(006)col=bluelwd=3)grid()

abline(h=023col=redlwd=3)

Knowing that the closing price of the warrant on November 07 2008 wasHK$ 0023 which value can you infer for the implied volatility σ at thisdatelowast

Exercise 67 Forward contracts Recall that the price πt(C) of a claimpayoff C = h(ST ) of maturity T can be written as πt(C) = g(tSt) wherethe function g(tx) satisfies the Black-Scholes PDE

rg(tx) = partg

partt(tx) + rx

partg

partx(tx) + 1

2σ2x2 part

2g

partx2 (tx)

g(T x) = h(x) (1)

with terminal condition g(T x) = h(x) x gt 0

a) Assume that C is a forward contract with payoff

C = ST minusK

at time T Find the function h(x) in (1)b) Find the solution g(tx) of the above PDE and compute the price πt(C)

at time t isin [0T ]Hint search for a solution of the form g(tx) = xminus α(t) where α(t) is afunction of t to be determined

lowast Download the corresponding or the that can be runhere

234

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

BS lt- function(S K T r sig)d1 lt- (log(SK) + (r + sig^22)T) (sigsqrt(T))d2 lt- d1 - sigsqrt(T)return(Spnorm(d1) - Kexp(-rT)pnorm(d2))impliedvol lt- function(S K T r market)sig lt- 020sigup lt- 1sigdown lt- 0001count lt- 0err lt- BS(S K T r sig) - marketwhile(abs(err) gt 000001 ampamp countlt1000)if(err lt 0)sigdown lt- sigsig lt- (sigup + sig)2elsesigup lt- sigsig lt- (sigdown + sig)2err lt- BS(S K T r sig) - marketcount lt- count + 1if(count==2000)return(NA)elsereturn(sig)market = 083K = 628T = 7 365S = 634r = 002impliedvol(S K T r market)

cells [ cell_type code execution_count null metadata outputs [] source [ from IPythoncoredisplay import display HTMLn display(HTML( )) ] cell_type code execution_count null metadata collapsed true outputs [] source [ import numpy as npn import scipystats as ssn import time n n Black and Scholesn def d1(S0 K r sigma T)n return (nplog(S0K) + (r + sigma2 2) T)(sigma npsqrt(T))n n def d2(S0 K r sigma T)n return (nplog(S0 K) + (r - sigma2 2) T) (sigma npsqrt(T))n n def BlackScholes(typeS0 K r sigma T)n if type==Cn return S0 ssnormcdf(d1(S0 K r sigma T)) - K npexp(-r T) ssnormcdf(d2(S0 K r sigma T))n elsen return K npexp(-r T) ssnormcdf(-d2(S0 K r sigma T)) - S0 ssnormcdf(-d1(S0 K r sigma T)) ] cell_type code execution_count null metadata outputs [] source [ BlackScholes(C1000 1200 002 015 10) ] cell_type code execution_count null metadata outputs [] source [ def difference(x p S K r t)n return BlackScholes(CS K r x t) - p ] cell_type code execution_count null metadata outputs [] source [ from scipyoptimize import bisectn bisect(difference00011args=(11541763731112766 1000 1200 002 10)) ] ] metadata anaconda-cloud kernelspec display_name Python 3 language python name python3 language_info codemirror_mode name ipython version 3 file_extension py mimetype textx-python name python nbconvert_exporter python pygments_lexer ipython3 version 375rc1 nbformat 4 nbformat_minor 1

Black-Scholes Pricing and Hedging

c) Compute the quantityξt =

partg

partx(tSt)

of risky assets in a self-financing portfolio hedging Cd) Repeat the above questions with the terminal condition g(T x) = x

Exercise 68a) Solve the Black-Scholes PDE

rg(tx) = partg

partt(tx) + rx

partg

partx(tx) + σ2

2 x2 part2g

partx2 (tx) (634)

with terminal condition g(T x) = 1 x gt 0

Hint Try a solution of the form g(tx) = f(t) and find f(t)

b) Find the respective quantities ξt and ηt of the risky asset St and risklessasset At = ert in the portfolio with value

Vt = g(tSt) = ξtSt + ηtAt

hedging the contract with payoff $1 at maturity

Exercise 69 Log-contracts see also Exercise 84a) Solve the PDE

0 =partg

partt(x t) + rx

partg

partx(x t) + σ2

2 x2 part2g

partx2 (x t)

with the terminal condition g(xT ) = log x x gt 0

Hint Try a solution of the form g(x t) = f(t) + log x and find f(t)b) Solve the Black-Scholes PDE

rh(x t) = parth

partt(x t) + rx

parth

partx(x t) + σ2

2 x2 part2h

partx2 (x t) (635)

with the terminal condition h(xT ) = log x x gt 0

Hint Try a solution of the form h(x t) = u(t)g(x t) and find u(t)c) Find the respective quantities ξt and ηt of the risky asset St and riskless

asset At = ert in the portfolio with value

Vt = g(St t) = ξtSt + ηtAt

hedging a log-contract with payoff logST at maturity 235

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

Exercise 610 Binary options Consider a price process (St)tisinR+ given by

dStSt

= rdt+ σdBt S0 = 1

under the risk-neutral probability measure Plowast The binary (or digital) calloption is a contract with maturity T strike price K and payoff

Cd = 1[Kinfin)(ST ) =

$1 if ST gt K

0 if ST lt K

a) Derive the Black-Schole PDE satisfied by the pricing function Cd(tSt) ofthe binary call option together with its terminal condition

b) Show that the solution Cd(tx) of the Black-Scholes PDE of Question (a)is given by

Cd(tx) = eminus(Tminust)rΦ((rminus σ22)(T minus t) + log(xK)

|σ|radicT minus t

)= eminus(Tminust)rΦ

(dminus(T minus t)

)

where

dminus(T minus t) =(rminus σ22)(T minus t) + log(StK)

|σ|radicT minus t

0 6 t lt T

Exercise 611

a) Bachelier (1900) model Solve the stochastic differential equation

dSt = αStdt+ σdBt (636)

in terms of ασ isin R and the initial condition S0b) Write down the Bachelier PDE satisfied by the function C(tx) where

C(tSt) is the price at time t isin [0T ] of the contingent claim with payoffφ(ST ) = exp(ST ) and identify the process Delta (ξt)tisin[0T ] that hedgesthis claim

c) Solve the Black-Scholes PDE of Question (b) with the terminal conditionφ(x) = ex x isin R

Hint Search for a solution of the form

C(tx) = exp(minus(T minus t)r+ xh(t) +

σ2

4r (h2(t)minus 1)

) (637)

where h(t) is a function to be determined with h(T ) = 1

236

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

d) Compute the portfolio strategy (ξt ηt)tisin[0T ] that hedges the contingentclaim with payoff exp(ST )

Exercise 612

a) Show that for every fixed value of S the function

d 7minusrarr h(S d) = SΦ(d+ |σ|

radicT)minusK eminusrTΦ(d)

reaches its maximum at dlowast(S) =log(SK) + (rminus σ22)T

|σ|radicT

b) By the differentiation rule

d

dSh(S dlowast(S)) =

parth

partS(S dlowast(S)) + dprimelowast(S)

parth

partd(S dlowast(S))

recover the value of the Black-Scholes Delta

Exercise 613 Compute the Black-Scholes Vega by differentiation of theBlack-Scholes function

gc(tx) = Bl(Kxσ rT minus t) = xΦ(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)

with respect to the volatility parameter σ knowing that

minus12(dminus(T minus t)

)2= minus1

2

(log(xK) + (rminus σ22)(T minus t)

|σ|radicT minus t

)2

= minus12(d+(T minus t)

)2+ (T minus t)r+ log x

K (638)

Exercise 614 Consider the backward induction relation (313) ie

v(tx) = (1minus plowastN )v (t+ 1x(1 + aN )) + plowastN v (t+ 1x(1 + bN ))

using the renormalizations rN = rTN and

aN = (1 + rN )(1minus |σ|radicTN)minus 1 bN = (1 + rN )(1 + |σ|

radicTN)minus 1

of Section 36 N gt 1 with

plowastN =rN minus aNbN minus aN

and plowastN =bN minus rNbN minus aN

a) Show that the Black-Scholes PDE (62) of Proposition 61 can be recoveredfrom the induction relation (313) when the number N of time steps tendsto infinity

237

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

b) Show that the expression of the Delta ξt =partgcpartx

(tSt) can be similarlyrecovered from the finite difference relation (319) ie

ξ(1)t (Stminus1) =

v (t (1 + bN )Stminus1)minus v (t (1 + aN )Stminus1)

Stminus1(bN minus aN )

as N tends to infinity

Problem 615 (Leung and Sircar (2015)) ProShares Ultra SampP500 andProShares UltraShort SampP500 are leveraged investment funds that seek dailyinvestment results before fees and expenses that correspond to β times (βx)the daily performance of the SampP500reg with respectively β = 2 for ProSharesUltra and β = minus2 for ProShares UltraShort Here leveraging with a factorβ 1 aims at multiplying the potential return of an investment by a factorβ The following 10 questions are interdependent and should be treated insequence

a) Consider a risky asset priced S0 = $4 at time t = 0 and taking twopossible values S1 = $5 and S1 = $2 at time t = 1 Compute the twopossible returns (in ) achieved when investing $4 in one share of the assetS and the expected return under the risk-neutral probability measureassuming that the risk-free interest rate is zero

b) Leveraging Still based on an initial $4 investment we decide to leverageby a factor β = 3 by borrowing another (β minus 1) times $4 = 2times $4 at ratezero to purchase a total of β = 3 shares of the asset S Compute thetwo returns (in ) possibly achieved in this case and the expected returnunder the risk-neutral probability measure assuming that the risk-freeinterest rate is zero

c) Denoting by Ft the ProShares value at time t how much should the fundinvest in the underlying asset priced St and how much $ should it borrowor save on the risk-free market at any time t in order to leverage with afactor β 1

d) Find the portfolio allocation (ξt ηt) for the fund value

Ft = ξtSt + ηtAt t isin R+

according to Question (c) where At = A0 ert is the riskless money marketaccount

e) We choose to model the SampP500 index St as the geometric Brownianmotion

dSt = rStdt+ σStdBt t isin R+

under the risk-neutral probability measure Plowast Find the stochastic dif-ferential equation satisfied by (Ft)tisinR+ under the self-financing conditiondFt = ξtdSt + ηtdAt

238

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

f) Is the discounted fund value ( eminusrtFt)tisinR+ a martingale under the risk-neutral probability measure Plowast

g) Find the relation between the fund value Ft and the index St by solvingthe stochastic differential equation obtained for Ft in Question (e) Forsimplicity we normalize F0 = Sβ0

h) Write the price at time t = 0 of the call option with payoff (FT minusK)+ onthe ProShares index using the Black-Scholes formula

i) Show that when β gt 0 the Delta at time t isin [0T ) of the call optionwith payoff (FT minusK)+ on ProShares Ultra is equal to the Delta of thecall option with payoff (ST minusKβ(t))

+ on the SampP500 for a certain strikeprice Kβ(t) to be determined explicitly

j) When β lt 0 find the relation between the Delta at time t isin [0T ) ofthe call option with payoff (FT minusK)+ on ProShares UltraShort and theDelta of the put option with payoff (Kβ(t)minus ST )+ on the SampP500

239

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

  1. pbsARFix223
  2. pbsARFix224
  3. pbsARFix225
  4. pbsARFix226
  5. pbsARFix227
  6. pbsARFix228
  7. pbsARFix229
  8. pbsARFix230
  9. fdrm1
  10. pbsARFix231
  11. 100
  12. 101
  13. 102
  14. 103
  15. 104
  16. 105
  17. 106
  18. 107
  19. 108
  20. 109
  21. 1010
  22. 1011
  23. 1012
  24. 1013
  25. 1014
  26. 1015
  27. 1016
  28. 1017
  29. 1018
  30. 1019
  31. anm10
  32. 10EndLeft
  33. 10StepLeft
  34. 10PauseLeft
  35. 10PlayLeft
  36. 10PlayPauseLeft
  37. 10PauseRight
  38. 10PlayRight
  39. 10PlayPauseRight
  40. 10StepRight
  41. 10EndRight
  42. 10Minus
  43. 10Reset
  44. 10Plus
  45. pbsARFix232
  46. pbsARFix233
  47. pbsARFix234
  48. pbsARFix235
  49. pbsARFix236
  50. pbsARFix237
  51. fdrm2
  52. 110
  53. 111
  54. 112
  55. 113
  56. 114
  57. 115
  58. 116
  59. 117
  60. 118
  61. 119
  62. 1110
  63. 1111
  64. 1112
  65. 1113
  66. 1114
  67. 1115
  68. 1116
  69. 1117
  70. 1118
  71. 1119
  72. anm11
  73. 11EndLeft
  74. 11StepLeft
  75. 11PauseLeft
  76. 11PlayLeft
  77. 11PlayPauseLeft
  78. 11PauseRight
  79. 11PlayRight
  80. 11PlayPauseRight
  81. 11StepRight
  82. 11EndRight
  83. 11Minus
  84. 11Reset
  85. 11Plus
  86. pbsARFix238
  87. pbsARFix239
  88. pbsARFix240
  89. pbsARFix241
  90. pbsARFix242
  91. 120
  92. 121
  93. 122
  94. 123
  95. 124
  96. 125
  97. 126
  98. 127
  99. 128
  100. 129
  101. 1210
  102. anm12
  103. 12EndLeft
  104. 12StepLeft
  105. 12PauseLeft
  106. 12PlayLeft
  107. 12PlayPauseLeft
  108. 12PauseRight
  109. 12PlayRight
  110. 12PlayPauseRight
  111. 12StepRight
  112. 12EndRight
  113. 12Minus
  114. 12Reset
  115. 12Plus
  116. 130
  117. 131
  118. 132
  119. 133
  120. 134
  121. 135
  122. 136
  123. 137
  124. 138
  125. 139
  126. 1310
  127. anm13
  128. 13EndLeft
  129. 13StepLeft
  130. 13PauseLeft
  131. 13PlayLeft
  132. 13PlayPauseLeft
  133. 13PauseRight
  134. 13PlayRight
  135. 13PlayPauseRight
  136. 13StepRight
  137. 13EndRight
  138. 13Minus
  139. 13Reset
  140. 13Plus
  141. pbsARFix243
  142. pbsARFix244
  143. pbsARFix245
  144. pbsARFix246
  145. 140
  146. 141
  147. 142
  148. 143
  149. 144
  150. 145
  151. 146
  152. 147
  153. 148
  154. 149
  155. 1410
  156. 1411
  157. 1412
  158. 1413
  159. 1414
  160. 1415
  161. 1416
  162. 1417
  163. 1418
  164. 1419
  165. 1420
  166. 1421
  167. 1422
  168. 1423
  169. 1424
  170. 1425
  171. 1426
  172. 1427
  173. 1428
  174. 1429
  175. 1430
  176. 1431
  177. 1432
  178. 1433
  179. 1434
  180. 1435
  181. 1436
  182. 1437
  183. 1438
  184. 1439
  185. 1440
  186. 1441
  187. 1442
  188. 1443
  189. 1444
  190. 1445
  191. 1446
  192. 1447
  193. 1448
  194. 1449
  195. 1450
  196. 1451
  197. 1452
  198. 1453
  199. 1454
  200. 1455
  201. 1456
  202. 1457
  203. 1458
  204. 1459
  205. 1460
  206. 1461
  207. 1462
  208. 1463
  209. 1464
  210. 1465
  211. 1466
  212. 1467
  213. 1468
  214. 1469
  215. 1470
  216. 1471
  217. 1472
  218. 1473
  219. 1474
  220. 1475
  221. 1476
  222. 1477
  223. 1478
  224. 1479
  225. 1480
  226. 1481
  227. 1482
  228. 1483
  229. 1484
  230. 1485
  231. 1486
  232. 1487
  233. 1488
  234. 1489
  235. 1490
  236. 1491
  237. 1492
  238. 1493
  239. 1494
  240. 1495
  241. 1496
  242. 1497
  243. 1498
  244. 1499
  245. 14100
  246. 14101
  247. 14102
  248. 14103
  249. 14104
  250. 14105
  251. 14106
  252. 14107
  253. 14108
  254. 14109
  255. 14110
  256. 14111
  257. 14112
  258. 14113
  259. 14114
  260. 14115
  261. 14116
  262. 14117
  263. 14118
  264. 14119
  265. 14120
  266. 14121
  267. 14122
  268. 14123
  269. 14124
  270. 14125
  271. 14126
  272. 14127
  273. 14128
  274. 14129
  275. 14130
  276. 14131
  277. 14132
  278. 14133
  279. 14134
  280. 14135
  281. 14136
  282. 14137
  283. 14138
  284. 14139
  285. 14140
  286. 14141
  287. 14142
  288. 14143
  289. 14144
  290. 14145
  291. 14146
  292. 14147
  293. 14148
  294. 14149
  295. 14150
  296. 14151
  297. 14152
  298. 14153
  299. 14154
  300. 14155
  301. 14156
  302. 14157
  303. 14158
  304. 14159
  305. 14160
  306. 14161
  307. 14162
  308. 14163
  309. 14164
  310. 14165
  311. 14166
  312. 14167
  313. 14168
  314. 14169
  315. 14170
  316. 14171
  317. 14172
  318. 14173
  319. 14174
  320. 14175
  321. 14176
  322. 14177
  323. 14178
  324. 14179
  325. 14180
  326. 14181
  327. 14182
  328. 14183
  329. 14184
  330. 14185
  331. 14186
  332. 14187
  333. 14188
  334. 14189
  335. 14190
  336. 14191
  337. 14192
  338. 14193
  339. 14194
  340. 14195
  341. 14196
  342. 14197
  343. anm14
  344. 14EndLeft
  345. 14StepLeft
  346. 14PauseLeft
  347. 14PlayLeft
  348. 14PlayPauseLeft
  349. 14PauseRight
  350. 14PlayRight
  351. 14PlayPauseRight
  352. 14StepRight
  353. 14EndRight
  354. 14Minus
  355. 14Reset
  356. 14Plus
  357. pbsARFix247
  358. pbsARFix248
  359. 150
  360. 151
  361. 152
  362. 153
  363. 154
  364. 155
  365. 156
  366. 157
  367. 158
  368. 159
  369. 1510
  370. 1511
  371. 1512
  372. 1513
  373. 1514
  374. 1515
  375. 1516
  376. 1517
  377. 1518
  378. 1519
  379. anm15
  380. 15EndLeft
  381. 15StepLeft
  382. 15PauseLeft
  383. 15PlayLeft
  384. 15PlayPauseLeft
  385. 15PauseRight
  386. 15PlayRight
  387. 15PlayPauseRight
  388. 15StepRight
  389. 15EndRight
  390. 15Minus
  391. 15Reset
  392. 15Plus
  393. pbsARFix249
  394. pbsARFix250
  395. pbsARFix251
  396. pbsARFix252
  397. pbsARFix253
  398. pbsARFix254
  399. pbsARFix255
  400. pbsARFix256
  401. pbsARFix257
  402. pbsARFix258
  403. pbsARFix259
  404. pbsARFix260
  405. pbsARFix261
Page 21: Black-ScholesPricingandHedging - NTU · to the Black-Scholes PDE (6.2) in order to price a claim payoff Cof the formC= h(S T).Asinthediscrete-timecase,thearbitragepriceπt(C) at

Black-Scholes Pricing and Hedging

The effective gearingGet =

ξtStπt(C)

can be interpreted as the hedge ratio ie the percentage of the portfoliowhich is invested on the risky asset When written as

∆g(tSt)g(tSt)

= Get times

∆StSt

the effective gearing gives the relative variation or percentage change∆g(tSt)g(tSt) of the option price g(tSt) from the relative variation∆StSt in the underlying asset price

The ratio Get = Stpart log g(tSt)partx can also be interpreted as an elasticity

coefficient

Break-even price The break-even price BEPt of the underlying asset is thevalue of S for which the intrinsic option value h(S) equals the option priceπt(C) at time t isin [0T ] For European call options it is given by

BEPt = K + πt(C) = K + g(tSt) t = 0 1 N

whereas for European put options it is given by

BEPt = K minus πt(C) = K minus g(tSt) 0 6 t 6 T

Premium The option premium OPt can be defined as the variation requiredfrom the underlying asset price in order to reach the break-even price iewe have

OPt =BEPt minus St

St=K + g(tSt)minus St

St 0 6 t 6 T

for European call options and

OPt =St minusBEPt

St=St + g(tSt)minusK

St 0 6 t 6 T

for European put options see Figure 617 below The term ldquopremiumrdquo issometimes also used to denote the arbitrage price g(tSt) of the option

221

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

f (tx σ)100

=

x =

K =

xpart log f

partx=

σ =

partf

partt(tx σ)=

T=

=(xminusK)x

∆ = = partf

partx(tx σ)

= partf

partσ(tx σ)

=K+f (txσ)minusx

x

=K+f (tx σ)

rf=

partf

partt+rxpartf

partx+

σ2 2x2part2f

partx2

Fig 617 Warrant terms and data

The R package bizdays (requires to install QuantLib) can be used to computecalendar time vs business time to maturity1 installpackages(bizdays)

library(bizdays)3 load_quantlib_calendars(HongKong from=2018-01-01 to=2018-12-31)

load_quantlib_calendars(Singapore from=2018-01-01 to=2018-12-31)5 bizdays(2018-03-10 2018-04-03 QuantLibHongKong)

bizdays(2018-03-10 2018-04-03 QuantLibSingapore)

65 The Heat Equation

In the next proposition we notice that the solution f(tx) of the Black-Scholes PDE (67) can be transformed into a solution g(t y) of the simplerheat equation by a change of variable and a time inversion t 7minusrarr T minus t onthe interval [0T ] so that the terminal condition at time T in the Black-Scholes equation (622) becomes an initial condition at time t = 0 in theheat equation (625) See also here for a related discussion on changes ofvariables for the Black-Scholes PDE

222

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

Proposition 68 Assume that f(tx) solves the Black-Scholes PDErf(tx) = partf

partt(tx) + rx

partf

partx(tx) + 1

2σ2x2 part

2f

partx2 (tx)

f(T x) = (xminusK)+(622)

with terminal condition h(x) = (xminusK)+ x gt 0 Then the function g(t y)defined by

g(t y) = ertf(T minus t e|σ|y+(σ22minusr)t) (623)

solves the heat equation (625) with initial condition

ψ(y) = h(

e|σ|y) y isin R (624)

ie we have partg

partt(t y) = 1

2part2g

party2 (t y)

g(0 y) = h(

e|σ|y)

(625)

Proposition 68 will be proved in Section 66 It will allow us to solve theBlack-Scholes PDE (622) based on the solution of the heat equation (625)with initial condition ψ(y) = h

(e|σ|y

) y isin R by inversion of Relation (623)

with s = T minus t x = e|σ|y+(σ22minusr)t ie

f(sx) = eminus(Tminuss)rg(T minus s minus(σ

22minus r)(T minus s) + log x|σ|

)

Next we focus on the heat equation

partϕ

partt(t y) = 1

2part2ϕ

party2 (t y) (626)

which is used to model the diffusion of heat over time through solids Herethe data of g(x t) represents the temperature measured at time t and pointx We refer the reader to Widder (1975) for a complete treatment of thistopic

223

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

Fig 618 Time-dependent solution of the heat equationlowast

Proposition 69 The fundamental solution of the heat equation (626) isgiven by the Gaussian probability density function

ϕ(t y) =1radic2πt

eminusy2(2t) y isin R

with variance t gt 0

Proof The proof is done by a direct calculation as follows

partϕ

partt(t y) = part

partt

(eminusy2(2t)radic

2πt

)

= minus eminusy2(2t)

2t32radic

2π+

y2

2t2eminusy2(2t)radic

2πt

=

(minus 1

2t +y2

2t2

)ϕ(t y)

and

12part2ϕ

party2 (t y) = minus12part

party

(y

t

eminusy2(2t)radic

2πt

)

= minus eminusy2(2t)

2tradic

2πt+

y2

2t2eminusy2(2t)radic

2πt

=

(minus 1

2t +y2

2t2

)ϕ(t y) t gt 0 y isin R

lowast The animation works in Acrobat Reader on the entire pdf file

224

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

In Section 66 the heat equation (626) will be shown to be equivalent to theBlack-Scholes PDE after a change of variables In particular this will lead tothe explicit solution of the Black-Scholes PDE

Proposition 610 The heat equationpartg

partt(t y) = 1

2part2g

party2 (t y)

g(0 y) = ψ(y)

(627)

with continuous initial condition

g(0 y) = ψ(y)

has the solution

g(t y) =winfinminusinfin

ψ(z) eminus(yminusz)2(2t) dzradic2πt

y isin R t gt 0 (628)

Proof We have

partg

partt(t y) = part

partt

winfinminusinfin

ψ(z) eminus(yminusz)2(2t) dzradic2πt

=winfinminusinfin

ψ(z)part

partt

(eminus(yminusz)2(2t)radic

2πt

)dz

=12winfinminusinfin

ψ(z)

((yminus z)2

t2minus 1t

)eminus(yminusz)2(2t) dzradic

2πt

=12winfinminusinfin

ψ(z)part2

partz2 eminus(yminusz)2(2t) dzradic2πt

=12winfinminusinfin

ψ(z)part2

party2 eminus(yminusz)2(2t) dzradic2πt

=12part2

party2

winfinminusinfin

ψ(z) eminus(yminusz)2(2t) dzradic2πt

=12part2g

party2 (t y)

On the other hand it can be checked that at time t = 0 we have

limtrarr0

winfinminusinfin

ψ(z) eminus(yminusz)2(2t) dzradic2πt

= limtrarr0

winfinminusinfin

ψ(y+ z) eminusz2(2t) dzradic2πt

= ψ(y) y isin R

225

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

The next Figure 619 shows the evolution of g(tx) with initial conditionbased on the European call payoff function h(x) = (xminusK)+ ie

g(0 y) = ψ(y) = h(

e|σ|y)=(

e|σ|y minusK)+ y isin R

Fig 619 Time-dependent solution of the heat equationlowast

Let us provide a second proof of Proposition 610 this time using Brownianmotion and stochastic calculus

Proof of Proposition 610 First note that under the change of variable x =z minus y we have

g(t y) =winfinminusinfin

ψ(z) eminus(yminusz)2(2t) dzradic2πt

=winfinminusinfin

ψ(y+ x) eminusx2(2t) dxradic2πt

= IE[ψ(y+Bt)]

= IE[ψ(yminusBt)]

where (Bt)tisinR+ is a standard Brownian motion and Bt N (0 t) t isin R+Applying Itocircrsquos formula and using the fact that the expectation of the stochas-tic integral with respect to Brownian motion is zero see Relation (417) inProposition 420 we find

g(t y) = IE[ψ(yminusBt)]

= ψ(y)minus IE[w t

0ψprime(yminusBs)dBs

]+

12 IE

[w t0ψprimeprime(yminusBs)ds

]= ψ(y) +

12w t

0IE[ψprimeprime(yminusBs)

]ds

lowast The animation works in Acrobat Reader on the entire pdf file

226

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

= ψ(y) +12w t

0part2

party2 IE [ψ(yminusBs)] ds

= ψ(y) +12w t

0part2g

party2 (s y)ds

Hence we have

partg

partt(t y) = part

parttIE[ψ(yminusBt)]

=12part2

party2 IE [ψ(yminusBt)]

=12part2g

party2 (t y)

Regarding the initial condition we check that

g(0 y) = IE[ψ(yminusB0)] = IE[ψ(y)] = ψ(y)

The expression g(t y) = IE[ψ(yminusBt)] provides a probabilistic interpreta-tion of the heat diffusion phenomenon based on Brownian motion Namelywhen ψε(y) = 1[minusεε](y) we find that

gε(t y) = IE[ψε(yminusBt)]= IE[1[minusεε](yminusBt)]= P

(yminusBt isin [minusε ε]

)= P

(yminus ε 6 Bt 6 y+ ε

)represents the probability of finding Bt within a neighborhood [y minus ε y + ε]of the point y isin R

66 Solution of the Black-Scholes PDE

In this section we solve the Black-Scholes PDE by the kernel method of Sec-tion 65 and a change of variables This solution method uses the change ofvariables (623) of Proposition 68 and a time inversion from which the ter-minal condition at time T in the Black-Scholes equation becomes an initialcondition at time t = 0 in the heat equation

Next we state the proof Proposition 68

Proof Letting s = T minus t and x = e|σ|y+(σ22minusr)t and using Relation (623)ie

g(t y) = ertf(T minus t e|σ|y+(σ22minusr)t)

227

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

we have

partg

partt(t y) = r ertf

(T minus t e|σ|y+(σ22minusr)t)minus ert partf

parts

(T minus t e|σ|y+(σ22minusr)t)

+

(σ2

2 minus r)

ert e|σ|y+(σ22minusr)t partf

partx

(T minus t e|σ|y+(σ22minusr)t)

= r ertf(T minus tx)minus ert partfparts

(T minus tx) +(σ2

2 minus r)

ertxpartfpartx

(T minus tx)

=12 ertx2σ2 part

2f

partx2 (T minus tx) +σ2

2 ertxpartfpartx

(T minus tx) (629)

where on the last step we used the Black-Scholes PDE On the other handwe have

partg

party(t y) = |σ| ert e|σ|y+(σ22minusr)t partf

partx

(T minus t e|σ|y+(σ22minusr)t)

and

12partg2

party2 (t y) =σ2

2 ert e|σ|y+(σ22minusr)t partf

partx

(T minus t e|σ|y+(σ22minusr)t)

+σ2

2 ert e2|σ|y+2(σ22minusr)t part2f

partx2(T minus t e|σ|y+(σ22minusr)t)

=σ2

2 ertxpartfpartx

(T minus tx) + σ2

2 ertx2 part2f

partx2 (T minus tx) (630)

We conclude by comparing (629) with (630) which shows that g(tx) solvesthe heat equation (627) with initial condition

g(0 y) = f(T e|σ|y

)= h

(e|σ|y

)

In the next proposition we derive the Black-Scholes formula (610) by solv-ing the PDE (622) The Black-Scholes formula will also be recovered by aprobabilistic argument via the computation of an expected value in Proposi-tion 77

Proposition 611 When h(x) = (x minusK)+ the solution of the Black-Scholes PDE (622) is given by

f(tx) = xΦ(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

) x gt 0

whereΦ(x) =

1radic2π

w xminusinfin

eminusy22dy x isin R

and

228

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

d+(T minus t) =

log(xK) + (r+ σ22)(T minus t)|σ|radicT minus t

dminus(T minus t) =log(xK) + (rminus σ22)(T minus t)

|σ|radicT minus t

x gt 0 t isin [0T )

Proof By inversion of Relation (623) with s = T minus t and x = e|σ|y+(σ22minusr)twe get

f(sx) = eminus(Tminuss)rg(T minus s minus(σ

22minus r)(T minus s) + log x|σ|

)and

h(x) = ψ

(log x|σ|

) x gt 0 or ψ(y) = h

(e|σ|y

) y isin R

Hence using the solution (628) and Relation (624) we get

f(tx) = eminus(Tminust)rg(T minus t minus(σ

22minus r)(T minus t) + log x|σ|

)= eminus(Tminust)r

winfinminusinfin

ψ

(minus(σ22minus r)(T minus t) + log x

|σ|+ z

)eminusz2(2(Tminust)) dzradic

2(T minus t)π

= eminus(Tminust)rwinfinminusinfin

h(x e|σ|zminus(σ22minusr)(Tminust)) eminusz2(2(Tminust)) dzradic

2(T minus t)π

= eminus(Tminust)rwinfinminusinfin

(x e|σ|zminus(σ22minusr)(Tminust) minusK

)+ eminusz2(2(Tminust)) dzradic2(T minus t)π

= eminus(Tminust)r

timeswinfin

(minusr+σ22)(Tminust)+log(Kx)|σ|

(x e|σ|zminus(σ22minusr)(Tminust) minusK

)eminusz2(2(Tminust)) dzradic

2(T minus t)π

= x eminus(Tminust)rwinfinminusdminus(Tminust)

radicTminust

e|σ|zminus(σ22minusr)(Tminust) eminusz2(2(Tminust)) dzradic2(T minus t)π

minusK eminus(Tminust)rwinfinminusdminus(Tminust)

radicTminust

eminusz2(2(Tminust)) dzradic2(T minus t)π

= xwinfinminusdminus(Tminust)

radicTminust

e|σ|zminus(Tminust)σ22minusz2(2(Tminust)) dzradic2(T minus t)π

minusK eminus(Tminust)rwinfinminusdminus(Tminust)

radicTminust

eminusz2(2(Tminust)) dzradic2(T minus t)π

= xwinfinminusdminus(Tminust)

radicTminust

eminus(zminus(Tminust)|σ|)2(2(Tminust)) dzradic2(T minus t)π

229

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

minusK eminus(Tminust)rwinfinminusdminus(Tminust)

radicTminust

eminusz2(2(Tminust)) dzradic2(T minus t)π

= xwinfinminusdminus(Tminust)

radicTminustminus(Tminust)|σ|

eminusz2(2(Tminust)) dzradic2(T minus t)π

minusK eminus(Tminust)rwinfinminusdminus(Tminust)

radicTminust

eminusz2(2(Tminust)) dzradic2(T minus t)π

= xwinfinminusdminus(Tminust)minus|σ|

radicTminust

eminusz22 dzradic2πminusK eminus(Tminust)r

winfinminusdminus(Tminust)

eminusz22 dzradic2π

= x(1minusΦ

(minus d+(T minus t)

))minusK eminus(Tminust)r

(1minusΦ

(minus dminus(T minus t)

))= xΦ

(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)

where we used the relation (614) ie

1minusΦ(a) = Φ(minusa) a isin R

Exercises

Exercise 61 Bachelier (1900) model Consider a market made of a risklessasset valued At = A0 with zero interest rate t isin R+ and a risky asset whoseprice St is modeled by a standard Brownian motion as St = Bt t isin R+

a) Show that the price g(tBt) of the option with payoff C = B2T satisfies

the heat equationpartϕ

partt(t y) = minus1

2part2ϕ

party2 (t y)

with terminal condition g(T x) = x2b) Find the function g(tx) by solving the PDE of Question (a)

Hint Try a solution of the form g(tx) = x2 + f(t)

See Exercises 611 713 and 714 for extensions to nonzero interest rates

Exercise 62 Consider a risky asset price (St)tisinR modeled in the Cox et al(1985) (CIR) model as

dSt = β(αminus St)dt+ σradicStdBt αβσ gt 0 (631)

and let (ηt ξt)tisinR+ be a portfolio strategy whose value Vt = ηtAt + ξtSttakes the form Vt = g(tSt) t isin R+ Figure 620 presents a random simula-tion of the solution to (631) with α = 0025 β = 1 and σ = 13230

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

0

1

2

3

4

5

6

7

8

0 01 02 03 04 05 06 07 08 09 1

St

t

Fig 620 Graph of the CIR short rate t 7rarr rt with α = 25 β = 1 and σ = 13

N=10000 t lt- 0(N-1) dt lt- 10Na=0025 b=2 sigma=0052 X lt- rnorm(Nmean=0sd=sqrt(dt))R lt- rep(0N)R[1]=001

for (j in 2N)R[j]=max(0R[j-1]+(a-bR[j-1])dt+sigmasqrt(R[j-1])X[j])4 plot(t R xlab = t ylab = type = l ylim = c(0002) col = blue)

Based on the self-financing condition written as

dVt = rVtdtminus rξtStdt+ ξtdSt

= rVtdtminus rξtStdt+ β(αminus St)ξtdt+ σξtradicStdBt t isin R+ (632)

derive the PDE satisfied by the function g(tx) using the Itocirc formula

Exercise 63 Black-Scholes PDE with dividends Consider a riskless as-set with price At = A0 ert t isin R+ and an underlying asset price process(St)tisinR+ modeled as

dSt = (microminus δ)Stdt+ σStdBt

where (Bt)tisinR+ is a standard Brownian motion and δ gt 0 is a continuous-time dividend rate By absence of arbitrage the payment of a dividend entailsa drop in the stock price by the same amount occuring generally on the ex-dividend date on which the purchase of the security no longer entitles theinvestor to the dividend amount The list of investors entitled to dividendpayment is consolidated on the date of record and payment is made on thepayable date

library(quantmod)2 getSymbols(0005HKfrom=2010-01-01to=SysDate()src=yahoo)

getDividends(0005HKfrom=2010-01-01to=SysDate()src=yahoo)

a) Assuming that the portfolio with value Vt = ξtSt + ηtAt at time t is self-financing and that dividends are continuously reinvested write down theportfolio variation dVt

231

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

b) Assuming that the portfolio value Vt takes the form Vt = g(tSt) at timet derive the Black-Scholes PDE for the function g(tx) with its terminalcondition

c) Compute the price at time t isin [0T ] of the European call option withstrike price K by solving the corresponding Black-Scholes PDE

d) Compute the Delta of the option

Exercise 64

a) Check that the Black-Scholes formula (610) for European call options

gc(tx) = xΦ(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)

satisfies the following boundary conditions

i) at x = 0 gc(t 0) = 0ii) at maturity t = T

gc(T x) = (xminusK)+ =

xminusK x gt K

0 x 6 K

iii) as time to maturity tends to infinity

limTrarrinfin

Bl(Kxσ rT minus t) = x t isin R+

b) Check that the Black-Scholes formula (618) for European put options

gp(tx) = K eminus(Tminust)rΦ(minus dminus(T minus t)

)minus xΦ

(minus d+(T minus t)

)satisfies the following boundary conditions

i) at x = 0 gp(t 0) = K eminus(Tminust)rii) as x tends to infinity gp(tinfin) = 0 for all t isin [0T )iii) at maturity t = T

gp(T x) = (K minus x)+ =

0 x gt K

K minus x x 6 K

iv) as time to maturity tends to infinity

limTrarrinfin

Blp(KStσ rT minus t) = 0 t isin R+

Exercise 65 Power option (Exercise 314 continued)

232

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

a) Solve the Black-Scholes PDE

rg(x t) = partg

partt(x t) + rx

partg

partx(x t) + σ2

2 x2 part2g

partx2 (x t) (633)

with terminal condition g(xT ) = x2 x gt 0 t isin [0T ]

Hint Try a solution of the form g(x t) = x2f(t) and find f(t)b) Find the respective quantities ξt and ηt of the risky asset St and riskless

asset At = ert in the portfolio with value

Vt = g(St t) = ξtSt + ηtAt 0 6 t 6 T

hedging the contract with payoff S2T at maturity

Exercise 66 On December 18 2007 a call warrant has been issued byFortis Bank on the stock price S of the MTR Corporation with maturityT = 23122008 strike price K = HK$ 3608 and entitlement ratio=10Recall that in the Black-Scholes model the price at time t of the Europeanclaim on the underlying asset priced St with strike price K maturity T interest rate r and volatility σ gt 0 is given by the Black-Scholes formula as

f(tSt) = StΦ(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)

wheredminus(T minus t) =

(rminus σ22)(T minus t) + log(StK)

|σ|radicT minus t

d+(T minus t) = dminus(T minus t) + |σ|radicT minus t = (r+ σ22)(T minus t) + log(StK)

|σ|radicT minus t

Recall that by Proposition 64 we have

partf

partx(tSt) = Φ

(d+(T minus t)

) 0 6 t 6 T

a) Using the values of the Gaussian cumulative distribution function com-pute the Black-Scholes price of the corresponding call option at timet =November 07 2008 with St = HK$ 17200 assuming a volatility σ =90 = 090 and an annual risk-free interest rate r = 4377 = 004377

b) Still using the Gaussian cumulative distribution function compute thequantity of the risky asset required in your portfolio at time t =November07 2008 in order to hedge one such option at maturity T = 23122008

c) Figure 1 represents the Black-Scholes price of the call option as a functionof σ isin [05 15] = [50 150]

233

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

0

01

02

03

04

05

06

05 06 07 08 09 1 11 12 13 14 15σimp

Optio

n pr

ice

σ

Market price

Fig 621 Option price as a function of the volatility σ gt 0

1 BSCall lt- function(S K r T sigma)d1 lt- (log(SK)+(r+sigma^22)T)(sigmasqrt(T))d2 lt- d1 - sigma sqrt(T)

3 BSCall = Spnorm(d1) - Kexp(-rT)pnorm(d2)BSCallsigma lt- seq(0515 length=100)

5 plot(sigmaBSCall(172360800437746365sigma) type=llty=1 xlab=Sigmaylab=Black-Scholes Call Price ylim = c(006)col=bluelwd=3)grid()

abline(h=023col=redlwd=3)

Knowing that the closing price of the warrant on November 07 2008 wasHK$ 0023 which value can you infer for the implied volatility σ at thisdatelowast

Exercise 67 Forward contracts Recall that the price πt(C) of a claimpayoff C = h(ST ) of maturity T can be written as πt(C) = g(tSt) wherethe function g(tx) satisfies the Black-Scholes PDE

rg(tx) = partg

partt(tx) + rx

partg

partx(tx) + 1

2σ2x2 part

2g

partx2 (tx)

g(T x) = h(x) (1)

with terminal condition g(T x) = h(x) x gt 0

a) Assume that C is a forward contract with payoff

C = ST minusK

at time T Find the function h(x) in (1)b) Find the solution g(tx) of the above PDE and compute the price πt(C)

at time t isin [0T ]Hint search for a solution of the form g(tx) = xminus α(t) where α(t) is afunction of t to be determined

lowast Download the corresponding or the that can be runhere

234

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

BS lt- function(S K T r sig)d1 lt- (log(SK) + (r + sig^22)T) (sigsqrt(T))d2 lt- d1 - sigsqrt(T)return(Spnorm(d1) - Kexp(-rT)pnorm(d2))impliedvol lt- function(S K T r market)sig lt- 020sigup lt- 1sigdown lt- 0001count lt- 0err lt- BS(S K T r sig) - marketwhile(abs(err) gt 000001 ampamp countlt1000)if(err lt 0)sigdown lt- sigsig lt- (sigup + sig)2elsesigup lt- sigsig lt- (sigdown + sig)2err lt- BS(S K T r sig) - marketcount lt- count + 1if(count==2000)return(NA)elsereturn(sig)market = 083K = 628T = 7 365S = 634r = 002impliedvol(S K T r market)

cells [ cell_type code execution_count null metadata outputs [] source [ from IPythoncoredisplay import display HTMLn display(HTML( )) ] cell_type code execution_count null metadata collapsed true outputs [] source [ import numpy as npn import scipystats as ssn import time n n Black and Scholesn def d1(S0 K r sigma T)n return (nplog(S0K) + (r + sigma2 2) T)(sigma npsqrt(T))n n def d2(S0 K r sigma T)n return (nplog(S0 K) + (r - sigma2 2) T) (sigma npsqrt(T))n n def BlackScholes(typeS0 K r sigma T)n if type==Cn return S0 ssnormcdf(d1(S0 K r sigma T)) - K npexp(-r T) ssnormcdf(d2(S0 K r sigma T))n elsen return K npexp(-r T) ssnormcdf(-d2(S0 K r sigma T)) - S0 ssnormcdf(-d1(S0 K r sigma T)) ] cell_type code execution_count null metadata outputs [] source [ BlackScholes(C1000 1200 002 015 10) ] cell_type code execution_count null metadata outputs [] source [ def difference(x p S K r t)n return BlackScholes(CS K r x t) - p ] cell_type code execution_count null metadata outputs [] source [ from scipyoptimize import bisectn bisect(difference00011args=(11541763731112766 1000 1200 002 10)) ] ] metadata anaconda-cloud kernelspec display_name Python 3 language python name python3 language_info codemirror_mode name ipython version 3 file_extension py mimetype textx-python name python nbconvert_exporter python pygments_lexer ipython3 version 375rc1 nbformat 4 nbformat_minor 1

Black-Scholes Pricing and Hedging

c) Compute the quantityξt =

partg

partx(tSt)

of risky assets in a self-financing portfolio hedging Cd) Repeat the above questions with the terminal condition g(T x) = x

Exercise 68a) Solve the Black-Scholes PDE

rg(tx) = partg

partt(tx) + rx

partg

partx(tx) + σ2

2 x2 part2g

partx2 (tx) (634)

with terminal condition g(T x) = 1 x gt 0

Hint Try a solution of the form g(tx) = f(t) and find f(t)

b) Find the respective quantities ξt and ηt of the risky asset St and risklessasset At = ert in the portfolio with value

Vt = g(tSt) = ξtSt + ηtAt

hedging the contract with payoff $1 at maturity

Exercise 69 Log-contracts see also Exercise 84a) Solve the PDE

0 =partg

partt(x t) + rx

partg

partx(x t) + σ2

2 x2 part2g

partx2 (x t)

with the terminal condition g(xT ) = log x x gt 0

Hint Try a solution of the form g(x t) = f(t) + log x and find f(t)b) Solve the Black-Scholes PDE

rh(x t) = parth

partt(x t) + rx

parth

partx(x t) + σ2

2 x2 part2h

partx2 (x t) (635)

with the terminal condition h(xT ) = log x x gt 0

Hint Try a solution of the form h(x t) = u(t)g(x t) and find u(t)c) Find the respective quantities ξt and ηt of the risky asset St and riskless

asset At = ert in the portfolio with value

Vt = g(St t) = ξtSt + ηtAt

hedging a log-contract with payoff logST at maturity 235

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

Exercise 610 Binary options Consider a price process (St)tisinR+ given by

dStSt

= rdt+ σdBt S0 = 1

under the risk-neutral probability measure Plowast The binary (or digital) calloption is a contract with maturity T strike price K and payoff

Cd = 1[Kinfin)(ST ) =

$1 if ST gt K

0 if ST lt K

a) Derive the Black-Schole PDE satisfied by the pricing function Cd(tSt) ofthe binary call option together with its terminal condition

b) Show that the solution Cd(tx) of the Black-Scholes PDE of Question (a)is given by

Cd(tx) = eminus(Tminust)rΦ((rminus σ22)(T minus t) + log(xK)

|σ|radicT minus t

)= eminus(Tminust)rΦ

(dminus(T minus t)

)

where

dminus(T minus t) =(rminus σ22)(T minus t) + log(StK)

|σ|radicT minus t

0 6 t lt T

Exercise 611

a) Bachelier (1900) model Solve the stochastic differential equation

dSt = αStdt+ σdBt (636)

in terms of ασ isin R and the initial condition S0b) Write down the Bachelier PDE satisfied by the function C(tx) where

C(tSt) is the price at time t isin [0T ] of the contingent claim with payoffφ(ST ) = exp(ST ) and identify the process Delta (ξt)tisin[0T ] that hedgesthis claim

c) Solve the Black-Scholes PDE of Question (b) with the terminal conditionφ(x) = ex x isin R

Hint Search for a solution of the form

C(tx) = exp(minus(T minus t)r+ xh(t) +

σ2

4r (h2(t)minus 1)

) (637)

where h(t) is a function to be determined with h(T ) = 1

236

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

d) Compute the portfolio strategy (ξt ηt)tisin[0T ] that hedges the contingentclaim with payoff exp(ST )

Exercise 612

a) Show that for every fixed value of S the function

d 7minusrarr h(S d) = SΦ(d+ |σ|

radicT)minusK eminusrTΦ(d)

reaches its maximum at dlowast(S) =log(SK) + (rminus σ22)T

|σ|radicT

b) By the differentiation rule

d

dSh(S dlowast(S)) =

parth

partS(S dlowast(S)) + dprimelowast(S)

parth

partd(S dlowast(S))

recover the value of the Black-Scholes Delta

Exercise 613 Compute the Black-Scholes Vega by differentiation of theBlack-Scholes function

gc(tx) = Bl(Kxσ rT minus t) = xΦ(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)

with respect to the volatility parameter σ knowing that

minus12(dminus(T minus t)

)2= minus1

2

(log(xK) + (rminus σ22)(T minus t)

|σ|radicT minus t

)2

= minus12(d+(T minus t)

)2+ (T minus t)r+ log x

K (638)

Exercise 614 Consider the backward induction relation (313) ie

v(tx) = (1minus plowastN )v (t+ 1x(1 + aN )) + plowastN v (t+ 1x(1 + bN ))

using the renormalizations rN = rTN and

aN = (1 + rN )(1minus |σ|radicTN)minus 1 bN = (1 + rN )(1 + |σ|

radicTN)minus 1

of Section 36 N gt 1 with

plowastN =rN minus aNbN minus aN

and plowastN =bN minus rNbN minus aN

a) Show that the Black-Scholes PDE (62) of Proposition 61 can be recoveredfrom the induction relation (313) when the number N of time steps tendsto infinity

237

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

b) Show that the expression of the Delta ξt =partgcpartx

(tSt) can be similarlyrecovered from the finite difference relation (319) ie

ξ(1)t (Stminus1) =

v (t (1 + bN )Stminus1)minus v (t (1 + aN )Stminus1)

Stminus1(bN minus aN )

as N tends to infinity

Problem 615 (Leung and Sircar (2015)) ProShares Ultra SampP500 andProShares UltraShort SampP500 are leveraged investment funds that seek dailyinvestment results before fees and expenses that correspond to β times (βx)the daily performance of the SampP500reg with respectively β = 2 for ProSharesUltra and β = minus2 for ProShares UltraShort Here leveraging with a factorβ 1 aims at multiplying the potential return of an investment by a factorβ The following 10 questions are interdependent and should be treated insequence

a) Consider a risky asset priced S0 = $4 at time t = 0 and taking twopossible values S1 = $5 and S1 = $2 at time t = 1 Compute the twopossible returns (in ) achieved when investing $4 in one share of the assetS and the expected return under the risk-neutral probability measureassuming that the risk-free interest rate is zero

b) Leveraging Still based on an initial $4 investment we decide to leverageby a factor β = 3 by borrowing another (β minus 1) times $4 = 2times $4 at ratezero to purchase a total of β = 3 shares of the asset S Compute thetwo returns (in ) possibly achieved in this case and the expected returnunder the risk-neutral probability measure assuming that the risk-freeinterest rate is zero

c) Denoting by Ft the ProShares value at time t how much should the fundinvest in the underlying asset priced St and how much $ should it borrowor save on the risk-free market at any time t in order to leverage with afactor β 1

d) Find the portfolio allocation (ξt ηt) for the fund value

Ft = ξtSt + ηtAt t isin R+

according to Question (c) where At = A0 ert is the riskless money marketaccount

e) We choose to model the SampP500 index St as the geometric Brownianmotion

dSt = rStdt+ σStdBt t isin R+

under the risk-neutral probability measure Plowast Find the stochastic dif-ferential equation satisfied by (Ft)tisinR+ under the self-financing conditiondFt = ξtdSt + ηtdAt

238

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

f) Is the discounted fund value ( eminusrtFt)tisinR+ a martingale under the risk-neutral probability measure Plowast

g) Find the relation between the fund value Ft and the index St by solvingthe stochastic differential equation obtained for Ft in Question (e) Forsimplicity we normalize F0 = Sβ0

h) Write the price at time t = 0 of the call option with payoff (FT minusK)+ onthe ProShares index using the Black-Scholes formula

i) Show that when β gt 0 the Delta at time t isin [0T ) of the call optionwith payoff (FT minusK)+ on ProShares Ultra is equal to the Delta of thecall option with payoff (ST minusKβ(t))

+ on the SampP500 for a certain strikeprice Kβ(t) to be determined explicitly

j) When β lt 0 find the relation between the Delta at time t isin [0T ) ofthe call option with payoff (FT minusK)+ on ProShares UltraShort and theDelta of the put option with payoff (Kβ(t)minus ST )+ on the SampP500

239

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

  1. pbsARFix223
  2. pbsARFix224
  3. pbsARFix225
  4. pbsARFix226
  5. pbsARFix227
  6. pbsARFix228
  7. pbsARFix229
  8. pbsARFix230
  9. fdrm1
  10. pbsARFix231
  11. 100
  12. 101
  13. 102
  14. 103
  15. 104
  16. 105
  17. 106
  18. 107
  19. 108
  20. 109
  21. 1010
  22. 1011
  23. 1012
  24. 1013
  25. 1014
  26. 1015
  27. 1016
  28. 1017
  29. 1018
  30. 1019
  31. anm10
  32. 10EndLeft
  33. 10StepLeft
  34. 10PauseLeft
  35. 10PlayLeft
  36. 10PlayPauseLeft
  37. 10PauseRight
  38. 10PlayRight
  39. 10PlayPauseRight
  40. 10StepRight
  41. 10EndRight
  42. 10Minus
  43. 10Reset
  44. 10Plus
  45. pbsARFix232
  46. pbsARFix233
  47. pbsARFix234
  48. pbsARFix235
  49. pbsARFix236
  50. pbsARFix237
  51. fdrm2
  52. 110
  53. 111
  54. 112
  55. 113
  56. 114
  57. 115
  58. 116
  59. 117
  60. 118
  61. 119
  62. 1110
  63. 1111
  64. 1112
  65. 1113
  66. 1114
  67. 1115
  68. 1116
  69. 1117
  70. 1118
  71. 1119
  72. anm11
  73. 11EndLeft
  74. 11StepLeft
  75. 11PauseLeft
  76. 11PlayLeft
  77. 11PlayPauseLeft
  78. 11PauseRight
  79. 11PlayRight
  80. 11PlayPauseRight
  81. 11StepRight
  82. 11EndRight
  83. 11Minus
  84. 11Reset
  85. 11Plus
  86. pbsARFix238
  87. pbsARFix239
  88. pbsARFix240
  89. pbsARFix241
  90. pbsARFix242
  91. 120
  92. 121
  93. 122
  94. 123
  95. 124
  96. 125
  97. 126
  98. 127
  99. 128
  100. 129
  101. 1210
  102. anm12
  103. 12EndLeft
  104. 12StepLeft
  105. 12PauseLeft
  106. 12PlayLeft
  107. 12PlayPauseLeft
  108. 12PauseRight
  109. 12PlayRight
  110. 12PlayPauseRight
  111. 12StepRight
  112. 12EndRight
  113. 12Minus
  114. 12Reset
  115. 12Plus
  116. 130
  117. 131
  118. 132
  119. 133
  120. 134
  121. 135
  122. 136
  123. 137
  124. 138
  125. 139
  126. 1310
  127. anm13
  128. 13EndLeft
  129. 13StepLeft
  130. 13PauseLeft
  131. 13PlayLeft
  132. 13PlayPauseLeft
  133. 13PauseRight
  134. 13PlayRight
  135. 13PlayPauseRight
  136. 13StepRight
  137. 13EndRight
  138. 13Minus
  139. 13Reset
  140. 13Plus
  141. pbsARFix243
  142. pbsARFix244
  143. pbsARFix245
  144. pbsARFix246
  145. 140
  146. 141
  147. 142
  148. 143
  149. 144
  150. 145
  151. 146
  152. 147
  153. 148
  154. 149
  155. 1410
  156. 1411
  157. 1412
  158. 1413
  159. 1414
  160. 1415
  161. 1416
  162. 1417
  163. 1418
  164. 1419
  165. 1420
  166. 1421
  167. 1422
  168. 1423
  169. 1424
  170. 1425
  171. 1426
  172. 1427
  173. 1428
  174. 1429
  175. 1430
  176. 1431
  177. 1432
  178. 1433
  179. 1434
  180. 1435
  181. 1436
  182. 1437
  183. 1438
  184. 1439
  185. 1440
  186. 1441
  187. 1442
  188. 1443
  189. 1444
  190. 1445
  191. 1446
  192. 1447
  193. 1448
  194. 1449
  195. 1450
  196. 1451
  197. 1452
  198. 1453
  199. 1454
  200. 1455
  201. 1456
  202. 1457
  203. 1458
  204. 1459
  205. 1460
  206. 1461
  207. 1462
  208. 1463
  209. 1464
  210. 1465
  211. 1466
  212. 1467
  213. 1468
  214. 1469
  215. 1470
  216. 1471
  217. 1472
  218. 1473
  219. 1474
  220. 1475
  221. 1476
  222. 1477
  223. 1478
  224. 1479
  225. 1480
  226. 1481
  227. 1482
  228. 1483
  229. 1484
  230. 1485
  231. 1486
  232. 1487
  233. 1488
  234. 1489
  235. 1490
  236. 1491
  237. 1492
  238. 1493
  239. 1494
  240. 1495
  241. 1496
  242. 1497
  243. 1498
  244. 1499
  245. 14100
  246. 14101
  247. 14102
  248. 14103
  249. 14104
  250. 14105
  251. 14106
  252. 14107
  253. 14108
  254. 14109
  255. 14110
  256. 14111
  257. 14112
  258. 14113
  259. 14114
  260. 14115
  261. 14116
  262. 14117
  263. 14118
  264. 14119
  265. 14120
  266. 14121
  267. 14122
  268. 14123
  269. 14124
  270. 14125
  271. 14126
  272. 14127
  273. 14128
  274. 14129
  275. 14130
  276. 14131
  277. 14132
  278. 14133
  279. 14134
  280. 14135
  281. 14136
  282. 14137
  283. 14138
  284. 14139
  285. 14140
  286. 14141
  287. 14142
  288. 14143
  289. 14144
  290. 14145
  291. 14146
  292. 14147
  293. 14148
  294. 14149
  295. 14150
  296. 14151
  297. 14152
  298. 14153
  299. 14154
  300. 14155
  301. 14156
  302. 14157
  303. 14158
  304. 14159
  305. 14160
  306. 14161
  307. 14162
  308. 14163
  309. 14164
  310. 14165
  311. 14166
  312. 14167
  313. 14168
  314. 14169
  315. 14170
  316. 14171
  317. 14172
  318. 14173
  319. 14174
  320. 14175
  321. 14176
  322. 14177
  323. 14178
  324. 14179
  325. 14180
  326. 14181
  327. 14182
  328. 14183
  329. 14184
  330. 14185
  331. 14186
  332. 14187
  333. 14188
  334. 14189
  335. 14190
  336. 14191
  337. 14192
  338. 14193
  339. 14194
  340. 14195
  341. 14196
  342. 14197
  343. anm14
  344. 14EndLeft
  345. 14StepLeft
  346. 14PauseLeft
  347. 14PlayLeft
  348. 14PlayPauseLeft
  349. 14PauseRight
  350. 14PlayRight
  351. 14PlayPauseRight
  352. 14StepRight
  353. 14EndRight
  354. 14Minus
  355. 14Reset
  356. 14Plus
  357. pbsARFix247
  358. pbsARFix248
  359. 150
  360. 151
  361. 152
  362. 153
  363. 154
  364. 155
  365. 156
  366. 157
  367. 158
  368. 159
  369. 1510
  370. 1511
  371. 1512
  372. 1513
  373. 1514
  374. 1515
  375. 1516
  376. 1517
  377. 1518
  378. 1519
  379. anm15
  380. 15EndLeft
  381. 15StepLeft
  382. 15PauseLeft
  383. 15PlayLeft
  384. 15PlayPauseLeft
  385. 15PauseRight
  386. 15PlayRight
  387. 15PlayPauseRight
  388. 15StepRight
  389. 15EndRight
  390. 15Minus
  391. 15Reset
  392. 15Plus
  393. pbsARFix249
  394. pbsARFix250
  395. pbsARFix251
  396. pbsARFix252
  397. pbsARFix253
  398. pbsARFix254
  399. pbsARFix255
  400. pbsARFix256
  401. pbsARFix257
  402. pbsARFix258
  403. pbsARFix259
  404. pbsARFix260
  405. pbsARFix261
Page 22: Black-ScholesPricingandHedging - NTU · to the Black-Scholes PDE (6.2) in order to price a claim payoff Cof the formC= h(S T).Asinthediscrete-timecase,thearbitragepriceπt(C) at

N Privault

f (tx σ)100

=

x =

K =

xpart log f

partx=

σ =

partf

partt(tx σ)=

T=

=(xminusK)x

∆ = = partf

partx(tx σ)

= partf

partσ(tx σ)

=K+f (txσ)minusx

x

=K+f (tx σ)

rf=

partf

partt+rxpartf

partx+

σ2 2x2part2f

partx2

Fig 617 Warrant terms and data

The R package bizdays (requires to install QuantLib) can be used to computecalendar time vs business time to maturity1 installpackages(bizdays)

library(bizdays)3 load_quantlib_calendars(HongKong from=2018-01-01 to=2018-12-31)

load_quantlib_calendars(Singapore from=2018-01-01 to=2018-12-31)5 bizdays(2018-03-10 2018-04-03 QuantLibHongKong)

bizdays(2018-03-10 2018-04-03 QuantLibSingapore)

65 The Heat Equation

In the next proposition we notice that the solution f(tx) of the Black-Scholes PDE (67) can be transformed into a solution g(t y) of the simplerheat equation by a change of variable and a time inversion t 7minusrarr T minus t onthe interval [0T ] so that the terminal condition at time T in the Black-Scholes equation (622) becomes an initial condition at time t = 0 in theheat equation (625) See also here for a related discussion on changes ofvariables for the Black-Scholes PDE

222

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

Proposition 68 Assume that f(tx) solves the Black-Scholes PDErf(tx) = partf

partt(tx) + rx

partf

partx(tx) + 1

2σ2x2 part

2f

partx2 (tx)

f(T x) = (xminusK)+(622)

with terminal condition h(x) = (xminusK)+ x gt 0 Then the function g(t y)defined by

g(t y) = ertf(T minus t e|σ|y+(σ22minusr)t) (623)

solves the heat equation (625) with initial condition

ψ(y) = h(

e|σ|y) y isin R (624)

ie we have partg

partt(t y) = 1

2part2g

party2 (t y)

g(0 y) = h(

e|σ|y)

(625)

Proposition 68 will be proved in Section 66 It will allow us to solve theBlack-Scholes PDE (622) based on the solution of the heat equation (625)with initial condition ψ(y) = h

(e|σ|y

) y isin R by inversion of Relation (623)

with s = T minus t x = e|σ|y+(σ22minusr)t ie

f(sx) = eminus(Tminuss)rg(T minus s minus(σ

22minus r)(T minus s) + log x|σ|

)

Next we focus on the heat equation

partϕ

partt(t y) = 1

2part2ϕ

party2 (t y) (626)

which is used to model the diffusion of heat over time through solids Herethe data of g(x t) represents the temperature measured at time t and pointx We refer the reader to Widder (1975) for a complete treatment of thistopic

223

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

Fig 618 Time-dependent solution of the heat equationlowast

Proposition 69 The fundamental solution of the heat equation (626) isgiven by the Gaussian probability density function

ϕ(t y) =1radic2πt

eminusy2(2t) y isin R

with variance t gt 0

Proof The proof is done by a direct calculation as follows

partϕ

partt(t y) = part

partt

(eminusy2(2t)radic

2πt

)

= minus eminusy2(2t)

2t32radic

2π+

y2

2t2eminusy2(2t)radic

2πt

=

(minus 1

2t +y2

2t2

)ϕ(t y)

and

12part2ϕ

party2 (t y) = minus12part

party

(y

t

eminusy2(2t)radic

2πt

)

= minus eminusy2(2t)

2tradic

2πt+

y2

2t2eminusy2(2t)radic

2πt

=

(minus 1

2t +y2

2t2

)ϕ(t y) t gt 0 y isin R

lowast The animation works in Acrobat Reader on the entire pdf file

224

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

In Section 66 the heat equation (626) will be shown to be equivalent to theBlack-Scholes PDE after a change of variables In particular this will lead tothe explicit solution of the Black-Scholes PDE

Proposition 610 The heat equationpartg

partt(t y) = 1

2part2g

party2 (t y)

g(0 y) = ψ(y)

(627)

with continuous initial condition

g(0 y) = ψ(y)

has the solution

g(t y) =winfinminusinfin

ψ(z) eminus(yminusz)2(2t) dzradic2πt

y isin R t gt 0 (628)

Proof We have

partg

partt(t y) = part

partt

winfinminusinfin

ψ(z) eminus(yminusz)2(2t) dzradic2πt

=winfinminusinfin

ψ(z)part

partt

(eminus(yminusz)2(2t)radic

2πt

)dz

=12winfinminusinfin

ψ(z)

((yminus z)2

t2minus 1t

)eminus(yminusz)2(2t) dzradic

2πt

=12winfinminusinfin

ψ(z)part2

partz2 eminus(yminusz)2(2t) dzradic2πt

=12winfinminusinfin

ψ(z)part2

party2 eminus(yminusz)2(2t) dzradic2πt

=12part2

party2

winfinminusinfin

ψ(z) eminus(yminusz)2(2t) dzradic2πt

=12part2g

party2 (t y)

On the other hand it can be checked that at time t = 0 we have

limtrarr0

winfinminusinfin

ψ(z) eminus(yminusz)2(2t) dzradic2πt

= limtrarr0

winfinminusinfin

ψ(y+ z) eminusz2(2t) dzradic2πt

= ψ(y) y isin R

225

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

The next Figure 619 shows the evolution of g(tx) with initial conditionbased on the European call payoff function h(x) = (xminusK)+ ie

g(0 y) = ψ(y) = h(

e|σ|y)=(

e|σ|y minusK)+ y isin R

Fig 619 Time-dependent solution of the heat equationlowast

Let us provide a second proof of Proposition 610 this time using Brownianmotion and stochastic calculus

Proof of Proposition 610 First note that under the change of variable x =z minus y we have

g(t y) =winfinminusinfin

ψ(z) eminus(yminusz)2(2t) dzradic2πt

=winfinminusinfin

ψ(y+ x) eminusx2(2t) dxradic2πt

= IE[ψ(y+Bt)]

= IE[ψ(yminusBt)]

where (Bt)tisinR+ is a standard Brownian motion and Bt N (0 t) t isin R+Applying Itocircrsquos formula and using the fact that the expectation of the stochas-tic integral with respect to Brownian motion is zero see Relation (417) inProposition 420 we find

g(t y) = IE[ψ(yminusBt)]

= ψ(y)minus IE[w t

0ψprime(yminusBs)dBs

]+

12 IE

[w t0ψprimeprime(yminusBs)ds

]= ψ(y) +

12w t

0IE[ψprimeprime(yminusBs)

]ds

lowast The animation works in Acrobat Reader on the entire pdf file

226

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

= ψ(y) +12w t

0part2

party2 IE [ψ(yminusBs)] ds

= ψ(y) +12w t

0part2g

party2 (s y)ds

Hence we have

partg

partt(t y) = part

parttIE[ψ(yminusBt)]

=12part2

party2 IE [ψ(yminusBt)]

=12part2g

party2 (t y)

Regarding the initial condition we check that

g(0 y) = IE[ψ(yminusB0)] = IE[ψ(y)] = ψ(y)

The expression g(t y) = IE[ψ(yminusBt)] provides a probabilistic interpreta-tion of the heat diffusion phenomenon based on Brownian motion Namelywhen ψε(y) = 1[minusεε](y) we find that

gε(t y) = IE[ψε(yminusBt)]= IE[1[minusεε](yminusBt)]= P

(yminusBt isin [minusε ε]

)= P

(yminus ε 6 Bt 6 y+ ε

)represents the probability of finding Bt within a neighborhood [y minus ε y + ε]of the point y isin R

66 Solution of the Black-Scholes PDE

In this section we solve the Black-Scholes PDE by the kernel method of Sec-tion 65 and a change of variables This solution method uses the change ofvariables (623) of Proposition 68 and a time inversion from which the ter-minal condition at time T in the Black-Scholes equation becomes an initialcondition at time t = 0 in the heat equation

Next we state the proof Proposition 68

Proof Letting s = T minus t and x = e|σ|y+(σ22minusr)t and using Relation (623)ie

g(t y) = ertf(T minus t e|σ|y+(σ22minusr)t)

227

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

we have

partg

partt(t y) = r ertf

(T minus t e|σ|y+(σ22minusr)t)minus ert partf

parts

(T minus t e|σ|y+(σ22minusr)t)

+

(σ2

2 minus r)

ert e|σ|y+(σ22minusr)t partf

partx

(T minus t e|σ|y+(σ22minusr)t)

= r ertf(T minus tx)minus ert partfparts

(T minus tx) +(σ2

2 minus r)

ertxpartfpartx

(T minus tx)

=12 ertx2σ2 part

2f

partx2 (T minus tx) +σ2

2 ertxpartfpartx

(T minus tx) (629)

where on the last step we used the Black-Scholes PDE On the other handwe have

partg

party(t y) = |σ| ert e|σ|y+(σ22minusr)t partf

partx

(T minus t e|σ|y+(σ22minusr)t)

and

12partg2

party2 (t y) =σ2

2 ert e|σ|y+(σ22minusr)t partf

partx

(T minus t e|σ|y+(σ22minusr)t)

+σ2

2 ert e2|σ|y+2(σ22minusr)t part2f

partx2(T minus t e|σ|y+(σ22minusr)t)

=σ2

2 ertxpartfpartx

(T minus tx) + σ2

2 ertx2 part2f

partx2 (T minus tx) (630)

We conclude by comparing (629) with (630) which shows that g(tx) solvesthe heat equation (627) with initial condition

g(0 y) = f(T e|σ|y

)= h

(e|σ|y

)

In the next proposition we derive the Black-Scholes formula (610) by solv-ing the PDE (622) The Black-Scholes formula will also be recovered by aprobabilistic argument via the computation of an expected value in Proposi-tion 77

Proposition 611 When h(x) = (x minusK)+ the solution of the Black-Scholes PDE (622) is given by

f(tx) = xΦ(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

) x gt 0

whereΦ(x) =

1radic2π

w xminusinfin

eminusy22dy x isin R

and

228

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

d+(T minus t) =

log(xK) + (r+ σ22)(T minus t)|σ|radicT minus t

dminus(T minus t) =log(xK) + (rminus σ22)(T minus t)

|σ|radicT minus t

x gt 0 t isin [0T )

Proof By inversion of Relation (623) with s = T minus t and x = e|σ|y+(σ22minusr)twe get

f(sx) = eminus(Tminuss)rg(T minus s minus(σ

22minus r)(T minus s) + log x|σ|

)and

h(x) = ψ

(log x|σ|

) x gt 0 or ψ(y) = h

(e|σ|y

) y isin R

Hence using the solution (628) and Relation (624) we get

f(tx) = eminus(Tminust)rg(T minus t minus(σ

22minus r)(T minus t) + log x|σ|

)= eminus(Tminust)r

winfinminusinfin

ψ

(minus(σ22minus r)(T minus t) + log x

|σ|+ z

)eminusz2(2(Tminust)) dzradic

2(T minus t)π

= eminus(Tminust)rwinfinminusinfin

h(x e|σ|zminus(σ22minusr)(Tminust)) eminusz2(2(Tminust)) dzradic

2(T minus t)π

= eminus(Tminust)rwinfinminusinfin

(x e|σ|zminus(σ22minusr)(Tminust) minusK

)+ eminusz2(2(Tminust)) dzradic2(T minus t)π

= eminus(Tminust)r

timeswinfin

(minusr+σ22)(Tminust)+log(Kx)|σ|

(x e|σ|zminus(σ22minusr)(Tminust) minusK

)eminusz2(2(Tminust)) dzradic

2(T minus t)π

= x eminus(Tminust)rwinfinminusdminus(Tminust)

radicTminust

e|σ|zminus(σ22minusr)(Tminust) eminusz2(2(Tminust)) dzradic2(T minus t)π

minusK eminus(Tminust)rwinfinminusdminus(Tminust)

radicTminust

eminusz2(2(Tminust)) dzradic2(T minus t)π

= xwinfinminusdminus(Tminust)

radicTminust

e|σ|zminus(Tminust)σ22minusz2(2(Tminust)) dzradic2(T minus t)π

minusK eminus(Tminust)rwinfinminusdminus(Tminust)

radicTminust

eminusz2(2(Tminust)) dzradic2(T minus t)π

= xwinfinminusdminus(Tminust)

radicTminust

eminus(zminus(Tminust)|σ|)2(2(Tminust)) dzradic2(T minus t)π

229

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

minusK eminus(Tminust)rwinfinminusdminus(Tminust)

radicTminust

eminusz2(2(Tminust)) dzradic2(T minus t)π

= xwinfinminusdminus(Tminust)

radicTminustminus(Tminust)|σ|

eminusz2(2(Tminust)) dzradic2(T minus t)π

minusK eminus(Tminust)rwinfinminusdminus(Tminust)

radicTminust

eminusz2(2(Tminust)) dzradic2(T minus t)π

= xwinfinminusdminus(Tminust)minus|σ|

radicTminust

eminusz22 dzradic2πminusK eminus(Tminust)r

winfinminusdminus(Tminust)

eminusz22 dzradic2π

= x(1minusΦ

(minus d+(T minus t)

))minusK eminus(Tminust)r

(1minusΦ

(minus dminus(T minus t)

))= xΦ

(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)

where we used the relation (614) ie

1minusΦ(a) = Φ(minusa) a isin R

Exercises

Exercise 61 Bachelier (1900) model Consider a market made of a risklessasset valued At = A0 with zero interest rate t isin R+ and a risky asset whoseprice St is modeled by a standard Brownian motion as St = Bt t isin R+

a) Show that the price g(tBt) of the option with payoff C = B2T satisfies

the heat equationpartϕ

partt(t y) = minus1

2part2ϕ

party2 (t y)

with terminal condition g(T x) = x2b) Find the function g(tx) by solving the PDE of Question (a)

Hint Try a solution of the form g(tx) = x2 + f(t)

See Exercises 611 713 and 714 for extensions to nonzero interest rates

Exercise 62 Consider a risky asset price (St)tisinR modeled in the Cox et al(1985) (CIR) model as

dSt = β(αminus St)dt+ σradicStdBt αβσ gt 0 (631)

and let (ηt ξt)tisinR+ be a portfolio strategy whose value Vt = ηtAt + ξtSttakes the form Vt = g(tSt) t isin R+ Figure 620 presents a random simula-tion of the solution to (631) with α = 0025 β = 1 and σ = 13230

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

0

1

2

3

4

5

6

7

8

0 01 02 03 04 05 06 07 08 09 1

St

t

Fig 620 Graph of the CIR short rate t 7rarr rt with α = 25 β = 1 and σ = 13

N=10000 t lt- 0(N-1) dt lt- 10Na=0025 b=2 sigma=0052 X lt- rnorm(Nmean=0sd=sqrt(dt))R lt- rep(0N)R[1]=001

for (j in 2N)R[j]=max(0R[j-1]+(a-bR[j-1])dt+sigmasqrt(R[j-1])X[j])4 plot(t R xlab = t ylab = type = l ylim = c(0002) col = blue)

Based on the self-financing condition written as

dVt = rVtdtminus rξtStdt+ ξtdSt

= rVtdtminus rξtStdt+ β(αminus St)ξtdt+ σξtradicStdBt t isin R+ (632)

derive the PDE satisfied by the function g(tx) using the Itocirc formula

Exercise 63 Black-Scholes PDE with dividends Consider a riskless as-set with price At = A0 ert t isin R+ and an underlying asset price process(St)tisinR+ modeled as

dSt = (microminus δ)Stdt+ σStdBt

where (Bt)tisinR+ is a standard Brownian motion and δ gt 0 is a continuous-time dividend rate By absence of arbitrage the payment of a dividend entailsa drop in the stock price by the same amount occuring generally on the ex-dividend date on which the purchase of the security no longer entitles theinvestor to the dividend amount The list of investors entitled to dividendpayment is consolidated on the date of record and payment is made on thepayable date

library(quantmod)2 getSymbols(0005HKfrom=2010-01-01to=SysDate()src=yahoo)

getDividends(0005HKfrom=2010-01-01to=SysDate()src=yahoo)

a) Assuming that the portfolio with value Vt = ξtSt + ηtAt at time t is self-financing and that dividends are continuously reinvested write down theportfolio variation dVt

231

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

b) Assuming that the portfolio value Vt takes the form Vt = g(tSt) at timet derive the Black-Scholes PDE for the function g(tx) with its terminalcondition

c) Compute the price at time t isin [0T ] of the European call option withstrike price K by solving the corresponding Black-Scholes PDE

d) Compute the Delta of the option

Exercise 64

a) Check that the Black-Scholes formula (610) for European call options

gc(tx) = xΦ(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)

satisfies the following boundary conditions

i) at x = 0 gc(t 0) = 0ii) at maturity t = T

gc(T x) = (xminusK)+ =

xminusK x gt K

0 x 6 K

iii) as time to maturity tends to infinity

limTrarrinfin

Bl(Kxσ rT minus t) = x t isin R+

b) Check that the Black-Scholes formula (618) for European put options

gp(tx) = K eminus(Tminust)rΦ(minus dminus(T minus t)

)minus xΦ

(minus d+(T minus t)

)satisfies the following boundary conditions

i) at x = 0 gp(t 0) = K eminus(Tminust)rii) as x tends to infinity gp(tinfin) = 0 for all t isin [0T )iii) at maturity t = T

gp(T x) = (K minus x)+ =

0 x gt K

K minus x x 6 K

iv) as time to maturity tends to infinity

limTrarrinfin

Blp(KStσ rT minus t) = 0 t isin R+

Exercise 65 Power option (Exercise 314 continued)

232

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

a) Solve the Black-Scholes PDE

rg(x t) = partg

partt(x t) + rx

partg

partx(x t) + σ2

2 x2 part2g

partx2 (x t) (633)

with terminal condition g(xT ) = x2 x gt 0 t isin [0T ]

Hint Try a solution of the form g(x t) = x2f(t) and find f(t)b) Find the respective quantities ξt and ηt of the risky asset St and riskless

asset At = ert in the portfolio with value

Vt = g(St t) = ξtSt + ηtAt 0 6 t 6 T

hedging the contract with payoff S2T at maturity

Exercise 66 On December 18 2007 a call warrant has been issued byFortis Bank on the stock price S of the MTR Corporation with maturityT = 23122008 strike price K = HK$ 3608 and entitlement ratio=10Recall that in the Black-Scholes model the price at time t of the Europeanclaim on the underlying asset priced St with strike price K maturity T interest rate r and volatility σ gt 0 is given by the Black-Scholes formula as

f(tSt) = StΦ(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)

wheredminus(T minus t) =

(rminus σ22)(T minus t) + log(StK)

|σ|radicT minus t

d+(T minus t) = dminus(T minus t) + |σ|radicT minus t = (r+ σ22)(T minus t) + log(StK)

|σ|radicT minus t

Recall that by Proposition 64 we have

partf

partx(tSt) = Φ

(d+(T minus t)

) 0 6 t 6 T

a) Using the values of the Gaussian cumulative distribution function com-pute the Black-Scholes price of the corresponding call option at timet =November 07 2008 with St = HK$ 17200 assuming a volatility σ =90 = 090 and an annual risk-free interest rate r = 4377 = 004377

b) Still using the Gaussian cumulative distribution function compute thequantity of the risky asset required in your portfolio at time t =November07 2008 in order to hedge one such option at maturity T = 23122008

c) Figure 1 represents the Black-Scholes price of the call option as a functionof σ isin [05 15] = [50 150]

233

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

0

01

02

03

04

05

06

05 06 07 08 09 1 11 12 13 14 15σimp

Optio

n pr

ice

σ

Market price

Fig 621 Option price as a function of the volatility σ gt 0

1 BSCall lt- function(S K r T sigma)d1 lt- (log(SK)+(r+sigma^22)T)(sigmasqrt(T))d2 lt- d1 - sigma sqrt(T)

3 BSCall = Spnorm(d1) - Kexp(-rT)pnorm(d2)BSCallsigma lt- seq(0515 length=100)

5 plot(sigmaBSCall(172360800437746365sigma) type=llty=1 xlab=Sigmaylab=Black-Scholes Call Price ylim = c(006)col=bluelwd=3)grid()

abline(h=023col=redlwd=3)

Knowing that the closing price of the warrant on November 07 2008 wasHK$ 0023 which value can you infer for the implied volatility σ at thisdatelowast

Exercise 67 Forward contracts Recall that the price πt(C) of a claimpayoff C = h(ST ) of maturity T can be written as πt(C) = g(tSt) wherethe function g(tx) satisfies the Black-Scholes PDE

rg(tx) = partg

partt(tx) + rx

partg

partx(tx) + 1

2σ2x2 part

2g

partx2 (tx)

g(T x) = h(x) (1)

with terminal condition g(T x) = h(x) x gt 0

a) Assume that C is a forward contract with payoff

C = ST minusK

at time T Find the function h(x) in (1)b) Find the solution g(tx) of the above PDE and compute the price πt(C)

at time t isin [0T ]Hint search for a solution of the form g(tx) = xminus α(t) where α(t) is afunction of t to be determined

lowast Download the corresponding or the that can be runhere

234

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

BS lt- function(S K T r sig)d1 lt- (log(SK) + (r + sig^22)T) (sigsqrt(T))d2 lt- d1 - sigsqrt(T)return(Spnorm(d1) - Kexp(-rT)pnorm(d2))impliedvol lt- function(S K T r market)sig lt- 020sigup lt- 1sigdown lt- 0001count lt- 0err lt- BS(S K T r sig) - marketwhile(abs(err) gt 000001 ampamp countlt1000)if(err lt 0)sigdown lt- sigsig lt- (sigup + sig)2elsesigup lt- sigsig lt- (sigdown + sig)2err lt- BS(S K T r sig) - marketcount lt- count + 1if(count==2000)return(NA)elsereturn(sig)market = 083K = 628T = 7 365S = 634r = 002impliedvol(S K T r market)

cells [ cell_type code execution_count null metadata outputs [] source [ from IPythoncoredisplay import display HTMLn display(HTML( )) ] cell_type code execution_count null metadata collapsed true outputs [] source [ import numpy as npn import scipystats as ssn import time n n Black and Scholesn def d1(S0 K r sigma T)n return (nplog(S0K) + (r + sigma2 2) T)(sigma npsqrt(T))n n def d2(S0 K r sigma T)n return (nplog(S0 K) + (r - sigma2 2) T) (sigma npsqrt(T))n n def BlackScholes(typeS0 K r sigma T)n if type==Cn return S0 ssnormcdf(d1(S0 K r sigma T)) - K npexp(-r T) ssnormcdf(d2(S0 K r sigma T))n elsen return K npexp(-r T) ssnormcdf(-d2(S0 K r sigma T)) - S0 ssnormcdf(-d1(S0 K r sigma T)) ] cell_type code execution_count null metadata outputs [] source [ BlackScholes(C1000 1200 002 015 10) ] cell_type code execution_count null metadata outputs [] source [ def difference(x p S K r t)n return BlackScholes(CS K r x t) - p ] cell_type code execution_count null metadata outputs [] source [ from scipyoptimize import bisectn bisect(difference00011args=(11541763731112766 1000 1200 002 10)) ] ] metadata anaconda-cloud kernelspec display_name Python 3 language python name python3 language_info codemirror_mode name ipython version 3 file_extension py mimetype textx-python name python nbconvert_exporter python pygments_lexer ipython3 version 375rc1 nbformat 4 nbformat_minor 1

Black-Scholes Pricing and Hedging

c) Compute the quantityξt =

partg

partx(tSt)

of risky assets in a self-financing portfolio hedging Cd) Repeat the above questions with the terminal condition g(T x) = x

Exercise 68a) Solve the Black-Scholes PDE

rg(tx) = partg

partt(tx) + rx

partg

partx(tx) + σ2

2 x2 part2g

partx2 (tx) (634)

with terminal condition g(T x) = 1 x gt 0

Hint Try a solution of the form g(tx) = f(t) and find f(t)

b) Find the respective quantities ξt and ηt of the risky asset St and risklessasset At = ert in the portfolio with value

Vt = g(tSt) = ξtSt + ηtAt

hedging the contract with payoff $1 at maturity

Exercise 69 Log-contracts see also Exercise 84a) Solve the PDE

0 =partg

partt(x t) + rx

partg

partx(x t) + σ2

2 x2 part2g

partx2 (x t)

with the terminal condition g(xT ) = log x x gt 0

Hint Try a solution of the form g(x t) = f(t) + log x and find f(t)b) Solve the Black-Scholes PDE

rh(x t) = parth

partt(x t) + rx

parth

partx(x t) + σ2

2 x2 part2h

partx2 (x t) (635)

with the terminal condition h(xT ) = log x x gt 0

Hint Try a solution of the form h(x t) = u(t)g(x t) and find u(t)c) Find the respective quantities ξt and ηt of the risky asset St and riskless

asset At = ert in the portfolio with value

Vt = g(St t) = ξtSt + ηtAt

hedging a log-contract with payoff logST at maturity 235

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

Exercise 610 Binary options Consider a price process (St)tisinR+ given by

dStSt

= rdt+ σdBt S0 = 1

under the risk-neutral probability measure Plowast The binary (or digital) calloption is a contract with maturity T strike price K and payoff

Cd = 1[Kinfin)(ST ) =

$1 if ST gt K

0 if ST lt K

a) Derive the Black-Schole PDE satisfied by the pricing function Cd(tSt) ofthe binary call option together with its terminal condition

b) Show that the solution Cd(tx) of the Black-Scholes PDE of Question (a)is given by

Cd(tx) = eminus(Tminust)rΦ((rminus σ22)(T minus t) + log(xK)

|σ|radicT minus t

)= eminus(Tminust)rΦ

(dminus(T minus t)

)

where

dminus(T minus t) =(rminus σ22)(T minus t) + log(StK)

|σ|radicT minus t

0 6 t lt T

Exercise 611

a) Bachelier (1900) model Solve the stochastic differential equation

dSt = αStdt+ σdBt (636)

in terms of ασ isin R and the initial condition S0b) Write down the Bachelier PDE satisfied by the function C(tx) where

C(tSt) is the price at time t isin [0T ] of the contingent claim with payoffφ(ST ) = exp(ST ) and identify the process Delta (ξt)tisin[0T ] that hedgesthis claim

c) Solve the Black-Scholes PDE of Question (b) with the terminal conditionφ(x) = ex x isin R

Hint Search for a solution of the form

C(tx) = exp(minus(T minus t)r+ xh(t) +

σ2

4r (h2(t)minus 1)

) (637)

where h(t) is a function to be determined with h(T ) = 1

236

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

d) Compute the portfolio strategy (ξt ηt)tisin[0T ] that hedges the contingentclaim with payoff exp(ST )

Exercise 612

a) Show that for every fixed value of S the function

d 7minusrarr h(S d) = SΦ(d+ |σ|

radicT)minusK eminusrTΦ(d)

reaches its maximum at dlowast(S) =log(SK) + (rminus σ22)T

|σ|radicT

b) By the differentiation rule

d

dSh(S dlowast(S)) =

parth

partS(S dlowast(S)) + dprimelowast(S)

parth

partd(S dlowast(S))

recover the value of the Black-Scholes Delta

Exercise 613 Compute the Black-Scholes Vega by differentiation of theBlack-Scholes function

gc(tx) = Bl(Kxσ rT minus t) = xΦ(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)

with respect to the volatility parameter σ knowing that

minus12(dminus(T minus t)

)2= minus1

2

(log(xK) + (rminus σ22)(T minus t)

|σ|radicT minus t

)2

= minus12(d+(T minus t)

)2+ (T minus t)r+ log x

K (638)

Exercise 614 Consider the backward induction relation (313) ie

v(tx) = (1minus plowastN )v (t+ 1x(1 + aN )) + plowastN v (t+ 1x(1 + bN ))

using the renormalizations rN = rTN and

aN = (1 + rN )(1minus |σ|radicTN)minus 1 bN = (1 + rN )(1 + |σ|

radicTN)minus 1

of Section 36 N gt 1 with

plowastN =rN minus aNbN minus aN

and plowastN =bN minus rNbN minus aN

a) Show that the Black-Scholes PDE (62) of Proposition 61 can be recoveredfrom the induction relation (313) when the number N of time steps tendsto infinity

237

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

b) Show that the expression of the Delta ξt =partgcpartx

(tSt) can be similarlyrecovered from the finite difference relation (319) ie

ξ(1)t (Stminus1) =

v (t (1 + bN )Stminus1)minus v (t (1 + aN )Stminus1)

Stminus1(bN minus aN )

as N tends to infinity

Problem 615 (Leung and Sircar (2015)) ProShares Ultra SampP500 andProShares UltraShort SampP500 are leveraged investment funds that seek dailyinvestment results before fees and expenses that correspond to β times (βx)the daily performance of the SampP500reg with respectively β = 2 for ProSharesUltra and β = minus2 for ProShares UltraShort Here leveraging with a factorβ 1 aims at multiplying the potential return of an investment by a factorβ The following 10 questions are interdependent and should be treated insequence

a) Consider a risky asset priced S0 = $4 at time t = 0 and taking twopossible values S1 = $5 and S1 = $2 at time t = 1 Compute the twopossible returns (in ) achieved when investing $4 in one share of the assetS and the expected return under the risk-neutral probability measureassuming that the risk-free interest rate is zero

b) Leveraging Still based on an initial $4 investment we decide to leverageby a factor β = 3 by borrowing another (β minus 1) times $4 = 2times $4 at ratezero to purchase a total of β = 3 shares of the asset S Compute thetwo returns (in ) possibly achieved in this case and the expected returnunder the risk-neutral probability measure assuming that the risk-freeinterest rate is zero

c) Denoting by Ft the ProShares value at time t how much should the fundinvest in the underlying asset priced St and how much $ should it borrowor save on the risk-free market at any time t in order to leverage with afactor β 1

d) Find the portfolio allocation (ξt ηt) for the fund value

Ft = ξtSt + ηtAt t isin R+

according to Question (c) where At = A0 ert is the riskless money marketaccount

e) We choose to model the SampP500 index St as the geometric Brownianmotion

dSt = rStdt+ σStdBt t isin R+

under the risk-neutral probability measure Plowast Find the stochastic dif-ferential equation satisfied by (Ft)tisinR+ under the self-financing conditiondFt = ξtdSt + ηtdAt

238

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

f) Is the discounted fund value ( eminusrtFt)tisinR+ a martingale under the risk-neutral probability measure Plowast

g) Find the relation between the fund value Ft and the index St by solvingthe stochastic differential equation obtained for Ft in Question (e) Forsimplicity we normalize F0 = Sβ0

h) Write the price at time t = 0 of the call option with payoff (FT minusK)+ onthe ProShares index using the Black-Scholes formula

i) Show that when β gt 0 the Delta at time t isin [0T ) of the call optionwith payoff (FT minusK)+ on ProShares Ultra is equal to the Delta of thecall option with payoff (ST minusKβ(t))

+ on the SampP500 for a certain strikeprice Kβ(t) to be determined explicitly

j) When β lt 0 find the relation between the Delta at time t isin [0T ) ofthe call option with payoff (FT minusK)+ on ProShares UltraShort and theDelta of the put option with payoff (Kβ(t)minus ST )+ on the SampP500

239

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

  1. pbsARFix223
  2. pbsARFix224
  3. pbsARFix225
  4. pbsARFix226
  5. pbsARFix227
  6. pbsARFix228
  7. pbsARFix229
  8. pbsARFix230
  9. fdrm1
  10. pbsARFix231
  11. 100
  12. 101
  13. 102
  14. 103
  15. 104
  16. 105
  17. 106
  18. 107
  19. 108
  20. 109
  21. 1010
  22. 1011
  23. 1012
  24. 1013
  25. 1014
  26. 1015
  27. 1016
  28. 1017
  29. 1018
  30. 1019
  31. anm10
  32. 10EndLeft
  33. 10StepLeft
  34. 10PauseLeft
  35. 10PlayLeft
  36. 10PlayPauseLeft
  37. 10PauseRight
  38. 10PlayRight
  39. 10PlayPauseRight
  40. 10StepRight
  41. 10EndRight
  42. 10Minus
  43. 10Reset
  44. 10Plus
  45. pbsARFix232
  46. pbsARFix233
  47. pbsARFix234
  48. pbsARFix235
  49. pbsARFix236
  50. pbsARFix237
  51. fdrm2
  52. 110
  53. 111
  54. 112
  55. 113
  56. 114
  57. 115
  58. 116
  59. 117
  60. 118
  61. 119
  62. 1110
  63. 1111
  64. 1112
  65. 1113
  66. 1114
  67. 1115
  68. 1116
  69. 1117
  70. 1118
  71. 1119
  72. anm11
  73. 11EndLeft
  74. 11StepLeft
  75. 11PauseLeft
  76. 11PlayLeft
  77. 11PlayPauseLeft
  78. 11PauseRight
  79. 11PlayRight
  80. 11PlayPauseRight
  81. 11StepRight
  82. 11EndRight
  83. 11Minus
  84. 11Reset
  85. 11Plus
  86. pbsARFix238
  87. pbsARFix239
  88. pbsARFix240
  89. pbsARFix241
  90. pbsARFix242
  91. 120
  92. 121
  93. 122
  94. 123
  95. 124
  96. 125
  97. 126
  98. 127
  99. 128
  100. 129
  101. 1210
  102. anm12
  103. 12EndLeft
  104. 12StepLeft
  105. 12PauseLeft
  106. 12PlayLeft
  107. 12PlayPauseLeft
  108. 12PauseRight
  109. 12PlayRight
  110. 12PlayPauseRight
  111. 12StepRight
  112. 12EndRight
  113. 12Minus
  114. 12Reset
  115. 12Plus
  116. 130
  117. 131
  118. 132
  119. 133
  120. 134
  121. 135
  122. 136
  123. 137
  124. 138
  125. 139
  126. 1310
  127. anm13
  128. 13EndLeft
  129. 13StepLeft
  130. 13PauseLeft
  131. 13PlayLeft
  132. 13PlayPauseLeft
  133. 13PauseRight
  134. 13PlayRight
  135. 13PlayPauseRight
  136. 13StepRight
  137. 13EndRight
  138. 13Minus
  139. 13Reset
  140. 13Plus
  141. pbsARFix243
  142. pbsARFix244
  143. pbsARFix245
  144. pbsARFix246
  145. 140
  146. 141
  147. 142
  148. 143
  149. 144
  150. 145
  151. 146
  152. 147
  153. 148
  154. 149
  155. 1410
  156. 1411
  157. 1412
  158. 1413
  159. 1414
  160. 1415
  161. 1416
  162. 1417
  163. 1418
  164. 1419
  165. 1420
  166. 1421
  167. 1422
  168. 1423
  169. 1424
  170. 1425
  171. 1426
  172. 1427
  173. 1428
  174. 1429
  175. 1430
  176. 1431
  177. 1432
  178. 1433
  179. 1434
  180. 1435
  181. 1436
  182. 1437
  183. 1438
  184. 1439
  185. 1440
  186. 1441
  187. 1442
  188. 1443
  189. 1444
  190. 1445
  191. 1446
  192. 1447
  193. 1448
  194. 1449
  195. 1450
  196. 1451
  197. 1452
  198. 1453
  199. 1454
  200. 1455
  201. 1456
  202. 1457
  203. 1458
  204. 1459
  205. 1460
  206. 1461
  207. 1462
  208. 1463
  209. 1464
  210. 1465
  211. 1466
  212. 1467
  213. 1468
  214. 1469
  215. 1470
  216. 1471
  217. 1472
  218. 1473
  219. 1474
  220. 1475
  221. 1476
  222. 1477
  223. 1478
  224. 1479
  225. 1480
  226. 1481
  227. 1482
  228. 1483
  229. 1484
  230. 1485
  231. 1486
  232. 1487
  233. 1488
  234. 1489
  235. 1490
  236. 1491
  237. 1492
  238. 1493
  239. 1494
  240. 1495
  241. 1496
  242. 1497
  243. 1498
  244. 1499
  245. 14100
  246. 14101
  247. 14102
  248. 14103
  249. 14104
  250. 14105
  251. 14106
  252. 14107
  253. 14108
  254. 14109
  255. 14110
  256. 14111
  257. 14112
  258. 14113
  259. 14114
  260. 14115
  261. 14116
  262. 14117
  263. 14118
  264. 14119
  265. 14120
  266. 14121
  267. 14122
  268. 14123
  269. 14124
  270. 14125
  271. 14126
  272. 14127
  273. 14128
  274. 14129
  275. 14130
  276. 14131
  277. 14132
  278. 14133
  279. 14134
  280. 14135
  281. 14136
  282. 14137
  283. 14138
  284. 14139
  285. 14140
  286. 14141
  287. 14142
  288. 14143
  289. 14144
  290. 14145
  291. 14146
  292. 14147
  293. 14148
  294. 14149
  295. 14150
  296. 14151
  297. 14152
  298. 14153
  299. 14154
  300. 14155
  301. 14156
  302. 14157
  303. 14158
  304. 14159
  305. 14160
  306. 14161
  307. 14162
  308. 14163
  309. 14164
  310. 14165
  311. 14166
  312. 14167
  313. 14168
  314. 14169
  315. 14170
  316. 14171
  317. 14172
  318. 14173
  319. 14174
  320. 14175
  321. 14176
  322. 14177
  323. 14178
  324. 14179
  325. 14180
  326. 14181
  327. 14182
  328. 14183
  329. 14184
  330. 14185
  331. 14186
  332. 14187
  333. 14188
  334. 14189
  335. 14190
  336. 14191
  337. 14192
  338. 14193
  339. 14194
  340. 14195
  341. 14196
  342. 14197
  343. anm14
  344. 14EndLeft
  345. 14StepLeft
  346. 14PauseLeft
  347. 14PlayLeft
  348. 14PlayPauseLeft
  349. 14PauseRight
  350. 14PlayRight
  351. 14PlayPauseRight
  352. 14StepRight
  353. 14EndRight
  354. 14Minus
  355. 14Reset
  356. 14Plus
  357. pbsARFix247
  358. pbsARFix248
  359. 150
  360. 151
  361. 152
  362. 153
  363. 154
  364. 155
  365. 156
  366. 157
  367. 158
  368. 159
  369. 1510
  370. 1511
  371. 1512
  372. 1513
  373. 1514
  374. 1515
  375. 1516
  376. 1517
  377. 1518
  378. 1519
  379. anm15
  380. 15EndLeft
  381. 15StepLeft
  382. 15PauseLeft
  383. 15PlayLeft
  384. 15PlayPauseLeft
  385. 15PauseRight
  386. 15PlayRight
  387. 15PlayPauseRight
  388. 15StepRight
  389. 15EndRight
  390. 15Minus
  391. 15Reset
  392. 15Plus
  393. pbsARFix249
  394. pbsARFix250
  395. pbsARFix251
  396. pbsARFix252
  397. pbsARFix253
  398. pbsARFix254
  399. pbsARFix255
  400. pbsARFix256
  401. pbsARFix257
  402. pbsARFix258
  403. pbsARFix259
  404. pbsARFix260
  405. pbsARFix261
Page 23: Black-ScholesPricingandHedging - NTU · to the Black-Scholes PDE (6.2) in order to price a claim payoff Cof the formC= h(S T).Asinthediscrete-timecase,thearbitragepriceπt(C) at

Black-Scholes Pricing and Hedging

Proposition 68 Assume that f(tx) solves the Black-Scholes PDErf(tx) = partf

partt(tx) + rx

partf

partx(tx) + 1

2σ2x2 part

2f

partx2 (tx)

f(T x) = (xminusK)+(622)

with terminal condition h(x) = (xminusK)+ x gt 0 Then the function g(t y)defined by

g(t y) = ertf(T minus t e|σ|y+(σ22minusr)t) (623)

solves the heat equation (625) with initial condition

ψ(y) = h(

e|σ|y) y isin R (624)

ie we have partg

partt(t y) = 1

2part2g

party2 (t y)

g(0 y) = h(

e|σ|y)

(625)

Proposition 68 will be proved in Section 66 It will allow us to solve theBlack-Scholes PDE (622) based on the solution of the heat equation (625)with initial condition ψ(y) = h

(e|σ|y

) y isin R by inversion of Relation (623)

with s = T minus t x = e|σ|y+(σ22minusr)t ie

f(sx) = eminus(Tminuss)rg(T minus s minus(σ

22minus r)(T minus s) + log x|σ|

)

Next we focus on the heat equation

partϕ

partt(t y) = 1

2part2ϕ

party2 (t y) (626)

which is used to model the diffusion of heat over time through solids Herethe data of g(x t) represents the temperature measured at time t and pointx We refer the reader to Widder (1975) for a complete treatment of thistopic

223

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

Fig 618 Time-dependent solution of the heat equationlowast

Proposition 69 The fundamental solution of the heat equation (626) isgiven by the Gaussian probability density function

ϕ(t y) =1radic2πt

eminusy2(2t) y isin R

with variance t gt 0

Proof The proof is done by a direct calculation as follows

partϕ

partt(t y) = part

partt

(eminusy2(2t)radic

2πt

)

= minus eminusy2(2t)

2t32radic

2π+

y2

2t2eminusy2(2t)radic

2πt

=

(minus 1

2t +y2

2t2

)ϕ(t y)

and

12part2ϕ

party2 (t y) = minus12part

party

(y

t

eminusy2(2t)radic

2πt

)

= minus eminusy2(2t)

2tradic

2πt+

y2

2t2eminusy2(2t)radic

2πt

=

(minus 1

2t +y2

2t2

)ϕ(t y) t gt 0 y isin R

lowast The animation works in Acrobat Reader on the entire pdf file

224

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

In Section 66 the heat equation (626) will be shown to be equivalent to theBlack-Scholes PDE after a change of variables In particular this will lead tothe explicit solution of the Black-Scholes PDE

Proposition 610 The heat equationpartg

partt(t y) = 1

2part2g

party2 (t y)

g(0 y) = ψ(y)

(627)

with continuous initial condition

g(0 y) = ψ(y)

has the solution

g(t y) =winfinminusinfin

ψ(z) eminus(yminusz)2(2t) dzradic2πt

y isin R t gt 0 (628)

Proof We have

partg

partt(t y) = part

partt

winfinminusinfin

ψ(z) eminus(yminusz)2(2t) dzradic2πt

=winfinminusinfin

ψ(z)part

partt

(eminus(yminusz)2(2t)radic

2πt

)dz

=12winfinminusinfin

ψ(z)

((yminus z)2

t2minus 1t

)eminus(yminusz)2(2t) dzradic

2πt

=12winfinminusinfin

ψ(z)part2

partz2 eminus(yminusz)2(2t) dzradic2πt

=12winfinminusinfin

ψ(z)part2

party2 eminus(yminusz)2(2t) dzradic2πt

=12part2

party2

winfinminusinfin

ψ(z) eminus(yminusz)2(2t) dzradic2πt

=12part2g

party2 (t y)

On the other hand it can be checked that at time t = 0 we have

limtrarr0

winfinminusinfin

ψ(z) eminus(yminusz)2(2t) dzradic2πt

= limtrarr0

winfinminusinfin

ψ(y+ z) eminusz2(2t) dzradic2πt

= ψ(y) y isin R

225

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

The next Figure 619 shows the evolution of g(tx) with initial conditionbased on the European call payoff function h(x) = (xminusK)+ ie

g(0 y) = ψ(y) = h(

e|σ|y)=(

e|σ|y minusK)+ y isin R

Fig 619 Time-dependent solution of the heat equationlowast

Let us provide a second proof of Proposition 610 this time using Brownianmotion and stochastic calculus

Proof of Proposition 610 First note that under the change of variable x =z minus y we have

g(t y) =winfinminusinfin

ψ(z) eminus(yminusz)2(2t) dzradic2πt

=winfinminusinfin

ψ(y+ x) eminusx2(2t) dxradic2πt

= IE[ψ(y+Bt)]

= IE[ψ(yminusBt)]

where (Bt)tisinR+ is a standard Brownian motion and Bt N (0 t) t isin R+Applying Itocircrsquos formula and using the fact that the expectation of the stochas-tic integral with respect to Brownian motion is zero see Relation (417) inProposition 420 we find

g(t y) = IE[ψ(yminusBt)]

= ψ(y)minus IE[w t

0ψprime(yminusBs)dBs

]+

12 IE

[w t0ψprimeprime(yminusBs)ds

]= ψ(y) +

12w t

0IE[ψprimeprime(yminusBs)

]ds

lowast The animation works in Acrobat Reader on the entire pdf file

226

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

= ψ(y) +12w t

0part2

party2 IE [ψ(yminusBs)] ds

= ψ(y) +12w t

0part2g

party2 (s y)ds

Hence we have

partg

partt(t y) = part

parttIE[ψ(yminusBt)]

=12part2

party2 IE [ψ(yminusBt)]

=12part2g

party2 (t y)

Regarding the initial condition we check that

g(0 y) = IE[ψ(yminusB0)] = IE[ψ(y)] = ψ(y)

The expression g(t y) = IE[ψ(yminusBt)] provides a probabilistic interpreta-tion of the heat diffusion phenomenon based on Brownian motion Namelywhen ψε(y) = 1[minusεε](y) we find that

gε(t y) = IE[ψε(yminusBt)]= IE[1[minusεε](yminusBt)]= P

(yminusBt isin [minusε ε]

)= P

(yminus ε 6 Bt 6 y+ ε

)represents the probability of finding Bt within a neighborhood [y minus ε y + ε]of the point y isin R

66 Solution of the Black-Scholes PDE

In this section we solve the Black-Scholes PDE by the kernel method of Sec-tion 65 and a change of variables This solution method uses the change ofvariables (623) of Proposition 68 and a time inversion from which the ter-minal condition at time T in the Black-Scholes equation becomes an initialcondition at time t = 0 in the heat equation

Next we state the proof Proposition 68

Proof Letting s = T minus t and x = e|σ|y+(σ22minusr)t and using Relation (623)ie

g(t y) = ertf(T minus t e|σ|y+(σ22minusr)t)

227

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

we have

partg

partt(t y) = r ertf

(T minus t e|σ|y+(σ22minusr)t)minus ert partf

parts

(T minus t e|σ|y+(σ22minusr)t)

+

(σ2

2 minus r)

ert e|σ|y+(σ22minusr)t partf

partx

(T minus t e|σ|y+(σ22minusr)t)

= r ertf(T minus tx)minus ert partfparts

(T minus tx) +(σ2

2 minus r)

ertxpartfpartx

(T minus tx)

=12 ertx2σ2 part

2f

partx2 (T minus tx) +σ2

2 ertxpartfpartx

(T minus tx) (629)

where on the last step we used the Black-Scholes PDE On the other handwe have

partg

party(t y) = |σ| ert e|σ|y+(σ22minusr)t partf

partx

(T minus t e|σ|y+(σ22minusr)t)

and

12partg2

party2 (t y) =σ2

2 ert e|σ|y+(σ22minusr)t partf

partx

(T minus t e|σ|y+(σ22minusr)t)

+σ2

2 ert e2|σ|y+2(σ22minusr)t part2f

partx2(T minus t e|σ|y+(σ22minusr)t)

=σ2

2 ertxpartfpartx

(T minus tx) + σ2

2 ertx2 part2f

partx2 (T minus tx) (630)

We conclude by comparing (629) with (630) which shows that g(tx) solvesthe heat equation (627) with initial condition

g(0 y) = f(T e|σ|y

)= h

(e|σ|y

)

In the next proposition we derive the Black-Scholes formula (610) by solv-ing the PDE (622) The Black-Scholes formula will also be recovered by aprobabilistic argument via the computation of an expected value in Proposi-tion 77

Proposition 611 When h(x) = (x minusK)+ the solution of the Black-Scholes PDE (622) is given by

f(tx) = xΦ(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

) x gt 0

whereΦ(x) =

1radic2π

w xminusinfin

eminusy22dy x isin R

and

228

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

d+(T minus t) =

log(xK) + (r+ σ22)(T minus t)|σ|radicT minus t

dminus(T minus t) =log(xK) + (rminus σ22)(T minus t)

|σ|radicT minus t

x gt 0 t isin [0T )

Proof By inversion of Relation (623) with s = T minus t and x = e|σ|y+(σ22minusr)twe get

f(sx) = eminus(Tminuss)rg(T minus s minus(σ

22minus r)(T minus s) + log x|σ|

)and

h(x) = ψ

(log x|σ|

) x gt 0 or ψ(y) = h

(e|σ|y

) y isin R

Hence using the solution (628) and Relation (624) we get

f(tx) = eminus(Tminust)rg(T minus t minus(σ

22minus r)(T minus t) + log x|σ|

)= eminus(Tminust)r

winfinminusinfin

ψ

(minus(σ22minus r)(T minus t) + log x

|σ|+ z

)eminusz2(2(Tminust)) dzradic

2(T minus t)π

= eminus(Tminust)rwinfinminusinfin

h(x e|σ|zminus(σ22minusr)(Tminust)) eminusz2(2(Tminust)) dzradic

2(T minus t)π

= eminus(Tminust)rwinfinminusinfin

(x e|σ|zminus(σ22minusr)(Tminust) minusK

)+ eminusz2(2(Tminust)) dzradic2(T minus t)π

= eminus(Tminust)r

timeswinfin

(minusr+σ22)(Tminust)+log(Kx)|σ|

(x e|σ|zminus(σ22minusr)(Tminust) minusK

)eminusz2(2(Tminust)) dzradic

2(T minus t)π

= x eminus(Tminust)rwinfinminusdminus(Tminust)

radicTminust

e|σ|zminus(σ22minusr)(Tminust) eminusz2(2(Tminust)) dzradic2(T minus t)π

minusK eminus(Tminust)rwinfinminusdminus(Tminust)

radicTminust

eminusz2(2(Tminust)) dzradic2(T minus t)π

= xwinfinminusdminus(Tminust)

radicTminust

e|σ|zminus(Tminust)σ22minusz2(2(Tminust)) dzradic2(T minus t)π

minusK eminus(Tminust)rwinfinminusdminus(Tminust)

radicTminust

eminusz2(2(Tminust)) dzradic2(T minus t)π

= xwinfinminusdminus(Tminust)

radicTminust

eminus(zminus(Tminust)|σ|)2(2(Tminust)) dzradic2(T minus t)π

229

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

minusK eminus(Tminust)rwinfinminusdminus(Tminust)

radicTminust

eminusz2(2(Tminust)) dzradic2(T minus t)π

= xwinfinminusdminus(Tminust)

radicTminustminus(Tminust)|σ|

eminusz2(2(Tminust)) dzradic2(T minus t)π

minusK eminus(Tminust)rwinfinminusdminus(Tminust)

radicTminust

eminusz2(2(Tminust)) dzradic2(T minus t)π

= xwinfinminusdminus(Tminust)minus|σ|

radicTminust

eminusz22 dzradic2πminusK eminus(Tminust)r

winfinminusdminus(Tminust)

eminusz22 dzradic2π

= x(1minusΦ

(minus d+(T minus t)

))minusK eminus(Tminust)r

(1minusΦ

(minus dminus(T minus t)

))= xΦ

(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)

where we used the relation (614) ie

1minusΦ(a) = Φ(minusa) a isin R

Exercises

Exercise 61 Bachelier (1900) model Consider a market made of a risklessasset valued At = A0 with zero interest rate t isin R+ and a risky asset whoseprice St is modeled by a standard Brownian motion as St = Bt t isin R+

a) Show that the price g(tBt) of the option with payoff C = B2T satisfies

the heat equationpartϕ

partt(t y) = minus1

2part2ϕ

party2 (t y)

with terminal condition g(T x) = x2b) Find the function g(tx) by solving the PDE of Question (a)

Hint Try a solution of the form g(tx) = x2 + f(t)

See Exercises 611 713 and 714 for extensions to nonzero interest rates

Exercise 62 Consider a risky asset price (St)tisinR modeled in the Cox et al(1985) (CIR) model as

dSt = β(αminus St)dt+ σradicStdBt αβσ gt 0 (631)

and let (ηt ξt)tisinR+ be a portfolio strategy whose value Vt = ηtAt + ξtSttakes the form Vt = g(tSt) t isin R+ Figure 620 presents a random simula-tion of the solution to (631) with α = 0025 β = 1 and σ = 13230

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

0

1

2

3

4

5

6

7

8

0 01 02 03 04 05 06 07 08 09 1

St

t

Fig 620 Graph of the CIR short rate t 7rarr rt with α = 25 β = 1 and σ = 13

N=10000 t lt- 0(N-1) dt lt- 10Na=0025 b=2 sigma=0052 X lt- rnorm(Nmean=0sd=sqrt(dt))R lt- rep(0N)R[1]=001

for (j in 2N)R[j]=max(0R[j-1]+(a-bR[j-1])dt+sigmasqrt(R[j-1])X[j])4 plot(t R xlab = t ylab = type = l ylim = c(0002) col = blue)

Based on the self-financing condition written as

dVt = rVtdtminus rξtStdt+ ξtdSt

= rVtdtminus rξtStdt+ β(αminus St)ξtdt+ σξtradicStdBt t isin R+ (632)

derive the PDE satisfied by the function g(tx) using the Itocirc formula

Exercise 63 Black-Scholes PDE with dividends Consider a riskless as-set with price At = A0 ert t isin R+ and an underlying asset price process(St)tisinR+ modeled as

dSt = (microminus δ)Stdt+ σStdBt

where (Bt)tisinR+ is a standard Brownian motion and δ gt 0 is a continuous-time dividend rate By absence of arbitrage the payment of a dividend entailsa drop in the stock price by the same amount occuring generally on the ex-dividend date on which the purchase of the security no longer entitles theinvestor to the dividend amount The list of investors entitled to dividendpayment is consolidated on the date of record and payment is made on thepayable date

library(quantmod)2 getSymbols(0005HKfrom=2010-01-01to=SysDate()src=yahoo)

getDividends(0005HKfrom=2010-01-01to=SysDate()src=yahoo)

a) Assuming that the portfolio with value Vt = ξtSt + ηtAt at time t is self-financing and that dividends are continuously reinvested write down theportfolio variation dVt

231

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

b) Assuming that the portfolio value Vt takes the form Vt = g(tSt) at timet derive the Black-Scholes PDE for the function g(tx) with its terminalcondition

c) Compute the price at time t isin [0T ] of the European call option withstrike price K by solving the corresponding Black-Scholes PDE

d) Compute the Delta of the option

Exercise 64

a) Check that the Black-Scholes formula (610) for European call options

gc(tx) = xΦ(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)

satisfies the following boundary conditions

i) at x = 0 gc(t 0) = 0ii) at maturity t = T

gc(T x) = (xminusK)+ =

xminusK x gt K

0 x 6 K

iii) as time to maturity tends to infinity

limTrarrinfin

Bl(Kxσ rT minus t) = x t isin R+

b) Check that the Black-Scholes formula (618) for European put options

gp(tx) = K eminus(Tminust)rΦ(minus dminus(T minus t)

)minus xΦ

(minus d+(T minus t)

)satisfies the following boundary conditions

i) at x = 0 gp(t 0) = K eminus(Tminust)rii) as x tends to infinity gp(tinfin) = 0 for all t isin [0T )iii) at maturity t = T

gp(T x) = (K minus x)+ =

0 x gt K

K minus x x 6 K

iv) as time to maturity tends to infinity

limTrarrinfin

Blp(KStσ rT minus t) = 0 t isin R+

Exercise 65 Power option (Exercise 314 continued)

232

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

a) Solve the Black-Scholes PDE

rg(x t) = partg

partt(x t) + rx

partg

partx(x t) + σ2

2 x2 part2g

partx2 (x t) (633)

with terminal condition g(xT ) = x2 x gt 0 t isin [0T ]

Hint Try a solution of the form g(x t) = x2f(t) and find f(t)b) Find the respective quantities ξt and ηt of the risky asset St and riskless

asset At = ert in the portfolio with value

Vt = g(St t) = ξtSt + ηtAt 0 6 t 6 T

hedging the contract with payoff S2T at maturity

Exercise 66 On December 18 2007 a call warrant has been issued byFortis Bank on the stock price S of the MTR Corporation with maturityT = 23122008 strike price K = HK$ 3608 and entitlement ratio=10Recall that in the Black-Scholes model the price at time t of the Europeanclaim on the underlying asset priced St with strike price K maturity T interest rate r and volatility σ gt 0 is given by the Black-Scholes formula as

f(tSt) = StΦ(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)

wheredminus(T minus t) =

(rminus σ22)(T minus t) + log(StK)

|σ|radicT minus t

d+(T minus t) = dminus(T minus t) + |σ|radicT minus t = (r+ σ22)(T minus t) + log(StK)

|σ|radicT minus t

Recall that by Proposition 64 we have

partf

partx(tSt) = Φ

(d+(T minus t)

) 0 6 t 6 T

a) Using the values of the Gaussian cumulative distribution function com-pute the Black-Scholes price of the corresponding call option at timet =November 07 2008 with St = HK$ 17200 assuming a volatility σ =90 = 090 and an annual risk-free interest rate r = 4377 = 004377

b) Still using the Gaussian cumulative distribution function compute thequantity of the risky asset required in your portfolio at time t =November07 2008 in order to hedge one such option at maturity T = 23122008

c) Figure 1 represents the Black-Scholes price of the call option as a functionof σ isin [05 15] = [50 150]

233

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

0

01

02

03

04

05

06

05 06 07 08 09 1 11 12 13 14 15σimp

Optio

n pr

ice

σ

Market price

Fig 621 Option price as a function of the volatility σ gt 0

1 BSCall lt- function(S K r T sigma)d1 lt- (log(SK)+(r+sigma^22)T)(sigmasqrt(T))d2 lt- d1 - sigma sqrt(T)

3 BSCall = Spnorm(d1) - Kexp(-rT)pnorm(d2)BSCallsigma lt- seq(0515 length=100)

5 plot(sigmaBSCall(172360800437746365sigma) type=llty=1 xlab=Sigmaylab=Black-Scholes Call Price ylim = c(006)col=bluelwd=3)grid()

abline(h=023col=redlwd=3)

Knowing that the closing price of the warrant on November 07 2008 wasHK$ 0023 which value can you infer for the implied volatility σ at thisdatelowast

Exercise 67 Forward contracts Recall that the price πt(C) of a claimpayoff C = h(ST ) of maturity T can be written as πt(C) = g(tSt) wherethe function g(tx) satisfies the Black-Scholes PDE

rg(tx) = partg

partt(tx) + rx

partg

partx(tx) + 1

2σ2x2 part

2g

partx2 (tx)

g(T x) = h(x) (1)

with terminal condition g(T x) = h(x) x gt 0

a) Assume that C is a forward contract with payoff

C = ST minusK

at time T Find the function h(x) in (1)b) Find the solution g(tx) of the above PDE and compute the price πt(C)

at time t isin [0T ]Hint search for a solution of the form g(tx) = xminus α(t) where α(t) is afunction of t to be determined

lowast Download the corresponding or the that can be runhere

234

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

BS lt- function(S K T r sig)d1 lt- (log(SK) + (r + sig^22)T) (sigsqrt(T))d2 lt- d1 - sigsqrt(T)return(Spnorm(d1) - Kexp(-rT)pnorm(d2))impliedvol lt- function(S K T r market)sig lt- 020sigup lt- 1sigdown lt- 0001count lt- 0err lt- BS(S K T r sig) - marketwhile(abs(err) gt 000001 ampamp countlt1000)if(err lt 0)sigdown lt- sigsig lt- (sigup + sig)2elsesigup lt- sigsig lt- (sigdown + sig)2err lt- BS(S K T r sig) - marketcount lt- count + 1if(count==2000)return(NA)elsereturn(sig)market = 083K = 628T = 7 365S = 634r = 002impliedvol(S K T r market)

cells [ cell_type code execution_count null metadata outputs [] source [ from IPythoncoredisplay import display HTMLn display(HTML( )) ] cell_type code execution_count null metadata collapsed true outputs [] source [ import numpy as npn import scipystats as ssn import time n n Black and Scholesn def d1(S0 K r sigma T)n return (nplog(S0K) + (r + sigma2 2) T)(sigma npsqrt(T))n n def d2(S0 K r sigma T)n return (nplog(S0 K) + (r - sigma2 2) T) (sigma npsqrt(T))n n def BlackScholes(typeS0 K r sigma T)n if type==Cn return S0 ssnormcdf(d1(S0 K r sigma T)) - K npexp(-r T) ssnormcdf(d2(S0 K r sigma T))n elsen return K npexp(-r T) ssnormcdf(-d2(S0 K r sigma T)) - S0 ssnormcdf(-d1(S0 K r sigma T)) ] cell_type code execution_count null metadata outputs [] source [ BlackScholes(C1000 1200 002 015 10) ] cell_type code execution_count null metadata outputs [] source [ def difference(x p S K r t)n return BlackScholes(CS K r x t) - p ] cell_type code execution_count null metadata outputs [] source [ from scipyoptimize import bisectn bisect(difference00011args=(11541763731112766 1000 1200 002 10)) ] ] metadata anaconda-cloud kernelspec display_name Python 3 language python name python3 language_info codemirror_mode name ipython version 3 file_extension py mimetype textx-python name python nbconvert_exporter python pygments_lexer ipython3 version 375rc1 nbformat 4 nbformat_minor 1

Black-Scholes Pricing and Hedging

c) Compute the quantityξt =

partg

partx(tSt)

of risky assets in a self-financing portfolio hedging Cd) Repeat the above questions with the terminal condition g(T x) = x

Exercise 68a) Solve the Black-Scholes PDE

rg(tx) = partg

partt(tx) + rx

partg

partx(tx) + σ2

2 x2 part2g

partx2 (tx) (634)

with terminal condition g(T x) = 1 x gt 0

Hint Try a solution of the form g(tx) = f(t) and find f(t)

b) Find the respective quantities ξt and ηt of the risky asset St and risklessasset At = ert in the portfolio with value

Vt = g(tSt) = ξtSt + ηtAt

hedging the contract with payoff $1 at maturity

Exercise 69 Log-contracts see also Exercise 84a) Solve the PDE

0 =partg

partt(x t) + rx

partg

partx(x t) + σ2

2 x2 part2g

partx2 (x t)

with the terminal condition g(xT ) = log x x gt 0

Hint Try a solution of the form g(x t) = f(t) + log x and find f(t)b) Solve the Black-Scholes PDE

rh(x t) = parth

partt(x t) + rx

parth

partx(x t) + σ2

2 x2 part2h

partx2 (x t) (635)

with the terminal condition h(xT ) = log x x gt 0

Hint Try a solution of the form h(x t) = u(t)g(x t) and find u(t)c) Find the respective quantities ξt and ηt of the risky asset St and riskless

asset At = ert in the portfolio with value

Vt = g(St t) = ξtSt + ηtAt

hedging a log-contract with payoff logST at maturity 235

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

Exercise 610 Binary options Consider a price process (St)tisinR+ given by

dStSt

= rdt+ σdBt S0 = 1

under the risk-neutral probability measure Plowast The binary (or digital) calloption is a contract with maturity T strike price K and payoff

Cd = 1[Kinfin)(ST ) =

$1 if ST gt K

0 if ST lt K

a) Derive the Black-Schole PDE satisfied by the pricing function Cd(tSt) ofthe binary call option together with its terminal condition

b) Show that the solution Cd(tx) of the Black-Scholes PDE of Question (a)is given by

Cd(tx) = eminus(Tminust)rΦ((rminus σ22)(T minus t) + log(xK)

|σ|radicT minus t

)= eminus(Tminust)rΦ

(dminus(T minus t)

)

where

dminus(T minus t) =(rminus σ22)(T minus t) + log(StK)

|σ|radicT minus t

0 6 t lt T

Exercise 611

a) Bachelier (1900) model Solve the stochastic differential equation

dSt = αStdt+ σdBt (636)

in terms of ασ isin R and the initial condition S0b) Write down the Bachelier PDE satisfied by the function C(tx) where

C(tSt) is the price at time t isin [0T ] of the contingent claim with payoffφ(ST ) = exp(ST ) and identify the process Delta (ξt)tisin[0T ] that hedgesthis claim

c) Solve the Black-Scholes PDE of Question (b) with the terminal conditionφ(x) = ex x isin R

Hint Search for a solution of the form

C(tx) = exp(minus(T minus t)r+ xh(t) +

σ2

4r (h2(t)minus 1)

) (637)

where h(t) is a function to be determined with h(T ) = 1

236

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

d) Compute the portfolio strategy (ξt ηt)tisin[0T ] that hedges the contingentclaim with payoff exp(ST )

Exercise 612

a) Show that for every fixed value of S the function

d 7minusrarr h(S d) = SΦ(d+ |σ|

radicT)minusK eminusrTΦ(d)

reaches its maximum at dlowast(S) =log(SK) + (rminus σ22)T

|σ|radicT

b) By the differentiation rule

d

dSh(S dlowast(S)) =

parth

partS(S dlowast(S)) + dprimelowast(S)

parth

partd(S dlowast(S))

recover the value of the Black-Scholes Delta

Exercise 613 Compute the Black-Scholes Vega by differentiation of theBlack-Scholes function

gc(tx) = Bl(Kxσ rT minus t) = xΦ(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)

with respect to the volatility parameter σ knowing that

minus12(dminus(T minus t)

)2= minus1

2

(log(xK) + (rminus σ22)(T minus t)

|σ|radicT minus t

)2

= minus12(d+(T minus t)

)2+ (T minus t)r+ log x

K (638)

Exercise 614 Consider the backward induction relation (313) ie

v(tx) = (1minus plowastN )v (t+ 1x(1 + aN )) + plowastN v (t+ 1x(1 + bN ))

using the renormalizations rN = rTN and

aN = (1 + rN )(1minus |σ|radicTN)minus 1 bN = (1 + rN )(1 + |σ|

radicTN)minus 1

of Section 36 N gt 1 with

plowastN =rN minus aNbN minus aN

and plowastN =bN minus rNbN minus aN

a) Show that the Black-Scholes PDE (62) of Proposition 61 can be recoveredfrom the induction relation (313) when the number N of time steps tendsto infinity

237

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

b) Show that the expression of the Delta ξt =partgcpartx

(tSt) can be similarlyrecovered from the finite difference relation (319) ie

ξ(1)t (Stminus1) =

v (t (1 + bN )Stminus1)minus v (t (1 + aN )Stminus1)

Stminus1(bN minus aN )

as N tends to infinity

Problem 615 (Leung and Sircar (2015)) ProShares Ultra SampP500 andProShares UltraShort SampP500 are leveraged investment funds that seek dailyinvestment results before fees and expenses that correspond to β times (βx)the daily performance of the SampP500reg with respectively β = 2 for ProSharesUltra and β = minus2 for ProShares UltraShort Here leveraging with a factorβ 1 aims at multiplying the potential return of an investment by a factorβ The following 10 questions are interdependent and should be treated insequence

a) Consider a risky asset priced S0 = $4 at time t = 0 and taking twopossible values S1 = $5 and S1 = $2 at time t = 1 Compute the twopossible returns (in ) achieved when investing $4 in one share of the assetS and the expected return under the risk-neutral probability measureassuming that the risk-free interest rate is zero

b) Leveraging Still based on an initial $4 investment we decide to leverageby a factor β = 3 by borrowing another (β minus 1) times $4 = 2times $4 at ratezero to purchase a total of β = 3 shares of the asset S Compute thetwo returns (in ) possibly achieved in this case and the expected returnunder the risk-neutral probability measure assuming that the risk-freeinterest rate is zero

c) Denoting by Ft the ProShares value at time t how much should the fundinvest in the underlying asset priced St and how much $ should it borrowor save on the risk-free market at any time t in order to leverage with afactor β 1

d) Find the portfolio allocation (ξt ηt) for the fund value

Ft = ξtSt + ηtAt t isin R+

according to Question (c) where At = A0 ert is the riskless money marketaccount

e) We choose to model the SampP500 index St as the geometric Brownianmotion

dSt = rStdt+ σStdBt t isin R+

under the risk-neutral probability measure Plowast Find the stochastic dif-ferential equation satisfied by (Ft)tisinR+ under the self-financing conditiondFt = ξtdSt + ηtdAt

238

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

f) Is the discounted fund value ( eminusrtFt)tisinR+ a martingale under the risk-neutral probability measure Plowast

g) Find the relation between the fund value Ft and the index St by solvingthe stochastic differential equation obtained for Ft in Question (e) Forsimplicity we normalize F0 = Sβ0

h) Write the price at time t = 0 of the call option with payoff (FT minusK)+ onthe ProShares index using the Black-Scholes formula

i) Show that when β gt 0 the Delta at time t isin [0T ) of the call optionwith payoff (FT minusK)+ on ProShares Ultra is equal to the Delta of thecall option with payoff (ST minusKβ(t))

+ on the SampP500 for a certain strikeprice Kβ(t) to be determined explicitly

j) When β lt 0 find the relation between the Delta at time t isin [0T ) ofthe call option with payoff (FT minusK)+ on ProShares UltraShort and theDelta of the put option with payoff (Kβ(t)minus ST )+ on the SampP500

239

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

  1. pbsARFix223
  2. pbsARFix224
  3. pbsARFix225
  4. pbsARFix226
  5. pbsARFix227
  6. pbsARFix228
  7. pbsARFix229
  8. pbsARFix230
  9. fdrm1
  10. pbsARFix231
  11. 100
  12. 101
  13. 102
  14. 103
  15. 104
  16. 105
  17. 106
  18. 107
  19. 108
  20. 109
  21. 1010
  22. 1011
  23. 1012
  24. 1013
  25. 1014
  26. 1015
  27. 1016
  28. 1017
  29. 1018
  30. 1019
  31. anm10
  32. 10EndLeft
  33. 10StepLeft
  34. 10PauseLeft
  35. 10PlayLeft
  36. 10PlayPauseLeft
  37. 10PauseRight
  38. 10PlayRight
  39. 10PlayPauseRight
  40. 10StepRight
  41. 10EndRight
  42. 10Minus
  43. 10Reset
  44. 10Plus
  45. pbsARFix232
  46. pbsARFix233
  47. pbsARFix234
  48. pbsARFix235
  49. pbsARFix236
  50. pbsARFix237
  51. fdrm2
  52. 110
  53. 111
  54. 112
  55. 113
  56. 114
  57. 115
  58. 116
  59. 117
  60. 118
  61. 119
  62. 1110
  63. 1111
  64. 1112
  65. 1113
  66. 1114
  67. 1115
  68. 1116
  69. 1117
  70. 1118
  71. 1119
  72. anm11
  73. 11EndLeft
  74. 11StepLeft
  75. 11PauseLeft
  76. 11PlayLeft
  77. 11PlayPauseLeft
  78. 11PauseRight
  79. 11PlayRight
  80. 11PlayPauseRight
  81. 11StepRight
  82. 11EndRight
  83. 11Minus
  84. 11Reset
  85. 11Plus
  86. pbsARFix238
  87. pbsARFix239
  88. pbsARFix240
  89. pbsARFix241
  90. pbsARFix242
  91. 120
  92. 121
  93. 122
  94. 123
  95. 124
  96. 125
  97. 126
  98. 127
  99. 128
  100. 129
  101. 1210
  102. anm12
  103. 12EndLeft
  104. 12StepLeft
  105. 12PauseLeft
  106. 12PlayLeft
  107. 12PlayPauseLeft
  108. 12PauseRight
  109. 12PlayRight
  110. 12PlayPauseRight
  111. 12StepRight
  112. 12EndRight
  113. 12Minus
  114. 12Reset
  115. 12Plus
  116. 130
  117. 131
  118. 132
  119. 133
  120. 134
  121. 135
  122. 136
  123. 137
  124. 138
  125. 139
  126. 1310
  127. anm13
  128. 13EndLeft
  129. 13StepLeft
  130. 13PauseLeft
  131. 13PlayLeft
  132. 13PlayPauseLeft
  133. 13PauseRight
  134. 13PlayRight
  135. 13PlayPauseRight
  136. 13StepRight
  137. 13EndRight
  138. 13Minus
  139. 13Reset
  140. 13Plus
  141. pbsARFix243
  142. pbsARFix244
  143. pbsARFix245
  144. pbsARFix246
  145. 140
  146. 141
  147. 142
  148. 143
  149. 144
  150. 145
  151. 146
  152. 147
  153. 148
  154. 149
  155. 1410
  156. 1411
  157. 1412
  158. 1413
  159. 1414
  160. 1415
  161. 1416
  162. 1417
  163. 1418
  164. 1419
  165. 1420
  166. 1421
  167. 1422
  168. 1423
  169. 1424
  170. 1425
  171. 1426
  172. 1427
  173. 1428
  174. 1429
  175. 1430
  176. 1431
  177. 1432
  178. 1433
  179. 1434
  180. 1435
  181. 1436
  182. 1437
  183. 1438
  184. 1439
  185. 1440
  186. 1441
  187. 1442
  188. 1443
  189. 1444
  190. 1445
  191. 1446
  192. 1447
  193. 1448
  194. 1449
  195. 1450
  196. 1451
  197. 1452
  198. 1453
  199. 1454
  200. 1455
  201. 1456
  202. 1457
  203. 1458
  204. 1459
  205. 1460
  206. 1461
  207. 1462
  208. 1463
  209. 1464
  210. 1465
  211. 1466
  212. 1467
  213. 1468
  214. 1469
  215. 1470
  216. 1471
  217. 1472
  218. 1473
  219. 1474
  220. 1475
  221. 1476
  222. 1477
  223. 1478
  224. 1479
  225. 1480
  226. 1481
  227. 1482
  228. 1483
  229. 1484
  230. 1485
  231. 1486
  232. 1487
  233. 1488
  234. 1489
  235. 1490
  236. 1491
  237. 1492
  238. 1493
  239. 1494
  240. 1495
  241. 1496
  242. 1497
  243. 1498
  244. 1499
  245. 14100
  246. 14101
  247. 14102
  248. 14103
  249. 14104
  250. 14105
  251. 14106
  252. 14107
  253. 14108
  254. 14109
  255. 14110
  256. 14111
  257. 14112
  258. 14113
  259. 14114
  260. 14115
  261. 14116
  262. 14117
  263. 14118
  264. 14119
  265. 14120
  266. 14121
  267. 14122
  268. 14123
  269. 14124
  270. 14125
  271. 14126
  272. 14127
  273. 14128
  274. 14129
  275. 14130
  276. 14131
  277. 14132
  278. 14133
  279. 14134
  280. 14135
  281. 14136
  282. 14137
  283. 14138
  284. 14139
  285. 14140
  286. 14141
  287. 14142
  288. 14143
  289. 14144
  290. 14145
  291. 14146
  292. 14147
  293. 14148
  294. 14149
  295. 14150
  296. 14151
  297. 14152
  298. 14153
  299. 14154
  300. 14155
  301. 14156
  302. 14157
  303. 14158
  304. 14159
  305. 14160
  306. 14161
  307. 14162
  308. 14163
  309. 14164
  310. 14165
  311. 14166
  312. 14167
  313. 14168
  314. 14169
  315. 14170
  316. 14171
  317. 14172
  318. 14173
  319. 14174
  320. 14175
  321. 14176
  322. 14177
  323. 14178
  324. 14179
  325. 14180
  326. 14181
  327. 14182
  328. 14183
  329. 14184
  330. 14185
  331. 14186
  332. 14187
  333. 14188
  334. 14189
  335. 14190
  336. 14191
  337. 14192
  338. 14193
  339. 14194
  340. 14195
  341. 14196
  342. 14197
  343. anm14
  344. 14EndLeft
  345. 14StepLeft
  346. 14PauseLeft
  347. 14PlayLeft
  348. 14PlayPauseLeft
  349. 14PauseRight
  350. 14PlayRight
  351. 14PlayPauseRight
  352. 14StepRight
  353. 14EndRight
  354. 14Minus
  355. 14Reset
  356. 14Plus
  357. pbsARFix247
  358. pbsARFix248
  359. 150
  360. 151
  361. 152
  362. 153
  363. 154
  364. 155
  365. 156
  366. 157
  367. 158
  368. 159
  369. 1510
  370. 1511
  371. 1512
  372. 1513
  373. 1514
  374. 1515
  375. 1516
  376. 1517
  377. 1518
  378. 1519
  379. anm15
  380. 15EndLeft
  381. 15StepLeft
  382. 15PauseLeft
  383. 15PlayLeft
  384. 15PlayPauseLeft
  385. 15PauseRight
  386. 15PlayRight
  387. 15PlayPauseRight
  388. 15StepRight
  389. 15EndRight
  390. 15Minus
  391. 15Reset
  392. 15Plus
  393. pbsARFix249
  394. pbsARFix250
  395. pbsARFix251
  396. pbsARFix252
  397. pbsARFix253
  398. pbsARFix254
  399. pbsARFix255
  400. pbsARFix256
  401. pbsARFix257
  402. pbsARFix258
  403. pbsARFix259
  404. pbsARFix260
  405. pbsARFix261
Page 24: Black-ScholesPricingandHedging - NTU · to the Black-Scholes PDE (6.2) in order to price a claim payoff Cof the formC= h(S T).Asinthediscrete-timecase,thearbitragepriceπt(C) at

N Privault

Fig 618 Time-dependent solution of the heat equationlowast

Proposition 69 The fundamental solution of the heat equation (626) isgiven by the Gaussian probability density function

ϕ(t y) =1radic2πt

eminusy2(2t) y isin R

with variance t gt 0

Proof The proof is done by a direct calculation as follows

partϕ

partt(t y) = part

partt

(eminusy2(2t)radic

2πt

)

= minus eminusy2(2t)

2t32radic

2π+

y2

2t2eminusy2(2t)radic

2πt

=

(minus 1

2t +y2

2t2

)ϕ(t y)

and

12part2ϕ

party2 (t y) = minus12part

party

(y

t

eminusy2(2t)radic

2πt

)

= minus eminusy2(2t)

2tradic

2πt+

y2

2t2eminusy2(2t)radic

2πt

=

(minus 1

2t +y2

2t2

)ϕ(t y) t gt 0 y isin R

lowast The animation works in Acrobat Reader on the entire pdf file

224

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

In Section 66 the heat equation (626) will be shown to be equivalent to theBlack-Scholes PDE after a change of variables In particular this will lead tothe explicit solution of the Black-Scholes PDE

Proposition 610 The heat equationpartg

partt(t y) = 1

2part2g

party2 (t y)

g(0 y) = ψ(y)

(627)

with continuous initial condition

g(0 y) = ψ(y)

has the solution

g(t y) =winfinminusinfin

ψ(z) eminus(yminusz)2(2t) dzradic2πt

y isin R t gt 0 (628)

Proof We have

partg

partt(t y) = part

partt

winfinminusinfin

ψ(z) eminus(yminusz)2(2t) dzradic2πt

=winfinminusinfin

ψ(z)part

partt

(eminus(yminusz)2(2t)radic

2πt

)dz

=12winfinminusinfin

ψ(z)

((yminus z)2

t2minus 1t

)eminus(yminusz)2(2t) dzradic

2πt

=12winfinminusinfin

ψ(z)part2

partz2 eminus(yminusz)2(2t) dzradic2πt

=12winfinminusinfin

ψ(z)part2

party2 eminus(yminusz)2(2t) dzradic2πt

=12part2

party2

winfinminusinfin

ψ(z) eminus(yminusz)2(2t) dzradic2πt

=12part2g

party2 (t y)

On the other hand it can be checked that at time t = 0 we have

limtrarr0

winfinminusinfin

ψ(z) eminus(yminusz)2(2t) dzradic2πt

= limtrarr0

winfinminusinfin

ψ(y+ z) eminusz2(2t) dzradic2πt

= ψ(y) y isin R

225

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

The next Figure 619 shows the evolution of g(tx) with initial conditionbased on the European call payoff function h(x) = (xminusK)+ ie

g(0 y) = ψ(y) = h(

e|σ|y)=(

e|σ|y minusK)+ y isin R

Fig 619 Time-dependent solution of the heat equationlowast

Let us provide a second proof of Proposition 610 this time using Brownianmotion and stochastic calculus

Proof of Proposition 610 First note that under the change of variable x =z minus y we have

g(t y) =winfinminusinfin

ψ(z) eminus(yminusz)2(2t) dzradic2πt

=winfinminusinfin

ψ(y+ x) eminusx2(2t) dxradic2πt

= IE[ψ(y+Bt)]

= IE[ψ(yminusBt)]

where (Bt)tisinR+ is a standard Brownian motion and Bt N (0 t) t isin R+Applying Itocircrsquos formula and using the fact that the expectation of the stochas-tic integral with respect to Brownian motion is zero see Relation (417) inProposition 420 we find

g(t y) = IE[ψ(yminusBt)]

= ψ(y)minus IE[w t

0ψprime(yminusBs)dBs

]+

12 IE

[w t0ψprimeprime(yminusBs)ds

]= ψ(y) +

12w t

0IE[ψprimeprime(yminusBs)

]ds

lowast The animation works in Acrobat Reader on the entire pdf file

226

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

= ψ(y) +12w t

0part2

party2 IE [ψ(yminusBs)] ds

= ψ(y) +12w t

0part2g

party2 (s y)ds

Hence we have

partg

partt(t y) = part

parttIE[ψ(yminusBt)]

=12part2

party2 IE [ψ(yminusBt)]

=12part2g

party2 (t y)

Regarding the initial condition we check that

g(0 y) = IE[ψ(yminusB0)] = IE[ψ(y)] = ψ(y)

The expression g(t y) = IE[ψ(yminusBt)] provides a probabilistic interpreta-tion of the heat diffusion phenomenon based on Brownian motion Namelywhen ψε(y) = 1[minusεε](y) we find that

gε(t y) = IE[ψε(yminusBt)]= IE[1[minusεε](yminusBt)]= P

(yminusBt isin [minusε ε]

)= P

(yminus ε 6 Bt 6 y+ ε

)represents the probability of finding Bt within a neighborhood [y minus ε y + ε]of the point y isin R

66 Solution of the Black-Scholes PDE

In this section we solve the Black-Scholes PDE by the kernel method of Sec-tion 65 and a change of variables This solution method uses the change ofvariables (623) of Proposition 68 and a time inversion from which the ter-minal condition at time T in the Black-Scholes equation becomes an initialcondition at time t = 0 in the heat equation

Next we state the proof Proposition 68

Proof Letting s = T minus t and x = e|σ|y+(σ22minusr)t and using Relation (623)ie

g(t y) = ertf(T minus t e|σ|y+(σ22minusr)t)

227

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

we have

partg

partt(t y) = r ertf

(T minus t e|σ|y+(σ22minusr)t)minus ert partf

parts

(T minus t e|σ|y+(σ22minusr)t)

+

(σ2

2 minus r)

ert e|σ|y+(σ22minusr)t partf

partx

(T minus t e|σ|y+(σ22minusr)t)

= r ertf(T minus tx)minus ert partfparts

(T minus tx) +(σ2

2 minus r)

ertxpartfpartx

(T minus tx)

=12 ertx2σ2 part

2f

partx2 (T minus tx) +σ2

2 ertxpartfpartx

(T minus tx) (629)

where on the last step we used the Black-Scholes PDE On the other handwe have

partg

party(t y) = |σ| ert e|σ|y+(σ22minusr)t partf

partx

(T minus t e|σ|y+(σ22minusr)t)

and

12partg2

party2 (t y) =σ2

2 ert e|σ|y+(σ22minusr)t partf

partx

(T minus t e|σ|y+(σ22minusr)t)

+σ2

2 ert e2|σ|y+2(σ22minusr)t part2f

partx2(T minus t e|σ|y+(σ22minusr)t)

=σ2

2 ertxpartfpartx

(T minus tx) + σ2

2 ertx2 part2f

partx2 (T minus tx) (630)

We conclude by comparing (629) with (630) which shows that g(tx) solvesthe heat equation (627) with initial condition

g(0 y) = f(T e|σ|y

)= h

(e|σ|y

)

In the next proposition we derive the Black-Scholes formula (610) by solv-ing the PDE (622) The Black-Scholes formula will also be recovered by aprobabilistic argument via the computation of an expected value in Proposi-tion 77

Proposition 611 When h(x) = (x minusK)+ the solution of the Black-Scholes PDE (622) is given by

f(tx) = xΦ(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

) x gt 0

whereΦ(x) =

1radic2π

w xminusinfin

eminusy22dy x isin R

and

228

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

d+(T minus t) =

log(xK) + (r+ σ22)(T minus t)|σ|radicT minus t

dminus(T minus t) =log(xK) + (rminus σ22)(T minus t)

|σ|radicT minus t

x gt 0 t isin [0T )

Proof By inversion of Relation (623) with s = T minus t and x = e|σ|y+(σ22minusr)twe get

f(sx) = eminus(Tminuss)rg(T minus s minus(σ

22minus r)(T minus s) + log x|σ|

)and

h(x) = ψ

(log x|σ|

) x gt 0 or ψ(y) = h

(e|σ|y

) y isin R

Hence using the solution (628) and Relation (624) we get

f(tx) = eminus(Tminust)rg(T minus t minus(σ

22minus r)(T minus t) + log x|σ|

)= eminus(Tminust)r

winfinminusinfin

ψ

(minus(σ22minus r)(T minus t) + log x

|σ|+ z

)eminusz2(2(Tminust)) dzradic

2(T minus t)π

= eminus(Tminust)rwinfinminusinfin

h(x e|σ|zminus(σ22minusr)(Tminust)) eminusz2(2(Tminust)) dzradic

2(T minus t)π

= eminus(Tminust)rwinfinminusinfin

(x e|σ|zminus(σ22minusr)(Tminust) minusK

)+ eminusz2(2(Tminust)) dzradic2(T minus t)π

= eminus(Tminust)r

timeswinfin

(minusr+σ22)(Tminust)+log(Kx)|σ|

(x e|σ|zminus(σ22minusr)(Tminust) minusK

)eminusz2(2(Tminust)) dzradic

2(T minus t)π

= x eminus(Tminust)rwinfinminusdminus(Tminust)

radicTminust

e|σ|zminus(σ22minusr)(Tminust) eminusz2(2(Tminust)) dzradic2(T minus t)π

minusK eminus(Tminust)rwinfinminusdminus(Tminust)

radicTminust

eminusz2(2(Tminust)) dzradic2(T minus t)π

= xwinfinminusdminus(Tminust)

radicTminust

e|σ|zminus(Tminust)σ22minusz2(2(Tminust)) dzradic2(T minus t)π

minusK eminus(Tminust)rwinfinminusdminus(Tminust)

radicTminust

eminusz2(2(Tminust)) dzradic2(T minus t)π

= xwinfinminusdminus(Tminust)

radicTminust

eminus(zminus(Tminust)|σ|)2(2(Tminust)) dzradic2(T minus t)π

229

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

minusK eminus(Tminust)rwinfinminusdminus(Tminust)

radicTminust

eminusz2(2(Tminust)) dzradic2(T minus t)π

= xwinfinminusdminus(Tminust)

radicTminustminus(Tminust)|σ|

eminusz2(2(Tminust)) dzradic2(T minus t)π

minusK eminus(Tminust)rwinfinminusdminus(Tminust)

radicTminust

eminusz2(2(Tminust)) dzradic2(T minus t)π

= xwinfinminusdminus(Tminust)minus|σ|

radicTminust

eminusz22 dzradic2πminusK eminus(Tminust)r

winfinminusdminus(Tminust)

eminusz22 dzradic2π

= x(1minusΦ

(minus d+(T minus t)

))minusK eminus(Tminust)r

(1minusΦ

(minus dminus(T minus t)

))= xΦ

(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)

where we used the relation (614) ie

1minusΦ(a) = Φ(minusa) a isin R

Exercises

Exercise 61 Bachelier (1900) model Consider a market made of a risklessasset valued At = A0 with zero interest rate t isin R+ and a risky asset whoseprice St is modeled by a standard Brownian motion as St = Bt t isin R+

a) Show that the price g(tBt) of the option with payoff C = B2T satisfies

the heat equationpartϕ

partt(t y) = minus1

2part2ϕ

party2 (t y)

with terminal condition g(T x) = x2b) Find the function g(tx) by solving the PDE of Question (a)

Hint Try a solution of the form g(tx) = x2 + f(t)

See Exercises 611 713 and 714 for extensions to nonzero interest rates

Exercise 62 Consider a risky asset price (St)tisinR modeled in the Cox et al(1985) (CIR) model as

dSt = β(αminus St)dt+ σradicStdBt αβσ gt 0 (631)

and let (ηt ξt)tisinR+ be a portfolio strategy whose value Vt = ηtAt + ξtSttakes the form Vt = g(tSt) t isin R+ Figure 620 presents a random simula-tion of the solution to (631) with α = 0025 β = 1 and σ = 13230

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

0

1

2

3

4

5

6

7

8

0 01 02 03 04 05 06 07 08 09 1

St

t

Fig 620 Graph of the CIR short rate t 7rarr rt with α = 25 β = 1 and σ = 13

N=10000 t lt- 0(N-1) dt lt- 10Na=0025 b=2 sigma=0052 X lt- rnorm(Nmean=0sd=sqrt(dt))R lt- rep(0N)R[1]=001

for (j in 2N)R[j]=max(0R[j-1]+(a-bR[j-1])dt+sigmasqrt(R[j-1])X[j])4 plot(t R xlab = t ylab = type = l ylim = c(0002) col = blue)

Based on the self-financing condition written as

dVt = rVtdtminus rξtStdt+ ξtdSt

= rVtdtminus rξtStdt+ β(αminus St)ξtdt+ σξtradicStdBt t isin R+ (632)

derive the PDE satisfied by the function g(tx) using the Itocirc formula

Exercise 63 Black-Scholes PDE with dividends Consider a riskless as-set with price At = A0 ert t isin R+ and an underlying asset price process(St)tisinR+ modeled as

dSt = (microminus δ)Stdt+ σStdBt

where (Bt)tisinR+ is a standard Brownian motion and δ gt 0 is a continuous-time dividend rate By absence of arbitrage the payment of a dividend entailsa drop in the stock price by the same amount occuring generally on the ex-dividend date on which the purchase of the security no longer entitles theinvestor to the dividend amount The list of investors entitled to dividendpayment is consolidated on the date of record and payment is made on thepayable date

library(quantmod)2 getSymbols(0005HKfrom=2010-01-01to=SysDate()src=yahoo)

getDividends(0005HKfrom=2010-01-01to=SysDate()src=yahoo)

a) Assuming that the portfolio with value Vt = ξtSt + ηtAt at time t is self-financing and that dividends are continuously reinvested write down theportfolio variation dVt

231

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

b) Assuming that the portfolio value Vt takes the form Vt = g(tSt) at timet derive the Black-Scholes PDE for the function g(tx) with its terminalcondition

c) Compute the price at time t isin [0T ] of the European call option withstrike price K by solving the corresponding Black-Scholes PDE

d) Compute the Delta of the option

Exercise 64

a) Check that the Black-Scholes formula (610) for European call options

gc(tx) = xΦ(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)

satisfies the following boundary conditions

i) at x = 0 gc(t 0) = 0ii) at maturity t = T

gc(T x) = (xminusK)+ =

xminusK x gt K

0 x 6 K

iii) as time to maturity tends to infinity

limTrarrinfin

Bl(Kxσ rT minus t) = x t isin R+

b) Check that the Black-Scholes formula (618) for European put options

gp(tx) = K eminus(Tminust)rΦ(minus dminus(T minus t)

)minus xΦ

(minus d+(T minus t)

)satisfies the following boundary conditions

i) at x = 0 gp(t 0) = K eminus(Tminust)rii) as x tends to infinity gp(tinfin) = 0 for all t isin [0T )iii) at maturity t = T

gp(T x) = (K minus x)+ =

0 x gt K

K minus x x 6 K

iv) as time to maturity tends to infinity

limTrarrinfin

Blp(KStσ rT minus t) = 0 t isin R+

Exercise 65 Power option (Exercise 314 continued)

232

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

a) Solve the Black-Scholes PDE

rg(x t) = partg

partt(x t) + rx

partg

partx(x t) + σ2

2 x2 part2g

partx2 (x t) (633)

with terminal condition g(xT ) = x2 x gt 0 t isin [0T ]

Hint Try a solution of the form g(x t) = x2f(t) and find f(t)b) Find the respective quantities ξt and ηt of the risky asset St and riskless

asset At = ert in the portfolio with value

Vt = g(St t) = ξtSt + ηtAt 0 6 t 6 T

hedging the contract with payoff S2T at maturity

Exercise 66 On December 18 2007 a call warrant has been issued byFortis Bank on the stock price S of the MTR Corporation with maturityT = 23122008 strike price K = HK$ 3608 and entitlement ratio=10Recall that in the Black-Scholes model the price at time t of the Europeanclaim on the underlying asset priced St with strike price K maturity T interest rate r and volatility σ gt 0 is given by the Black-Scholes formula as

f(tSt) = StΦ(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)

wheredminus(T minus t) =

(rminus σ22)(T minus t) + log(StK)

|σ|radicT minus t

d+(T minus t) = dminus(T minus t) + |σ|radicT minus t = (r+ σ22)(T minus t) + log(StK)

|σ|radicT minus t

Recall that by Proposition 64 we have

partf

partx(tSt) = Φ

(d+(T minus t)

) 0 6 t 6 T

a) Using the values of the Gaussian cumulative distribution function com-pute the Black-Scholes price of the corresponding call option at timet =November 07 2008 with St = HK$ 17200 assuming a volatility σ =90 = 090 and an annual risk-free interest rate r = 4377 = 004377

b) Still using the Gaussian cumulative distribution function compute thequantity of the risky asset required in your portfolio at time t =November07 2008 in order to hedge one such option at maturity T = 23122008

c) Figure 1 represents the Black-Scholes price of the call option as a functionof σ isin [05 15] = [50 150]

233

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

0

01

02

03

04

05

06

05 06 07 08 09 1 11 12 13 14 15σimp

Optio

n pr

ice

σ

Market price

Fig 621 Option price as a function of the volatility σ gt 0

1 BSCall lt- function(S K r T sigma)d1 lt- (log(SK)+(r+sigma^22)T)(sigmasqrt(T))d2 lt- d1 - sigma sqrt(T)

3 BSCall = Spnorm(d1) - Kexp(-rT)pnorm(d2)BSCallsigma lt- seq(0515 length=100)

5 plot(sigmaBSCall(172360800437746365sigma) type=llty=1 xlab=Sigmaylab=Black-Scholes Call Price ylim = c(006)col=bluelwd=3)grid()

abline(h=023col=redlwd=3)

Knowing that the closing price of the warrant on November 07 2008 wasHK$ 0023 which value can you infer for the implied volatility σ at thisdatelowast

Exercise 67 Forward contracts Recall that the price πt(C) of a claimpayoff C = h(ST ) of maturity T can be written as πt(C) = g(tSt) wherethe function g(tx) satisfies the Black-Scholes PDE

rg(tx) = partg

partt(tx) + rx

partg

partx(tx) + 1

2σ2x2 part

2g

partx2 (tx)

g(T x) = h(x) (1)

with terminal condition g(T x) = h(x) x gt 0

a) Assume that C is a forward contract with payoff

C = ST minusK

at time T Find the function h(x) in (1)b) Find the solution g(tx) of the above PDE and compute the price πt(C)

at time t isin [0T ]Hint search for a solution of the form g(tx) = xminus α(t) where α(t) is afunction of t to be determined

lowast Download the corresponding or the that can be runhere

234

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

BS lt- function(S K T r sig)d1 lt- (log(SK) + (r + sig^22)T) (sigsqrt(T))d2 lt- d1 - sigsqrt(T)return(Spnorm(d1) - Kexp(-rT)pnorm(d2))impliedvol lt- function(S K T r market)sig lt- 020sigup lt- 1sigdown lt- 0001count lt- 0err lt- BS(S K T r sig) - marketwhile(abs(err) gt 000001 ampamp countlt1000)if(err lt 0)sigdown lt- sigsig lt- (sigup + sig)2elsesigup lt- sigsig lt- (sigdown + sig)2err lt- BS(S K T r sig) - marketcount lt- count + 1if(count==2000)return(NA)elsereturn(sig)market = 083K = 628T = 7 365S = 634r = 002impliedvol(S K T r market)

cells [ cell_type code execution_count null metadata outputs [] source [ from IPythoncoredisplay import display HTMLn display(HTML( )) ] cell_type code execution_count null metadata collapsed true outputs [] source [ import numpy as npn import scipystats as ssn import time n n Black and Scholesn def d1(S0 K r sigma T)n return (nplog(S0K) + (r + sigma2 2) T)(sigma npsqrt(T))n n def d2(S0 K r sigma T)n return (nplog(S0 K) + (r - sigma2 2) T) (sigma npsqrt(T))n n def BlackScholes(typeS0 K r sigma T)n if type==Cn return S0 ssnormcdf(d1(S0 K r sigma T)) - K npexp(-r T) ssnormcdf(d2(S0 K r sigma T))n elsen return K npexp(-r T) ssnormcdf(-d2(S0 K r sigma T)) - S0 ssnormcdf(-d1(S0 K r sigma T)) ] cell_type code execution_count null metadata outputs [] source [ BlackScholes(C1000 1200 002 015 10) ] cell_type code execution_count null metadata outputs [] source [ def difference(x p S K r t)n return BlackScholes(CS K r x t) - p ] cell_type code execution_count null metadata outputs [] source [ from scipyoptimize import bisectn bisect(difference00011args=(11541763731112766 1000 1200 002 10)) ] ] metadata anaconda-cloud kernelspec display_name Python 3 language python name python3 language_info codemirror_mode name ipython version 3 file_extension py mimetype textx-python name python nbconvert_exporter python pygments_lexer ipython3 version 375rc1 nbformat 4 nbformat_minor 1

Black-Scholes Pricing and Hedging

c) Compute the quantityξt =

partg

partx(tSt)

of risky assets in a self-financing portfolio hedging Cd) Repeat the above questions with the terminal condition g(T x) = x

Exercise 68a) Solve the Black-Scholes PDE

rg(tx) = partg

partt(tx) + rx

partg

partx(tx) + σ2

2 x2 part2g

partx2 (tx) (634)

with terminal condition g(T x) = 1 x gt 0

Hint Try a solution of the form g(tx) = f(t) and find f(t)

b) Find the respective quantities ξt and ηt of the risky asset St and risklessasset At = ert in the portfolio with value

Vt = g(tSt) = ξtSt + ηtAt

hedging the contract with payoff $1 at maturity

Exercise 69 Log-contracts see also Exercise 84a) Solve the PDE

0 =partg

partt(x t) + rx

partg

partx(x t) + σ2

2 x2 part2g

partx2 (x t)

with the terminal condition g(xT ) = log x x gt 0

Hint Try a solution of the form g(x t) = f(t) + log x and find f(t)b) Solve the Black-Scholes PDE

rh(x t) = parth

partt(x t) + rx

parth

partx(x t) + σ2

2 x2 part2h

partx2 (x t) (635)

with the terminal condition h(xT ) = log x x gt 0

Hint Try a solution of the form h(x t) = u(t)g(x t) and find u(t)c) Find the respective quantities ξt and ηt of the risky asset St and riskless

asset At = ert in the portfolio with value

Vt = g(St t) = ξtSt + ηtAt

hedging a log-contract with payoff logST at maturity 235

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

Exercise 610 Binary options Consider a price process (St)tisinR+ given by

dStSt

= rdt+ σdBt S0 = 1

under the risk-neutral probability measure Plowast The binary (or digital) calloption is a contract with maturity T strike price K and payoff

Cd = 1[Kinfin)(ST ) =

$1 if ST gt K

0 if ST lt K

a) Derive the Black-Schole PDE satisfied by the pricing function Cd(tSt) ofthe binary call option together with its terminal condition

b) Show that the solution Cd(tx) of the Black-Scholes PDE of Question (a)is given by

Cd(tx) = eminus(Tminust)rΦ((rminus σ22)(T minus t) + log(xK)

|σ|radicT minus t

)= eminus(Tminust)rΦ

(dminus(T minus t)

)

where

dminus(T minus t) =(rminus σ22)(T minus t) + log(StK)

|σ|radicT minus t

0 6 t lt T

Exercise 611

a) Bachelier (1900) model Solve the stochastic differential equation

dSt = αStdt+ σdBt (636)

in terms of ασ isin R and the initial condition S0b) Write down the Bachelier PDE satisfied by the function C(tx) where

C(tSt) is the price at time t isin [0T ] of the contingent claim with payoffφ(ST ) = exp(ST ) and identify the process Delta (ξt)tisin[0T ] that hedgesthis claim

c) Solve the Black-Scholes PDE of Question (b) with the terminal conditionφ(x) = ex x isin R

Hint Search for a solution of the form

C(tx) = exp(minus(T minus t)r+ xh(t) +

σ2

4r (h2(t)minus 1)

) (637)

where h(t) is a function to be determined with h(T ) = 1

236

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

d) Compute the portfolio strategy (ξt ηt)tisin[0T ] that hedges the contingentclaim with payoff exp(ST )

Exercise 612

a) Show that for every fixed value of S the function

d 7minusrarr h(S d) = SΦ(d+ |σ|

radicT)minusK eminusrTΦ(d)

reaches its maximum at dlowast(S) =log(SK) + (rminus σ22)T

|σ|radicT

b) By the differentiation rule

d

dSh(S dlowast(S)) =

parth

partS(S dlowast(S)) + dprimelowast(S)

parth

partd(S dlowast(S))

recover the value of the Black-Scholes Delta

Exercise 613 Compute the Black-Scholes Vega by differentiation of theBlack-Scholes function

gc(tx) = Bl(Kxσ rT minus t) = xΦ(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)

with respect to the volatility parameter σ knowing that

minus12(dminus(T minus t)

)2= minus1

2

(log(xK) + (rminus σ22)(T minus t)

|σ|radicT minus t

)2

= minus12(d+(T minus t)

)2+ (T minus t)r+ log x

K (638)

Exercise 614 Consider the backward induction relation (313) ie

v(tx) = (1minus plowastN )v (t+ 1x(1 + aN )) + plowastN v (t+ 1x(1 + bN ))

using the renormalizations rN = rTN and

aN = (1 + rN )(1minus |σ|radicTN)minus 1 bN = (1 + rN )(1 + |σ|

radicTN)minus 1

of Section 36 N gt 1 with

plowastN =rN minus aNbN minus aN

and plowastN =bN minus rNbN minus aN

a) Show that the Black-Scholes PDE (62) of Proposition 61 can be recoveredfrom the induction relation (313) when the number N of time steps tendsto infinity

237

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

b) Show that the expression of the Delta ξt =partgcpartx

(tSt) can be similarlyrecovered from the finite difference relation (319) ie

ξ(1)t (Stminus1) =

v (t (1 + bN )Stminus1)minus v (t (1 + aN )Stminus1)

Stminus1(bN minus aN )

as N tends to infinity

Problem 615 (Leung and Sircar (2015)) ProShares Ultra SampP500 andProShares UltraShort SampP500 are leveraged investment funds that seek dailyinvestment results before fees and expenses that correspond to β times (βx)the daily performance of the SampP500reg with respectively β = 2 for ProSharesUltra and β = minus2 for ProShares UltraShort Here leveraging with a factorβ 1 aims at multiplying the potential return of an investment by a factorβ The following 10 questions are interdependent and should be treated insequence

a) Consider a risky asset priced S0 = $4 at time t = 0 and taking twopossible values S1 = $5 and S1 = $2 at time t = 1 Compute the twopossible returns (in ) achieved when investing $4 in one share of the assetS and the expected return under the risk-neutral probability measureassuming that the risk-free interest rate is zero

b) Leveraging Still based on an initial $4 investment we decide to leverageby a factor β = 3 by borrowing another (β minus 1) times $4 = 2times $4 at ratezero to purchase a total of β = 3 shares of the asset S Compute thetwo returns (in ) possibly achieved in this case and the expected returnunder the risk-neutral probability measure assuming that the risk-freeinterest rate is zero

c) Denoting by Ft the ProShares value at time t how much should the fundinvest in the underlying asset priced St and how much $ should it borrowor save on the risk-free market at any time t in order to leverage with afactor β 1

d) Find the portfolio allocation (ξt ηt) for the fund value

Ft = ξtSt + ηtAt t isin R+

according to Question (c) where At = A0 ert is the riskless money marketaccount

e) We choose to model the SampP500 index St as the geometric Brownianmotion

dSt = rStdt+ σStdBt t isin R+

under the risk-neutral probability measure Plowast Find the stochastic dif-ferential equation satisfied by (Ft)tisinR+ under the self-financing conditiondFt = ξtdSt + ηtdAt

238

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

f) Is the discounted fund value ( eminusrtFt)tisinR+ a martingale under the risk-neutral probability measure Plowast

g) Find the relation between the fund value Ft and the index St by solvingthe stochastic differential equation obtained for Ft in Question (e) Forsimplicity we normalize F0 = Sβ0

h) Write the price at time t = 0 of the call option with payoff (FT minusK)+ onthe ProShares index using the Black-Scholes formula

i) Show that when β gt 0 the Delta at time t isin [0T ) of the call optionwith payoff (FT minusK)+ on ProShares Ultra is equal to the Delta of thecall option with payoff (ST minusKβ(t))

+ on the SampP500 for a certain strikeprice Kβ(t) to be determined explicitly

j) When β lt 0 find the relation between the Delta at time t isin [0T ) ofthe call option with payoff (FT minusK)+ on ProShares UltraShort and theDelta of the put option with payoff (Kβ(t)minus ST )+ on the SampP500

239

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

  1. pbsARFix223
  2. pbsARFix224
  3. pbsARFix225
  4. pbsARFix226
  5. pbsARFix227
  6. pbsARFix228
  7. pbsARFix229
  8. pbsARFix230
  9. fdrm1
  10. pbsARFix231
  11. 100
  12. 101
  13. 102
  14. 103
  15. 104
  16. 105
  17. 106
  18. 107
  19. 108
  20. 109
  21. 1010
  22. 1011
  23. 1012
  24. 1013
  25. 1014
  26. 1015
  27. 1016
  28. 1017
  29. 1018
  30. 1019
  31. anm10
  32. 10EndLeft
  33. 10StepLeft
  34. 10PauseLeft
  35. 10PlayLeft
  36. 10PlayPauseLeft
  37. 10PauseRight
  38. 10PlayRight
  39. 10PlayPauseRight
  40. 10StepRight
  41. 10EndRight
  42. 10Minus
  43. 10Reset
  44. 10Plus
  45. pbsARFix232
  46. pbsARFix233
  47. pbsARFix234
  48. pbsARFix235
  49. pbsARFix236
  50. pbsARFix237
  51. fdrm2
  52. 110
  53. 111
  54. 112
  55. 113
  56. 114
  57. 115
  58. 116
  59. 117
  60. 118
  61. 119
  62. 1110
  63. 1111
  64. 1112
  65. 1113
  66. 1114
  67. 1115
  68. 1116
  69. 1117
  70. 1118
  71. 1119
  72. anm11
  73. 11EndLeft
  74. 11StepLeft
  75. 11PauseLeft
  76. 11PlayLeft
  77. 11PlayPauseLeft
  78. 11PauseRight
  79. 11PlayRight
  80. 11PlayPauseRight
  81. 11StepRight
  82. 11EndRight
  83. 11Minus
  84. 11Reset
  85. 11Plus
  86. pbsARFix238
  87. pbsARFix239
  88. pbsARFix240
  89. pbsARFix241
  90. pbsARFix242
  91. 120
  92. 121
  93. 122
  94. 123
  95. 124
  96. 125
  97. 126
  98. 127
  99. 128
  100. 129
  101. 1210
  102. anm12
  103. 12EndLeft
  104. 12StepLeft
  105. 12PauseLeft
  106. 12PlayLeft
  107. 12PlayPauseLeft
  108. 12PauseRight
  109. 12PlayRight
  110. 12PlayPauseRight
  111. 12StepRight
  112. 12EndRight
  113. 12Minus
  114. 12Reset
  115. 12Plus
  116. 130
  117. 131
  118. 132
  119. 133
  120. 134
  121. 135
  122. 136
  123. 137
  124. 138
  125. 139
  126. 1310
  127. anm13
  128. 13EndLeft
  129. 13StepLeft
  130. 13PauseLeft
  131. 13PlayLeft
  132. 13PlayPauseLeft
  133. 13PauseRight
  134. 13PlayRight
  135. 13PlayPauseRight
  136. 13StepRight
  137. 13EndRight
  138. 13Minus
  139. 13Reset
  140. 13Plus
  141. pbsARFix243
  142. pbsARFix244
  143. pbsARFix245
  144. pbsARFix246
  145. 140
  146. 141
  147. 142
  148. 143
  149. 144
  150. 145
  151. 146
  152. 147
  153. 148
  154. 149
  155. 1410
  156. 1411
  157. 1412
  158. 1413
  159. 1414
  160. 1415
  161. 1416
  162. 1417
  163. 1418
  164. 1419
  165. 1420
  166. 1421
  167. 1422
  168. 1423
  169. 1424
  170. 1425
  171. 1426
  172. 1427
  173. 1428
  174. 1429
  175. 1430
  176. 1431
  177. 1432
  178. 1433
  179. 1434
  180. 1435
  181. 1436
  182. 1437
  183. 1438
  184. 1439
  185. 1440
  186. 1441
  187. 1442
  188. 1443
  189. 1444
  190. 1445
  191. 1446
  192. 1447
  193. 1448
  194. 1449
  195. 1450
  196. 1451
  197. 1452
  198. 1453
  199. 1454
  200. 1455
  201. 1456
  202. 1457
  203. 1458
  204. 1459
  205. 1460
  206. 1461
  207. 1462
  208. 1463
  209. 1464
  210. 1465
  211. 1466
  212. 1467
  213. 1468
  214. 1469
  215. 1470
  216. 1471
  217. 1472
  218. 1473
  219. 1474
  220. 1475
  221. 1476
  222. 1477
  223. 1478
  224. 1479
  225. 1480
  226. 1481
  227. 1482
  228. 1483
  229. 1484
  230. 1485
  231. 1486
  232. 1487
  233. 1488
  234. 1489
  235. 1490
  236. 1491
  237. 1492
  238. 1493
  239. 1494
  240. 1495
  241. 1496
  242. 1497
  243. 1498
  244. 1499
  245. 14100
  246. 14101
  247. 14102
  248. 14103
  249. 14104
  250. 14105
  251. 14106
  252. 14107
  253. 14108
  254. 14109
  255. 14110
  256. 14111
  257. 14112
  258. 14113
  259. 14114
  260. 14115
  261. 14116
  262. 14117
  263. 14118
  264. 14119
  265. 14120
  266. 14121
  267. 14122
  268. 14123
  269. 14124
  270. 14125
  271. 14126
  272. 14127
  273. 14128
  274. 14129
  275. 14130
  276. 14131
  277. 14132
  278. 14133
  279. 14134
  280. 14135
  281. 14136
  282. 14137
  283. 14138
  284. 14139
  285. 14140
  286. 14141
  287. 14142
  288. 14143
  289. 14144
  290. 14145
  291. 14146
  292. 14147
  293. 14148
  294. 14149
  295. 14150
  296. 14151
  297. 14152
  298. 14153
  299. 14154
  300. 14155
  301. 14156
  302. 14157
  303. 14158
  304. 14159
  305. 14160
  306. 14161
  307. 14162
  308. 14163
  309. 14164
  310. 14165
  311. 14166
  312. 14167
  313. 14168
  314. 14169
  315. 14170
  316. 14171
  317. 14172
  318. 14173
  319. 14174
  320. 14175
  321. 14176
  322. 14177
  323. 14178
  324. 14179
  325. 14180
  326. 14181
  327. 14182
  328. 14183
  329. 14184
  330. 14185
  331. 14186
  332. 14187
  333. 14188
  334. 14189
  335. 14190
  336. 14191
  337. 14192
  338. 14193
  339. 14194
  340. 14195
  341. 14196
  342. 14197
  343. anm14
  344. 14EndLeft
  345. 14StepLeft
  346. 14PauseLeft
  347. 14PlayLeft
  348. 14PlayPauseLeft
  349. 14PauseRight
  350. 14PlayRight
  351. 14PlayPauseRight
  352. 14StepRight
  353. 14EndRight
  354. 14Minus
  355. 14Reset
  356. 14Plus
  357. pbsARFix247
  358. pbsARFix248
  359. 150
  360. 151
  361. 152
  362. 153
  363. 154
  364. 155
  365. 156
  366. 157
  367. 158
  368. 159
  369. 1510
  370. 1511
  371. 1512
  372. 1513
  373. 1514
  374. 1515
  375. 1516
  376. 1517
  377. 1518
  378. 1519
  379. anm15
  380. 15EndLeft
  381. 15StepLeft
  382. 15PauseLeft
  383. 15PlayLeft
  384. 15PlayPauseLeft
  385. 15PauseRight
  386. 15PlayRight
  387. 15PlayPauseRight
  388. 15StepRight
  389. 15EndRight
  390. 15Minus
  391. 15Reset
  392. 15Plus
  393. pbsARFix249
  394. pbsARFix250
  395. pbsARFix251
  396. pbsARFix252
  397. pbsARFix253
  398. pbsARFix254
  399. pbsARFix255
  400. pbsARFix256
  401. pbsARFix257
  402. pbsARFix258
  403. pbsARFix259
  404. pbsARFix260
  405. pbsARFix261
Page 25: Black-ScholesPricingandHedging - NTU · to the Black-Scholes PDE (6.2) in order to price a claim payoff Cof the formC= h(S T).Asinthediscrete-timecase,thearbitragepriceπt(C) at

Black-Scholes Pricing and Hedging

In Section 66 the heat equation (626) will be shown to be equivalent to theBlack-Scholes PDE after a change of variables In particular this will lead tothe explicit solution of the Black-Scholes PDE

Proposition 610 The heat equationpartg

partt(t y) = 1

2part2g

party2 (t y)

g(0 y) = ψ(y)

(627)

with continuous initial condition

g(0 y) = ψ(y)

has the solution

g(t y) =winfinminusinfin

ψ(z) eminus(yminusz)2(2t) dzradic2πt

y isin R t gt 0 (628)

Proof We have

partg

partt(t y) = part

partt

winfinminusinfin

ψ(z) eminus(yminusz)2(2t) dzradic2πt

=winfinminusinfin

ψ(z)part

partt

(eminus(yminusz)2(2t)radic

2πt

)dz

=12winfinminusinfin

ψ(z)

((yminus z)2

t2minus 1t

)eminus(yminusz)2(2t) dzradic

2πt

=12winfinminusinfin

ψ(z)part2

partz2 eminus(yminusz)2(2t) dzradic2πt

=12winfinminusinfin

ψ(z)part2

party2 eminus(yminusz)2(2t) dzradic2πt

=12part2

party2

winfinminusinfin

ψ(z) eminus(yminusz)2(2t) dzradic2πt

=12part2g

party2 (t y)

On the other hand it can be checked that at time t = 0 we have

limtrarr0

winfinminusinfin

ψ(z) eminus(yminusz)2(2t) dzradic2πt

= limtrarr0

winfinminusinfin

ψ(y+ z) eminusz2(2t) dzradic2πt

= ψ(y) y isin R

225

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

The next Figure 619 shows the evolution of g(tx) with initial conditionbased on the European call payoff function h(x) = (xminusK)+ ie

g(0 y) = ψ(y) = h(

e|σ|y)=(

e|σ|y minusK)+ y isin R

Fig 619 Time-dependent solution of the heat equationlowast

Let us provide a second proof of Proposition 610 this time using Brownianmotion and stochastic calculus

Proof of Proposition 610 First note that under the change of variable x =z minus y we have

g(t y) =winfinminusinfin

ψ(z) eminus(yminusz)2(2t) dzradic2πt

=winfinminusinfin

ψ(y+ x) eminusx2(2t) dxradic2πt

= IE[ψ(y+Bt)]

= IE[ψ(yminusBt)]

where (Bt)tisinR+ is a standard Brownian motion and Bt N (0 t) t isin R+Applying Itocircrsquos formula and using the fact that the expectation of the stochas-tic integral with respect to Brownian motion is zero see Relation (417) inProposition 420 we find

g(t y) = IE[ψ(yminusBt)]

= ψ(y)minus IE[w t

0ψprime(yminusBs)dBs

]+

12 IE

[w t0ψprimeprime(yminusBs)ds

]= ψ(y) +

12w t

0IE[ψprimeprime(yminusBs)

]ds

lowast The animation works in Acrobat Reader on the entire pdf file

226

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

= ψ(y) +12w t

0part2

party2 IE [ψ(yminusBs)] ds

= ψ(y) +12w t

0part2g

party2 (s y)ds

Hence we have

partg

partt(t y) = part

parttIE[ψ(yminusBt)]

=12part2

party2 IE [ψ(yminusBt)]

=12part2g

party2 (t y)

Regarding the initial condition we check that

g(0 y) = IE[ψ(yminusB0)] = IE[ψ(y)] = ψ(y)

The expression g(t y) = IE[ψ(yminusBt)] provides a probabilistic interpreta-tion of the heat diffusion phenomenon based on Brownian motion Namelywhen ψε(y) = 1[minusεε](y) we find that

gε(t y) = IE[ψε(yminusBt)]= IE[1[minusεε](yminusBt)]= P

(yminusBt isin [minusε ε]

)= P

(yminus ε 6 Bt 6 y+ ε

)represents the probability of finding Bt within a neighborhood [y minus ε y + ε]of the point y isin R

66 Solution of the Black-Scholes PDE

In this section we solve the Black-Scholes PDE by the kernel method of Sec-tion 65 and a change of variables This solution method uses the change ofvariables (623) of Proposition 68 and a time inversion from which the ter-minal condition at time T in the Black-Scholes equation becomes an initialcondition at time t = 0 in the heat equation

Next we state the proof Proposition 68

Proof Letting s = T minus t and x = e|σ|y+(σ22minusr)t and using Relation (623)ie

g(t y) = ertf(T minus t e|σ|y+(σ22minusr)t)

227

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

we have

partg

partt(t y) = r ertf

(T minus t e|σ|y+(σ22minusr)t)minus ert partf

parts

(T minus t e|σ|y+(σ22minusr)t)

+

(σ2

2 minus r)

ert e|σ|y+(σ22minusr)t partf

partx

(T minus t e|σ|y+(σ22minusr)t)

= r ertf(T minus tx)minus ert partfparts

(T minus tx) +(σ2

2 minus r)

ertxpartfpartx

(T minus tx)

=12 ertx2σ2 part

2f

partx2 (T minus tx) +σ2

2 ertxpartfpartx

(T minus tx) (629)

where on the last step we used the Black-Scholes PDE On the other handwe have

partg

party(t y) = |σ| ert e|σ|y+(σ22minusr)t partf

partx

(T minus t e|σ|y+(σ22minusr)t)

and

12partg2

party2 (t y) =σ2

2 ert e|σ|y+(σ22minusr)t partf

partx

(T minus t e|σ|y+(σ22minusr)t)

+σ2

2 ert e2|σ|y+2(σ22minusr)t part2f

partx2(T minus t e|σ|y+(σ22minusr)t)

=σ2

2 ertxpartfpartx

(T minus tx) + σ2

2 ertx2 part2f

partx2 (T minus tx) (630)

We conclude by comparing (629) with (630) which shows that g(tx) solvesthe heat equation (627) with initial condition

g(0 y) = f(T e|σ|y

)= h

(e|σ|y

)

In the next proposition we derive the Black-Scholes formula (610) by solv-ing the PDE (622) The Black-Scholes formula will also be recovered by aprobabilistic argument via the computation of an expected value in Proposi-tion 77

Proposition 611 When h(x) = (x minusK)+ the solution of the Black-Scholes PDE (622) is given by

f(tx) = xΦ(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

) x gt 0

whereΦ(x) =

1radic2π

w xminusinfin

eminusy22dy x isin R

and

228

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

d+(T minus t) =

log(xK) + (r+ σ22)(T minus t)|σ|radicT minus t

dminus(T minus t) =log(xK) + (rminus σ22)(T minus t)

|σ|radicT minus t

x gt 0 t isin [0T )

Proof By inversion of Relation (623) with s = T minus t and x = e|σ|y+(σ22minusr)twe get

f(sx) = eminus(Tminuss)rg(T minus s minus(σ

22minus r)(T minus s) + log x|σ|

)and

h(x) = ψ

(log x|σ|

) x gt 0 or ψ(y) = h

(e|σ|y

) y isin R

Hence using the solution (628) and Relation (624) we get

f(tx) = eminus(Tminust)rg(T minus t minus(σ

22minus r)(T minus t) + log x|σ|

)= eminus(Tminust)r

winfinminusinfin

ψ

(minus(σ22minus r)(T minus t) + log x

|σ|+ z

)eminusz2(2(Tminust)) dzradic

2(T minus t)π

= eminus(Tminust)rwinfinminusinfin

h(x e|σ|zminus(σ22minusr)(Tminust)) eminusz2(2(Tminust)) dzradic

2(T minus t)π

= eminus(Tminust)rwinfinminusinfin

(x e|σ|zminus(σ22minusr)(Tminust) minusK

)+ eminusz2(2(Tminust)) dzradic2(T minus t)π

= eminus(Tminust)r

timeswinfin

(minusr+σ22)(Tminust)+log(Kx)|σ|

(x e|σ|zminus(σ22minusr)(Tminust) minusK

)eminusz2(2(Tminust)) dzradic

2(T minus t)π

= x eminus(Tminust)rwinfinminusdminus(Tminust)

radicTminust

e|σ|zminus(σ22minusr)(Tminust) eminusz2(2(Tminust)) dzradic2(T minus t)π

minusK eminus(Tminust)rwinfinminusdminus(Tminust)

radicTminust

eminusz2(2(Tminust)) dzradic2(T minus t)π

= xwinfinminusdminus(Tminust)

radicTminust

e|σ|zminus(Tminust)σ22minusz2(2(Tminust)) dzradic2(T minus t)π

minusK eminus(Tminust)rwinfinminusdminus(Tminust)

radicTminust

eminusz2(2(Tminust)) dzradic2(T minus t)π

= xwinfinminusdminus(Tminust)

radicTminust

eminus(zminus(Tminust)|σ|)2(2(Tminust)) dzradic2(T minus t)π

229

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

minusK eminus(Tminust)rwinfinminusdminus(Tminust)

radicTminust

eminusz2(2(Tminust)) dzradic2(T minus t)π

= xwinfinminusdminus(Tminust)

radicTminustminus(Tminust)|σ|

eminusz2(2(Tminust)) dzradic2(T minus t)π

minusK eminus(Tminust)rwinfinminusdminus(Tminust)

radicTminust

eminusz2(2(Tminust)) dzradic2(T minus t)π

= xwinfinminusdminus(Tminust)minus|σ|

radicTminust

eminusz22 dzradic2πminusK eminus(Tminust)r

winfinminusdminus(Tminust)

eminusz22 dzradic2π

= x(1minusΦ

(minus d+(T minus t)

))minusK eminus(Tminust)r

(1minusΦ

(minus dminus(T minus t)

))= xΦ

(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)

where we used the relation (614) ie

1minusΦ(a) = Φ(minusa) a isin R

Exercises

Exercise 61 Bachelier (1900) model Consider a market made of a risklessasset valued At = A0 with zero interest rate t isin R+ and a risky asset whoseprice St is modeled by a standard Brownian motion as St = Bt t isin R+

a) Show that the price g(tBt) of the option with payoff C = B2T satisfies

the heat equationpartϕ

partt(t y) = minus1

2part2ϕ

party2 (t y)

with terminal condition g(T x) = x2b) Find the function g(tx) by solving the PDE of Question (a)

Hint Try a solution of the form g(tx) = x2 + f(t)

See Exercises 611 713 and 714 for extensions to nonzero interest rates

Exercise 62 Consider a risky asset price (St)tisinR modeled in the Cox et al(1985) (CIR) model as

dSt = β(αminus St)dt+ σradicStdBt αβσ gt 0 (631)

and let (ηt ξt)tisinR+ be a portfolio strategy whose value Vt = ηtAt + ξtSttakes the form Vt = g(tSt) t isin R+ Figure 620 presents a random simula-tion of the solution to (631) with α = 0025 β = 1 and σ = 13230

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

0

1

2

3

4

5

6

7

8

0 01 02 03 04 05 06 07 08 09 1

St

t

Fig 620 Graph of the CIR short rate t 7rarr rt with α = 25 β = 1 and σ = 13

N=10000 t lt- 0(N-1) dt lt- 10Na=0025 b=2 sigma=0052 X lt- rnorm(Nmean=0sd=sqrt(dt))R lt- rep(0N)R[1]=001

for (j in 2N)R[j]=max(0R[j-1]+(a-bR[j-1])dt+sigmasqrt(R[j-1])X[j])4 plot(t R xlab = t ylab = type = l ylim = c(0002) col = blue)

Based on the self-financing condition written as

dVt = rVtdtminus rξtStdt+ ξtdSt

= rVtdtminus rξtStdt+ β(αminus St)ξtdt+ σξtradicStdBt t isin R+ (632)

derive the PDE satisfied by the function g(tx) using the Itocirc formula

Exercise 63 Black-Scholes PDE with dividends Consider a riskless as-set with price At = A0 ert t isin R+ and an underlying asset price process(St)tisinR+ modeled as

dSt = (microminus δ)Stdt+ σStdBt

where (Bt)tisinR+ is a standard Brownian motion and δ gt 0 is a continuous-time dividend rate By absence of arbitrage the payment of a dividend entailsa drop in the stock price by the same amount occuring generally on the ex-dividend date on which the purchase of the security no longer entitles theinvestor to the dividend amount The list of investors entitled to dividendpayment is consolidated on the date of record and payment is made on thepayable date

library(quantmod)2 getSymbols(0005HKfrom=2010-01-01to=SysDate()src=yahoo)

getDividends(0005HKfrom=2010-01-01to=SysDate()src=yahoo)

a) Assuming that the portfolio with value Vt = ξtSt + ηtAt at time t is self-financing and that dividends are continuously reinvested write down theportfolio variation dVt

231

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

b) Assuming that the portfolio value Vt takes the form Vt = g(tSt) at timet derive the Black-Scholes PDE for the function g(tx) with its terminalcondition

c) Compute the price at time t isin [0T ] of the European call option withstrike price K by solving the corresponding Black-Scholes PDE

d) Compute the Delta of the option

Exercise 64

a) Check that the Black-Scholes formula (610) for European call options

gc(tx) = xΦ(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)

satisfies the following boundary conditions

i) at x = 0 gc(t 0) = 0ii) at maturity t = T

gc(T x) = (xminusK)+ =

xminusK x gt K

0 x 6 K

iii) as time to maturity tends to infinity

limTrarrinfin

Bl(Kxσ rT minus t) = x t isin R+

b) Check that the Black-Scholes formula (618) for European put options

gp(tx) = K eminus(Tminust)rΦ(minus dminus(T minus t)

)minus xΦ

(minus d+(T minus t)

)satisfies the following boundary conditions

i) at x = 0 gp(t 0) = K eminus(Tminust)rii) as x tends to infinity gp(tinfin) = 0 for all t isin [0T )iii) at maturity t = T

gp(T x) = (K minus x)+ =

0 x gt K

K minus x x 6 K

iv) as time to maturity tends to infinity

limTrarrinfin

Blp(KStσ rT minus t) = 0 t isin R+

Exercise 65 Power option (Exercise 314 continued)

232

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

a) Solve the Black-Scholes PDE

rg(x t) = partg

partt(x t) + rx

partg

partx(x t) + σ2

2 x2 part2g

partx2 (x t) (633)

with terminal condition g(xT ) = x2 x gt 0 t isin [0T ]

Hint Try a solution of the form g(x t) = x2f(t) and find f(t)b) Find the respective quantities ξt and ηt of the risky asset St and riskless

asset At = ert in the portfolio with value

Vt = g(St t) = ξtSt + ηtAt 0 6 t 6 T

hedging the contract with payoff S2T at maturity

Exercise 66 On December 18 2007 a call warrant has been issued byFortis Bank on the stock price S of the MTR Corporation with maturityT = 23122008 strike price K = HK$ 3608 and entitlement ratio=10Recall that in the Black-Scholes model the price at time t of the Europeanclaim on the underlying asset priced St with strike price K maturity T interest rate r and volatility σ gt 0 is given by the Black-Scholes formula as

f(tSt) = StΦ(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)

wheredminus(T minus t) =

(rminus σ22)(T minus t) + log(StK)

|σ|radicT minus t

d+(T minus t) = dminus(T minus t) + |σ|radicT minus t = (r+ σ22)(T minus t) + log(StK)

|σ|radicT minus t

Recall that by Proposition 64 we have

partf

partx(tSt) = Φ

(d+(T minus t)

) 0 6 t 6 T

a) Using the values of the Gaussian cumulative distribution function com-pute the Black-Scholes price of the corresponding call option at timet =November 07 2008 with St = HK$ 17200 assuming a volatility σ =90 = 090 and an annual risk-free interest rate r = 4377 = 004377

b) Still using the Gaussian cumulative distribution function compute thequantity of the risky asset required in your portfolio at time t =November07 2008 in order to hedge one such option at maturity T = 23122008

c) Figure 1 represents the Black-Scholes price of the call option as a functionof σ isin [05 15] = [50 150]

233

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

0

01

02

03

04

05

06

05 06 07 08 09 1 11 12 13 14 15σimp

Optio

n pr

ice

σ

Market price

Fig 621 Option price as a function of the volatility σ gt 0

1 BSCall lt- function(S K r T sigma)d1 lt- (log(SK)+(r+sigma^22)T)(sigmasqrt(T))d2 lt- d1 - sigma sqrt(T)

3 BSCall = Spnorm(d1) - Kexp(-rT)pnorm(d2)BSCallsigma lt- seq(0515 length=100)

5 plot(sigmaBSCall(172360800437746365sigma) type=llty=1 xlab=Sigmaylab=Black-Scholes Call Price ylim = c(006)col=bluelwd=3)grid()

abline(h=023col=redlwd=3)

Knowing that the closing price of the warrant on November 07 2008 wasHK$ 0023 which value can you infer for the implied volatility σ at thisdatelowast

Exercise 67 Forward contracts Recall that the price πt(C) of a claimpayoff C = h(ST ) of maturity T can be written as πt(C) = g(tSt) wherethe function g(tx) satisfies the Black-Scholes PDE

rg(tx) = partg

partt(tx) + rx

partg

partx(tx) + 1

2σ2x2 part

2g

partx2 (tx)

g(T x) = h(x) (1)

with terminal condition g(T x) = h(x) x gt 0

a) Assume that C is a forward contract with payoff

C = ST minusK

at time T Find the function h(x) in (1)b) Find the solution g(tx) of the above PDE and compute the price πt(C)

at time t isin [0T ]Hint search for a solution of the form g(tx) = xminus α(t) where α(t) is afunction of t to be determined

lowast Download the corresponding or the that can be runhere

234

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

BS lt- function(S K T r sig)d1 lt- (log(SK) + (r + sig^22)T) (sigsqrt(T))d2 lt- d1 - sigsqrt(T)return(Spnorm(d1) - Kexp(-rT)pnorm(d2))impliedvol lt- function(S K T r market)sig lt- 020sigup lt- 1sigdown lt- 0001count lt- 0err lt- BS(S K T r sig) - marketwhile(abs(err) gt 000001 ampamp countlt1000)if(err lt 0)sigdown lt- sigsig lt- (sigup + sig)2elsesigup lt- sigsig lt- (sigdown + sig)2err lt- BS(S K T r sig) - marketcount lt- count + 1if(count==2000)return(NA)elsereturn(sig)market = 083K = 628T = 7 365S = 634r = 002impliedvol(S K T r market)

cells [ cell_type code execution_count null metadata outputs [] source [ from IPythoncoredisplay import display HTMLn display(HTML( )) ] cell_type code execution_count null metadata collapsed true outputs [] source [ import numpy as npn import scipystats as ssn import time n n Black and Scholesn def d1(S0 K r sigma T)n return (nplog(S0K) + (r + sigma2 2) T)(sigma npsqrt(T))n n def d2(S0 K r sigma T)n return (nplog(S0 K) + (r - sigma2 2) T) (sigma npsqrt(T))n n def BlackScholes(typeS0 K r sigma T)n if type==Cn return S0 ssnormcdf(d1(S0 K r sigma T)) - K npexp(-r T) ssnormcdf(d2(S0 K r sigma T))n elsen return K npexp(-r T) ssnormcdf(-d2(S0 K r sigma T)) - S0 ssnormcdf(-d1(S0 K r sigma T)) ] cell_type code execution_count null metadata outputs [] source [ BlackScholes(C1000 1200 002 015 10) ] cell_type code execution_count null metadata outputs [] source [ def difference(x p S K r t)n return BlackScholes(CS K r x t) - p ] cell_type code execution_count null metadata outputs [] source [ from scipyoptimize import bisectn bisect(difference00011args=(11541763731112766 1000 1200 002 10)) ] ] metadata anaconda-cloud kernelspec display_name Python 3 language python name python3 language_info codemirror_mode name ipython version 3 file_extension py mimetype textx-python name python nbconvert_exporter python pygments_lexer ipython3 version 375rc1 nbformat 4 nbformat_minor 1

Black-Scholes Pricing and Hedging

c) Compute the quantityξt =

partg

partx(tSt)

of risky assets in a self-financing portfolio hedging Cd) Repeat the above questions with the terminal condition g(T x) = x

Exercise 68a) Solve the Black-Scholes PDE

rg(tx) = partg

partt(tx) + rx

partg

partx(tx) + σ2

2 x2 part2g

partx2 (tx) (634)

with terminal condition g(T x) = 1 x gt 0

Hint Try a solution of the form g(tx) = f(t) and find f(t)

b) Find the respective quantities ξt and ηt of the risky asset St and risklessasset At = ert in the portfolio with value

Vt = g(tSt) = ξtSt + ηtAt

hedging the contract with payoff $1 at maturity

Exercise 69 Log-contracts see also Exercise 84a) Solve the PDE

0 =partg

partt(x t) + rx

partg

partx(x t) + σ2

2 x2 part2g

partx2 (x t)

with the terminal condition g(xT ) = log x x gt 0

Hint Try a solution of the form g(x t) = f(t) + log x and find f(t)b) Solve the Black-Scholes PDE

rh(x t) = parth

partt(x t) + rx

parth

partx(x t) + σ2

2 x2 part2h

partx2 (x t) (635)

with the terminal condition h(xT ) = log x x gt 0

Hint Try a solution of the form h(x t) = u(t)g(x t) and find u(t)c) Find the respective quantities ξt and ηt of the risky asset St and riskless

asset At = ert in the portfolio with value

Vt = g(St t) = ξtSt + ηtAt

hedging a log-contract with payoff logST at maturity 235

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

Exercise 610 Binary options Consider a price process (St)tisinR+ given by

dStSt

= rdt+ σdBt S0 = 1

under the risk-neutral probability measure Plowast The binary (or digital) calloption is a contract with maturity T strike price K and payoff

Cd = 1[Kinfin)(ST ) =

$1 if ST gt K

0 if ST lt K

a) Derive the Black-Schole PDE satisfied by the pricing function Cd(tSt) ofthe binary call option together with its terminal condition

b) Show that the solution Cd(tx) of the Black-Scholes PDE of Question (a)is given by

Cd(tx) = eminus(Tminust)rΦ((rminus σ22)(T minus t) + log(xK)

|σ|radicT minus t

)= eminus(Tminust)rΦ

(dminus(T minus t)

)

where

dminus(T minus t) =(rminus σ22)(T minus t) + log(StK)

|σ|radicT minus t

0 6 t lt T

Exercise 611

a) Bachelier (1900) model Solve the stochastic differential equation

dSt = αStdt+ σdBt (636)

in terms of ασ isin R and the initial condition S0b) Write down the Bachelier PDE satisfied by the function C(tx) where

C(tSt) is the price at time t isin [0T ] of the contingent claim with payoffφ(ST ) = exp(ST ) and identify the process Delta (ξt)tisin[0T ] that hedgesthis claim

c) Solve the Black-Scholes PDE of Question (b) with the terminal conditionφ(x) = ex x isin R

Hint Search for a solution of the form

C(tx) = exp(minus(T minus t)r+ xh(t) +

σ2

4r (h2(t)minus 1)

) (637)

where h(t) is a function to be determined with h(T ) = 1

236

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

d) Compute the portfolio strategy (ξt ηt)tisin[0T ] that hedges the contingentclaim with payoff exp(ST )

Exercise 612

a) Show that for every fixed value of S the function

d 7minusrarr h(S d) = SΦ(d+ |σ|

radicT)minusK eminusrTΦ(d)

reaches its maximum at dlowast(S) =log(SK) + (rminus σ22)T

|σ|radicT

b) By the differentiation rule

d

dSh(S dlowast(S)) =

parth

partS(S dlowast(S)) + dprimelowast(S)

parth

partd(S dlowast(S))

recover the value of the Black-Scholes Delta

Exercise 613 Compute the Black-Scholes Vega by differentiation of theBlack-Scholes function

gc(tx) = Bl(Kxσ rT minus t) = xΦ(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)

with respect to the volatility parameter σ knowing that

minus12(dminus(T minus t)

)2= minus1

2

(log(xK) + (rminus σ22)(T minus t)

|σ|radicT minus t

)2

= minus12(d+(T minus t)

)2+ (T minus t)r+ log x

K (638)

Exercise 614 Consider the backward induction relation (313) ie

v(tx) = (1minus plowastN )v (t+ 1x(1 + aN )) + plowastN v (t+ 1x(1 + bN ))

using the renormalizations rN = rTN and

aN = (1 + rN )(1minus |σ|radicTN)minus 1 bN = (1 + rN )(1 + |σ|

radicTN)minus 1

of Section 36 N gt 1 with

plowastN =rN minus aNbN minus aN

and plowastN =bN minus rNbN minus aN

a) Show that the Black-Scholes PDE (62) of Proposition 61 can be recoveredfrom the induction relation (313) when the number N of time steps tendsto infinity

237

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

b) Show that the expression of the Delta ξt =partgcpartx

(tSt) can be similarlyrecovered from the finite difference relation (319) ie

ξ(1)t (Stminus1) =

v (t (1 + bN )Stminus1)minus v (t (1 + aN )Stminus1)

Stminus1(bN minus aN )

as N tends to infinity

Problem 615 (Leung and Sircar (2015)) ProShares Ultra SampP500 andProShares UltraShort SampP500 are leveraged investment funds that seek dailyinvestment results before fees and expenses that correspond to β times (βx)the daily performance of the SampP500reg with respectively β = 2 for ProSharesUltra and β = minus2 for ProShares UltraShort Here leveraging with a factorβ 1 aims at multiplying the potential return of an investment by a factorβ The following 10 questions are interdependent and should be treated insequence

a) Consider a risky asset priced S0 = $4 at time t = 0 and taking twopossible values S1 = $5 and S1 = $2 at time t = 1 Compute the twopossible returns (in ) achieved when investing $4 in one share of the assetS and the expected return under the risk-neutral probability measureassuming that the risk-free interest rate is zero

b) Leveraging Still based on an initial $4 investment we decide to leverageby a factor β = 3 by borrowing another (β minus 1) times $4 = 2times $4 at ratezero to purchase a total of β = 3 shares of the asset S Compute thetwo returns (in ) possibly achieved in this case and the expected returnunder the risk-neutral probability measure assuming that the risk-freeinterest rate is zero

c) Denoting by Ft the ProShares value at time t how much should the fundinvest in the underlying asset priced St and how much $ should it borrowor save on the risk-free market at any time t in order to leverage with afactor β 1

d) Find the portfolio allocation (ξt ηt) for the fund value

Ft = ξtSt + ηtAt t isin R+

according to Question (c) where At = A0 ert is the riskless money marketaccount

e) We choose to model the SampP500 index St as the geometric Brownianmotion

dSt = rStdt+ σStdBt t isin R+

under the risk-neutral probability measure Plowast Find the stochastic dif-ferential equation satisfied by (Ft)tisinR+ under the self-financing conditiondFt = ξtdSt + ηtdAt

238

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

f) Is the discounted fund value ( eminusrtFt)tisinR+ a martingale under the risk-neutral probability measure Plowast

g) Find the relation between the fund value Ft and the index St by solvingthe stochastic differential equation obtained for Ft in Question (e) Forsimplicity we normalize F0 = Sβ0

h) Write the price at time t = 0 of the call option with payoff (FT minusK)+ onthe ProShares index using the Black-Scholes formula

i) Show that when β gt 0 the Delta at time t isin [0T ) of the call optionwith payoff (FT minusK)+ on ProShares Ultra is equal to the Delta of thecall option with payoff (ST minusKβ(t))

+ on the SampP500 for a certain strikeprice Kβ(t) to be determined explicitly

j) When β lt 0 find the relation between the Delta at time t isin [0T ) ofthe call option with payoff (FT minusK)+ on ProShares UltraShort and theDelta of the put option with payoff (Kβ(t)minus ST )+ on the SampP500

239

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

  1. pbsARFix223
  2. pbsARFix224
  3. pbsARFix225
  4. pbsARFix226
  5. pbsARFix227
  6. pbsARFix228
  7. pbsARFix229
  8. pbsARFix230
  9. fdrm1
  10. pbsARFix231
  11. 100
  12. 101
  13. 102
  14. 103
  15. 104
  16. 105
  17. 106
  18. 107
  19. 108
  20. 109
  21. 1010
  22. 1011
  23. 1012
  24. 1013
  25. 1014
  26. 1015
  27. 1016
  28. 1017
  29. 1018
  30. 1019
  31. anm10
  32. 10EndLeft
  33. 10StepLeft
  34. 10PauseLeft
  35. 10PlayLeft
  36. 10PlayPauseLeft
  37. 10PauseRight
  38. 10PlayRight
  39. 10PlayPauseRight
  40. 10StepRight
  41. 10EndRight
  42. 10Minus
  43. 10Reset
  44. 10Plus
  45. pbsARFix232
  46. pbsARFix233
  47. pbsARFix234
  48. pbsARFix235
  49. pbsARFix236
  50. pbsARFix237
  51. fdrm2
  52. 110
  53. 111
  54. 112
  55. 113
  56. 114
  57. 115
  58. 116
  59. 117
  60. 118
  61. 119
  62. 1110
  63. 1111
  64. 1112
  65. 1113
  66. 1114
  67. 1115
  68. 1116
  69. 1117
  70. 1118
  71. 1119
  72. anm11
  73. 11EndLeft
  74. 11StepLeft
  75. 11PauseLeft
  76. 11PlayLeft
  77. 11PlayPauseLeft
  78. 11PauseRight
  79. 11PlayRight
  80. 11PlayPauseRight
  81. 11StepRight
  82. 11EndRight
  83. 11Minus
  84. 11Reset
  85. 11Plus
  86. pbsARFix238
  87. pbsARFix239
  88. pbsARFix240
  89. pbsARFix241
  90. pbsARFix242
  91. 120
  92. 121
  93. 122
  94. 123
  95. 124
  96. 125
  97. 126
  98. 127
  99. 128
  100. 129
  101. 1210
  102. anm12
  103. 12EndLeft
  104. 12StepLeft
  105. 12PauseLeft
  106. 12PlayLeft
  107. 12PlayPauseLeft
  108. 12PauseRight
  109. 12PlayRight
  110. 12PlayPauseRight
  111. 12StepRight
  112. 12EndRight
  113. 12Minus
  114. 12Reset
  115. 12Plus
  116. 130
  117. 131
  118. 132
  119. 133
  120. 134
  121. 135
  122. 136
  123. 137
  124. 138
  125. 139
  126. 1310
  127. anm13
  128. 13EndLeft
  129. 13StepLeft
  130. 13PauseLeft
  131. 13PlayLeft
  132. 13PlayPauseLeft
  133. 13PauseRight
  134. 13PlayRight
  135. 13PlayPauseRight
  136. 13StepRight
  137. 13EndRight
  138. 13Minus
  139. 13Reset
  140. 13Plus
  141. pbsARFix243
  142. pbsARFix244
  143. pbsARFix245
  144. pbsARFix246
  145. 140
  146. 141
  147. 142
  148. 143
  149. 144
  150. 145
  151. 146
  152. 147
  153. 148
  154. 149
  155. 1410
  156. 1411
  157. 1412
  158. 1413
  159. 1414
  160. 1415
  161. 1416
  162. 1417
  163. 1418
  164. 1419
  165. 1420
  166. 1421
  167. 1422
  168. 1423
  169. 1424
  170. 1425
  171. 1426
  172. 1427
  173. 1428
  174. 1429
  175. 1430
  176. 1431
  177. 1432
  178. 1433
  179. 1434
  180. 1435
  181. 1436
  182. 1437
  183. 1438
  184. 1439
  185. 1440
  186. 1441
  187. 1442
  188. 1443
  189. 1444
  190. 1445
  191. 1446
  192. 1447
  193. 1448
  194. 1449
  195. 1450
  196. 1451
  197. 1452
  198. 1453
  199. 1454
  200. 1455
  201. 1456
  202. 1457
  203. 1458
  204. 1459
  205. 1460
  206. 1461
  207. 1462
  208. 1463
  209. 1464
  210. 1465
  211. 1466
  212. 1467
  213. 1468
  214. 1469
  215. 1470
  216. 1471
  217. 1472
  218. 1473
  219. 1474
  220. 1475
  221. 1476
  222. 1477
  223. 1478
  224. 1479
  225. 1480
  226. 1481
  227. 1482
  228. 1483
  229. 1484
  230. 1485
  231. 1486
  232. 1487
  233. 1488
  234. 1489
  235. 1490
  236. 1491
  237. 1492
  238. 1493
  239. 1494
  240. 1495
  241. 1496
  242. 1497
  243. 1498
  244. 1499
  245. 14100
  246. 14101
  247. 14102
  248. 14103
  249. 14104
  250. 14105
  251. 14106
  252. 14107
  253. 14108
  254. 14109
  255. 14110
  256. 14111
  257. 14112
  258. 14113
  259. 14114
  260. 14115
  261. 14116
  262. 14117
  263. 14118
  264. 14119
  265. 14120
  266. 14121
  267. 14122
  268. 14123
  269. 14124
  270. 14125
  271. 14126
  272. 14127
  273. 14128
  274. 14129
  275. 14130
  276. 14131
  277. 14132
  278. 14133
  279. 14134
  280. 14135
  281. 14136
  282. 14137
  283. 14138
  284. 14139
  285. 14140
  286. 14141
  287. 14142
  288. 14143
  289. 14144
  290. 14145
  291. 14146
  292. 14147
  293. 14148
  294. 14149
  295. 14150
  296. 14151
  297. 14152
  298. 14153
  299. 14154
  300. 14155
  301. 14156
  302. 14157
  303. 14158
  304. 14159
  305. 14160
  306. 14161
  307. 14162
  308. 14163
  309. 14164
  310. 14165
  311. 14166
  312. 14167
  313. 14168
  314. 14169
  315. 14170
  316. 14171
  317. 14172
  318. 14173
  319. 14174
  320. 14175
  321. 14176
  322. 14177
  323. 14178
  324. 14179
  325. 14180
  326. 14181
  327. 14182
  328. 14183
  329. 14184
  330. 14185
  331. 14186
  332. 14187
  333. 14188
  334. 14189
  335. 14190
  336. 14191
  337. 14192
  338. 14193
  339. 14194
  340. 14195
  341. 14196
  342. 14197
  343. anm14
  344. 14EndLeft
  345. 14StepLeft
  346. 14PauseLeft
  347. 14PlayLeft
  348. 14PlayPauseLeft
  349. 14PauseRight
  350. 14PlayRight
  351. 14PlayPauseRight
  352. 14StepRight
  353. 14EndRight
  354. 14Minus
  355. 14Reset
  356. 14Plus
  357. pbsARFix247
  358. pbsARFix248
  359. 150
  360. 151
  361. 152
  362. 153
  363. 154
  364. 155
  365. 156
  366. 157
  367. 158
  368. 159
  369. 1510
  370. 1511
  371. 1512
  372. 1513
  373. 1514
  374. 1515
  375. 1516
  376. 1517
  377. 1518
  378. 1519
  379. anm15
  380. 15EndLeft
  381. 15StepLeft
  382. 15PauseLeft
  383. 15PlayLeft
  384. 15PlayPauseLeft
  385. 15PauseRight
  386. 15PlayRight
  387. 15PlayPauseRight
  388. 15StepRight
  389. 15EndRight
  390. 15Minus
  391. 15Reset
  392. 15Plus
  393. pbsARFix249
  394. pbsARFix250
  395. pbsARFix251
  396. pbsARFix252
  397. pbsARFix253
  398. pbsARFix254
  399. pbsARFix255
  400. pbsARFix256
  401. pbsARFix257
  402. pbsARFix258
  403. pbsARFix259
  404. pbsARFix260
  405. pbsARFix261
Page 26: Black-ScholesPricingandHedging - NTU · to the Black-Scholes PDE (6.2) in order to price a claim payoff Cof the formC= h(S T).Asinthediscrete-timecase,thearbitragepriceπt(C) at

N Privault

The next Figure 619 shows the evolution of g(tx) with initial conditionbased on the European call payoff function h(x) = (xminusK)+ ie

g(0 y) = ψ(y) = h(

e|σ|y)=(

e|σ|y minusK)+ y isin R

Fig 619 Time-dependent solution of the heat equationlowast

Let us provide a second proof of Proposition 610 this time using Brownianmotion and stochastic calculus

Proof of Proposition 610 First note that under the change of variable x =z minus y we have

g(t y) =winfinminusinfin

ψ(z) eminus(yminusz)2(2t) dzradic2πt

=winfinminusinfin

ψ(y+ x) eminusx2(2t) dxradic2πt

= IE[ψ(y+Bt)]

= IE[ψ(yminusBt)]

where (Bt)tisinR+ is a standard Brownian motion and Bt N (0 t) t isin R+Applying Itocircrsquos formula and using the fact that the expectation of the stochas-tic integral with respect to Brownian motion is zero see Relation (417) inProposition 420 we find

g(t y) = IE[ψ(yminusBt)]

= ψ(y)minus IE[w t

0ψprime(yminusBs)dBs

]+

12 IE

[w t0ψprimeprime(yminusBs)ds

]= ψ(y) +

12w t

0IE[ψprimeprime(yminusBs)

]ds

lowast The animation works in Acrobat Reader on the entire pdf file

226

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

= ψ(y) +12w t

0part2

party2 IE [ψ(yminusBs)] ds

= ψ(y) +12w t

0part2g

party2 (s y)ds

Hence we have

partg

partt(t y) = part

parttIE[ψ(yminusBt)]

=12part2

party2 IE [ψ(yminusBt)]

=12part2g

party2 (t y)

Regarding the initial condition we check that

g(0 y) = IE[ψ(yminusB0)] = IE[ψ(y)] = ψ(y)

The expression g(t y) = IE[ψ(yminusBt)] provides a probabilistic interpreta-tion of the heat diffusion phenomenon based on Brownian motion Namelywhen ψε(y) = 1[minusεε](y) we find that

gε(t y) = IE[ψε(yminusBt)]= IE[1[minusεε](yminusBt)]= P

(yminusBt isin [minusε ε]

)= P

(yminus ε 6 Bt 6 y+ ε

)represents the probability of finding Bt within a neighborhood [y minus ε y + ε]of the point y isin R

66 Solution of the Black-Scholes PDE

In this section we solve the Black-Scholes PDE by the kernel method of Sec-tion 65 and a change of variables This solution method uses the change ofvariables (623) of Proposition 68 and a time inversion from which the ter-minal condition at time T in the Black-Scholes equation becomes an initialcondition at time t = 0 in the heat equation

Next we state the proof Proposition 68

Proof Letting s = T minus t and x = e|σ|y+(σ22minusr)t and using Relation (623)ie

g(t y) = ertf(T minus t e|σ|y+(σ22minusr)t)

227

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

we have

partg

partt(t y) = r ertf

(T minus t e|σ|y+(σ22minusr)t)minus ert partf

parts

(T minus t e|σ|y+(σ22minusr)t)

+

(σ2

2 minus r)

ert e|σ|y+(σ22minusr)t partf

partx

(T minus t e|σ|y+(σ22minusr)t)

= r ertf(T minus tx)minus ert partfparts

(T minus tx) +(σ2

2 minus r)

ertxpartfpartx

(T minus tx)

=12 ertx2σ2 part

2f

partx2 (T minus tx) +σ2

2 ertxpartfpartx

(T minus tx) (629)

where on the last step we used the Black-Scholes PDE On the other handwe have

partg

party(t y) = |σ| ert e|σ|y+(σ22minusr)t partf

partx

(T minus t e|σ|y+(σ22minusr)t)

and

12partg2

party2 (t y) =σ2

2 ert e|σ|y+(σ22minusr)t partf

partx

(T minus t e|σ|y+(σ22minusr)t)

+σ2

2 ert e2|σ|y+2(σ22minusr)t part2f

partx2(T minus t e|σ|y+(σ22minusr)t)

=σ2

2 ertxpartfpartx

(T minus tx) + σ2

2 ertx2 part2f

partx2 (T minus tx) (630)

We conclude by comparing (629) with (630) which shows that g(tx) solvesthe heat equation (627) with initial condition

g(0 y) = f(T e|σ|y

)= h

(e|σ|y

)

In the next proposition we derive the Black-Scholes formula (610) by solv-ing the PDE (622) The Black-Scholes formula will also be recovered by aprobabilistic argument via the computation of an expected value in Proposi-tion 77

Proposition 611 When h(x) = (x minusK)+ the solution of the Black-Scholes PDE (622) is given by

f(tx) = xΦ(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

) x gt 0

whereΦ(x) =

1radic2π

w xminusinfin

eminusy22dy x isin R

and

228

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

d+(T minus t) =

log(xK) + (r+ σ22)(T minus t)|σ|radicT minus t

dminus(T minus t) =log(xK) + (rminus σ22)(T minus t)

|σ|radicT minus t

x gt 0 t isin [0T )

Proof By inversion of Relation (623) with s = T minus t and x = e|σ|y+(σ22minusr)twe get

f(sx) = eminus(Tminuss)rg(T minus s minus(σ

22minus r)(T minus s) + log x|σ|

)and

h(x) = ψ

(log x|σ|

) x gt 0 or ψ(y) = h

(e|σ|y

) y isin R

Hence using the solution (628) and Relation (624) we get

f(tx) = eminus(Tminust)rg(T minus t minus(σ

22minus r)(T minus t) + log x|σ|

)= eminus(Tminust)r

winfinminusinfin

ψ

(minus(σ22minus r)(T minus t) + log x

|σ|+ z

)eminusz2(2(Tminust)) dzradic

2(T minus t)π

= eminus(Tminust)rwinfinminusinfin

h(x e|σ|zminus(σ22minusr)(Tminust)) eminusz2(2(Tminust)) dzradic

2(T minus t)π

= eminus(Tminust)rwinfinminusinfin

(x e|σ|zminus(σ22minusr)(Tminust) minusK

)+ eminusz2(2(Tminust)) dzradic2(T minus t)π

= eminus(Tminust)r

timeswinfin

(minusr+σ22)(Tminust)+log(Kx)|σ|

(x e|σ|zminus(σ22minusr)(Tminust) minusK

)eminusz2(2(Tminust)) dzradic

2(T minus t)π

= x eminus(Tminust)rwinfinminusdminus(Tminust)

radicTminust

e|σ|zminus(σ22minusr)(Tminust) eminusz2(2(Tminust)) dzradic2(T minus t)π

minusK eminus(Tminust)rwinfinminusdminus(Tminust)

radicTminust

eminusz2(2(Tminust)) dzradic2(T minus t)π

= xwinfinminusdminus(Tminust)

radicTminust

e|σ|zminus(Tminust)σ22minusz2(2(Tminust)) dzradic2(T minus t)π

minusK eminus(Tminust)rwinfinminusdminus(Tminust)

radicTminust

eminusz2(2(Tminust)) dzradic2(T minus t)π

= xwinfinminusdminus(Tminust)

radicTminust

eminus(zminus(Tminust)|σ|)2(2(Tminust)) dzradic2(T minus t)π

229

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

minusK eminus(Tminust)rwinfinminusdminus(Tminust)

radicTminust

eminusz2(2(Tminust)) dzradic2(T minus t)π

= xwinfinminusdminus(Tminust)

radicTminustminus(Tminust)|σ|

eminusz2(2(Tminust)) dzradic2(T minus t)π

minusK eminus(Tminust)rwinfinminusdminus(Tminust)

radicTminust

eminusz2(2(Tminust)) dzradic2(T minus t)π

= xwinfinminusdminus(Tminust)minus|σ|

radicTminust

eminusz22 dzradic2πminusK eminus(Tminust)r

winfinminusdminus(Tminust)

eminusz22 dzradic2π

= x(1minusΦ

(minus d+(T minus t)

))minusK eminus(Tminust)r

(1minusΦ

(minus dminus(T minus t)

))= xΦ

(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)

where we used the relation (614) ie

1minusΦ(a) = Φ(minusa) a isin R

Exercises

Exercise 61 Bachelier (1900) model Consider a market made of a risklessasset valued At = A0 with zero interest rate t isin R+ and a risky asset whoseprice St is modeled by a standard Brownian motion as St = Bt t isin R+

a) Show that the price g(tBt) of the option with payoff C = B2T satisfies

the heat equationpartϕ

partt(t y) = minus1

2part2ϕ

party2 (t y)

with terminal condition g(T x) = x2b) Find the function g(tx) by solving the PDE of Question (a)

Hint Try a solution of the form g(tx) = x2 + f(t)

See Exercises 611 713 and 714 for extensions to nonzero interest rates

Exercise 62 Consider a risky asset price (St)tisinR modeled in the Cox et al(1985) (CIR) model as

dSt = β(αminus St)dt+ σradicStdBt αβσ gt 0 (631)

and let (ηt ξt)tisinR+ be a portfolio strategy whose value Vt = ηtAt + ξtSttakes the form Vt = g(tSt) t isin R+ Figure 620 presents a random simula-tion of the solution to (631) with α = 0025 β = 1 and σ = 13230

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

0

1

2

3

4

5

6

7

8

0 01 02 03 04 05 06 07 08 09 1

St

t

Fig 620 Graph of the CIR short rate t 7rarr rt with α = 25 β = 1 and σ = 13

N=10000 t lt- 0(N-1) dt lt- 10Na=0025 b=2 sigma=0052 X lt- rnorm(Nmean=0sd=sqrt(dt))R lt- rep(0N)R[1]=001

for (j in 2N)R[j]=max(0R[j-1]+(a-bR[j-1])dt+sigmasqrt(R[j-1])X[j])4 plot(t R xlab = t ylab = type = l ylim = c(0002) col = blue)

Based on the self-financing condition written as

dVt = rVtdtminus rξtStdt+ ξtdSt

= rVtdtminus rξtStdt+ β(αminus St)ξtdt+ σξtradicStdBt t isin R+ (632)

derive the PDE satisfied by the function g(tx) using the Itocirc formula

Exercise 63 Black-Scholes PDE with dividends Consider a riskless as-set with price At = A0 ert t isin R+ and an underlying asset price process(St)tisinR+ modeled as

dSt = (microminus δ)Stdt+ σStdBt

where (Bt)tisinR+ is a standard Brownian motion and δ gt 0 is a continuous-time dividend rate By absence of arbitrage the payment of a dividend entailsa drop in the stock price by the same amount occuring generally on the ex-dividend date on which the purchase of the security no longer entitles theinvestor to the dividend amount The list of investors entitled to dividendpayment is consolidated on the date of record and payment is made on thepayable date

library(quantmod)2 getSymbols(0005HKfrom=2010-01-01to=SysDate()src=yahoo)

getDividends(0005HKfrom=2010-01-01to=SysDate()src=yahoo)

a) Assuming that the portfolio with value Vt = ξtSt + ηtAt at time t is self-financing and that dividends are continuously reinvested write down theportfolio variation dVt

231

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

b) Assuming that the portfolio value Vt takes the form Vt = g(tSt) at timet derive the Black-Scholes PDE for the function g(tx) with its terminalcondition

c) Compute the price at time t isin [0T ] of the European call option withstrike price K by solving the corresponding Black-Scholes PDE

d) Compute the Delta of the option

Exercise 64

a) Check that the Black-Scholes formula (610) for European call options

gc(tx) = xΦ(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)

satisfies the following boundary conditions

i) at x = 0 gc(t 0) = 0ii) at maturity t = T

gc(T x) = (xminusK)+ =

xminusK x gt K

0 x 6 K

iii) as time to maturity tends to infinity

limTrarrinfin

Bl(Kxσ rT minus t) = x t isin R+

b) Check that the Black-Scholes formula (618) for European put options

gp(tx) = K eminus(Tminust)rΦ(minus dminus(T minus t)

)minus xΦ

(minus d+(T minus t)

)satisfies the following boundary conditions

i) at x = 0 gp(t 0) = K eminus(Tminust)rii) as x tends to infinity gp(tinfin) = 0 for all t isin [0T )iii) at maturity t = T

gp(T x) = (K minus x)+ =

0 x gt K

K minus x x 6 K

iv) as time to maturity tends to infinity

limTrarrinfin

Blp(KStσ rT minus t) = 0 t isin R+

Exercise 65 Power option (Exercise 314 continued)

232

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

a) Solve the Black-Scholes PDE

rg(x t) = partg

partt(x t) + rx

partg

partx(x t) + σ2

2 x2 part2g

partx2 (x t) (633)

with terminal condition g(xT ) = x2 x gt 0 t isin [0T ]

Hint Try a solution of the form g(x t) = x2f(t) and find f(t)b) Find the respective quantities ξt and ηt of the risky asset St and riskless

asset At = ert in the portfolio with value

Vt = g(St t) = ξtSt + ηtAt 0 6 t 6 T

hedging the contract with payoff S2T at maturity

Exercise 66 On December 18 2007 a call warrant has been issued byFortis Bank on the stock price S of the MTR Corporation with maturityT = 23122008 strike price K = HK$ 3608 and entitlement ratio=10Recall that in the Black-Scholes model the price at time t of the Europeanclaim on the underlying asset priced St with strike price K maturity T interest rate r and volatility σ gt 0 is given by the Black-Scholes formula as

f(tSt) = StΦ(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)

wheredminus(T minus t) =

(rminus σ22)(T minus t) + log(StK)

|σ|radicT minus t

d+(T minus t) = dminus(T minus t) + |σ|radicT minus t = (r+ σ22)(T minus t) + log(StK)

|σ|radicT minus t

Recall that by Proposition 64 we have

partf

partx(tSt) = Φ

(d+(T minus t)

) 0 6 t 6 T

a) Using the values of the Gaussian cumulative distribution function com-pute the Black-Scholes price of the corresponding call option at timet =November 07 2008 with St = HK$ 17200 assuming a volatility σ =90 = 090 and an annual risk-free interest rate r = 4377 = 004377

b) Still using the Gaussian cumulative distribution function compute thequantity of the risky asset required in your portfolio at time t =November07 2008 in order to hedge one such option at maturity T = 23122008

c) Figure 1 represents the Black-Scholes price of the call option as a functionof σ isin [05 15] = [50 150]

233

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

0

01

02

03

04

05

06

05 06 07 08 09 1 11 12 13 14 15σimp

Optio

n pr

ice

σ

Market price

Fig 621 Option price as a function of the volatility σ gt 0

1 BSCall lt- function(S K r T sigma)d1 lt- (log(SK)+(r+sigma^22)T)(sigmasqrt(T))d2 lt- d1 - sigma sqrt(T)

3 BSCall = Spnorm(d1) - Kexp(-rT)pnorm(d2)BSCallsigma lt- seq(0515 length=100)

5 plot(sigmaBSCall(172360800437746365sigma) type=llty=1 xlab=Sigmaylab=Black-Scholes Call Price ylim = c(006)col=bluelwd=3)grid()

abline(h=023col=redlwd=3)

Knowing that the closing price of the warrant on November 07 2008 wasHK$ 0023 which value can you infer for the implied volatility σ at thisdatelowast

Exercise 67 Forward contracts Recall that the price πt(C) of a claimpayoff C = h(ST ) of maturity T can be written as πt(C) = g(tSt) wherethe function g(tx) satisfies the Black-Scholes PDE

rg(tx) = partg

partt(tx) + rx

partg

partx(tx) + 1

2σ2x2 part

2g

partx2 (tx)

g(T x) = h(x) (1)

with terminal condition g(T x) = h(x) x gt 0

a) Assume that C is a forward contract with payoff

C = ST minusK

at time T Find the function h(x) in (1)b) Find the solution g(tx) of the above PDE and compute the price πt(C)

at time t isin [0T ]Hint search for a solution of the form g(tx) = xminus α(t) where α(t) is afunction of t to be determined

lowast Download the corresponding or the that can be runhere

234

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

BS lt- function(S K T r sig)d1 lt- (log(SK) + (r + sig^22)T) (sigsqrt(T))d2 lt- d1 - sigsqrt(T)return(Spnorm(d1) - Kexp(-rT)pnorm(d2))impliedvol lt- function(S K T r market)sig lt- 020sigup lt- 1sigdown lt- 0001count lt- 0err lt- BS(S K T r sig) - marketwhile(abs(err) gt 000001 ampamp countlt1000)if(err lt 0)sigdown lt- sigsig lt- (sigup + sig)2elsesigup lt- sigsig lt- (sigdown + sig)2err lt- BS(S K T r sig) - marketcount lt- count + 1if(count==2000)return(NA)elsereturn(sig)market = 083K = 628T = 7 365S = 634r = 002impliedvol(S K T r market)

cells [ cell_type code execution_count null metadata outputs [] source [ from IPythoncoredisplay import display HTMLn display(HTML( )) ] cell_type code execution_count null metadata collapsed true outputs [] source [ import numpy as npn import scipystats as ssn import time n n Black and Scholesn def d1(S0 K r sigma T)n return (nplog(S0K) + (r + sigma2 2) T)(sigma npsqrt(T))n n def d2(S0 K r sigma T)n return (nplog(S0 K) + (r - sigma2 2) T) (sigma npsqrt(T))n n def BlackScholes(typeS0 K r sigma T)n if type==Cn return S0 ssnormcdf(d1(S0 K r sigma T)) - K npexp(-r T) ssnormcdf(d2(S0 K r sigma T))n elsen return K npexp(-r T) ssnormcdf(-d2(S0 K r sigma T)) - S0 ssnormcdf(-d1(S0 K r sigma T)) ] cell_type code execution_count null metadata outputs [] source [ BlackScholes(C1000 1200 002 015 10) ] cell_type code execution_count null metadata outputs [] source [ def difference(x p S K r t)n return BlackScholes(CS K r x t) - p ] cell_type code execution_count null metadata outputs [] source [ from scipyoptimize import bisectn bisect(difference00011args=(11541763731112766 1000 1200 002 10)) ] ] metadata anaconda-cloud kernelspec display_name Python 3 language python name python3 language_info codemirror_mode name ipython version 3 file_extension py mimetype textx-python name python nbconvert_exporter python pygments_lexer ipython3 version 375rc1 nbformat 4 nbformat_minor 1

Black-Scholes Pricing and Hedging

c) Compute the quantityξt =

partg

partx(tSt)

of risky assets in a self-financing portfolio hedging Cd) Repeat the above questions with the terminal condition g(T x) = x

Exercise 68a) Solve the Black-Scholes PDE

rg(tx) = partg

partt(tx) + rx

partg

partx(tx) + σ2

2 x2 part2g

partx2 (tx) (634)

with terminal condition g(T x) = 1 x gt 0

Hint Try a solution of the form g(tx) = f(t) and find f(t)

b) Find the respective quantities ξt and ηt of the risky asset St and risklessasset At = ert in the portfolio with value

Vt = g(tSt) = ξtSt + ηtAt

hedging the contract with payoff $1 at maturity

Exercise 69 Log-contracts see also Exercise 84a) Solve the PDE

0 =partg

partt(x t) + rx

partg

partx(x t) + σ2

2 x2 part2g

partx2 (x t)

with the terminal condition g(xT ) = log x x gt 0

Hint Try a solution of the form g(x t) = f(t) + log x and find f(t)b) Solve the Black-Scholes PDE

rh(x t) = parth

partt(x t) + rx

parth

partx(x t) + σ2

2 x2 part2h

partx2 (x t) (635)

with the terminal condition h(xT ) = log x x gt 0

Hint Try a solution of the form h(x t) = u(t)g(x t) and find u(t)c) Find the respective quantities ξt and ηt of the risky asset St and riskless

asset At = ert in the portfolio with value

Vt = g(St t) = ξtSt + ηtAt

hedging a log-contract with payoff logST at maturity 235

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

Exercise 610 Binary options Consider a price process (St)tisinR+ given by

dStSt

= rdt+ σdBt S0 = 1

under the risk-neutral probability measure Plowast The binary (or digital) calloption is a contract with maturity T strike price K and payoff

Cd = 1[Kinfin)(ST ) =

$1 if ST gt K

0 if ST lt K

a) Derive the Black-Schole PDE satisfied by the pricing function Cd(tSt) ofthe binary call option together with its terminal condition

b) Show that the solution Cd(tx) of the Black-Scholes PDE of Question (a)is given by

Cd(tx) = eminus(Tminust)rΦ((rminus σ22)(T minus t) + log(xK)

|σ|radicT minus t

)= eminus(Tminust)rΦ

(dminus(T minus t)

)

where

dminus(T minus t) =(rminus σ22)(T minus t) + log(StK)

|σ|radicT minus t

0 6 t lt T

Exercise 611

a) Bachelier (1900) model Solve the stochastic differential equation

dSt = αStdt+ σdBt (636)

in terms of ασ isin R and the initial condition S0b) Write down the Bachelier PDE satisfied by the function C(tx) where

C(tSt) is the price at time t isin [0T ] of the contingent claim with payoffφ(ST ) = exp(ST ) and identify the process Delta (ξt)tisin[0T ] that hedgesthis claim

c) Solve the Black-Scholes PDE of Question (b) with the terminal conditionφ(x) = ex x isin R

Hint Search for a solution of the form

C(tx) = exp(minus(T minus t)r+ xh(t) +

σ2

4r (h2(t)minus 1)

) (637)

where h(t) is a function to be determined with h(T ) = 1

236

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

d) Compute the portfolio strategy (ξt ηt)tisin[0T ] that hedges the contingentclaim with payoff exp(ST )

Exercise 612

a) Show that for every fixed value of S the function

d 7minusrarr h(S d) = SΦ(d+ |σ|

radicT)minusK eminusrTΦ(d)

reaches its maximum at dlowast(S) =log(SK) + (rminus σ22)T

|σ|radicT

b) By the differentiation rule

d

dSh(S dlowast(S)) =

parth

partS(S dlowast(S)) + dprimelowast(S)

parth

partd(S dlowast(S))

recover the value of the Black-Scholes Delta

Exercise 613 Compute the Black-Scholes Vega by differentiation of theBlack-Scholes function

gc(tx) = Bl(Kxσ rT minus t) = xΦ(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)

with respect to the volatility parameter σ knowing that

minus12(dminus(T minus t)

)2= minus1

2

(log(xK) + (rminus σ22)(T minus t)

|σ|radicT minus t

)2

= minus12(d+(T minus t)

)2+ (T minus t)r+ log x

K (638)

Exercise 614 Consider the backward induction relation (313) ie

v(tx) = (1minus plowastN )v (t+ 1x(1 + aN )) + plowastN v (t+ 1x(1 + bN ))

using the renormalizations rN = rTN and

aN = (1 + rN )(1minus |σ|radicTN)minus 1 bN = (1 + rN )(1 + |σ|

radicTN)minus 1

of Section 36 N gt 1 with

plowastN =rN minus aNbN minus aN

and plowastN =bN minus rNbN minus aN

a) Show that the Black-Scholes PDE (62) of Proposition 61 can be recoveredfrom the induction relation (313) when the number N of time steps tendsto infinity

237

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

b) Show that the expression of the Delta ξt =partgcpartx

(tSt) can be similarlyrecovered from the finite difference relation (319) ie

ξ(1)t (Stminus1) =

v (t (1 + bN )Stminus1)minus v (t (1 + aN )Stminus1)

Stminus1(bN minus aN )

as N tends to infinity

Problem 615 (Leung and Sircar (2015)) ProShares Ultra SampP500 andProShares UltraShort SampP500 are leveraged investment funds that seek dailyinvestment results before fees and expenses that correspond to β times (βx)the daily performance of the SampP500reg with respectively β = 2 for ProSharesUltra and β = minus2 for ProShares UltraShort Here leveraging with a factorβ 1 aims at multiplying the potential return of an investment by a factorβ The following 10 questions are interdependent and should be treated insequence

a) Consider a risky asset priced S0 = $4 at time t = 0 and taking twopossible values S1 = $5 and S1 = $2 at time t = 1 Compute the twopossible returns (in ) achieved when investing $4 in one share of the assetS and the expected return under the risk-neutral probability measureassuming that the risk-free interest rate is zero

b) Leveraging Still based on an initial $4 investment we decide to leverageby a factor β = 3 by borrowing another (β minus 1) times $4 = 2times $4 at ratezero to purchase a total of β = 3 shares of the asset S Compute thetwo returns (in ) possibly achieved in this case and the expected returnunder the risk-neutral probability measure assuming that the risk-freeinterest rate is zero

c) Denoting by Ft the ProShares value at time t how much should the fundinvest in the underlying asset priced St and how much $ should it borrowor save on the risk-free market at any time t in order to leverage with afactor β 1

d) Find the portfolio allocation (ξt ηt) for the fund value

Ft = ξtSt + ηtAt t isin R+

according to Question (c) where At = A0 ert is the riskless money marketaccount

e) We choose to model the SampP500 index St as the geometric Brownianmotion

dSt = rStdt+ σStdBt t isin R+

under the risk-neutral probability measure Plowast Find the stochastic dif-ferential equation satisfied by (Ft)tisinR+ under the self-financing conditiondFt = ξtdSt + ηtdAt

238

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

f) Is the discounted fund value ( eminusrtFt)tisinR+ a martingale under the risk-neutral probability measure Plowast

g) Find the relation between the fund value Ft and the index St by solvingthe stochastic differential equation obtained for Ft in Question (e) Forsimplicity we normalize F0 = Sβ0

h) Write the price at time t = 0 of the call option with payoff (FT minusK)+ onthe ProShares index using the Black-Scholes formula

i) Show that when β gt 0 the Delta at time t isin [0T ) of the call optionwith payoff (FT minusK)+ on ProShares Ultra is equal to the Delta of thecall option with payoff (ST minusKβ(t))

+ on the SampP500 for a certain strikeprice Kβ(t) to be determined explicitly

j) When β lt 0 find the relation between the Delta at time t isin [0T ) ofthe call option with payoff (FT minusK)+ on ProShares UltraShort and theDelta of the put option with payoff (Kβ(t)minus ST )+ on the SampP500

239

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

  1. pbsARFix223
  2. pbsARFix224
  3. pbsARFix225
  4. pbsARFix226
  5. pbsARFix227
  6. pbsARFix228
  7. pbsARFix229
  8. pbsARFix230
  9. fdrm1
  10. pbsARFix231
  11. 100
  12. 101
  13. 102
  14. 103
  15. 104
  16. 105
  17. 106
  18. 107
  19. 108
  20. 109
  21. 1010
  22. 1011
  23. 1012
  24. 1013
  25. 1014
  26. 1015
  27. 1016
  28. 1017
  29. 1018
  30. 1019
  31. anm10
  32. 10EndLeft
  33. 10StepLeft
  34. 10PauseLeft
  35. 10PlayLeft
  36. 10PlayPauseLeft
  37. 10PauseRight
  38. 10PlayRight
  39. 10PlayPauseRight
  40. 10StepRight
  41. 10EndRight
  42. 10Minus
  43. 10Reset
  44. 10Plus
  45. pbsARFix232
  46. pbsARFix233
  47. pbsARFix234
  48. pbsARFix235
  49. pbsARFix236
  50. pbsARFix237
  51. fdrm2
  52. 110
  53. 111
  54. 112
  55. 113
  56. 114
  57. 115
  58. 116
  59. 117
  60. 118
  61. 119
  62. 1110
  63. 1111
  64. 1112
  65. 1113
  66. 1114
  67. 1115
  68. 1116
  69. 1117
  70. 1118
  71. 1119
  72. anm11
  73. 11EndLeft
  74. 11StepLeft
  75. 11PauseLeft
  76. 11PlayLeft
  77. 11PlayPauseLeft
  78. 11PauseRight
  79. 11PlayRight
  80. 11PlayPauseRight
  81. 11StepRight
  82. 11EndRight
  83. 11Minus
  84. 11Reset
  85. 11Plus
  86. pbsARFix238
  87. pbsARFix239
  88. pbsARFix240
  89. pbsARFix241
  90. pbsARFix242
  91. 120
  92. 121
  93. 122
  94. 123
  95. 124
  96. 125
  97. 126
  98. 127
  99. 128
  100. 129
  101. 1210
  102. anm12
  103. 12EndLeft
  104. 12StepLeft
  105. 12PauseLeft
  106. 12PlayLeft
  107. 12PlayPauseLeft
  108. 12PauseRight
  109. 12PlayRight
  110. 12PlayPauseRight
  111. 12StepRight
  112. 12EndRight
  113. 12Minus
  114. 12Reset
  115. 12Plus
  116. 130
  117. 131
  118. 132
  119. 133
  120. 134
  121. 135
  122. 136
  123. 137
  124. 138
  125. 139
  126. 1310
  127. anm13
  128. 13EndLeft
  129. 13StepLeft
  130. 13PauseLeft
  131. 13PlayLeft
  132. 13PlayPauseLeft
  133. 13PauseRight
  134. 13PlayRight
  135. 13PlayPauseRight
  136. 13StepRight
  137. 13EndRight
  138. 13Minus
  139. 13Reset
  140. 13Plus
  141. pbsARFix243
  142. pbsARFix244
  143. pbsARFix245
  144. pbsARFix246
  145. 140
  146. 141
  147. 142
  148. 143
  149. 144
  150. 145
  151. 146
  152. 147
  153. 148
  154. 149
  155. 1410
  156. 1411
  157. 1412
  158. 1413
  159. 1414
  160. 1415
  161. 1416
  162. 1417
  163. 1418
  164. 1419
  165. 1420
  166. 1421
  167. 1422
  168. 1423
  169. 1424
  170. 1425
  171. 1426
  172. 1427
  173. 1428
  174. 1429
  175. 1430
  176. 1431
  177. 1432
  178. 1433
  179. 1434
  180. 1435
  181. 1436
  182. 1437
  183. 1438
  184. 1439
  185. 1440
  186. 1441
  187. 1442
  188. 1443
  189. 1444
  190. 1445
  191. 1446
  192. 1447
  193. 1448
  194. 1449
  195. 1450
  196. 1451
  197. 1452
  198. 1453
  199. 1454
  200. 1455
  201. 1456
  202. 1457
  203. 1458
  204. 1459
  205. 1460
  206. 1461
  207. 1462
  208. 1463
  209. 1464
  210. 1465
  211. 1466
  212. 1467
  213. 1468
  214. 1469
  215. 1470
  216. 1471
  217. 1472
  218. 1473
  219. 1474
  220. 1475
  221. 1476
  222. 1477
  223. 1478
  224. 1479
  225. 1480
  226. 1481
  227. 1482
  228. 1483
  229. 1484
  230. 1485
  231. 1486
  232. 1487
  233. 1488
  234. 1489
  235. 1490
  236. 1491
  237. 1492
  238. 1493
  239. 1494
  240. 1495
  241. 1496
  242. 1497
  243. 1498
  244. 1499
  245. 14100
  246. 14101
  247. 14102
  248. 14103
  249. 14104
  250. 14105
  251. 14106
  252. 14107
  253. 14108
  254. 14109
  255. 14110
  256. 14111
  257. 14112
  258. 14113
  259. 14114
  260. 14115
  261. 14116
  262. 14117
  263. 14118
  264. 14119
  265. 14120
  266. 14121
  267. 14122
  268. 14123
  269. 14124
  270. 14125
  271. 14126
  272. 14127
  273. 14128
  274. 14129
  275. 14130
  276. 14131
  277. 14132
  278. 14133
  279. 14134
  280. 14135
  281. 14136
  282. 14137
  283. 14138
  284. 14139
  285. 14140
  286. 14141
  287. 14142
  288. 14143
  289. 14144
  290. 14145
  291. 14146
  292. 14147
  293. 14148
  294. 14149
  295. 14150
  296. 14151
  297. 14152
  298. 14153
  299. 14154
  300. 14155
  301. 14156
  302. 14157
  303. 14158
  304. 14159
  305. 14160
  306. 14161
  307. 14162
  308. 14163
  309. 14164
  310. 14165
  311. 14166
  312. 14167
  313. 14168
  314. 14169
  315. 14170
  316. 14171
  317. 14172
  318. 14173
  319. 14174
  320. 14175
  321. 14176
  322. 14177
  323. 14178
  324. 14179
  325. 14180
  326. 14181
  327. 14182
  328. 14183
  329. 14184
  330. 14185
  331. 14186
  332. 14187
  333. 14188
  334. 14189
  335. 14190
  336. 14191
  337. 14192
  338. 14193
  339. 14194
  340. 14195
  341. 14196
  342. 14197
  343. anm14
  344. 14EndLeft
  345. 14StepLeft
  346. 14PauseLeft
  347. 14PlayLeft
  348. 14PlayPauseLeft
  349. 14PauseRight
  350. 14PlayRight
  351. 14PlayPauseRight
  352. 14StepRight
  353. 14EndRight
  354. 14Minus
  355. 14Reset
  356. 14Plus
  357. pbsARFix247
  358. pbsARFix248
  359. 150
  360. 151
  361. 152
  362. 153
  363. 154
  364. 155
  365. 156
  366. 157
  367. 158
  368. 159
  369. 1510
  370. 1511
  371. 1512
  372. 1513
  373. 1514
  374. 1515
  375. 1516
  376. 1517
  377. 1518
  378. 1519
  379. anm15
  380. 15EndLeft
  381. 15StepLeft
  382. 15PauseLeft
  383. 15PlayLeft
  384. 15PlayPauseLeft
  385. 15PauseRight
  386. 15PlayRight
  387. 15PlayPauseRight
  388. 15StepRight
  389. 15EndRight
  390. 15Minus
  391. 15Reset
  392. 15Plus
  393. pbsARFix249
  394. pbsARFix250
  395. pbsARFix251
  396. pbsARFix252
  397. pbsARFix253
  398. pbsARFix254
  399. pbsARFix255
  400. pbsARFix256
  401. pbsARFix257
  402. pbsARFix258
  403. pbsARFix259
  404. pbsARFix260
  405. pbsARFix261
Page 27: Black-ScholesPricingandHedging - NTU · to the Black-Scholes PDE (6.2) in order to price a claim payoff Cof the formC= h(S T).Asinthediscrete-timecase,thearbitragepriceπt(C) at

Black-Scholes Pricing and Hedging

= ψ(y) +12w t

0part2

party2 IE [ψ(yminusBs)] ds

= ψ(y) +12w t

0part2g

party2 (s y)ds

Hence we have

partg

partt(t y) = part

parttIE[ψ(yminusBt)]

=12part2

party2 IE [ψ(yminusBt)]

=12part2g

party2 (t y)

Regarding the initial condition we check that

g(0 y) = IE[ψ(yminusB0)] = IE[ψ(y)] = ψ(y)

The expression g(t y) = IE[ψ(yminusBt)] provides a probabilistic interpreta-tion of the heat diffusion phenomenon based on Brownian motion Namelywhen ψε(y) = 1[minusεε](y) we find that

gε(t y) = IE[ψε(yminusBt)]= IE[1[minusεε](yminusBt)]= P

(yminusBt isin [minusε ε]

)= P

(yminus ε 6 Bt 6 y+ ε

)represents the probability of finding Bt within a neighborhood [y minus ε y + ε]of the point y isin R

66 Solution of the Black-Scholes PDE

In this section we solve the Black-Scholes PDE by the kernel method of Sec-tion 65 and a change of variables This solution method uses the change ofvariables (623) of Proposition 68 and a time inversion from which the ter-minal condition at time T in the Black-Scholes equation becomes an initialcondition at time t = 0 in the heat equation

Next we state the proof Proposition 68

Proof Letting s = T minus t and x = e|σ|y+(σ22minusr)t and using Relation (623)ie

g(t y) = ertf(T minus t e|σ|y+(σ22minusr)t)

227

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

we have

partg

partt(t y) = r ertf

(T minus t e|σ|y+(σ22minusr)t)minus ert partf

parts

(T minus t e|σ|y+(σ22minusr)t)

+

(σ2

2 minus r)

ert e|σ|y+(σ22minusr)t partf

partx

(T minus t e|σ|y+(σ22minusr)t)

= r ertf(T minus tx)minus ert partfparts

(T minus tx) +(σ2

2 minus r)

ertxpartfpartx

(T minus tx)

=12 ertx2σ2 part

2f

partx2 (T minus tx) +σ2

2 ertxpartfpartx

(T minus tx) (629)

where on the last step we used the Black-Scholes PDE On the other handwe have

partg

party(t y) = |σ| ert e|σ|y+(σ22minusr)t partf

partx

(T minus t e|σ|y+(σ22minusr)t)

and

12partg2

party2 (t y) =σ2

2 ert e|σ|y+(σ22minusr)t partf

partx

(T minus t e|σ|y+(σ22minusr)t)

+σ2

2 ert e2|σ|y+2(σ22minusr)t part2f

partx2(T minus t e|σ|y+(σ22minusr)t)

=σ2

2 ertxpartfpartx

(T minus tx) + σ2

2 ertx2 part2f

partx2 (T minus tx) (630)

We conclude by comparing (629) with (630) which shows that g(tx) solvesthe heat equation (627) with initial condition

g(0 y) = f(T e|σ|y

)= h

(e|σ|y

)

In the next proposition we derive the Black-Scholes formula (610) by solv-ing the PDE (622) The Black-Scholes formula will also be recovered by aprobabilistic argument via the computation of an expected value in Proposi-tion 77

Proposition 611 When h(x) = (x minusK)+ the solution of the Black-Scholes PDE (622) is given by

f(tx) = xΦ(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

) x gt 0

whereΦ(x) =

1radic2π

w xminusinfin

eminusy22dy x isin R

and

228

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

d+(T minus t) =

log(xK) + (r+ σ22)(T minus t)|σ|radicT minus t

dminus(T minus t) =log(xK) + (rminus σ22)(T minus t)

|σ|radicT minus t

x gt 0 t isin [0T )

Proof By inversion of Relation (623) with s = T minus t and x = e|σ|y+(σ22minusr)twe get

f(sx) = eminus(Tminuss)rg(T minus s minus(σ

22minus r)(T minus s) + log x|σ|

)and

h(x) = ψ

(log x|σ|

) x gt 0 or ψ(y) = h

(e|σ|y

) y isin R

Hence using the solution (628) and Relation (624) we get

f(tx) = eminus(Tminust)rg(T minus t minus(σ

22minus r)(T minus t) + log x|σ|

)= eminus(Tminust)r

winfinminusinfin

ψ

(minus(σ22minus r)(T minus t) + log x

|σ|+ z

)eminusz2(2(Tminust)) dzradic

2(T minus t)π

= eminus(Tminust)rwinfinminusinfin

h(x e|σ|zminus(σ22minusr)(Tminust)) eminusz2(2(Tminust)) dzradic

2(T minus t)π

= eminus(Tminust)rwinfinminusinfin

(x e|σ|zminus(σ22minusr)(Tminust) minusK

)+ eminusz2(2(Tminust)) dzradic2(T minus t)π

= eminus(Tminust)r

timeswinfin

(minusr+σ22)(Tminust)+log(Kx)|σ|

(x e|σ|zminus(σ22minusr)(Tminust) minusK

)eminusz2(2(Tminust)) dzradic

2(T minus t)π

= x eminus(Tminust)rwinfinminusdminus(Tminust)

radicTminust

e|σ|zminus(σ22minusr)(Tminust) eminusz2(2(Tminust)) dzradic2(T minus t)π

minusK eminus(Tminust)rwinfinminusdminus(Tminust)

radicTminust

eminusz2(2(Tminust)) dzradic2(T minus t)π

= xwinfinminusdminus(Tminust)

radicTminust

e|σ|zminus(Tminust)σ22minusz2(2(Tminust)) dzradic2(T minus t)π

minusK eminus(Tminust)rwinfinminusdminus(Tminust)

radicTminust

eminusz2(2(Tminust)) dzradic2(T minus t)π

= xwinfinminusdminus(Tminust)

radicTminust

eminus(zminus(Tminust)|σ|)2(2(Tminust)) dzradic2(T minus t)π

229

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

minusK eminus(Tminust)rwinfinminusdminus(Tminust)

radicTminust

eminusz2(2(Tminust)) dzradic2(T minus t)π

= xwinfinminusdminus(Tminust)

radicTminustminus(Tminust)|σ|

eminusz2(2(Tminust)) dzradic2(T minus t)π

minusK eminus(Tminust)rwinfinminusdminus(Tminust)

radicTminust

eminusz2(2(Tminust)) dzradic2(T minus t)π

= xwinfinminusdminus(Tminust)minus|σ|

radicTminust

eminusz22 dzradic2πminusK eminus(Tminust)r

winfinminusdminus(Tminust)

eminusz22 dzradic2π

= x(1minusΦ

(minus d+(T minus t)

))minusK eminus(Tminust)r

(1minusΦ

(minus dminus(T minus t)

))= xΦ

(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)

where we used the relation (614) ie

1minusΦ(a) = Φ(minusa) a isin R

Exercises

Exercise 61 Bachelier (1900) model Consider a market made of a risklessasset valued At = A0 with zero interest rate t isin R+ and a risky asset whoseprice St is modeled by a standard Brownian motion as St = Bt t isin R+

a) Show that the price g(tBt) of the option with payoff C = B2T satisfies

the heat equationpartϕ

partt(t y) = minus1

2part2ϕ

party2 (t y)

with terminal condition g(T x) = x2b) Find the function g(tx) by solving the PDE of Question (a)

Hint Try a solution of the form g(tx) = x2 + f(t)

See Exercises 611 713 and 714 for extensions to nonzero interest rates

Exercise 62 Consider a risky asset price (St)tisinR modeled in the Cox et al(1985) (CIR) model as

dSt = β(αminus St)dt+ σradicStdBt αβσ gt 0 (631)

and let (ηt ξt)tisinR+ be a portfolio strategy whose value Vt = ηtAt + ξtSttakes the form Vt = g(tSt) t isin R+ Figure 620 presents a random simula-tion of the solution to (631) with α = 0025 β = 1 and σ = 13230

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

0

1

2

3

4

5

6

7

8

0 01 02 03 04 05 06 07 08 09 1

St

t

Fig 620 Graph of the CIR short rate t 7rarr rt with α = 25 β = 1 and σ = 13

N=10000 t lt- 0(N-1) dt lt- 10Na=0025 b=2 sigma=0052 X lt- rnorm(Nmean=0sd=sqrt(dt))R lt- rep(0N)R[1]=001

for (j in 2N)R[j]=max(0R[j-1]+(a-bR[j-1])dt+sigmasqrt(R[j-1])X[j])4 plot(t R xlab = t ylab = type = l ylim = c(0002) col = blue)

Based on the self-financing condition written as

dVt = rVtdtminus rξtStdt+ ξtdSt

= rVtdtminus rξtStdt+ β(αminus St)ξtdt+ σξtradicStdBt t isin R+ (632)

derive the PDE satisfied by the function g(tx) using the Itocirc formula

Exercise 63 Black-Scholes PDE with dividends Consider a riskless as-set with price At = A0 ert t isin R+ and an underlying asset price process(St)tisinR+ modeled as

dSt = (microminus δ)Stdt+ σStdBt

where (Bt)tisinR+ is a standard Brownian motion and δ gt 0 is a continuous-time dividend rate By absence of arbitrage the payment of a dividend entailsa drop in the stock price by the same amount occuring generally on the ex-dividend date on which the purchase of the security no longer entitles theinvestor to the dividend amount The list of investors entitled to dividendpayment is consolidated on the date of record and payment is made on thepayable date

library(quantmod)2 getSymbols(0005HKfrom=2010-01-01to=SysDate()src=yahoo)

getDividends(0005HKfrom=2010-01-01to=SysDate()src=yahoo)

a) Assuming that the portfolio with value Vt = ξtSt + ηtAt at time t is self-financing and that dividends are continuously reinvested write down theportfolio variation dVt

231

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

b) Assuming that the portfolio value Vt takes the form Vt = g(tSt) at timet derive the Black-Scholes PDE for the function g(tx) with its terminalcondition

c) Compute the price at time t isin [0T ] of the European call option withstrike price K by solving the corresponding Black-Scholes PDE

d) Compute the Delta of the option

Exercise 64

a) Check that the Black-Scholes formula (610) for European call options

gc(tx) = xΦ(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)

satisfies the following boundary conditions

i) at x = 0 gc(t 0) = 0ii) at maturity t = T

gc(T x) = (xminusK)+ =

xminusK x gt K

0 x 6 K

iii) as time to maturity tends to infinity

limTrarrinfin

Bl(Kxσ rT minus t) = x t isin R+

b) Check that the Black-Scholes formula (618) for European put options

gp(tx) = K eminus(Tminust)rΦ(minus dminus(T minus t)

)minus xΦ

(minus d+(T minus t)

)satisfies the following boundary conditions

i) at x = 0 gp(t 0) = K eminus(Tminust)rii) as x tends to infinity gp(tinfin) = 0 for all t isin [0T )iii) at maturity t = T

gp(T x) = (K minus x)+ =

0 x gt K

K minus x x 6 K

iv) as time to maturity tends to infinity

limTrarrinfin

Blp(KStσ rT minus t) = 0 t isin R+

Exercise 65 Power option (Exercise 314 continued)

232

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

a) Solve the Black-Scholes PDE

rg(x t) = partg

partt(x t) + rx

partg

partx(x t) + σ2

2 x2 part2g

partx2 (x t) (633)

with terminal condition g(xT ) = x2 x gt 0 t isin [0T ]

Hint Try a solution of the form g(x t) = x2f(t) and find f(t)b) Find the respective quantities ξt and ηt of the risky asset St and riskless

asset At = ert in the portfolio with value

Vt = g(St t) = ξtSt + ηtAt 0 6 t 6 T

hedging the contract with payoff S2T at maturity

Exercise 66 On December 18 2007 a call warrant has been issued byFortis Bank on the stock price S of the MTR Corporation with maturityT = 23122008 strike price K = HK$ 3608 and entitlement ratio=10Recall that in the Black-Scholes model the price at time t of the Europeanclaim on the underlying asset priced St with strike price K maturity T interest rate r and volatility σ gt 0 is given by the Black-Scholes formula as

f(tSt) = StΦ(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)

wheredminus(T minus t) =

(rminus σ22)(T minus t) + log(StK)

|σ|radicT minus t

d+(T minus t) = dminus(T minus t) + |σ|radicT minus t = (r+ σ22)(T minus t) + log(StK)

|σ|radicT minus t

Recall that by Proposition 64 we have

partf

partx(tSt) = Φ

(d+(T minus t)

) 0 6 t 6 T

a) Using the values of the Gaussian cumulative distribution function com-pute the Black-Scholes price of the corresponding call option at timet =November 07 2008 with St = HK$ 17200 assuming a volatility σ =90 = 090 and an annual risk-free interest rate r = 4377 = 004377

b) Still using the Gaussian cumulative distribution function compute thequantity of the risky asset required in your portfolio at time t =November07 2008 in order to hedge one such option at maturity T = 23122008

c) Figure 1 represents the Black-Scholes price of the call option as a functionof σ isin [05 15] = [50 150]

233

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

0

01

02

03

04

05

06

05 06 07 08 09 1 11 12 13 14 15σimp

Optio

n pr

ice

σ

Market price

Fig 621 Option price as a function of the volatility σ gt 0

1 BSCall lt- function(S K r T sigma)d1 lt- (log(SK)+(r+sigma^22)T)(sigmasqrt(T))d2 lt- d1 - sigma sqrt(T)

3 BSCall = Spnorm(d1) - Kexp(-rT)pnorm(d2)BSCallsigma lt- seq(0515 length=100)

5 plot(sigmaBSCall(172360800437746365sigma) type=llty=1 xlab=Sigmaylab=Black-Scholes Call Price ylim = c(006)col=bluelwd=3)grid()

abline(h=023col=redlwd=3)

Knowing that the closing price of the warrant on November 07 2008 wasHK$ 0023 which value can you infer for the implied volatility σ at thisdatelowast

Exercise 67 Forward contracts Recall that the price πt(C) of a claimpayoff C = h(ST ) of maturity T can be written as πt(C) = g(tSt) wherethe function g(tx) satisfies the Black-Scholes PDE

rg(tx) = partg

partt(tx) + rx

partg

partx(tx) + 1

2σ2x2 part

2g

partx2 (tx)

g(T x) = h(x) (1)

with terminal condition g(T x) = h(x) x gt 0

a) Assume that C is a forward contract with payoff

C = ST minusK

at time T Find the function h(x) in (1)b) Find the solution g(tx) of the above PDE and compute the price πt(C)

at time t isin [0T ]Hint search for a solution of the form g(tx) = xminus α(t) where α(t) is afunction of t to be determined

lowast Download the corresponding or the that can be runhere

234

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

BS lt- function(S K T r sig)d1 lt- (log(SK) + (r + sig^22)T) (sigsqrt(T))d2 lt- d1 - sigsqrt(T)return(Spnorm(d1) - Kexp(-rT)pnorm(d2))impliedvol lt- function(S K T r market)sig lt- 020sigup lt- 1sigdown lt- 0001count lt- 0err lt- BS(S K T r sig) - marketwhile(abs(err) gt 000001 ampamp countlt1000)if(err lt 0)sigdown lt- sigsig lt- (sigup + sig)2elsesigup lt- sigsig lt- (sigdown + sig)2err lt- BS(S K T r sig) - marketcount lt- count + 1if(count==2000)return(NA)elsereturn(sig)market = 083K = 628T = 7 365S = 634r = 002impliedvol(S K T r market)

cells [ cell_type code execution_count null metadata outputs [] source [ from IPythoncoredisplay import display HTMLn display(HTML( )) ] cell_type code execution_count null metadata collapsed true outputs [] source [ import numpy as npn import scipystats as ssn import time n n Black and Scholesn def d1(S0 K r sigma T)n return (nplog(S0K) + (r + sigma2 2) T)(sigma npsqrt(T))n n def d2(S0 K r sigma T)n return (nplog(S0 K) + (r - sigma2 2) T) (sigma npsqrt(T))n n def BlackScholes(typeS0 K r sigma T)n if type==Cn return S0 ssnormcdf(d1(S0 K r sigma T)) - K npexp(-r T) ssnormcdf(d2(S0 K r sigma T))n elsen return K npexp(-r T) ssnormcdf(-d2(S0 K r sigma T)) - S0 ssnormcdf(-d1(S0 K r sigma T)) ] cell_type code execution_count null metadata outputs [] source [ BlackScholes(C1000 1200 002 015 10) ] cell_type code execution_count null metadata outputs [] source [ def difference(x p S K r t)n return BlackScholes(CS K r x t) - p ] cell_type code execution_count null metadata outputs [] source [ from scipyoptimize import bisectn bisect(difference00011args=(11541763731112766 1000 1200 002 10)) ] ] metadata anaconda-cloud kernelspec display_name Python 3 language python name python3 language_info codemirror_mode name ipython version 3 file_extension py mimetype textx-python name python nbconvert_exporter python pygments_lexer ipython3 version 375rc1 nbformat 4 nbformat_minor 1

Black-Scholes Pricing and Hedging

c) Compute the quantityξt =

partg

partx(tSt)

of risky assets in a self-financing portfolio hedging Cd) Repeat the above questions with the terminal condition g(T x) = x

Exercise 68a) Solve the Black-Scholes PDE

rg(tx) = partg

partt(tx) + rx

partg

partx(tx) + σ2

2 x2 part2g

partx2 (tx) (634)

with terminal condition g(T x) = 1 x gt 0

Hint Try a solution of the form g(tx) = f(t) and find f(t)

b) Find the respective quantities ξt and ηt of the risky asset St and risklessasset At = ert in the portfolio with value

Vt = g(tSt) = ξtSt + ηtAt

hedging the contract with payoff $1 at maturity

Exercise 69 Log-contracts see also Exercise 84a) Solve the PDE

0 =partg

partt(x t) + rx

partg

partx(x t) + σ2

2 x2 part2g

partx2 (x t)

with the terminal condition g(xT ) = log x x gt 0

Hint Try a solution of the form g(x t) = f(t) + log x and find f(t)b) Solve the Black-Scholes PDE

rh(x t) = parth

partt(x t) + rx

parth

partx(x t) + σ2

2 x2 part2h

partx2 (x t) (635)

with the terminal condition h(xT ) = log x x gt 0

Hint Try a solution of the form h(x t) = u(t)g(x t) and find u(t)c) Find the respective quantities ξt and ηt of the risky asset St and riskless

asset At = ert in the portfolio with value

Vt = g(St t) = ξtSt + ηtAt

hedging a log-contract with payoff logST at maturity 235

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

Exercise 610 Binary options Consider a price process (St)tisinR+ given by

dStSt

= rdt+ σdBt S0 = 1

under the risk-neutral probability measure Plowast The binary (or digital) calloption is a contract with maturity T strike price K and payoff

Cd = 1[Kinfin)(ST ) =

$1 if ST gt K

0 if ST lt K

a) Derive the Black-Schole PDE satisfied by the pricing function Cd(tSt) ofthe binary call option together with its terminal condition

b) Show that the solution Cd(tx) of the Black-Scholes PDE of Question (a)is given by

Cd(tx) = eminus(Tminust)rΦ((rminus σ22)(T minus t) + log(xK)

|σ|radicT minus t

)= eminus(Tminust)rΦ

(dminus(T minus t)

)

where

dminus(T minus t) =(rminus σ22)(T minus t) + log(StK)

|σ|radicT minus t

0 6 t lt T

Exercise 611

a) Bachelier (1900) model Solve the stochastic differential equation

dSt = αStdt+ σdBt (636)

in terms of ασ isin R and the initial condition S0b) Write down the Bachelier PDE satisfied by the function C(tx) where

C(tSt) is the price at time t isin [0T ] of the contingent claim with payoffφ(ST ) = exp(ST ) and identify the process Delta (ξt)tisin[0T ] that hedgesthis claim

c) Solve the Black-Scholes PDE of Question (b) with the terminal conditionφ(x) = ex x isin R

Hint Search for a solution of the form

C(tx) = exp(minus(T minus t)r+ xh(t) +

σ2

4r (h2(t)minus 1)

) (637)

where h(t) is a function to be determined with h(T ) = 1

236

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

d) Compute the portfolio strategy (ξt ηt)tisin[0T ] that hedges the contingentclaim with payoff exp(ST )

Exercise 612

a) Show that for every fixed value of S the function

d 7minusrarr h(S d) = SΦ(d+ |σ|

radicT)minusK eminusrTΦ(d)

reaches its maximum at dlowast(S) =log(SK) + (rminus σ22)T

|σ|radicT

b) By the differentiation rule

d

dSh(S dlowast(S)) =

parth

partS(S dlowast(S)) + dprimelowast(S)

parth

partd(S dlowast(S))

recover the value of the Black-Scholes Delta

Exercise 613 Compute the Black-Scholes Vega by differentiation of theBlack-Scholes function

gc(tx) = Bl(Kxσ rT minus t) = xΦ(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)

with respect to the volatility parameter σ knowing that

minus12(dminus(T minus t)

)2= minus1

2

(log(xK) + (rminus σ22)(T minus t)

|σ|radicT minus t

)2

= minus12(d+(T minus t)

)2+ (T minus t)r+ log x

K (638)

Exercise 614 Consider the backward induction relation (313) ie

v(tx) = (1minus plowastN )v (t+ 1x(1 + aN )) + plowastN v (t+ 1x(1 + bN ))

using the renormalizations rN = rTN and

aN = (1 + rN )(1minus |σ|radicTN)minus 1 bN = (1 + rN )(1 + |σ|

radicTN)minus 1

of Section 36 N gt 1 with

plowastN =rN minus aNbN minus aN

and plowastN =bN minus rNbN minus aN

a) Show that the Black-Scholes PDE (62) of Proposition 61 can be recoveredfrom the induction relation (313) when the number N of time steps tendsto infinity

237

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

b) Show that the expression of the Delta ξt =partgcpartx

(tSt) can be similarlyrecovered from the finite difference relation (319) ie

ξ(1)t (Stminus1) =

v (t (1 + bN )Stminus1)minus v (t (1 + aN )Stminus1)

Stminus1(bN minus aN )

as N tends to infinity

Problem 615 (Leung and Sircar (2015)) ProShares Ultra SampP500 andProShares UltraShort SampP500 are leveraged investment funds that seek dailyinvestment results before fees and expenses that correspond to β times (βx)the daily performance of the SampP500reg with respectively β = 2 for ProSharesUltra and β = minus2 for ProShares UltraShort Here leveraging with a factorβ 1 aims at multiplying the potential return of an investment by a factorβ The following 10 questions are interdependent and should be treated insequence

a) Consider a risky asset priced S0 = $4 at time t = 0 and taking twopossible values S1 = $5 and S1 = $2 at time t = 1 Compute the twopossible returns (in ) achieved when investing $4 in one share of the assetS and the expected return under the risk-neutral probability measureassuming that the risk-free interest rate is zero

b) Leveraging Still based on an initial $4 investment we decide to leverageby a factor β = 3 by borrowing another (β minus 1) times $4 = 2times $4 at ratezero to purchase a total of β = 3 shares of the asset S Compute thetwo returns (in ) possibly achieved in this case and the expected returnunder the risk-neutral probability measure assuming that the risk-freeinterest rate is zero

c) Denoting by Ft the ProShares value at time t how much should the fundinvest in the underlying asset priced St and how much $ should it borrowor save on the risk-free market at any time t in order to leverage with afactor β 1

d) Find the portfolio allocation (ξt ηt) for the fund value

Ft = ξtSt + ηtAt t isin R+

according to Question (c) where At = A0 ert is the riskless money marketaccount

e) We choose to model the SampP500 index St as the geometric Brownianmotion

dSt = rStdt+ σStdBt t isin R+

under the risk-neutral probability measure Plowast Find the stochastic dif-ferential equation satisfied by (Ft)tisinR+ under the self-financing conditiondFt = ξtdSt + ηtdAt

238

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

f) Is the discounted fund value ( eminusrtFt)tisinR+ a martingale under the risk-neutral probability measure Plowast

g) Find the relation between the fund value Ft and the index St by solvingthe stochastic differential equation obtained for Ft in Question (e) Forsimplicity we normalize F0 = Sβ0

h) Write the price at time t = 0 of the call option with payoff (FT minusK)+ onthe ProShares index using the Black-Scholes formula

i) Show that when β gt 0 the Delta at time t isin [0T ) of the call optionwith payoff (FT minusK)+ on ProShares Ultra is equal to the Delta of thecall option with payoff (ST minusKβ(t))

+ on the SampP500 for a certain strikeprice Kβ(t) to be determined explicitly

j) When β lt 0 find the relation between the Delta at time t isin [0T ) ofthe call option with payoff (FT minusK)+ on ProShares UltraShort and theDelta of the put option with payoff (Kβ(t)minus ST )+ on the SampP500

239

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

  1. pbsARFix223
  2. pbsARFix224
  3. pbsARFix225
  4. pbsARFix226
  5. pbsARFix227
  6. pbsARFix228
  7. pbsARFix229
  8. pbsARFix230
  9. fdrm1
  10. pbsARFix231
  11. 100
  12. 101
  13. 102
  14. 103
  15. 104
  16. 105
  17. 106
  18. 107
  19. 108
  20. 109
  21. 1010
  22. 1011
  23. 1012
  24. 1013
  25. 1014
  26. 1015
  27. 1016
  28. 1017
  29. 1018
  30. 1019
  31. anm10
  32. 10EndLeft
  33. 10StepLeft
  34. 10PauseLeft
  35. 10PlayLeft
  36. 10PlayPauseLeft
  37. 10PauseRight
  38. 10PlayRight
  39. 10PlayPauseRight
  40. 10StepRight
  41. 10EndRight
  42. 10Minus
  43. 10Reset
  44. 10Plus
  45. pbsARFix232
  46. pbsARFix233
  47. pbsARFix234
  48. pbsARFix235
  49. pbsARFix236
  50. pbsARFix237
  51. fdrm2
  52. 110
  53. 111
  54. 112
  55. 113
  56. 114
  57. 115
  58. 116
  59. 117
  60. 118
  61. 119
  62. 1110
  63. 1111
  64. 1112
  65. 1113
  66. 1114
  67. 1115
  68. 1116
  69. 1117
  70. 1118
  71. 1119
  72. anm11
  73. 11EndLeft
  74. 11StepLeft
  75. 11PauseLeft
  76. 11PlayLeft
  77. 11PlayPauseLeft
  78. 11PauseRight
  79. 11PlayRight
  80. 11PlayPauseRight
  81. 11StepRight
  82. 11EndRight
  83. 11Minus
  84. 11Reset
  85. 11Plus
  86. pbsARFix238
  87. pbsARFix239
  88. pbsARFix240
  89. pbsARFix241
  90. pbsARFix242
  91. 120
  92. 121
  93. 122
  94. 123
  95. 124
  96. 125
  97. 126
  98. 127
  99. 128
  100. 129
  101. 1210
  102. anm12
  103. 12EndLeft
  104. 12StepLeft
  105. 12PauseLeft
  106. 12PlayLeft
  107. 12PlayPauseLeft
  108. 12PauseRight
  109. 12PlayRight
  110. 12PlayPauseRight
  111. 12StepRight
  112. 12EndRight
  113. 12Minus
  114. 12Reset
  115. 12Plus
  116. 130
  117. 131
  118. 132
  119. 133
  120. 134
  121. 135
  122. 136
  123. 137
  124. 138
  125. 139
  126. 1310
  127. anm13
  128. 13EndLeft
  129. 13StepLeft
  130. 13PauseLeft
  131. 13PlayLeft
  132. 13PlayPauseLeft
  133. 13PauseRight
  134. 13PlayRight
  135. 13PlayPauseRight
  136. 13StepRight
  137. 13EndRight
  138. 13Minus
  139. 13Reset
  140. 13Plus
  141. pbsARFix243
  142. pbsARFix244
  143. pbsARFix245
  144. pbsARFix246
  145. 140
  146. 141
  147. 142
  148. 143
  149. 144
  150. 145
  151. 146
  152. 147
  153. 148
  154. 149
  155. 1410
  156. 1411
  157. 1412
  158. 1413
  159. 1414
  160. 1415
  161. 1416
  162. 1417
  163. 1418
  164. 1419
  165. 1420
  166. 1421
  167. 1422
  168. 1423
  169. 1424
  170. 1425
  171. 1426
  172. 1427
  173. 1428
  174. 1429
  175. 1430
  176. 1431
  177. 1432
  178. 1433
  179. 1434
  180. 1435
  181. 1436
  182. 1437
  183. 1438
  184. 1439
  185. 1440
  186. 1441
  187. 1442
  188. 1443
  189. 1444
  190. 1445
  191. 1446
  192. 1447
  193. 1448
  194. 1449
  195. 1450
  196. 1451
  197. 1452
  198. 1453
  199. 1454
  200. 1455
  201. 1456
  202. 1457
  203. 1458
  204. 1459
  205. 1460
  206. 1461
  207. 1462
  208. 1463
  209. 1464
  210. 1465
  211. 1466
  212. 1467
  213. 1468
  214. 1469
  215. 1470
  216. 1471
  217. 1472
  218. 1473
  219. 1474
  220. 1475
  221. 1476
  222. 1477
  223. 1478
  224. 1479
  225. 1480
  226. 1481
  227. 1482
  228. 1483
  229. 1484
  230. 1485
  231. 1486
  232. 1487
  233. 1488
  234. 1489
  235. 1490
  236. 1491
  237. 1492
  238. 1493
  239. 1494
  240. 1495
  241. 1496
  242. 1497
  243. 1498
  244. 1499
  245. 14100
  246. 14101
  247. 14102
  248. 14103
  249. 14104
  250. 14105
  251. 14106
  252. 14107
  253. 14108
  254. 14109
  255. 14110
  256. 14111
  257. 14112
  258. 14113
  259. 14114
  260. 14115
  261. 14116
  262. 14117
  263. 14118
  264. 14119
  265. 14120
  266. 14121
  267. 14122
  268. 14123
  269. 14124
  270. 14125
  271. 14126
  272. 14127
  273. 14128
  274. 14129
  275. 14130
  276. 14131
  277. 14132
  278. 14133
  279. 14134
  280. 14135
  281. 14136
  282. 14137
  283. 14138
  284. 14139
  285. 14140
  286. 14141
  287. 14142
  288. 14143
  289. 14144
  290. 14145
  291. 14146
  292. 14147
  293. 14148
  294. 14149
  295. 14150
  296. 14151
  297. 14152
  298. 14153
  299. 14154
  300. 14155
  301. 14156
  302. 14157
  303. 14158
  304. 14159
  305. 14160
  306. 14161
  307. 14162
  308. 14163
  309. 14164
  310. 14165
  311. 14166
  312. 14167
  313. 14168
  314. 14169
  315. 14170
  316. 14171
  317. 14172
  318. 14173
  319. 14174
  320. 14175
  321. 14176
  322. 14177
  323. 14178
  324. 14179
  325. 14180
  326. 14181
  327. 14182
  328. 14183
  329. 14184
  330. 14185
  331. 14186
  332. 14187
  333. 14188
  334. 14189
  335. 14190
  336. 14191
  337. 14192
  338. 14193
  339. 14194
  340. 14195
  341. 14196
  342. 14197
  343. anm14
  344. 14EndLeft
  345. 14StepLeft
  346. 14PauseLeft
  347. 14PlayLeft
  348. 14PlayPauseLeft
  349. 14PauseRight
  350. 14PlayRight
  351. 14PlayPauseRight
  352. 14StepRight
  353. 14EndRight
  354. 14Minus
  355. 14Reset
  356. 14Plus
  357. pbsARFix247
  358. pbsARFix248
  359. 150
  360. 151
  361. 152
  362. 153
  363. 154
  364. 155
  365. 156
  366. 157
  367. 158
  368. 159
  369. 1510
  370. 1511
  371. 1512
  372. 1513
  373. 1514
  374. 1515
  375. 1516
  376. 1517
  377. 1518
  378. 1519
  379. anm15
  380. 15EndLeft
  381. 15StepLeft
  382. 15PauseLeft
  383. 15PlayLeft
  384. 15PlayPauseLeft
  385. 15PauseRight
  386. 15PlayRight
  387. 15PlayPauseRight
  388. 15StepRight
  389. 15EndRight
  390. 15Minus
  391. 15Reset
  392. 15Plus
  393. pbsARFix249
  394. pbsARFix250
  395. pbsARFix251
  396. pbsARFix252
  397. pbsARFix253
  398. pbsARFix254
  399. pbsARFix255
  400. pbsARFix256
  401. pbsARFix257
  402. pbsARFix258
  403. pbsARFix259
  404. pbsARFix260
  405. pbsARFix261
Page 28: Black-ScholesPricingandHedging - NTU · to the Black-Scholes PDE (6.2) in order to price a claim payoff Cof the formC= h(S T).Asinthediscrete-timecase,thearbitragepriceπt(C) at

N Privault

we have

partg

partt(t y) = r ertf

(T minus t e|σ|y+(σ22minusr)t)minus ert partf

parts

(T minus t e|σ|y+(σ22minusr)t)

+

(σ2

2 minus r)

ert e|σ|y+(σ22minusr)t partf

partx

(T minus t e|σ|y+(σ22minusr)t)

= r ertf(T minus tx)minus ert partfparts

(T minus tx) +(σ2

2 minus r)

ertxpartfpartx

(T minus tx)

=12 ertx2σ2 part

2f

partx2 (T minus tx) +σ2

2 ertxpartfpartx

(T minus tx) (629)

where on the last step we used the Black-Scholes PDE On the other handwe have

partg

party(t y) = |σ| ert e|σ|y+(σ22minusr)t partf

partx

(T minus t e|σ|y+(σ22minusr)t)

and

12partg2

party2 (t y) =σ2

2 ert e|σ|y+(σ22minusr)t partf

partx

(T minus t e|σ|y+(σ22minusr)t)

+σ2

2 ert e2|σ|y+2(σ22minusr)t part2f

partx2(T minus t e|σ|y+(σ22minusr)t)

=σ2

2 ertxpartfpartx

(T minus tx) + σ2

2 ertx2 part2f

partx2 (T minus tx) (630)

We conclude by comparing (629) with (630) which shows that g(tx) solvesthe heat equation (627) with initial condition

g(0 y) = f(T e|σ|y

)= h

(e|σ|y

)

In the next proposition we derive the Black-Scholes formula (610) by solv-ing the PDE (622) The Black-Scholes formula will also be recovered by aprobabilistic argument via the computation of an expected value in Proposi-tion 77

Proposition 611 When h(x) = (x minusK)+ the solution of the Black-Scholes PDE (622) is given by

f(tx) = xΦ(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

) x gt 0

whereΦ(x) =

1radic2π

w xminusinfin

eminusy22dy x isin R

and

228

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

d+(T minus t) =

log(xK) + (r+ σ22)(T minus t)|σ|radicT minus t

dminus(T minus t) =log(xK) + (rminus σ22)(T minus t)

|σ|radicT minus t

x gt 0 t isin [0T )

Proof By inversion of Relation (623) with s = T minus t and x = e|σ|y+(σ22minusr)twe get

f(sx) = eminus(Tminuss)rg(T minus s minus(σ

22minus r)(T minus s) + log x|σ|

)and

h(x) = ψ

(log x|σ|

) x gt 0 or ψ(y) = h

(e|σ|y

) y isin R

Hence using the solution (628) and Relation (624) we get

f(tx) = eminus(Tminust)rg(T minus t minus(σ

22minus r)(T minus t) + log x|σ|

)= eminus(Tminust)r

winfinminusinfin

ψ

(minus(σ22minus r)(T minus t) + log x

|σ|+ z

)eminusz2(2(Tminust)) dzradic

2(T minus t)π

= eminus(Tminust)rwinfinminusinfin

h(x e|σ|zminus(σ22minusr)(Tminust)) eminusz2(2(Tminust)) dzradic

2(T minus t)π

= eminus(Tminust)rwinfinminusinfin

(x e|σ|zminus(σ22minusr)(Tminust) minusK

)+ eminusz2(2(Tminust)) dzradic2(T minus t)π

= eminus(Tminust)r

timeswinfin

(minusr+σ22)(Tminust)+log(Kx)|σ|

(x e|σ|zminus(σ22minusr)(Tminust) minusK

)eminusz2(2(Tminust)) dzradic

2(T minus t)π

= x eminus(Tminust)rwinfinminusdminus(Tminust)

radicTminust

e|σ|zminus(σ22minusr)(Tminust) eminusz2(2(Tminust)) dzradic2(T minus t)π

minusK eminus(Tminust)rwinfinminusdminus(Tminust)

radicTminust

eminusz2(2(Tminust)) dzradic2(T minus t)π

= xwinfinminusdminus(Tminust)

radicTminust

e|σ|zminus(Tminust)σ22minusz2(2(Tminust)) dzradic2(T minus t)π

minusK eminus(Tminust)rwinfinminusdminus(Tminust)

radicTminust

eminusz2(2(Tminust)) dzradic2(T minus t)π

= xwinfinminusdminus(Tminust)

radicTminust

eminus(zminus(Tminust)|σ|)2(2(Tminust)) dzradic2(T minus t)π

229

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

minusK eminus(Tminust)rwinfinminusdminus(Tminust)

radicTminust

eminusz2(2(Tminust)) dzradic2(T minus t)π

= xwinfinminusdminus(Tminust)

radicTminustminus(Tminust)|σ|

eminusz2(2(Tminust)) dzradic2(T minus t)π

minusK eminus(Tminust)rwinfinminusdminus(Tminust)

radicTminust

eminusz2(2(Tminust)) dzradic2(T minus t)π

= xwinfinminusdminus(Tminust)minus|σ|

radicTminust

eminusz22 dzradic2πminusK eminus(Tminust)r

winfinminusdminus(Tminust)

eminusz22 dzradic2π

= x(1minusΦ

(minus d+(T minus t)

))minusK eminus(Tminust)r

(1minusΦ

(minus dminus(T minus t)

))= xΦ

(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)

where we used the relation (614) ie

1minusΦ(a) = Φ(minusa) a isin R

Exercises

Exercise 61 Bachelier (1900) model Consider a market made of a risklessasset valued At = A0 with zero interest rate t isin R+ and a risky asset whoseprice St is modeled by a standard Brownian motion as St = Bt t isin R+

a) Show that the price g(tBt) of the option with payoff C = B2T satisfies

the heat equationpartϕ

partt(t y) = minus1

2part2ϕ

party2 (t y)

with terminal condition g(T x) = x2b) Find the function g(tx) by solving the PDE of Question (a)

Hint Try a solution of the form g(tx) = x2 + f(t)

See Exercises 611 713 and 714 for extensions to nonzero interest rates

Exercise 62 Consider a risky asset price (St)tisinR modeled in the Cox et al(1985) (CIR) model as

dSt = β(αminus St)dt+ σradicStdBt αβσ gt 0 (631)

and let (ηt ξt)tisinR+ be a portfolio strategy whose value Vt = ηtAt + ξtSttakes the form Vt = g(tSt) t isin R+ Figure 620 presents a random simula-tion of the solution to (631) with α = 0025 β = 1 and σ = 13230

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

0

1

2

3

4

5

6

7

8

0 01 02 03 04 05 06 07 08 09 1

St

t

Fig 620 Graph of the CIR short rate t 7rarr rt with α = 25 β = 1 and σ = 13

N=10000 t lt- 0(N-1) dt lt- 10Na=0025 b=2 sigma=0052 X lt- rnorm(Nmean=0sd=sqrt(dt))R lt- rep(0N)R[1]=001

for (j in 2N)R[j]=max(0R[j-1]+(a-bR[j-1])dt+sigmasqrt(R[j-1])X[j])4 plot(t R xlab = t ylab = type = l ylim = c(0002) col = blue)

Based on the self-financing condition written as

dVt = rVtdtminus rξtStdt+ ξtdSt

= rVtdtminus rξtStdt+ β(αminus St)ξtdt+ σξtradicStdBt t isin R+ (632)

derive the PDE satisfied by the function g(tx) using the Itocirc formula

Exercise 63 Black-Scholes PDE with dividends Consider a riskless as-set with price At = A0 ert t isin R+ and an underlying asset price process(St)tisinR+ modeled as

dSt = (microminus δ)Stdt+ σStdBt

where (Bt)tisinR+ is a standard Brownian motion and δ gt 0 is a continuous-time dividend rate By absence of arbitrage the payment of a dividend entailsa drop in the stock price by the same amount occuring generally on the ex-dividend date on which the purchase of the security no longer entitles theinvestor to the dividend amount The list of investors entitled to dividendpayment is consolidated on the date of record and payment is made on thepayable date

library(quantmod)2 getSymbols(0005HKfrom=2010-01-01to=SysDate()src=yahoo)

getDividends(0005HKfrom=2010-01-01to=SysDate()src=yahoo)

a) Assuming that the portfolio with value Vt = ξtSt + ηtAt at time t is self-financing and that dividends are continuously reinvested write down theportfolio variation dVt

231

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

b) Assuming that the portfolio value Vt takes the form Vt = g(tSt) at timet derive the Black-Scholes PDE for the function g(tx) with its terminalcondition

c) Compute the price at time t isin [0T ] of the European call option withstrike price K by solving the corresponding Black-Scholes PDE

d) Compute the Delta of the option

Exercise 64

a) Check that the Black-Scholes formula (610) for European call options

gc(tx) = xΦ(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)

satisfies the following boundary conditions

i) at x = 0 gc(t 0) = 0ii) at maturity t = T

gc(T x) = (xminusK)+ =

xminusK x gt K

0 x 6 K

iii) as time to maturity tends to infinity

limTrarrinfin

Bl(Kxσ rT minus t) = x t isin R+

b) Check that the Black-Scholes formula (618) for European put options

gp(tx) = K eminus(Tminust)rΦ(minus dminus(T minus t)

)minus xΦ

(minus d+(T minus t)

)satisfies the following boundary conditions

i) at x = 0 gp(t 0) = K eminus(Tminust)rii) as x tends to infinity gp(tinfin) = 0 for all t isin [0T )iii) at maturity t = T

gp(T x) = (K minus x)+ =

0 x gt K

K minus x x 6 K

iv) as time to maturity tends to infinity

limTrarrinfin

Blp(KStσ rT minus t) = 0 t isin R+

Exercise 65 Power option (Exercise 314 continued)

232

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

a) Solve the Black-Scholes PDE

rg(x t) = partg

partt(x t) + rx

partg

partx(x t) + σ2

2 x2 part2g

partx2 (x t) (633)

with terminal condition g(xT ) = x2 x gt 0 t isin [0T ]

Hint Try a solution of the form g(x t) = x2f(t) and find f(t)b) Find the respective quantities ξt and ηt of the risky asset St and riskless

asset At = ert in the portfolio with value

Vt = g(St t) = ξtSt + ηtAt 0 6 t 6 T

hedging the contract with payoff S2T at maturity

Exercise 66 On December 18 2007 a call warrant has been issued byFortis Bank on the stock price S of the MTR Corporation with maturityT = 23122008 strike price K = HK$ 3608 and entitlement ratio=10Recall that in the Black-Scholes model the price at time t of the Europeanclaim on the underlying asset priced St with strike price K maturity T interest rate r and volatility σ gt 0 is given by the Black-Scholes formula as

f(tSt) = StΦ(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)

wheredminus(T minus t) =

(rminus σ22)(T minus t) + log(StK)

|σ|radicT minus t

d+(T minus t) = dminus(T minus t) + |σ|radicT minus t = (r+ σ22)(T minus t) + log(StK)

|σ|radicT minus t

Recall that by Proposition 64 we have

partf

partx(tSt) = Φ

(d+(T minus t)

) 0 6 t 6 T

a) Using the values of the Gaussian cumulative distribution function com-pute the Black-Scholes price of the corresponding call option at timet =November 07 2008 with St = HK$ 17200 assuming a volatility σ =90 = 090 and an annual risk-free interest rate r = 4377 = 004377

b) Still using the Gaussian cumulative distribution function compute thequantity of the risky asset required in your portfolio at time t =November07 2008 in order to hedge one such option at maturity T = 23122008

c) Figure 1 represents the Black-Scholes price of the call option as a functionof σ isin [05 15] = [50 150]

233

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

0

01

02

03

04

05

06

05 06 07 08 09 1 11 12 13 14 15σimp

Optio

n pr

ice

σ

Market price

Fig 621 Option price as a function of the volatility σ gt 0

1 BSCall lt- function(S K r T sigma)d1 lt- (log(SK)+(r+sigma^22)T)(sigmasqrt(T))d2 lt- d1 - sigma sqrt(T)

3 BSCall = Spnorm(d1) - Kexp(-rT)pnorm(d2)BSCallsigma lt- seq(0515 length=100)

5 plot(sigmaBSCall(172360800437746365sigma) type=llty=1 xlab=Sigmaylab=Black-Scholes Call Price ylim = c(006)col=bluelwd=3)grid()

abline(h=023col=redlwd=3)

Knowing that the closing price of the warrant on November 07 2008 wasHK$ 0023 which value can you infer for the implied volatility σ at thisdatelowast

Exercise 67 Forward contracts Recall that the price πt(C) of a claimpayoff C = h(ST ) of maturity T can be written as πt(C) = g(tSt) wherethe function g(tx) satisfies the Black-Scholes PDE

rg(tx) = partg

partt(tx) + rx

partg

partx(tx) + 1

2σ2x2 part

2g

partx2 (tx)

g(T x) = h(x) (1)

with terminal condition g(T x) = h(x) x gt 0

a) Assume that C is a forward contract with payoff

C = ST minusK

at time T Find the function h(x) in (1)b) Find the solution g(tx) of the above PDE and compute the price πt(C)

at time t isin [0T ]Hint search for a solution of the form g(tx) = xminus α(t) where α(t) is afunction of t to be determined

lowast Download the corresponding or the that can be runhere

234

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

BS lt- function(S K T r sig)d1 lt- (log(SK) + (r + sig^22)T) (sigsqrt(T))d2 lt- d1 - sigsqrt(T)return(Spnorm(d1) - Kexp(-rT)pnorm(d2))impliedvol lt- function(S K T r market)sig lt- 020sigup lt- 1sigdown lt- 0001count lt- 0err lt- BS(S K T r sig) - marketwhile(abs(err) gt 000001 ampamp countlt1000)if(err lt 0)sigdown lt- sigsig lt- (sigup + sig)2elsesigup lt- sigsig lt- (sigdown + sig)2err lt- BS(S K T r sig) - marketcount lt- count + 1if(count==2000)return(NA)elsereturn(sig)market = 083K = 628T = 7 365S = 634r = 002impliedvol(S K T r market)

cells [ cell_type code execution_count null metadata outputs [] source [ from IPythoncoredisplay import display HTMLn display(HTML( )) ] cell_type code execution_count null metadata collapsed true outputs [] source [ import numpy as npn import scipystats as ssn import time n n Black and Scholesn def d1(S0 K r sigma T)n return (nplog(S0K) + (r + sigma2 2) T)(sigma npsqrt(T))n n def d2(S0 K r sigma T)n return (nplog(S0 K) + (r - sigma2 2) T) (sigma npsqrt(T))n n def BlackScholes(typeS0 K r sigma T)n if type==Cn return S0 ssnormcdf(d1(S0 K r sigma T)) - K npexp(-r T) ssnormcdf(d2(S0 K r sigma T))n elsen return K npexp(-r T) ssnormcdf(-d2(S0 K r sigma T)) - S0 ssnormcdf(-d1(S0 K r sigma T)) ] cell_type code execution_count null metadata outputs [] source [ BlackScholes(C1000 1200 002 015 10) ] cell_type code execution_count null metadata outputs [] source [ def difference(x p S K r t)n return BlackScholes(CS K r x t) - p ] cell_type code execution_count null metadata outputs [] source [ from scipyoptimize import bisectn bisect(difference00011args=(11541763731112766 1000 1200 002 10)) ] ] metadata anaconda-cloud kernelspec display_name Python 3 language python name python3 language_info codemirror_mode name ipython version 3 file_extension py mimetype textx-python name python nbconvert_exporter python pygments_lexer ipython3 version 375rc1 nbformat 4 nbformat_minor 1

Black-Scholes Pricing and Hedging

c) Compute the quantityξt =

partg

partx(tSt)

of risky assets in a self-financing portfolio hedging Cd) Repeat the above questions with the terminal condition g(T x) = x

Exercise 68a) Solve the Black-Scholes PDE

rg(tx) = partg

partt(tx) + rx

partg

partx(tx) + σ2

2 x2 part2g

partx2 (tx) (634)

with terminal condition g(T x) = 1 x gt 0

Hint Try a solution of the form g(tx) = f(t) and find f(t)

b) Find the respective quantities ξt and ηt of the risky asset St and risklessasset At = ert in the portfolio with value

Vt = g(tSt) = ξtSt + ηtAt

hedging the contract with payoff $1 at maturity

Exercise 69 Log-contracts see also Exercise 84a) Solve the PDE

0 =partg

partt(x t) + rx

partg

partx(x t) + σ2

2 x2 part2g

partx2 (x t)

with the terminal condition g(xT ) = log x x gt 0

Hint Try a solution of the form g(x t) = f(t) + log x and find f(t)b) Solve the Black-Scholes PDE

rh(x t) = parth

partt(x t) + rx

parth

partx(x t) + σ2

2 x2 part2h

partx2 (x t) (635)

with the terminal condition h(xT ) = log x x gt 0

Hint Try a solution of the form h(x t) = u(t)g(x t) and find u(t)c) Find the respective quantities ξt and ηt of the risky asset St and riskless

asset At = ert in the portfolio with value

Vt = g(St t) = ξtSt + ηtAt

hedging a log-contract with payoff logST at maturity 235

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

Exercise 610 Binary options Consider a price process (St)tisinR+ given by

dStSt

= rdt+ σdBt S0 = 1

under the risk-neutral probability measure Plowast The binary (or digital) calloption is a contract with maturity T strike price K and payoff

Cd = 1[Kinfin)(ST ) =

$1 if ST gt K

0 if ST lt K

a) Derive the Black-Schole PDE satisfied by the pricing function Cd(tSt) ofthe binary call option together with its terminal condition

b) Show that the solution Cd(tx) of the Black-Scholes PDE of Question (a)is given by

Cd(tx) = eminus(Tminust)rΦ((rminus σ22)(T minus t) + log(xK)

|σ|radicT minus t

)= eminus(Tminust)rΦ

(dminus(T minus t)

)

where

dminus(T minus t) =(rminus σ22)(T minus t) + log(StK)

|σ|radicT minus t

0 6 t lt T

Exercise 611

a) Bachelier (1900) model Solve the stochastic differential equation

dSt = αStdt+ σdBt (636)

in terms of ασ isin R and the initial condition S0b) Write down the Bachelier PDE satisfied by the function C(tx) where

C(tSt) is the price at time t isin [0T ] of the contingent claim with payoffφ(ST ) = exp(ST ) and identify the process Delta (ξt)tisin[0T ] that hedgesthis claim

c) Solve the Black-Scholes PDE of Question (b) with the terminal conditionφ(x) = ex x isin R

Hint Search for a solution of the form

C(tx) = exp(minus(T minus t)r+ xh(t) +

σ2

4r (h2(t)minus 1)

) (637)

where h(t) is a function to be determined with h(T ) = 1

236

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

d) Compute the portfolio strategy (ξt ηt)tisin[0T ] that hedges the contingentclaim with payoff exp(ST )

Exercise 612

a) Show that for every fixed value of S the function

d 7minusrarr h(S d) = SΦ(d+ |σ|

radicT)minusK eminusrTΦ(d)

reaches its maximum at dlowast(S) =log(SK) + (rminus σ22)T

|σ|radicT

b) By the differentiation rule

d

dSh(S dlowast(S)) =

parth

partS(S dlowast(S)) + dprimelowast(S)

parth

partd(S dlowast(S))

recover the value of the Black-Scholes Delta

Exercise 613 Compute the Black-Scholes Vega by differentiation of theBlack-Scholes function

gc(tx) = Bl(Kxσ rT minus t) = xΦ(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)

with respect to the volatility parameter σ knowing that

minus12(dminus(T minus t)

)2= minus1

2

(log(xK) + (rminus σ22)(T minus t)

|σ|radicT minus t

)2

= minus12(d+(T minus t)

)2+ (T minus t)r+ log x

K (638)

Exercise 614 Consider the backward induction relation (313) ie

v(tx) = (1minus plowastN )v (t+ 1x(1 + aN )) + plowastN v (t+ 1x(1 + bN ))

using the renormalizations rN = rTN and

aN = (1 + rN )(1minus |σ|radicTN)minus 1 bN = (1 + rN )(1 + |σ|

radicTN)minus 1

of Section 36 N gt 1 with

plowastN =rN minus aNbN minus aN

and plowastN =bN minus rNbN minus aN

a) Show that the Black-Scholes PDE (62) of Proposition 61 can be recoveredfrom the induction relation (313) when the number N of time steps tendsto infinity

237

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

b) Show that the expression of the Delta ξt =partgcpartx

(tSt) can be similarlyrecovered from the finite difference relation (319) ie

ξ(1)t (Stminus1) =

v (t (1 + bN )Stminus1)minus v (t (1 + aN )Stminus1)

Stminus1(bN minus aN )

as N tends to infinity

Problem 615 (Leung and Sircar (2015)) ProShares Ultra SampP500 andProShares UltraShort SampP500 are leveraged investment funds that seek dailyinvestment results before fees and expenses that correspond to β times (βx)the daily performance of the SampP500reg with respectively β = 2 for ProSharesUltra and β = minus2 for ProShares UltraShort Here leveraging with a factorβ 1 aims at multiplying the potential return of an investment by a factorβ The following 10 questions are interdependent and should be treated insequence

a) Consider a risky asset priced S0 = $4 at time t = 0 and taking twopossible values S1 = $5 and S1 = $2 at time t = 1 Compute the twopossible returns (in ) achieved when investing $4 in one share of the assetS and the expected return under the risk-neutral probability measureassuming that the risk-free interest rate is zero

b) Leveraging Still based on an initial $4 investment we decide to leverageby a factor β = 3 by borrowing another (β minus 1) times $4 = 2times $4 at ratezero to purchase a total of β = 3 shares of the asset S Compute thetwo returns (in ) possibly achieved in this case and the expected returnunder the risk-neutral probability measure assuming that the risk-freeinterest rate is zero

c) Denoting by Ft the ProShares value at time t how much should the fundinvest in the underlying asset priced St and how much $ should it borrowor save on the risk-free market at any time t in order to leverage with afactor β 1

d) Find the portfolio allocation (ξt ηt) for the fund value

Ft = ξtSt + ηtAt t isin R+

according to Question (c) where At = A0 ert is the riskless money marketaccount

e) We choose to model the SampP500 index St as the geometric Brownianmotion

dSt = rStdt+ σStdBt t isin R+

under the risk-neutral probability measure Plowast Find the stochastic dif-ferential equation satisfied by (Ft)tisinR+ under the self-financing conditiondFt = ξtdSt + ηtdAt

238

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

f) Is the discounted fund value ( eminusrtFt)tisinR+ a martingale under the risk-neutral probability measure Plowast

g) Find the relation between the fund value Ft and the index St by solvingthe stochastic differential equation obtained for Ft in Question (e) Forsimplicity we normalize F0 = Sβ0

h) Write the price at time t = 0 of the call option with payoff (FT minusK)+ onthe ProShares index using the Black-Scholes formula

i) Show that when β gt 0 the Delta at time t isin [0T ) of the call optionwith payoff (FT minusK)+ on ProShares Ultra is equal to the Delta of thecall option with payoff (ST minusKβ(t))

+ on the SampP500 for a certain strikeprice Kβ(t) to be determined explicitly

j) When β lt 0 find the relation between the Delta at time t isin [0T ) ofthe call option with payoff (FT minusK)+ on ProShares UltraShort and theDelta of the put option with payoff (Kβ(t)minus ST )+ on the SampP500

239

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

  1. pbsARFix223
  2. pbsARFix224
  3. pbsARFix225
  4. pbsARFix226
  5. pbsARFix227
  6. pbsARFix228
  7. pbsARFix229
  8. pbsARFix230
  9. fdrm1
  10. pbsARFix231
  11. 100
  12. 101
  13. 102
  14. 103
  15. 104
  16. 105
  17. 106
  18. 107
  19. 108
  20. 109
  21. 1010
  22. 1011
  23. 1012
  24. 1013
  25. 1014
  26. 1015
  27. 1016
  28. 1017
  29. 1018
  30. 1019
  31. anm10
  32. 10EndLeft
  33. 10StepLeft
  34. 10PauseLeft
  35. 10PlayLeft
  36. 10PlayPauseLeft
  37. 10PauseRight
  38. 10PlayRight
  39. 10PlayPauseRight
  40. 10StepRight
  41. 10EndRight
  42. 10Minus
  43. 10Reset
  44. 10Plus
  45. pbsARFix232
  46. pbsARFix233
  47. pbsARFix234
  48. pbsARFix235
  49. pbsARFix236
  50. pbsARFix237
  51. fdrm2
  52. 110
  53. 111
  54. 112
  55. 113
  56. 114
  57. 115
  58. 116
  59. 117
  60. 118
  61. 119
  62. 1110
  63. 1111
  64. 1112
  65. 1113
  66. 1114
  67. 1115
  68. 1116
  69. 1117
  70. 1118
  71. 1119
  72. anm11
  73. 11EndLeft
  74. 11StepLeft
  75. 11PauseLeft
  76. 11PlayLeft
  77. 11PlayPauseLeft
  78. 11PauseRight
  79. 11PlayRight
  80. 11PlayPauseRight
  81. 11StepRight
  82. 11EndRight
  83. 11Minus
  84. 11Reset
  85. 11Plus
  86. pbsARFix238
  87. pbsARFix239
  88. pbsARFix240
  89. pbsARFix241
  90. pbsARFix242
  91. 120
  92. 121
  93. 122
  94. 123
  95. 124
  96. 125
  97. 126
  98. 127
  99. 128
  100. 129
  101. 1210
  102. anm12
  103. 12EndLeft
  104. 12StepLeft
  105. 12PauseLeft
  106. 12PlayLeft
  107. 12PlayPauseLeft
  108. 12PauseRight
  109. 12PlayRight
  110. 12PlayPauseRight
  111. 12StepRight
  112. 12EndRight
  113. 12Minus
  114. 12Reset
  115. 12Plus
  116. 130
  117. 131
  118. 132
  119. 133
  120. 134
  121. 135
  122. 136
  123. 137
  124. 138
  125. 139
  126. 1310
  127. anm13
  128. 13EndLeft
  129. 13StepLeft
  130. 13PauseLeft
  131. 13PlayLeft
  132. 13PlayPauseLeft
  133. 13PauseRight
  134. 13PlayRight
  135. 13PlayPauseRight
  136. 13StepRight
  137. 13EndRight
  138. 13Minus
  139. 13Reset
  140. 13Plus
  141. pbsARFix243
  142. pbsARFix244
  143. pbsARFix245
  144. pbsARFix246
  145. 140
  146. 141
  147. 142
  148. 143
  149. 144
  150. 145
  151. 146
  152. 147
  153. 148
  154. 149
  155. 1410
  156. 1411
  157. 1412
  158. 1413
  159. 1414
  160. 1415
  161. 1416
  162. 1417
  163. 1418
  164. 1419
  165. 1420
  166. 1421
  167. 1422
  168. 1423
  169. 1424
  170. 1425
  171. 1426
  172. 1427
  173. 1428
  174. 1429
  175. 1430
  176. 1431
  177. 1432
  178. 1433
  179. 1434
  180. 1435
  181. 1436
  182. 1437
  183. 1438
  184. 1439
  185. 1440
  186. 1441
  187. 1442
  188. 1443
  189. 1444
  190. 1445
  191. 1446
  192. 1447
  193. 1448
  194. 1449
  195. 1450
  196. 1451
  197. 1452
  198. 1453
  199. 1454
  200. 1455
  201. 1456
  202. 1457
  203. 1458
  204. 1459
  205. 1460
  206. 1461
  207. 1462
  208. 1463
  209. 1464
  210. 1465
  211. 1466
  212. 1467
  213. 1468
  214. 1469
  215. 1470
  216. 1471
  217. 1472
  218. 1473
  219. 1474
  220. 1475
  221. 1476
  222. 1477
  223. 1478
  224. 1479
  225. 1480
  226. 1481
  227. 1482
  228. 1483
  229. 1484
  230. 1485
  231. 1486
  232. 1487
  233. 1488
  234. 1489
  235. 1490
  236. 1491
  237. 1492
  238. 1493
  239. 1494
  240. 1495
  241. 1496
  242. 1497
  243. 1498
  244. 1499
  245. 14100
  246. 14101
  247. 14102
  248. 14103
  249. 14104
  250. 14105
  251. 14106
  252. 14107
  253. 14108
  254. 14109
  255. 14110
  256. 14111
  257. 14112
  258. 14113
  259. 14114
  260. 14115
  261. 14116
  262. 14117
  263. 14118
  264. 14119
  265. 14120
  266. 14121
  267. 14122
  268. 14123
  269. 14124
  270. 14125
  271. 14126
  272. 14127
  273. 14128
  274. 14129
  275. 14130
  276. 14131
  277. 14132
  278. 14133
  279. 14134
  280. 14135
  281. 14136
  282. 14137
  283. 14138
  284. 14139
  285. 14140
  286. 14141
  287. 14142
  288. 14143
  289. 14144
  290. 14145
  291. 14146
  292. 14147
  293. 14148
  294. 14149
  295. 14150
  296. 14151
  297. 14152
  298. 14153
  299. 14154
  300. 14155
  301. 14156
  302. 14157
  303. 14158
  304. 14159
  305. 14160
  306. 14161
  307. 14162
  308. 14163
  309. 14164
  310. 14165
  311. 14166
  312. 14167
  313. 14168
  314. 14169
  315. 14170
  316. 14171
  317. 14172
  318. 14173
  319. 14174
  320. 14175
  321. 14176
  322. 14177
  323. 14178
  324. 14179
  325. 14180
  326. 14181
  327. 14182
  328. 14183
  329. 14184
  330. 14185
  331. 14186
  332. 14187
  333. 14188
  334. 14189
  335. 14190
  336. 14191
  337. 14192
  338. 14193
  339. 14194
  340. 14195
  341. 14196
  342. 14197
  343. anm14
  344. 14EndLeft
  345. 14StepLeft
  346. 14PauseLeft
  347. 14PlayLeft
  348. 14PlayPauseLeft
  349. 14PauseRight
  350. 14PlayRight
  351. 14PlayPauseRight
  352. 14StepRight
  353. 14EndRight
  354. 14Minus
  355. 14Reset
  356. 14Plus
  357. pbsARFix247
  358. pbsARFix248
  359. 150
  360. 151
  361. 152
  362. 153
  363. 154
  364. 155
  365. 156
  366. 157
  367. 158
  368. 159
  369. 1510
  370. 1511
  371. 1512
  372. 1513
  373. 1514
  374. 1515
  375. 1516
  376. 1517
  377. 1518
  378. 1519
  379. anm15
  380. 15EndLeft
  381. 15StepLeft
  382. 15PauseLeft
  383. 15PlayLeft
  384. 15PlayPauseLeft
  385. 15PauseRight
  386. 15PlayRight
  387. 15PlayPauseRight
  388. 15StepRight
  389. 15EndRight
  390. 15Minus
  391. 15Reset
  392. 15Plus
  393. pbsARFix249
  394. pbsARFix250
  395. pbsARFix251
  396. pbsARFix252
  397. pbsARFix253
  398. pbsARFix254
  399. pbsARFix255
  400. pbsARFix256
  401. pbsARFix257
  402. pbsARFix258
  403. pbsARFix259
  404. pbsARFix260
  405. pbsARFix261
Page 29: Black-ScholesPricingandHedging - NTU · to the Black-Scholes PDE (6.2) in order to price a claim payoff Cof the formC= h(S T).Asinthediscrete-timecase,thearbitragepriceπt(C) at

Black-Scholes Pricing and Hedging

d+(T minus t) =

log(xK) + (r+ σ22)(T minus t)|σ|radicT minus t

dminus(T minus t) =log(xK) + (rminus σ22)(T minus t)

|σ|radicT minus t

x gt 0 t isin [0T )

Proof By inversion of Relation (623) with s = T minus t and x = e|σ|y+(σ22minusr)twe get

f(sx) = eminus(Tminuss)rg(T minus s minus(σ

22minus r)(T minus s) + log x|σ|

)and

h(x) = ψ

(log x|σ|

) x gt 0 or ψ(y) = h

(e|σ|y

) y isin R

Hence using the solution (628) and Relation (624) we get

f(tx) = eminus(Tminust)rg(T minus t minus(σ

22minus r)(T minus t) + log x|σ|

)= eminus(Tminust)r

winfinminusinfin

ψ

(minus(σ22minus r)(T minus t) + log x

|σ|+ z

)eminusz2(2(Tminust)) dzradic

2(T minus t)π

= eminus(Tminust)rwinfinminusinfin

h(x e|σ|zminus(σ22minusr)(Tminust)) eminusz2(2(Tminust)) dzradic

2(T minus t)π

= eminus(Tminust)rwinfinminusinfin

(x e|σ|zminus(σ22minusr)(Tminust) minusK

)+ eminusz2(2(Tminust)) dzradic2(T minus t)π

= eminus(Tminust)r

timeswinfin

(minusr+σ22)(Tminust)+log(Kx)|σ|

(x e|σ|zminus(σ22minusr)(Tminust) minusK

)eminusz2(2(Tminust)) dzradic

2(T minus t)π

= x eminus(Tminust)rwinfinminusdminus(Tminust)

radicTminust

e|σ|zminus(σ22minusr)(Tminust) eminusz2(2(Tminust)) dzradic2(T minus t)π

minusK eminus(Tminust)rwinfinminusdminus(Tminust)

radicTminust

eminusz2(2(Tminust)) dzradic2(T minus t)π

= xwinfinminusdminus(Tminust)

radicTminust

e|σ|zminus(Tminust)σ22minusz2(2(Tminust)) dzradic2(T minus t)π

minusK eminus(Tminust)rwinfinminusdminus(Tminust)

radicTminust

eminusz2(2(Tminust)) dzradic2(T minus t)π

= xwinfinminusdminus(Tminust)

radicTminust

eminus(zminus(Tminust)|σ|)2(2(Tminust)) dzradic2(T minus t)π

229

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

minusK eminus(Tminust)rwinfinminusdminus(Tminust)

radicTminust

eminusz2(2(Tminust)) dzradic2(T minus t)π

= xwinfinminusdminus(Tminust)

radicTminustminus(Tminust)|σ|

eminusz2(2(Tminust)) dzradic2(T minus t)π

minusK eminus(Tminust)rwinfinminusdminus(Tminust)

radicTminust

eminusz2(2(Tminust)) dzradic2(T minus t)π

= xwinfinminusdminus(Tminust)minus|σ|

radicTminust

eminusz22 dzradic2πminusK eminus(Tminust)r

winfinminusdminus(Tminust)

eminusz22 dzradic2π

= x(1minusΦ

(minus d+(T minus t)

))minusK eminus(Tminust)r

(1minusΦ

(minus dminus(T minus t)

))= xΦ

(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)

where we used the relation (614) ie

1minusΦ(a) = Φ(minusa) a isin R

Exercises

Exercise 61 Bachelier (1900) model Consider a market made of a risklessasset valued At = A0 with zero interest rate t isin R+ and a risky asset whoseprice St is modeled by a standard Brownian motion as St = Bt t isin R+

a) Show that the price g(tBt) of the option with payoff C = B2T satisfies

the heat equationpartϕ

partt(t y) = minus1

2part2ϕ

party2 (t y)

with terminal condition g(T x) = x2b) Find the function g(tx) by solving the PDE of Question (a)

Hint Try a solution of the form g(tx) = x2 + f(t)

See Exercises 611 713 and 714 for extensions to nonzero interest rates

Exercise 62 Consider a risky asset price (St)tisinR modeled in the Cox et al(1985) (CIR) model as

dSt = β(αminus St)dt+ σradicStdBt αβσ gt 0 (631)

and let (ηt ξt)tisinR+ be a portfolio strategy whose value Vt = ηtAt + ξtSttakes the form Vt = g(tSt) t isin R+ Figure 620 presents a random simula-tion of the solution to (631) with α = 0025 β = 1 and σ = 13230

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

0

1

2

3

4

5

6

7

8

0 01 02 03 04 05 06 07 08 09 1

St

t

Fig 620 Graph of the CIR short rate t 7rarr rt with α = 25 β = 1 and σ = 13

N=10000 t lt- 0(N-1) dt lt- 10Na=0025 b=2 sigma=0052 X lt- rnorm(Nmean=0sd=sqrt(dt))R lt- rep(0N)R[1]=001

for (j in 2N)R[j]=max(0R[j-1]+(a-bR[j-1])dt+sigmasqrt(R[j-1])X[j])4 plot(t R xlab = t ylab = type = l ylim = c(0002) col = blue)

Based on the self-financing condition written as

dVt = rVtdtminus rξtStdt+ ξtdSt

= rVtdtminus rξtStdt+ β(αminus St)ξtdt+ σξtradicStdBt t isin R+ (632)

derive the PDE satisfied by the function g(tx) using the Itocirc formula

Exercise 63 Black-Scholes PDE with dividends Consider a riskless as-set with price At = A0 ert t isin R+ and an underlying asset price process(St)tisinR+ modeled as

dSt = (microminus δ)Stdt+ σStdBt

where (Bt)tisinR+ is a standard Brownian motion and δ gt 0 is a continuous-time dividend rate By absence of arbitrage the payment of a dividend entailsa drop in the stock price by the same amount occuring generally on the ex-dividend date on which the purchase of the security no longer entitles theinvestor to the dividend amount The list of investors entitled to dividendpayment is consolidated on the date of record and payment is made on thepayable date

library(quantmod)2 getSymbols(0005HKfrom=2010-01-01to=SysDate()src=yahoo)

getDividends(0005HKfrom=2010-01-01to=SysDate()src=yahoo)

a) Assuming that the portfolio with value Vt = ξtSt + ηtAt at time t is self-financing and that dividends are continuously reinvested write down theportfolio variation dVt

231

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

b) Assuming that the portfolio value Vt takes the form Vt = g(tSt) at timet derive the Black-Scholes PDE for the function g(tx) with its terminalcondition

c) Compute the price at time t isin [0T ] of the European call option withstrike price K by solving the corresponding Black-Scholes PDE

d) Compute the Delta of the option

Exercise 64

a) Check that the Black-Scholes formula (610) for European call options

gc(tx) = xΦ(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)

satisfies the following boundary conditions

i) at x = 0 gc(t 0) = 0ii) at maturity t = T

gc(T x) = (xminusK)+ =

xminusK x gt K

0 x 6 K

iii) as time to maturity tends to infinity

limTrarrinfin

Bl(Kxσ rT minus t) = x t isin R+

b) Check that the Black-Scholes formula (618) for European put options

gp(tx) = K eminus(Tminust)rΦ(minus dminus(T minus t)

)minus xΦ

(minus d+(T minus t)

)satisfies the following boundary conditions

i) at x = 0 gp(t 0) = K eminus(Tminust)rii) as x tends to infinity gp(tinfin) = 0 for all t isin [0T )iii) at maturity t = T

gp(T x) = (K minus x)+ =

0 x gt K

K minus x x 6 K

iv) as time to maturity tends to infinity

limTrarrinfin

Blp(KStσ rT minus t) = 0 t isin R+

Exercise 65 Power option (Exercise 314 continued)

232

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

a) Solve the Black-Scholes PDE

rg(x t) = partg

partt(x t) + rx

partg

partx(x t) + σ2

2 x2 part2g

partx2 (x t) (633)

with terminal condition g(xT ) = x2 x gt 0 t isin [0T ]

Hint Try a solution of the form g(x t) = x2f(t) and find f(t)b) Find the respective quantities ξt and ηt of the risky asset St and riskless

asset At = ert in the portfolio with value

Vt = g(St t) = ξtSt + ηtAt 0 6 t 6 T

hedging the contract with payoff S2T at maturity

Exercise 66 On December 18 2007 a call warrant has been issued byFortis Bank on the stock price S of the MTR Corporation with maturityT = 23122008 strike price K = HK$ 3608 and entitlement ratio=10Recall that in the Black-Scholes model the price at time t of the Europeanclaim on the underlying asset priced St with strike price K maturity T interest rate r and volatility σ gt 0 is given by the Black-Scholes formula as

f(tSt) = StΦ(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)

wheredminus(T minus t) =

(rminus σ22)(T minus t) + log(StK)

|σ|radicT minus t

d+(T minus t) = dminus(T minus t) + |σ|radicT minus t = (r+ σ22)(T minus t) + log(StK)

|σ|radicT minus t

Recall that by Proposition 64 we have

partf

partx(tSt) = Φ

(d+(T minus t)

) 0 6 t 6 T

a) Using the values of the Gaussian cumulative distribution function com-pute the Black-Scholes price of the corresponding call option at timet =November 07 2008 with St = HK$ 17200 assuming a volatility σ =90 = 090 and an annual risk-free interest rate r = 4377 = 004377

b) Still using the Gaussian cumulative distribution function compute thequantity of the risky asset required in your portfolio at time t =November07 2008 in order to hedge one such option at maturity T = 23122008

c) Figure 1 represents the Black-Scholes price of the call option as a functionof σ isin [05 15] = [50 150]

233

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

0

01

02

03

04

05

06

05 06 07 08 09 1 11 12 13 14 15σimp

Optio

n pr

ice

σ

Market price

Fig 621 Option price as a function of the volatility σ gt 0

1 BSCall lt- function(S K r T sigma)d1 lt- (log(SK)+(r+sigma^22)T)(sigmasqrt(T))d2 lt- d1 - sigma sqrt(T)

3 BSCall = Spnorm(d1) - Kexp(-rT)pnorm(d2)BSCallsigma lt- seq(0515 length=100)

5 plot(sigmaBSCall(172360800437746365sigma) type=llty=1 xlab=Sigmaylab=Black-Scholes Call Price ylim = c(006)col=bluelwd=3)grid()

abline(h=023col=redlwd=3)

Knowing that the closing price of the warrant on November 07 2008 wasHK$ 0023 which value can you infer for the implied volatility σ at thisdatelowast

Exercise 67 Forward contracts Recall that the price πt(C) of a claimpayoff C = h(ST ) of maturity T can be written as πt(C) = g(tSt) wherethe function g(tx) satisfies the Black-Scholes PDE

rg(tx) = partg

partt(tx) + rx

partg

partx(tx) + 1

2σ2x2 part

2g

partx2 (tx)

g(T x) = h(x) (1)

with terminal condition g(T x) = h(x) x gt 0

a) Assume that C is a forward contract with payoff

C = ST minusK

at time T Find the function h(x) in (1)b) Find the solution g(tx) of the above PDE and compute the price πt(C)

at time t isin [0T ]Hint search for a solution of the form g(tx) = xminus α(t) where α(t) is afunction of t to be determined

lowast Download the corresponding or the that can be runhere

234

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

BS lt- function(S K T r sig)d1 lt- (log(SK) + (r + sig^22)T) (sigsqrt(T))d2 lt- d1 - sigsqrt(T)return(Spnorm(d1) - Kexp(-rT)pnorm(d2))impliedvol lt- function(S K T r market)sig lt- 020sigup lt- 1sigdown lt- 0001count lt- 0err lt- BS(S K T r sig) - marketwhile(abs(err) gt 000001 ampamp countlt1000)if(err lt 0)sigdown lt- sigsig lt- (sigup + sig)2elsesigup lt- sigsig lt- (sigdown + sig)2err lt- BS(S K T r sig) - marketcount lt- count + 1if(count==2000)return(NA)elsereturn(sig)market = 083K = 628T = 7 365S = 634r = 002impliedvol(S K T r market)

cells [ cell_type code execution_count null metadata outputs [] source [ from IPythoncoredisplay import display HTMLn display(HTML( )) ] cell_type code execution_count null metadata collapsed true outputs [] source [ import numpy as npn import scipystats as ssn import time n n Black and Scholesn def d1(S0 K r sigma T)n return (nplog(S0K) + (r + sigma2 2) T)(sigma npsqrt(T))n n def d2(S0 K r sigma T)n return (nplog(S0 K) + (r - sigma2 2) T) (sigma npsqrt(T))n n def BlackScholes(typeS0 K r sigma T)n if type==Cn return S0 ssnormcdf(d1(S0 K r sigma T)) - K npexp(-r T) ssnormcdf(d2(S0 K r sigma T))n elsen return K npexp(-r T) ssnormcdf(-d2(S0 K r sigma T)) - S0 ssnormcdf(-d1(S0 K r sigma T)) ] cell_type code execution_count null metadata outputs [] source [ BlackScholes(C1000 1200 002 015 10) ] cell_type code execution_count null metadata outputs [] source [ def difference(x p S K r t)n return BlackScholes(CS K r x t) - p ] cell_type code execution_count null metadata outputs [] source [ from scipyoptimize import bisectn bisect(difference00011args=(11541763731112766 1000 1200 002 10)) ] ] metadata anaconda-cloud kernelspec display_name Python 3 language python name python3 language_info codemirror_mode name ipython version 3 file_extension py mimetype textx-python name python nbconvert_exporter python pygments_lexer ipython3 version 375rc1 nbformat 4 nbformat_minor 1

Black-Scholes Pricing and Hedging

c) Compute the quantityξt =

partg

partx(tSt)

of risky assets in a self-financing portfolio hedging Cd) Repeat the above questions with the terminal condition g(T x) = x

Exercise 68a) Solve the Black-Scholes PDE

rg(tx) = partg

partt(tx) + rx

partg

partx(tx) + σ2

2 x2 part2g

partx2 (tx) (634)

with terminal condition g(T x) = 1 x gt 0

Hint Try a solution of the form g(tx) = f(t) and find f(t)

b) Find the respective quantities ξt and ηt of the risky asset St and risklessasset At = ert in the portfolio with value

Vt = g(tSt) = ξtSt + ηtAt

hedging the contract with payoff $1 at maturity

Exercise 69 Log-contracts see also Exercise 84a) Solve the PDE

0 =partg

partt(x t) + rx

partg

partx(x t) + σ2

2 x2 part2g

partx2 (x t)

with the terminal condition g(xT ) = log x x gt 0

Hint Try a solution of the form g(x t) = f(t) + log x and find f(t)b) Solve the Black-Scholes PDE

rh(x t) = parth

partt(x t) + rx

parth

partx(x t) + σ2

2 x2 part2h

partx2 (x t) (635)

with the terminal condition h(xT ) = log x x gt 0

Hint Try a solution of the form h(x t) = u(t)g(x t) and find u(t)c) Find the respective quantities ξt and ηt of the risky asset St and riskless

asset At = ert in the portfolio with value

Vt = g(St t) = ξtSt + ηtAt

hedging a log-contract with payoff logST at maturity 235

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

Exercise 610 Binary options Consider a price process (St)tisinR+ given by

dStSt

= rdt+ σdBt S0 = 1

under the risk-neutral probability measure Plowast The binary (or digital) calloption is a contract with maturity T strike price K and payoff

Cd = 1[Kinfin)(ST ) =

$1 if ST gt K

0 if ST lt K

a) Derive the Black-Schole PDE satisfied by the pricing function Cd(tSt) ofthe binary call option together with its terminal condition

b) Show that the solution Cd(tx) of the Black-Scholes PDE of Question (a)is given by

Cd(tx) = eminus(Tminust)rΦ((rminus σ22)(T minus t) + log(xK)

|σ|radicT minus t

)= eminus(Tminust)rΦ

(dminus(T minus t)

)

where

dminus(T minus t) =(rminus σ22)(T minus t) + log(StK)

|σ|radicT minus t

0 6 t lt T

Exercise 611

a) Bachelier (1900) model Solve the stochastic differential equation

dSt = αStdt+ σdBt (636)

in terms of ασ isin R and the initial condition S0b) Write down the Bachelier PDE satisfied by the function C(tx) where

C(tSt) is the price at time t isin [0T ] of the contingent claim with payoffφ(ST ) = exp(ST ) and identify the process Delta (ξt)tisin[0T ] that hedgesthis claim

c) Solve the Black-Scholes PDE of Question (b) with the terminal conditionφ(x) = ex x isin R

Hint Search for a solution of the form

C(tx) = exp(minus(T minus t)r+ xh(t) +

σ2

4r (h2(t)minus 1)

) (637)

where h(t) is a function to be determined with h(T ) = 1

236

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

d) Compute the portfolio strategy (ξt ηt)tisin[0T ] that hedges the contingentclaim with payoff exp(ST )

Exercise 612

a) Show that for every fixed value of S the function

d 7minusrarr h(S d) = SΦ(d+ |σ|

radicT)minusK eminusrTΦ(d)

reaches its maximum at dlowast(S) =log(SK) + (rminus σ22)T

|σ|radicT

b) By the differentiation rule

d

dSh(S dlowast(S)) =

parth

partS(S dlowast(S)) + dprimelowast(S)

parth

partd(S dlowast(S))

recover the value of the Black-Scholes Delta

Exercise 613 Compute the Black-Scholes Vega by differentiation of theBlack-Scholes function

gc(tx) = Bl(Kxσ rT minus t) = xΦ(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)

with respect to the volatility parameter σ knowing that

minus12(dminus(T minus t)

)2= minus1

2

(log(xK) + (rminus σ22)(T minus t)

|σ|radicT minus t

)2

= minus12(d+(T minus t)

)2+ (T minus t)r+ log x

K (638)

Exercise 614 Consider the backward induction relation (313) ie

v(tx) = (1minus plowastN )v (t+ 1x(1 + aN )) + plowastN v (t+ 1x(1 + bN ))

using the renormalizations rN = rTN and

aN = (1 + rN )(1minus |σ|radicTN)minus 1 bN = (1 + rN )(1 + |σ|

radicTN)minus 1

of Section 36 N gt 1 with

plowastN =rN minus aNbN minus aN

and plowastN =bN minus rNbN minus aN

a) Show that the Black-Scholes PDE (62) of Proposition 61 can be recoveredfrom the induction relation (313) when the number N of time steps tendsto infinity

237

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

b) Show that the expression of the Delta ξt =partgcpartx

(tSt) can be similarlyrecovered from the finite difference relation (319) ie

ξ(1)t (Stminus1) =

v (t (1 + bN )Stminus1)minus v (t (1 + aN )Stminus1)

Stminus1(bN minus aN )

as N tends to infinity

Problem 615 (Leung and Sircar (2015)) ProShares Ultra SampP500 andProShares UltraShort SampP500 are leveraged investment funds that seek dailyinvestment results before fees and expenses that correspond to β times (βx)the daily performance of the SampP500reg with respectively β = 2 for ProSharesUltra and β = minus2 for ProShares UltraShort Here leveraging with a factorβ 1 aims at multiplying the potential return of an investment by a factorβ The following 10 questions are interdependent and should be treated insequence

a) Consider a risky asset priced S0 = $4 at time t = 0 and taking twopossible values S1 = $5 and S1 = $2 at time t = 1 Compute the twopossible returns (in ) achieved when investing $4 in one share of the assetS and the expected return under the risk-neutral probability measureassuming that the risk-free interest rate is zero

b) Leveraging Still based on an initial $4 investment we decide to leverageby a factor β = 3 by borrowing another (β minus 1) times $4 = 2times $4 at ratezero to purchase a total of β = 3 shares of the asset S Compute thetwo returns (in ) possibly achieved in this case and the expected returnunder the risk-neutral probability measure assuming that the risk-freeinterest rate is zero

c) Denoting by Ft the ProShares value at time t how much should the fundinvest in the underlying asset priced St and how much $ should it borrowor save on the risk-free market at any time t in order to leverage with afactor β 1

d) Find the portfolio allocation (ξt ηt) for the fund value

Ft = ξtSt + ηtAt t isin R+

according to Question (c) where At = A0 ert is the riskless money marketaccount

e) We choose to model the SampP500 index St as the geometric Brownianmotion

dSt = rStdt+ σStdBt t isin R+

under the risk-neutral probability measure Plowast Find the stochastic dif-ferential equation satisfied by (Ft)tisinR+ under the self-financing conditiondFt = ξtdSt + ηtdAt

238

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

f) Is the discounted fund value ( eminusrtFt)tisinR+ a martingale under the risk-neutral probability measure Plowast

g) Find the relation between the fund value Ft and the index St by solvingthe stochastic differential equation obtained for Ft in Question (e) Forsimplicity we normalize F0 = Sβ0

h) Write the price at time t = 0 of the call option with payoff (FT minusK)+ onthe ProShares index using the Black-Scholes formula

i) Show that when β gt 0 the Delta at time t isin [0T ) of the call optionwith payoff (FT minusK)+ on ProShares Ultra is equal to the Delta of thecall option with payoff (ST minusKβ(t))

+ on the SampP500 for a certain strikeprice Kβ(t) to be determined explicitly

j) When β lt 0 find the relation between the Delta at time t isin [0T ) ofthe call option with payoff (FT minusK)+ on ProShares UltraShort and theDelta of the put option with payoff (Kβ(t)minus ST )+ on the SampP500

239

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

  1. pbsARFix223
  2. pbsARFix224
  3. pbsARFix225
  4. pbsARFix226
  5. pbsARFix227
  6. pbsARFix228
  7. pbsARFix229
  8. pbsARFix230
  9. fdrm1
  10. pbsARFix231
  11. 100
  12. 101
  13. 102
  14. 103
  15. 104
  16. 105
  17. 106
  18. 107
  19. 108
  20. 109
  21. 1010
  22. 1011
  23. 1012
  24. 1013
  25. 1014
  26. 1015
  27. 1016
  28. 1017
  29. 1018
  30. 1019
  31. anm10
  32. 10EndLeft
  33. 10StepLeft
  34. 10PauseLeft
  35. 10PlayLeft
  36. 10PlayPauseLeft
  37. 10PauseRight
  38. 10PlayRight
  39. 10PlayPauseRight
  40. 10StepRight
  41. 10EndRight
  42. 10Minus
  43. 10Reset
  44. 10Plus
  45. pbsARFix232
  46. pbsARFix233
  47. pbsARFix234
  48. pbsARFix235
  49. pbsARFix236
  50. pbsARFix237
  51. fdrm2
  52. 110
  53. 111
  54. 112
  55. 113
  56. 114
  57. 115
  58. 116
  59. 117
  60. 118
  61. 119
  62. 1110
  63. 1111
  64. 1112
  65. 1113
  66. 1114
  67. 1115
  68. 1116
  69. 1117
  70. 1118
  71. 1119
  72. anm11
  73. 11EndLeft
  74. 11StepLeft
  75. 11PauseLeft
  76. 11PlayLeft
  77. 11PlayPauseLeft
  78. 11PauseRight
  79. 11PlayRight
  80. 11PlayPauseRight
  81. 11StepRight
  82. 11EndRight
  83. 11Minus
  84. 11Reset
  85. 11Plus
  86. pbsARFix238
  87. pbsARFix239
  88. pbsARFix240
  89. pbsARFix241
  90. pbsARFix242
  91. 120
  92. 121
  93. 122
  94. 123
  95. 124
  96. 125
  97. 126
  98. 127
  99. 128
  100. 129
  101. 1210
  102. anm12
  103. 12EndLeft
  104. 12StepLeft
  105. 12PauseLeft
  106. 12PlayLeft
  107. 12PlayPauseLeft
  108. 12PauseRight
  109. 12PlayRight
  110. 12PlayPauseRight
  111. 12StepRight
  112. 12EndRight
  113. 12Minus
  114. 12Reset
  115. 12Plus
  116. 130
  117. 131
  118. 132
  119. 133
  120. 134
  121. 135
  122. 136
  123. 137
  124. 138
  125. 139
  126. 1310
  127. anm13
  128. 13EndLeft
  129. 13StepLeft
  130. 13PauseLeft
  131. 13PlayLeft
  132. 13PlayPauseLeft
  133. 13PauseRight
  134. 13PlayRight
  135. 13PlayPauseRight
  136. 13StepRight
  137. 13EndRight
  138. 13Minus
  139. 13Reset
  140. 13Plus
  141. pbsARFix243
  142. pbsARFix244
  143. pbsARFix245
  144. pbsARFix246
  145. 140
  146. 141
  147. 142
  148. 143
  149. 144
  150. 145
  151. 146
  152. 147
  153. 148
  154. 149
  155. 1410
  156. 1411
  157. 1412
  158. 1413
  159. 1414
  160. 1415
  161. 1416
  162. 1417
  163. 1418
  164. 1419
  165. 1420
  166. 1421
  167. 1422
  168. 1423
  169. 1424
  170. 1425
  171. 1426
  172. 1427
  173. 1428
  174. 1429
  175. 1430
  176. 1431
  177. 1432
  178. 1433
  179. 1434
  180. 1435
  181. 1436
  182. 1437
  183. 1438
  184. 1439
  185. 1440
  186. 1441
  187. 1442
  188. 1443
  189. 1444
  190. 1445
  191. 1446
  192. 1447
  193. 1448
  194. 1449
  195. 1450
  196. 1451
  197. 1452
  198. 1453
  199. 1454
  200. 1455
  201. 1456
  202. 1457
  203. 1458
  204. 1459
  205. 1460
  206. 1461
  207. 1462
  208. 1463
  209. 1464
  210. 1465
  211. 1466
  212. 1467
  213. 1468
  214. 1469
  215. 1470
  216. 1471
  217. 1472
  218. 1473
  219. 1474
  220. 1475
  221. 1476
  222. 1477
  223. 1478
  224. 1479
  225. 1480
  226. 1481
  227. 1482
  228. 1483
  229. 1484
  230. 1485
  231. 1486
  232. 1487
  233. 1488
  234. 1489
  235. 1490
  236. 1491
  237. 1492
  238. 1493
  239. 1494
  240. 1495
  241. 1496
  242. 1497
  243. 1498
  244. 1499
  245. 14100
  246. 14101
  247. 14102
  248. 14103
  249. 14104
  250. 14105
  251. 14106
  252. 14107
  253. 14108
  254. 14109
  255. 14110
  256. 14111
  257. 14112
  258. 14113
  259. 14114
  260. 14115
  261. 14116
  262. 14117
  263. 14118
  264. 14119
  265. 14120
  266. 14121
  267. 14122
  268. 14123
  269. 14124
  270. 14125
  271. 14126
  272. 14127
  273. 14128
  274. 14129
  275. 14130
  276. 14131
  277. 14132
  278. 14133
  279. 14134
  280. 14135
  281. 14136
  282. 14137
  283. 14138
  284. 14139
  285. 14140
  286. 14141
  287. 14142
  288. 14143
  289. 14144
  290. 14145
  291. 14146
  292. 14147
  293. 14148
  294. 14149
  295. 14150
  296. 14151
  297. 14152
  298. 14153
  299. 14154
  300. 14155
  301. 14156
  302. 14157
  303. 14158
  304. 14159
  305. 14160
  306. 14161
  307. 14162
  308. 14163
  309. 14164
  310. 14165
  311. 14166
  312. 14167
  313. 14168
  314. 14169
  315. 14170
  316. 14171
  317. 14172
  318. 14173
  319. 14174
  320. 14175
  321. 14176
  322. 14177
  323. 14178
  324. 14179
  325. 14180
  326. 14181
  327. 14182
  328. 14183
  329. 14184
  330. 14185
  331. 14186
  332. 14187
  333. 14188
  334. 14189
  335. 14190
  336. 14191
  337. 14192
  338. 14193
  339. 14194
  340. 14195
  341. 14196
  342. 14197
  343. anm14
  344. 14EndLeft
  345. 14StepLeft
  346. 14PauseLeft
  347. 14PlayLeft
  348. 14PlayPauseLeft
  349. 14PauseRight
  350. 14PlayRight
  351. 14PlayPauseRight
  352. 14StepRight
  353. 14EndRight
  354. 14Minus
  355. 14Reset
  356. 14Plus
  357. pbsARFix247
  358. pbsARFix248
  359. 150
  360. 151
  361. 152
  362. 153
  363. 154
  364. 155
  365. 156
  366. 157
  367. 158
  368. 159
  369. 1510
  370. 1511
  371. 1512
  372. 1513
  373. 1514
  374. 1515
  375. 1516
  376. 1517
  377. 1518
  378. 1519
  379. anm15
  380. 15EndLeft
  381. 15StepLeft
  382. 15PauseLeft
  383. 15PlayLeft
  384. 15PlayPauseLeft
  385. 15PauseRight
  386. 15PlayRight
  387. 15PlayPauseRight
  388. 15StepRight
  389. 15EndRight
  390. 15Minus
  391. 15Reset
  392. 15Plus
  393. pbsARFix249
  394. pbsARFix250
  395. pbsARFix251
  396. pbsARFix252
  397. pbsARFix253
  398. pbsARFix254
  399. pbsARFix255
  400. pbsARFix256
  401. pbsARFix257
  402. pbsARFix258
  403. pbsARFix259
  404. pbsARFix260
  405. pbsARFix261
Page 30: Black-ScholesPricingandHedging - NTU · to the Black-Scholes PDE (6.2) in order to price a claim payoff Cof the formC= h(S T).Asinthediscrete-timecase,thearbitragepriceπt(C) at

N Privault

minusK eminus(Tminust)rwinfinminusdminus(Tminust)

radicTminust

eminusz2(2(Tminust)) dzradic2(T minus t)π

= xwinfinminusdminus(Tminust)

radicTminustminus(Tminust)|σ|

eminusz2(2(Tminust)) dzradic2(T minus t)π

minusK eminus(Tminust)rwinfinminusdminus(Tminust)

radicTminust

eminusz2(2(Tminust)) dzradic2(T minus t)π

= xwinfinminusdminus(Tminust)minus|σ|

radicTminust

eminusz22 dzradic2πminusK eminus(Tminust)r

winfinminusdminus(Tminust)

eminusz22 dzradic2π

= x(1minusΦ

(minus d+(T minus t)

))minusK eminus(Tminust)r

(1minusΦ

(minus dminus(T minus t)

))= xΦ

(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)

where we used the relation (614) ie

1minusΦ(a) = Φ(minusa) a isin R

Exercises

Exercise 61 Bachelier (1900) model Consider a market made of a risklessasset valued At = A0 with zero interest rate t isin R+ and a risky asset whoseprice St is modeled by a standard Brownian motion as St = Bt t isin R+

a) Show that the price g(tBt) of the option with payoff C = B2T satisfies

the heat equationpartϕ

partt(t y) = minus1

2part2ϕ

party2 (t y)

with terminal condition g(T x) = x2b) Find the function g(tx) by solving the PDE of Question (a)

Hint Try a solution of the form g(tx) = x2 + f(t)

See Exercises 611 713 and 714 for extensions to nonzero interest rates

Exercise 62 Consider a risky asset price (St)tisinR modeled in the Cox et al(1985) (CIR) model as

dSt = β(αminus St)dt+ σradicStdBt αβσ gt 0 (631)

and let (ηt ξt)tisinR+ be a portfolio strategy whose value Vt = ηtAt + ξtSttakes the form Vt = g(tSt) t isin R+ Figure 620 presents a random simula-tion of the solution to (631) with α = 0025 β = 1 and σ = 13230

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

0

1

2

3

4

5

6

7

8

0 01 02 03 04 05 06 07 08 09 1

St

t

Fig 620 Graph of the CIR short rate t 7rarr rt with α = 25 β = 1 and σ = 13

N=10000 t lt- 0(N-1) dt lt- 10Na=0025 b=2 sigma=0052 X lt- rnorm(Nmean=0sd=sqrt(dt))R lt- rep(0N)R[1]=001

for (j in 2N)R[j]=max(0R[j-1]+(a-bR[j-1])dt+sigmasqrt(R[j-1])X[j])4 plot(t R xlab = t ylab = type = l ylim = c(0002) col = blue)

Based on the self-financing condition written as

dVt = rVtdtminus rξtStdt+ ξtdSt

= rVtdtminus rξtStdt+ β(αminus St)ξtdt+ σξtradicStdBt t isin R+ (632)

derive the PDE satisfied by the function g(tx) using the Itocirc formula

Exercise 63 Black-Scholes PDE with dividends Consider a riskless as-set with price At = A0 ert t isin R+ and an underlying asset price process(St)tisinR+ modeled as

dSt = (microminus δ)Stdt+ σStdBt

where (Bt)tisinR+ is a standard Brownian motion and δ gt 0 is a continuous-time dividend rate By absence of arbitrage the payment of a dividend entailsa drop in the stock price by the same amount occuring generally on the ex-dividend date on which the purchase of the security no longer entitles theinvestor to the dividend amount The list of investors entitled to dividendpayment is consolidated on the date of record and payment is made on thepayable date

library(quantmod)2 getSymbols(0005HKfrom=2010-01-01to=SysDate()src=yahoo)

getDividends(0005HKfrom=2010-01-01to=SysDate()src=yahoo)

a) Assuming that the portfolio with value Vt = ξtSt + ηtAt at time t is self-financing and that dividends are continuously reinvested write down theportfolio variation dVt

231

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

b) Assuming that the portfolio value Vt takes the form Vt = g(tSt) at timet derive the Black-Scholes PDE for the function g(tx) with its terminalcondition

c) Compute the price at time t isin [0T ] of the European call option withstrike price K by solving the corresponding Black-Scholes PDE

d) Compute the Delta of the option

Exercise 64

a) Check that the Black-Scholes formula (610) for European call options

gc(tx) = xΦ(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)

satisfies the following boundary conditions

i) at x = 0 gc(t 0) = 0ii) at maturity t = T

gc(T x) = (xminusK)+ =

xminusK x gt K

0 x 6 K

iii) as time to maturity tends to infinity

limTrarrinfin

Bl(Kxσ rT minus t) = x t isin R+

b) Check that the Black-Scholes formula (618) for European put options

gp(tx) = K eminus(Tminust)rΦ(minus dminus(T minus t)

)minus xΦ

(minus d+(T minus t)

)satisfies the following boundary conditions

i) at x = 0 gp(t 0) = K eminus(Tminust)rii) as x tends to infinity gp(tinfin) = 0 for all t isin [0T )iii) at maturity t = T

gp(T x) = (K minus x)+ =

0 x gt K

K minus x x 6 K

iv) as time to maturity tends to infinity

limTrarrinfin

Blp(KStσ rT minus t) = 0 t isin R+

Exercise 65 Power option (Exercise 314 continued)

232

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

a) Solve the Black-Scholes PDE

rg(x t) = partg

partt(x t) + rx

partg

partx(x t) + σ2

2 x2 part2g

partx2 (x t) (633)

with terminal condition g(xT ) = x2 x gt 0 t isin [0T ]

Hint Try a solution of the form g(x t) = x2f(t) and find f(t)b) Find the respective quantities ξt and ηt of the risky asset St and riskless

asset At = ert in the portfolio with value

Vt = g(St t) = ξtSt + ηtAt 0 6 t 6 T

hedging the contract with payoff S2T at maturity

Exercise 66 On December 18 2007 a call warrant has been issued byFortis Bank on the stock price S of the MTR Corporation with maturityT = 23122008 strike price K = HK$ 3608 and entitlement ratio=10Recall that in the Black-Scholes model the price at time t of the Europeanclaim on the underlying asset priced St with strike price K maturity T interest rate r and volatility σ gt 0 is given by the Black-Scholes formula as

f(tSt) = StΦ(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)

wheredminus(T minus t) =

(rminus σ22)(T minus t) + log(StK)

|σ|radicT minus t

d+(T minus t) = dminus(T minus t) + |σ|radicT minus t = (r+ σ22)(T minus t) + log(StK)

|σ|radicT minus t

Recall that by Proposition 64 we have

partf

partx(tSt) = Φ

(d+(T minus t)

) 0 6 t 6 T

a) Using the values of the Gaussian cumulative distribution function com-pute the Black-Scholes price of the corresponding call option at timet =November 07 2008 with St = HK$ 17200 assuming a volatility σ =90 = 090 and an annual risk-free interest rate r = 4377 = 004377

b) Still using the Gaussian cumulative distribution function compute thequantity of the risky asset required in your portfolio at time t =November07 2008 in order to hedge one such option at maturity T = 23122008

c) Figure 1 represents the Black-Scholes price of the call option as a functionof σ isin [05 15] = [50 150]

233

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

0

01

02

03

04

05

06

05 06 07 08 09 1 11 12 13 14 15σimp

Optio

n pr

ice

σ

Market price

Fig 621 Option price as a function of the volatility σ gt 0

1 BSCall lt- function(S K r T sigma)d1 lt- (log(SK)+(r+sigma^22)T)(sigmasqrt(T))d2 lt- d1 - sigma sqrt(T)

3 BSCall = Spnorm(d1) - Kexp(-rT)pnorm(d2)BSCallsigma lt- seq(0515 length=100)

5 plot(sigmaBSCall(172360800437746365sigma) type=llty=1 xlab=Sigmaylab=Black-Scholes Call Price ylim = c(006)col=bluelwd=3)grid()

abline(h=023col=redlwd=3)

Knowing that the closing price of the warrant on November 07 2008 wasHK$ 0023 which value can you infer for the implied volatility σ at thisdatelowast

Exercise 67 Forward contracts Recall that the price πt(C) of a claimpayoff C = h(ST ) of maturity T can be written as πt(C) = g(tSt) wherethe function g(tx) satisfies the Black-Scholes PDE

rg(tx) = partg

partt(tx) + rx

partg

partx(tx) + 1

2σ2x2 part

2g

partx2 (tx)

g(T x) = h(x) (1)

with terminal condition g(T x) = h(x) x gt 0

a) Assume that C is a forward contract with payoff

C = ST minusK

at time T Find the function h(x) in (1)b) Find the solution g(tx) of the above PDE and compute the price πt(C)

at time t isin [0T ]Hint search for a solution of the form g(tx) = xminus α(t) where α(t) is afunction of t to be determined

lowast Download the corresponding or the that can be runhere

234

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

BS lt- function(S K T r sig)d1 lt- (log(SK) + (r + sig^22)T) (sigsqrt(T))d2 lt- d1 - sigsqrt(T)return(Spnorm(d1) - Kexp(-rT)pnorm(d2))impliedvol lt- function(S K T r market)sig lt- 020sigup lt- 1sigdown lt- 0001count lt- 0err lt- BS(S K T r sig) - marketwhile(abs(err) gt 000001 ampamp countlt1000)if(err lt 0)sigdown lt- sigsig lt- (sigup + sig)2elsesigup lt- sigsig lt- (sigdown + sig)2err lt- BS(S K T r sig) - marketcount lt- count + 1if(count==2000)return(NA)elsereturn(sig)market = 083K = 628T = 7 365S = 634r = 002impliedvol(S K T r market)

cells [ cell_type code execution_count null metadata outputs [] source [ from IPythoncoredisplay import display HTMLn display(HTML( )) ] cell_type code execution_count null metadata collapsed true outputs [] source [ import numpy as npn import scipystats as ssn import time n n Black and Scholesn def d1(S0 K r sigma T)n return (nplog(S0K) + (r + sigma2 2) T)(sigma npsqrt(T))n n def d2(S0 K r sigma T)n return (nplog(S0 K) + (r - sigma2 2) T) (sigma npsqrt(T))n n def BlackScholes(typeS0 K r sigma T)n if type==Cn return S0 ssnormcdf(d1(S0 K r sigma T)) - K npexp(-r T) ssnormcdf(d2(S0 K r sigma T))n elsen return K npexp(-r T) ssnormcdf(-d2(S0 K r sigma T)) - S0 ssnormcdf(-d1(S0 K r sigma T)) ] cell_type code execution_count null metadata outputs [] source [ BlackScholes(C1000 1200 002 015 10) ] cell_type code execution_count null metadata outputs [] source [ def difference(x p S K r t)n return BlackScholes(CS K r x t) - p ] cell_type code execution_count null metadata outputs [] source [ from scipyoptimize import bisectn bisect(difference00011args=(11541763731112766 1000 1200 002 10)) ] ] metadata anaconda-cloud kernelspec display_name Python 3 language python name python3 language_info codemirror_mode name ipython version 3 file_extension py mimetype textx-python name python nbconvert_exporter python pygments_lexer ipython3 version 375rc1 nbformat 4 nbformat_minor 1

Black-Scholes Pricing and Hedging

c) Compute the quantityξt =

partg

partx(tSt)

of risky assets in a self-financing portfolio hedging Cd) Repeat the above questions with the terminal condition g(T x) = x

Exercise 68a) Solve the Black-Scholes PDE

rg(tx) = partg

partt(tx) + rx

partg

partx(tx) + σ2

2 x2 part2g

partx2 (tx) (634)

with terminal condition g(T x) = 1 x gt 0

Hint Try a solution of the form g(tx) = f(t) and find f(t)

b) Find the respective quantities ξt and ηt of the risky asset St and risklessasset At = ert in the portfolio with value

Vt = g(tSt) = ξtSt + ηtAt

hedging the contract with payoff $1 at maturity

Exercise 69 Log-contracts see also Exercise 84a) Solve the PDE

0 =partg

partt(x t) + rx

partg

partx(x t) + σ2

2 x2 part2g

partx2 (x t)

with the terminal condition g(xT ) = log x x gt 0

Hint Try a solution of the form g(x t) = f(t) + log x and find f(t)b) Solve the Black-Scholes PDE

rh(x t) = parth

partt(x t) + rx

parth

partx(x t) + σ2

2 x2 part2h

partx2 (x t) (635)

with the terminal condition h(xT ) = log x x gt 0

Hint Try a solution of the form h(x t) = u(t)g(x t) and find u(t)c) Find the respective quantities ξt and ηt of the risky asset St and riskless

asset At = ert in the portfolio with value

Vt = g(St t) = ξtSt + ηtAt

hedging a log-contract with payoff logST at maturity 235

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

Exercise 610 Binary options Consider a price process (St)tisinR+ given by

dStSt

= rdt+ σdBt S0 = 1

under the risk-neutral probability measure Plowast The binary (or digital) calloption is a contract with maturity T strike price K and payoff

Cd = 1[Kinfin)(ST ) =

$1 if ST gt K

0 if ST lt K

a) Derive the Black-Schole PDE satisfied by the pricing function Cd(tSt) ofthe binary call option together with its terminal condition

b) Show that the solution Cd(tx) of the Black-Scholes PDE of Question (a)is given by

Cd(tx) = eminus(Tminust)rΦ((rminus σ22)(T minus t) + log(xK)

|σ|radicT minus t

)= eminus(Tminust)rΦ

(dminus(T minus t)

)

where

dminus(T minus t) =(rminus σ22)(T minus t) + log(StK)

|σ|radicT minus t

0 6 t lt T

Exercise 611

a) Bachelier (1900) model Solve the stochastic differential equation

dSt = αStdt+ σdBt (636)

in terms of ασ isin R and the initial condition S0b) Write down the Bachelier PDE satisfied by the function C(tx) where

C(tSt) is the price at time t isin [0T ] of the contingent claim with payoffφ(ST ) = exp(ST ) and identify the process Delta (ξt)tisin[0T ] that hedgesthis claim

c) Solve the Black-Scholes PDE of Question (b) with the terminal conditionφ(x) = ex x isin R

Hint Search for a solution of the form

C(tx) = exp(minus(T minus t)r+ xh(t) +

σ2

4r (h2(t)minus 1)

) (637)

where h(t) is a function to be determined with h(T ) = 1

236

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

d) Compute the portfolio strategy (ξt ηt)tisin[0T ] that hedges the contingentclaim with payoff exp(ST )

Exercise 612

a) Show that for every fixed value of S the function

d 7minusrarr h(S d) = SΦ(d+ |σ|

radicT)minusK eminusrTΦ(d)

reaches its maximum at dlowast(S) =log(SK) + (rminus σ22)T

|σ|radicT

b) By the differentiation rule

d

dSh(S dlowast(S)) =

parth

partS(S dlowast(S)) + dprimelowast(S)

parth

partd(S dlowast(S))

recover the value of the Black-Scholes Delta

Exercise 613 Compute the Black-Scholes Vega by differentiation of theBlack-Scholes function

gc(tx) = Bl(Kxσ rT minus t) = xΦ(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)

with respect to the volatility parameter σ knowing that

minus12(dminus(T minus t)

)2= minus1

2

(log(xK) + (rminus σ22)(T minus t)

|σ|radicT minus t

)2

= minus12(d+(T minus t)

)2+ (T minus t)r+ log x

K (638)

Exercise 614 Consider the backward induction relation (313) ie

v(tx) = (1minus plowastN )v (t+ 1x(1 + aN )) + plowastN v (t+ 1x(1 + bN ))

using the renormalizations rN = rTN and

aN = (1 + rN )(1minus |σ|radicTN)minus 1 bN = (1 + rN )(1 + |σ|

radicTN)minus 1

of Section 36 N gt 1 with

plowastN =rN minus aNbN minus aN

and plowastN =bN minus rNbN minus aN

a) Show that the Black-Scholes PDE (62) of Proposition 61 can be recoveredfrom the induction relation (313) when the number N of time steps tendsto infinity

237

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

b) Show that the expression of the Delta ξt =partgcpartx

(tSt) can be similarlyrecovered from the finite difference relation (319) ie

ξ(1)t (Stminus1) =

v (t (1 + bN )Stminus1)minus v (t (1 + aN )Stminus1)

Stminus1(bN minus aN )

as N tends to infinity

Problem 615 (Leung and Sircar (2015)) ProShares Ultra SampP500 andProShares UltraShort SampP500 are leveraged investment funds that seek dailyinvestment results before fees and expenses that correspond to β times (βx)the daily performance of the SampP500reg with respectively β = 2 for ProSharesUltra and β = minus2 for ProShares UltraShort Here leveraging with a factorβ 1 aims at multiplying the potential return of an investment by a factorβ The following 10 questions are interdependent and should be treated insequence

a) Consider a risky asset priced S0 = $4 at time t = 0 and taking twopossible values S1 = $5 and S1 = $2 at time t = 1 Compute the twopossible returns (in ) achieved when investing $4 in one share of the assetS and the expected return under the risk-neutral probability measureassuming that the risk-free interest rate is zero

b) Leveraging Still based on an initial $4 investment we decide to leverageby a factor β = 3 by borrowing another (β minus 1) times $4 = 2times $4 at ratezero to purchase a total of β = 3 shares of the asset S Compute thetwo returns (in ) possibly achieved in this case and the expected returnunder the risk-neutral probability measure assuming that the risk-freeinterest rate is zero

c) Denoting by Ft the ProShares value at time t how much should the fundinvest in the underlying asset priced St and how much $ should it borrowor save on the risk-free market at any time t in order to leverage with afactor β 1

d) Find the portfolio allocation (ξt ηt) for the fund value

Ft = ξtSt + ηtAt t isin R+

according to Question (c) where At = A0 ert is the riskless money marketaccount

e) We choose to model the SampP500 index St as the geometric Brownianmotion

dSt = rStdt+ σStdBt t isin R+

under the risk-neutral probability measure Plowast Find the stochastic dif-ferential equation satisfied by (Ft)tisinR+ under the self-financing conditiondFt = ξtdSt + ηtdAt

238

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

f) Is the discounted fund value ( eminusrtFt)tisinR+ a martingale under the risk-neutral probability measure Plowast

g) Find the relation between the fund value Ft and the index St by solvingthe stochastic differential equation obtained for Ft in Question (e) Forsimplicity we normalize F0 = Sβ0

h) Write the price at time t = 0 of the call option with payoff (FT minusK)+ onthe ProShares index using the Black-Scholes formula

i) Show that when β gt 0 the Delta at time t isin [0T ) of the call optionwith payoff (FT minusK)+ on ProShares Ultra is equal to the Delta of thecall option with payoff (ST minusKβ(t))

+ on the SampP500 for a certain strikeprice Kβ(t) to be determined explicitly

j) When β lt 0 find the relation between the Delta at time t isin [0T ) ofthe call option with payoff (FT minusK)+ on ProShares UltraShort and theDelta of the put option with payoff (Kβ(t)minus ST )+ on the SampP500

239

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

  1. pbsARFix223
  2. pbsARFix224
  3. pbsARFix225
  4. pbsARFix226
  5. pbsARFix227
  6. pbsARFix228
  7. pbsARFix229
  8. pbsARFix230
  9. fdrm1
  10. pbsARFix231
  11. 100
  12. 101
  13. 102
  14. 103
  15. 104
  16. 105
  17. 106
  18. 107
  19. 108
  20. 109
  21. 1010
  22. 1011
  23. 1012
  24. 1013
  25. 1014
  26. 1015
  27. 1016
  28. 1017
  29. 1018
  30. 1019
  31. anm10
  32. 10EndLeft
  33. 10StepLeft
  34. 10PauseLeft
  35. 10PlayLeft
  36. 10PlayPauseLeft
  37. 10PauseRight
  38. 10PlayRight
  39. 10PlayPauseRight
  40. 10StepRight
  41. 10EndRight
  42. 10Minus
  43. 10Reset
  44. 10Plus
  45. pbsARFix232
  46. pbsARFix233
  47. pbsARFix234
  48. pbsARFix235
  49. pbsARFix236
  50. pbsARFix237
  51. fdrm2
  52. 110
  53. 111
  54. 112
  55. 113
  56. 114
  57. 115
  58. 116
  59. 117
  60. 118
  61. 119
  62. 1110
  63. 1111
  64. 1112
  65. 1113
  66. 1114
  67. 1115
  68. 1116
  69. 1117
  70. 1118
  71. 1119
  72. anm11
  73. 11EndLeft
  74. 11StepLeft
  75. 11PauseLeft
  76. 11PlayLeft
  77. 11PlayPauseLeft
  78. 11PauseRight
  79. 11PlayRight
  80. 11PlayPauseRight
  81. 11StepRight
  82. 11EndRight
  83. 11Minus
  84. 11Reset
  85. 11Plus
  86. pbsARFix238
  87. pbsARFix239
  88. pbsARFix240
  89. pbsARFix241
  90. pbsARFix242
  91. 120
  92. 121
  93. 122
  94. 123
  95. 124
  96. 125
  97. 126
  98. 127
  99. 128
  100. 129
  101. 1210
  102. anm12
  103. 12EndLeft
  104. 12StepLeft
  105. 12PauseLeft
  106. 12PlayLeft
  107. 12PlayPauseLeft
  108. 12PauseRight
  109. 12PlayRight
  110. 12PlayPauseRight
  111. 12StepRight
  112. 12EndRight
  113. 12Minus
  114. 12Reset
  115. 12Plus
  116. 130
  117. 131
  118. 132
  119. 133
  120. 134
  121. 135
  122. 136
  123. 137
  124. 138
  125. 139
  126. 1310
  127. anm13
  128. 13EndLeft
  129. 13StepLeft
  130. 13PauseLeft
  131. 13PlayLeft
  132. 13PlayPauseLeft
  133. 13PauseRight
  134. 13PlayRight
  135. 13PlayPauseRight
  136. 13StepRight
  137. 13EndRight
  138. 13Minus
  139. 13Reset
  140. 13Plus
  141. pbsARFix243
  142. pbsARFix244
  143. pbsARFix245
  144. pbsARFix246
  145. 140
  146. 141
  147. 142
  148. 143
  149. 144
  150. 145
  151. 146
  152. 147
  153. 148
  154. 149
  155. 1410
  156. 1411
  157. 1412
  158. 1413
  159. 1414
  160. 1415
  161. 1416
  162. 1417
  163. 1418
  164. 1419
  165. 1420
  166. 1421
  167. 1422
  168. 1423
  169. 1424
  170. 1425
  171. 1426
  172. 1427
  173. 1428
  174. 1429
  175. 1430
  176. 1431
  177. 1432
  178. 1433
  179. 1434
  180. 1435
  181. 1436
  182. 1437
  183. 1438
  184. 1439
  185. 1440
  186. 1441
  187. 1442
  188. 1443
  189. 1444
  190. 1445
  191. 1446
  192. 1447
  193. 1448
  194. 1449
  195. 1450
  196. 1451
  197. 1452
  198. 1453
  199. 1454
  200. 1455
  201. 1456
  202. 1457
  203. 1458
  204. 1459
  205. 1460
  206. 1461
  207. 1462
  208. 1463
  209. 1464
  210. 1465
  211. 1466
  212. 1467
  213. 1468
  214. 1469
  215. 1470
  216. 1471
  217. 1472
  218. 1473
  219. 1474
  220. 1475
  221. 1476
  222. 1477
  223. 1478
  224. 1479
  225. 1480
  226. 1481
  227. 1482
  228. 1483
  229. 1484
  230. 1485
  231. 1486
  232. 1487
  233. 1488
  234. 1489
  235. 1490
  236. 1491
  237. 1492
  238. 1493
  239. 1494
  240. 1495
  241. 1496
  242. 1497
  243. 1498
  244. 1499
  245. 14100
  246. 14101
  247. 14102
  248. 14103
  249. 14104
  250. 14105
  251. 14106
  252. 14107
  253. 14108
  254. 14109
  255. 14110
  256. 14111
  257. 14112
  258. 14113
  259. 14114
  260. 14115
  261. 14116
  262. 14117
  263. 14118
  264. 14119
  265. 14120
  266. 14121
  267. 14122
  268. 14123
  269. 14124
  270. 14125
  271. 14126
  272. 14127
  273. 14128
  274. 14129
  275. 14130
  276. 14131
  277. 14132
  278. 14133
  279. 14134
  280. 14135
  281. 14136
  282. 14137
  283. 14138
  284. 14139
  285. 14140
  286. 14141
  287. 14142
  288. 14143
  289. 14144
  290. 14145
  291. 14146
  292. 14147
  293. 14148
  294. 14149
  295. 14150
  296. 14151
  297. 14152
  298. 14153
  299. 14154
  300. 14155
  301. 14156
  302. 14157
  303. 14158
  304. 14159
  305. 14160
  306. 14161
  307. 14162
  308. 14163
  309. 14164
  310. 14165
  311. 14166
  312. 14167
  313. 14168
  314. 14169
  315. 14170
  316. 14171
  317. 14172
  318. 14173
  319. 14174
  320. 14175
  321. 14176
  322. 14177
  323. 14178
  324. 14179
  325. 14180
  326. 14181
  327. 14182
  328. 14183
  329. 14184
  330. 14185
  331. 14186
  332. 14187
  333. 14188
  334. 14189
  335. 14190
  336. 14191
  337. 14192
  338. 14193
  339. 14194
  340. 14195
  341. 14196
  342. 14197
  343. anm14
  344. 14EndLeft
  345. 14StepLeft
  346. 14PauseLeft
  347. 14PlayLeft
  348. 14PlayPauseLeft
  349. 14PauseRight
  350. 14PlayRight
  351. 14PlayPauseRight
  352. 14StepRight
  353. 14EndRight
  354. 14Minus
  355. 14Reset
  356. 14Plus
  357. pbsARFix247
  358. pbsARFix248
  359. 150
  360. 151
  361. 152
  362. 153
  363. 154
  364. 155
  365. 156
  366. 157
  367. 158
  368. 159
  369. 1510
  370. 1511
  371. 1512
  372. 1513
  373. 1514
  374. 1515
  375. 1516
  376. 1517
  377. 1518
  378. 1519
  379. anm15
  380. 15EndLeft
  381. 15StepLeft
  382. 15PauseLeft
  383. 15PlayLeft
  384. 15PlayPauseLeft
  385. 15PauseRight
  386. 15PlayRight
  387. 15PlayPauseRight
  388. 15StepRight
  389. 15EndRight
  390. 15Minus
  391. 15Reset
  392. 15Plus
  393. pbsARFix249
  394. pbsARFix250
  395. pbsARFix251
  396. pbsARFix252
  397. pbsARFix253
  398. pbsARFix254
  399. pbsARFix255
  400. pbsARFix256
  401. pbsARFix257
  402. pbsARFix258
  403. pbsARFix259
  404. pbsARFix260
  405. pbsARFix261
Page 31: Black-ScholesPricingandHedging - NTU · to the Black-Scholes PDE (6.2) in order to price a claim payoff Cof the formC= h(S T).Asinthediscrete-timecase,thearbitragepriceπt(C) at

Black-Scholes Pricing and Hedging

0

1

2

3

4

5

6

7

8

0 01 02 03 04 05 06 07 08 09 1

St

t

Fig 620 Graph of the CIR short rate t 7rarr rt with α = 25 β = 1 and σ = 13

N=10000 t lt- 0(N-1) dt lt- 10Na=0025 b=2 sigma=0052 X lt- rnorm(Nmean=0sd=sqrt(dt))R lt- rep(0N)R[1]=001

for (j in 2N)R[j]=max(0R[j-1]+(a-bR[j-1])dt+sigmasqrt(R[j-1])X[j])4 plot(t R xlab = t ylab = type = l ylim = c(0002) col = blue)

Based on the self-financing condition written as

dVt = rVtdtminus rξtStdt+ ξtdSt

= rVtdtminus rξtStdt+ β(αminus St)ξtdt+ σξtradicStdBt t isin R+ (632)

derive the PDE satisfied by the function g(tx) using the Itocirc formula

Exercise 63 Black-Scholes PDE with dividends Consider a riskless as-set with price At = A0 ert t isin R+ and an underlying asset price process(St)tisinR+ modeled as

dSt = (microminus δ)Stdt+ σStdBt

where (Bt)tisinR+ is a standard Brownian motion and δ gt 0 is a continuous-time dividend rate By absence of arbitrage the payment of a dividend entailsa drop in the stock price by the same amount occuring generally on the ex-dividend date on which the purchase of the security no longer entitles theinvestor to the dividend amount The list of investors entitled to dividendpayment is consolidated on the date of record and payment is made on thepayable date

library(quantmod)2 getSymbols(0005HKfrom=2010-01-01to=SysDate()src=yahoo)

getDividends(0005HKfrom=2010-01-01to=SysDate()src=yahoo)

a) Assuming that the portfolio with value Vt = ξtSt + ηtAt at time t is self-financing and that dividends are continuously reinvested write down theportfolio variation dVt

231

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

b) Assuming that the portfolio value Vt takes the form Vt = g(tSt) at timet derive the Black-Scholes PDE for the function g(tx) with its terminalcondition

c) Compute the price at time t isin [0T ] of the European call option withstrike price K by solving the corresponding Black-Scholes PDE

d) Compute the Delta of the option

Exercise 64

a) Check that the Black-Scholes formula (610) for European call options

gc(tx) = xΦ(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)

satisfies the following boundary conditions

i) at x = 0 gc(t 0) = 0ii) at maturity t = T

gc(T x) = (xminusK)+ =

xminusK x gt K

0 x 6 K

iii) as time to maturity tends to infinity

limTrarrinfin

Bl(Kxσ rT minus t) = x t isin R+

b) Check that the Black-Scholes formula (618) for European put options

gp(tx) = K eminus(Tminust)rΦ(minus dminus(T minus t)

)minus xΦ

(minus d+(T minus t)

)satisfies the following boundary conditions

i) at x = 0 gp(t 0) = K eminus(Tminust)rii) as x tends to infinity gp(tinfin) = 0 for all t isin [0T )iii) at maturity t = T

gp(T x) = (K minus x)+ =

0 x gt K

K minus x x 6 K

iv) as time to maturity tends to infinity

limTrarrinfin

Blp(KStσ rT minus t) = 0 t isin R+

Exercise 65 Power option (Exercise 314 continued)

232

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

a) Solve the Black-Scholes PDE

rg(x t) = partg

partt(x t) + rx

partg

partx(x t) + σ2

2 x2 part2g

partx2 (x t) (633)

with terminal condition g(xT ) = x2 x gt 0 t isin [0T ]

Hint Try a solution of the form g(x t) = x2f(t) and find f(t)b) Find the respective quantities ξt and ηt of the risky asset St and riskless

asset At = ert in the portfolio with value

Vt = g(St t) = ξtSt + ηtAt 0 6 t 6 T

hedging the contract with payoff S2T at maturity

Exercise 66 On December 18 2007 a call warrant has been issued byFortis Bank on the stock price S of the MTR Corporation with maturityT = 23122008 strike price K = HK$ 3608 and entitlement ratio=10Recall that in the Black-Scholes model the price at time t of the Europeanclaim on the underlying asset priced St with strike price K maturity T interest rate r and volatility σ gt 0 is given by the Black-Scholes formula as

f(tSt) = StΦ(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)

wheredminus(T minus t) =

(rminus σ22)(T minus t) + log(StK)

|σ|radicT minus t

d+(T minus t) = dminus(T minus t) + |σ|radicT minus t = (r+ σ22)(T minus t) + log(StK)

|σ|radicT minus t

Recall that by Proposition 64 we have

partf

partx(tSt) = Φ

(d+(T minus t)

) 0 6 t 6 T

a) Using the values of the Gaussian cumulative distribution function com-pute the Black-Scholes price of the corresponding call option at timet =November 07 2008 with St = HK$ 17200 assuming a volatility σ =90 = 090 and an annual risk-free interest rate r = 4377 = 004377

b) Still using the Gaussian cumulative distribution function compute thequantity of the risky asset required in your portfolio at time t =November07 2008 in order to hedge one such option at maturity T = 23122008

c) Figure 1 represents the Black-Scholes price of the call option as a functionof σ isin [05 15] = [50 150]

233

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

0

01

02

03

04

05

06

05 06 07 08 09 1 11 12 13 14 15σimp

Optio

n pr

ice

σ

Market price

Fig 621 Option price as a function of the volatility σ gt 0

1 BSCall lt- function(S K r T sigma)d1 lt- (log(SK)+(r+sigma^22)T)(sigmasqrt(T))d2 lt- d1 - sigma sqrt(T)

3 BSCall = Spnorm(d1) - Kexp(-rT)pnorm(d2)BSCallsigma lt- seq(0515 length=100)

5 plot(sigmaBSCall(172360800437746365sigma) type=llty=1 xlab=Sigmaylab=Black-Scholes Call Price ylim = c(006)col=bluelwd=3)grid()

abline(h=023col=redlwd=3)

Knowing that the closing price of the warrant on November 07 2008 wasHK$ 0023 which value can you infer for the implied volatility σ at thisdatelowast

Exercise 67 Forward contracts Recall that the price πt(C) of a claimpayoff C = h(ST ) of maturity T can be written as πt(C) = g(tSt) wherethe function g(tx) satisfies the Black-Scholes PDE

rg(tx) = partg

partt(tx) + rx

partg

partx(tx) + 1

2σ2x2 part

2g

partx2 (tx)

g(T x) = h(x) (1)

with terminal condition g(T x) = h(x) x gt 0

a) Assume that C is a forward contract with payoff

C = ST minusK

at time T Find the function h(x) in (1)b) Find the solution g(tx) of the above PDE and compute the price πt(C)

at time t isin [0T ]Hint search for a solution of the form g(tx) = xminus α(t) where α(t) is afunction of t to be determined

lowast Download the corresponding or the that can be runhere

234

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

BS lt- function(S K T r sig)d1 lt- (log(SK) + (r + sig^22)T) (sigsqrt(T))d2 lt- d1 - sigsqrt(T)return(Spnorm(d1) - Kexp(-rT)pnorm(d2))impliedvol lt- function(S K T r market)sig lt- 020sigup lt- 1sigdown lt- 0001count lt- 0err lt- BS(S K T r sig) - marketwhile(abs(err) gt 000001 ampamp countlt1000)if(err lt 0)sigdown lt- sigsig lt- (sigup + sig)2elsesigup lt- sigsig lt- (sigdown + sig)2err lt- BS(S K T r sig) - marketcount lt- count + 1if(count==2000)return(NA)elsereturn(sig)market = 083K = 628T = 7 365S = 634r = 002impliedvol(S K T r market)

cells [ cell_type code execution_count null metadata outputs [] source [ from IPythoncoredisplay import display HTMLn display(HTML( )) ] cell_type code execution_count null metadata collapsed true outputs [] source [ import numpy as npn import scipystats as ssn import time n n Black and Scholesn def d1(S0 K r sigma T)n return (nplog(S0K) + (r + sigma2 2) T)(sigma npsqrt(T))n n def d2(S0 K r sigma T)n return (nplog(S0 K) + (r - sigma2 2) T) (sigma npsqrt(T))n n def BlackScholes(typeS0 K r sigma T)n if type==Cn return S0 ssnormcdf(d1(S0 K r sigma T)) - K npexp(-r T) ssnormcdf(d2(S0 K r sigma T))n elsen return K npexp(-r T) ssnormcdf(-d2(S0 K r sigma T)) - S0 ssnormcdf(-d1(S0 K r sigma T)) ] cell_type code execution_count null metadata outputs [] source [ BlackScholes(C1000 1200 002 015 10) ] cell_type code execution_count null metadata outputs [] source [ def difference(x p S K r t)n return BlackScholes(CS K r x t) - p ] cell_type code execution_count null metadata outputs [] source [ from scipyoptimize import bisectn bisect(difference00011args=(11541763731112766 1000 1200 002 10)) ] ] metadata anaconda-cloud kernelspec display_name Python 3 language python name python3 language_info codemirror_mode name ipython version 3 file_extension py mimetype textx-python name python nbconvert_exporter python pygments_lexer ipython3 version 375rc1 nbformat 4 nbformat_minor 1

Black-Scholes Pricing and Hedging

c) Compute the quantityξt =

partg

partx(tSt)

of risky assets in a self-financing portfolio hedging Cd) Repeat the above questions with the terminal condition g(T x) = x

Exercise 68a) Solve the Black-Scholes PDE

rg(tx) = partg

partt(tx) + rx

partg

partx(tx) + σ2

2 x2 part2g

partx2 (tx) (634)

with terminal condition g(T x) = 1 x gt 0

Hint Try a solution of the form g(tx) = f(t) and find f(t)

b) Find the respective quantities ξt and ηt of the risky asset St and risklessasset At = ert in the portfolio with value

Vt = g(tSt) = ξtSt + ηtAt

hedging the contract with payoff $1 at maturity

Exercise 69 Log-contracts see also Exercise 84a) Solve the PDE

0 =partg

partt(x t) + rx

partg

partx(x t) + σ2

2 x2 part2g

partx2 (x t)

with the terminal condition g(xT ) = log x x gt 0

Hint Try a solution of the form g(x t) = f(t) + log x and find f(t)b) Solve the Black-Scholes PDE

rh(x t) = parth

partt(x t) + rx

parth

partx(x t) + σ2

2 x2 part2h

partx2 (x t) (635)

with the terminal condition h(xT ) = log x x gt 0

Hint Try a solution of the form h(x t) = u(t)g(x t) and find u(t)c) Find the respective quantities ξt and ηt of the risky asset St and riskless

asset At = ert in the portfolio with value

Vt = g(St t) = ξtSt + ηtAt

hedging a log-contract with payoff logST at maturity 235

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

Exercise 610 Binary options Consider a price process (St)tisinR+ given by

dStSt

= rdt+ σdBt S0 = 1

under the risk-neutral probability measure Plowast The binary (or digital) calloption is a contract with maturity T strike price K and payoff

Cd = 1[Kinfin)(ST ) =

$1 if ST gt K

0 if ST lt K

a) Derive the Black-Schole PDE satisfied by the pricing function Cd(tSt) ofthe binary call option together with its terminal condition

b) Show that the solution Cd(tx) of the Black-Scholes PDE of Question (a)is given by

Cd(tx) = eminus(Tminust)rΦ((rminus σ22)(T minus t) + log(xK)

|σ|radicT minus t

)= eminus(Tminust)rΦ

(dminus(T minus t)

)

where

dminus(T minus t) =(rminus σ22)(T minus t) + log(StK)

|σ|radicT minus t

0 6 t lt T

Exercise 611

a) Bachelier (1900) model Solve the stochastic differential equation

dSt = αStdt+ σdBt (636)

in terms of ασ isin R and the initial condition S0b) Write down the Bachelier PDE satisfied by the function C(tx) where

C(tSt) is the price at time t isin [0T ] of the contingent claim with payoffφ(ST ) = exp(ST ) and identify the process Delta (ξt)tisin[0T ] that hedgesthis claim

c) Solve the Black-Scholes PDE of Question (b) with the terminal conditionφ(x) = ex x isin R

Hint Search for a solution of the form

C(tx) = exp(minus(T minus t)r+ xh(t) +

σ2

4r (h2(t)minus 1)

) (637)

where h(t) is a function to be determined with h(T ) = 1

236

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

d) Compute the portfolio strategy (ξt ηt)tisin[0T ] that hedges the contingentclaim with payoff exp(ST )

Exercise 612

a) Show that for every fixed value of S the function

d 7minusrarr h(S d) = SΦ(d+ |σ|

radicT)minusK eminusrTΦ(d)

reaches its maximum at dlowast(S) =log(SK) + (rminus σ22)T

|σ|radicT

b) By the differentiation rule

d

dSh(S dlowast(S)) =

parth

partS(S dlowast(S)) + dprimelowast(S)

parth

partd(S dlowast(S))

recover the value of the Black-Scholes Delta

Exercise 613 Compute the Black-Scholes Vega by differentiation of theBlack-Scholes function

gc(tx) = Bl(Kxσ rT minus t) = xΦ(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)

with respect to the volatility parameter σ knowing that

minus12(dminus(T minus t)

)2= minus1

2

(log(xK) + (rminus σ22)(T minus t)

|σ|radicT minus t

)2

= minus12(d+(T minus t)

)2+ (T minus t)r+ log x

K (638)

Exercise 614 Consider the backward induction relation (313) ie

v(tx) = (1minus plowastN )v (t+ 1x(1 + aN )) + plowastN v (t+ 1x(1 + bN ))

using the renormalizations rN = rTN and

aN = (1 + rN )(1minus |σ|radicTN)minus 1 bN = (1 + rN )(1 + |σ|

radicTN)minus 1

of Section 36 N gt 1 with

plowastN =rN minus aNbN minus aN

and plowastN =bN minus rNbN minus aN

a) Show that the Black-Scholes PDE (62) of Proposition 61 can be recoveredfrom the induction relation (313) when the number N of time steps tendsto infinity

237

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

b) Show that the expression of the Delta ξt =partgcpartx

(tSt) can be similarlyrecovered from the finite difference relation (319) ie

ξ(1)t (Stminus1) =

v (t (1 + bN )Stminus1)minus v (t (1 + aN )Stminus1)

Stminus1(bN minus aN )

as N tends to infinity

Problem 615 (Leung and Sircar (2015)) ProShares Ultra SampP500 andProShares UltraShort SampP500 are leveraged investment funds that seek dailyinvestment results before fees and expenses that correspond to β times (βx)the daily performance of the SampP500reg with respectively β = 2 for ProSharesUltra and β = minus2 for ProShares UltraShort Here leveraging with a factorβ 1 aims at multiplying the potential return of an investment by a factorβ The following 10 questions are interdependent and should be treated insequence

a) Consider a risky asset priced S0 = $4 at time t = 0 and taking twopossible values S1 = $5 and S1 = $2 at time t = 1 Compute the twopossible returns (in ) achieved when investing $4 in one share of the assetS and the expected return under the risk-neutral probability measureassuming that the risk-free interest rate is zero

b) Leveraging Still based on an initial $4 investment we decide to leverageby a factor β = 3 by borrowing another (β minus 1) times $4 = 2times $4 at ratezero to purchase a total of β = 3 shares of the asset S Compute thetwo returns (in ) possibly achieved in this case and the expected returnunder the risk-neutral probability measure assuming that the risk-freeinterest rate is zero

c) Denoting by Ft the ProShares value at time t how much should the fundinvest in the underlying asset priced St and how much $ should it borrowor save on the risk-free market at any time t in order to leverage with afactor β 1

d) Find the portfolio allocation (ξt ηt) for the fund value

Ft = ξtSt + ηtAt t isin R+

according to Question (c) where At = A0 ert is the riskless money marketaccount

e) We choose to model the SampP500 index St as the geometric Brownianmotion

dSt = rStdt+ σStdBt t isin R+

under the risk-neutral probability measure Plowast Find the stochastic dif-ferential equation satisfied by (Ft)tisinR+ under the self-financing conditiondFt = ξtdSt + ηtdAt

238

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

f) Is the discounted fund value ( eminusrtFt)tisinR+ a martingale under the risk-neutral probability measure Plowast

g) Find the relation between the fund value Ft and the index St by solvingthe stochastic differential equation obtained for Ft in Question (e) Forsimplicity we normalize F0 = Sβ0

h) Write the price at time t = 0 of the call option with payoff (FT minusK)+ onthe ProShares index using the Black-Scholes formula

i) Show that when β gt 0 the Delta at time t isin [0T ) of the call optionwith payoff (FT minusK)+ on ProShares Ultra is equal to the Delta of thecall option with payoff (ST minusKβ(t))

+ on the SampP500 for a certain strikeprice Kβ(t) to be determined explicitly

j) When β lt 0 find the relation between the Delta at time t isin [0T ) ofthe call option with payoff (FT minusK)+ on ProShares UltraShort and theDelta of the put option with payoff (Kβ(t)minus ST )+ on the SampP500

239

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

  1. pbsARFix223
  2. pbsARFix224
  3. pbsARFix225
  4. pbsARFix226
  5. pbsARFix227
  6. pbsARFix228
  7. pbsARFix229
  8. pbsARFix230
  9. fdrm1
  10. pbsARFix231
  11. 100
  12. 101
  13. 102
  14. 103
  15. 104
  16. 105
  17. 106
  18. 107
  19. 108
  20. 109
  21. 1010
  22. 1011
  23. 1012
  24. 1013
  25. 1014
  26. 1015
  27. 1016
  28. 1017
  29. 1018
  30. 1019
  31. anm10
  32. 10EndLeft
  33. 10StepLeft
  34. 10PauseLeft
  35. 10PlayLeft
  36. 10PlayPauseLeft
  37. 10PauseRight
  38. 10PlayRight
  39. 10PlayPauseRight
  40. 10StepRight
  41. 10EndRight
  42. 10Minus
  43. 10Reset
  44. 10Plus
  45. pbsARFix232
  46. pbsARFix233
  47. pbsARFix234
  48. pbsARFix235
  49. pbsARFix236
  50. pbsARFix237
  51. fdrm2
  52. 110
  53. 111
  54. 112
  55. 113
  56. 114
  57. 115
  58. 116
  59. 117
  60. 118
  61. 119
  62. 1110
  63. 1111
  64. 1112
  65. 1113
  66. 1114
  67. 1115
  68. 1116
  69. 1117
  70. 1118
  71. 1119
  72. anm11
  73. 11EndLeft
  74. 11StepLeft
  75. 11PauseLeft
  76. 11PlayLeft
  77. 11PlayPauseLeft
  78. 11PauseRight
  79. 11PlayRight
  80. 11PlayPauseRight
  81. 11StepRight
  82. 11EndRight
  83. 11Minus
  84. 11Reset
  85. 11Plus
  86. pbsARFix238
  87. pbsARFix239
  88. pbsARFix240
  89. pbsARFix241
  90. pbsARFix242
  91. 120
  92. 121
  93. 122
  94. 123
  95. 124
  96. 125
  97. 126
  98. 127
  99. 128
  100. 129
  101. 1210
  102. anm12
  103. 12EndLeft
  104. 12StepLeft
  105. 12PauseLeft
  106. 12PlayLeft
  107. 12PlayPauseLeft
  108. 12PauseRight
  109. 12PlayRight
  110. 12PlayPauseRight
  111. 12StepRight
  112. 12EndRight
  113. 12Minus
  114. 12Reset
  115. 12Plus
  116. 130
  117. 131
  118. 132
  119. 133
  120. 134
  121. 135
  122. 136
  123. 137
  124. 138
  125. 139
  126. 1310
  127. anm13
  128. 13EndLeft
  129. 13StepLeft
  130. 13PauseLeft
  131. 13PlayLeft
  132. 13PlayPauseLeft
  133. 13PauseRight
  134. 13PlayRight
  135. 13PlayPauseRight
  136. 13StepRight
  137. 13EndRight
  138. 13Minus
  139. 13Reset
  140. 13Plus
  141. pbsARFix243
  142. pbsARFix244
  143. pbsARFix245
  144. pbsARFix246
  145. 140
  146. 141
  147. 142
  148. 143
  149. 144
  150. 145
  151. 146
  152. 147
  153. 148
  154. 149
  155. 1410
  156. 1411
  157. 1412
  158. 1413
  159. 1414
  160. 1415
  161. 1416
  162. 1417
  163. 1418
  164. 1419
  165. 1420
  166. 1421
  167. 1422
  168. 1423
  169. 1424
  170. 1425
  171. 1426
  172. 1427
  173. 1428
  174. 1429
  175. 1430
  176. 1431
  177. 1432
  178. 1433
  179. 1434
  180. 1435
  181. 1436
  182. 1437
  183. 1438
  184. 1439
  185. 1440
  186. 1441
  187. 1442
  188. 1443
  189. 1444
  190. 1445
  191. 1446
  192. 1447
  193. 1448
  194. 1449
  195. 1450
  196. 1451
  197. 1452
  198. 1453
  199. 1454
  200. 1455
  201. 1456
  202. 1457
  203. 1458
  204. 1459
  205. 1460
  206. 1461
  207. 1462
  208. 1463
  209. 1464
  210. 1465
  211. 1466
  212. 1467
  213. 1468
  214. 1469
  215. 1470
  216. 1471
  217. 1472
  218. 1473
  219. 1474
  220. 1475
  221. 1476
  222. 1477
  223. 1478
  224. 1479
  225. 1480
  226. 1481
  227. 1482
  228. 1483
  229. 1484
  230. 1485
  231. 1486
  232. 1487
  233. 1488
  234. 1489
  235. 1490
  236. 1491
  237. 1492
  238. 1493
  239. 1494
  240. 1495
  241. 1496
  242. 1497
  243. 1498
  244. 1499
  245. 14100
  246. 14101
  247. 14102
  248. 14103
  249. 14104
  250. 14105
  251. 14106
  252. 14107
  253. 14108
  254. 14109
  255. 14110
  256. 14111
  257. 14112
  258. 14113
  259. 14114
  260. 14115
  261. 14116
  262. 14117
  263. 14118
  264. 14119
  265. 14120
  266. 14121
  267. 14122
  268. 14123
  269. 14124
  270. 14125
  271. 14126
  272. 14127
  273. 14128
  274. 14129
  275. 14130
  276. 14131
  277. 14132
  278. 14133
  279. 14134
  280. 14135
  281. 14136
  282. 14137
  283. 14138
  284. 14139
  285. 14140
  286. 14141
  287. 14142
  288. 14143
  289. 14144
  290. 14145
  291. 14146
  292. 14147
  293. 14148
  294. 14149
  295. 14150
  296. 14151
  297. 14152
  298. 14153
  299. 14154
  300. 14155
  301. 14156
  302. 14157
  303. 14158
  304. 14159
  305. 14160
  306. 14161
  307. 14162
  308. 14163
  309. 14164
  310. 14165
  311. 14166
  312. 14167
  313. 14168
  314. 14169
  315. 14170
  316. 14171
  317. 14172
  318. 14173
  319. 14174
  320. 14175
  321. 14176
  322. 14177
  323. 14178
  324. 14179
  325. 14180
  326. 14181
  327. 14182
  328. 14183
  329. 14184
  330. 14185
  331. 14186
  332. 14187
  333. 14188
  334. 14189
  335. 14190
  336. 14191
  337. 14192
  338. 14193
  339. 14194
  340. 14195
  341. 14196
  342. 14197
  343. anm14
  344. 14EndLeft
  345. 14StepLeft
  346. 14PauseLeft
  347. 14PlayLeft
  348. 14PlayPauseLeft
  349. 14PauseRight
  350. 14PlayRight
  351. 14PlayPauseRight
  352. 14StepRight
  353. 14EndRight
  354. 14Minus
  355. 14Reset
  356. 14Plus
  357. pbsARFix247
  358. pbsARFix248
  359. 150
  360. 151
  361. 152
  362. 153
  363. 154
  364. 155
  365. 156
  366. 157
  367. 158
  368. 159
  369. 1510
  370. 1511
  371. 1512
  372. 1513
  373. 1514
  374. 1515
  375. 1516
  376. 1517
  377. 1518
  378. 1519
  379. anm15
  380. 15EndLeft
  381. 15StepLeft
  382. 15PauseLeft
  383. 15PlayLeft
  384. 15PlayPauseLeft
  385. 15PauseRight
  386. 15PlayRight
  387. 15PlayPauseRight
  388. 15StepRight
  389. 15EndRight
  390. 15Minus
  391. 15Reset
  392. 15Plus
  393. pbsARFix249
  394. pbsARFix250
  395. pbsARFix251
  396. pbsARFix252
  397. pbsARFix253
  398. pbsARFix254
  399. pbsARFix255
  400. pbsARFix256
  401. pbsARFix257
  402. pbsARFix258
  403. pbsARFix259
  404. pbsARFix260
  405. pbsARFix261
Page 32: Black-ScholesPricingandHedging - NTU · to the Black-Scholes PDE (6.2) in order to price a claim payoff Cof the formC= h(S T).Asinthediscrete-timecase,thearbitragepriceπt(C) at

N Privault

b) Assuming that the portfolio value Vt takes the form Vt = g(tSt) at timet derive the Black-Scholes PDE for the function g(tx) with its terminalcondition

c) Compute the price at time t isin [0T ] of the European call option withstrike price K by solving the corresponding Black-Scholes PDE

d) Compute the Delta of the option

Exercise 64

a) Check that the Black-Scholes formula (610) for European call options

gc(tx) = xΦ(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)

satisfies the following boundary conditions

i) at x = 0 gc(t 0) = 0ii) at maturity t = T

gc(T x) = (xminusK)+ =

xminusK x gt K

0 x 6 K

iii) as time to maturity tends to infinity

limTrarrinfin

Bl(Kxσ rT minus t) = x t isin R+

b) Check that the Black-Scholes formula (618) for European put options

gp(tx) = K eminus(Tminust)rΦ(minus dminus(T minus t)

)minus xΦ

(minus d+(T minus t)

)satisfies the following boundary conditions

i) at x = 0 gp(t 0) = K eminus(Tminust)rii) as x tends to infinity gp(tinfin) = 0 for all t isin [0T )iii) at maturity t = T

gp(T x) = (K minus x)+ =

0 x gt K

K minus x x 6 K

iv) as time to maturity tends to infinity

limTrarrinfin

Blp(KStσ rT minus t) = 0 t isin R+

Exercise 65 Power option (Exercise 314 continued)

232

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

a) Solve the Black-Scholes PDE

rg(x t) = partg

partt(x t) + rx

partg

partx(x t) + σ2

2 x2 part2g

partx2 (x t) (633)

with terminal condition g(xT ) = x2 x gt 0 t isin [0T ]

Hint Try a solution of the form g(x t) = x2f(t) and find f(t)b) Find the respective quantities ξt and ηt of the risky asset St and riskless

asset At = ert in the portfolio with value

Vt = g(St t) = ξtSt + ηtAt 0 6 t 6 T

hedging the contract with payoff S2T at maturity

Exercise 66 On December 18 2007 a call warrant has been issued byFortis Bank on the stock price S of the MTR Corporation with maturityT = 23122008 strike price K = HK$ 3608 and entitlement ratio=10Recall that in the Black-Scholes model the price at time t of the Europeanclaim on the underlying asset priced St with strike price K maturity T interest rate r and volatility σ gt 0 is given by the Black-Scholes formula as

f(tSt) = StΦ(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)

wheredminus(T minus t) =

(rminus σ22)(T minus t) + log(StK)

|σ|radicT minus t

d+(T minus t) = dminus(T minus t) + |σ|radicT minus t = (r+ σ22)(T minus t) + log(StK)

|σ|radicT minus t

Recall that by Proposition 64 we have

partf

partx(tSt) = Φ

(d+(T minus t)

) 0 6 t 6 T

a) Using the values of the Gaussian cumulative distribution function com-pute the Black-Scholes price of the corresponding call option at timet =November 07 2008 with St = HK$ 17200 assuming a volatility σ =90 = 090 and an annual risk-free interest rate r = 4377 = 004377

b) Still using the Gaussian cumulative distribution function compute thequantity of the risky asset required in your portfolio at time t =November07 2008 in order to hedge one such option at maturity T = 23122008

c) Figure 1 represents the Black-Scholes price of the call option as a functionof σ isin [05 15] = [50 150]

233

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

0

01

02

03

04

05

06

05 06 07 08 09 1 11 12 13 14 15σimp

Optio

n pr

ice

σ

Market price

Fig 621 Option price as a function of the volatility σ gt 0

1 BSCall lt- function(S K r T sigma)d1 lt- (log(SK)+(r+sigma^22)T)(sigmasqrt(T))d2 lt- d1 - sigma sqrt(T)

3 BSCall = Spnorm(d1) - Kexp(-rT)pnorm(d2)BSCallsigma lt- seq(0515 length=100)

5 plot(sigmaBSCall(172360800437746365sigma) type=llty=1 xlab=Sigmaylab=Black-Scholes Call Price ylim = c(006)col=bluelwd=3)grid()

abline(h=023col=redlwd=3)

Knowing that the closing price of the warrant on November 07 2008 wasHK$ 0023 which value can you infer for the implied volatility σ at thisdatelowast

Exercise 67 Forward contracts Recall that the price πt(C) of a claimpayoff C = h(ST ) of maturity T can be written as πt(C) = g(tSt) wherethe function g(tx) satisfies the Black-Scholes PDE

rg(tx) = partg

partt(tx) + rx

partg

partx(tx) + 1

2σ2x2 part

2g

partx2 (tx)

g(T x) = h(x) (1)

with terminal condition g(T x) = h(x) x gt 0

a) Assume that C is a forward contract with payoff

C = ST minusK

at time T Find the function h(x) in (1)b) Find the solution g(tx) of the above PDE and compute the price πt(C)

at time t isin [0T ]Hint search for a solution of the form g(tx) = xminus α(t) where α(t) is afunction of t to be determined

lowast Download the corresponding or the that can be runhere

234

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

BS lt- function(S K T r sig)d1 lt- (log(SK) + (r + sig^22)T) (sigsqrt(T))d2 lt- d1 - sigsqrt(T)return(Spnorm(d1) - Kexp(-rT)pnorm(d2))impliedvol lt- function(S K T r market)sig lt- 020sigup lt- 1sigdown lt- 0001count lt- 0err lt- BS(S K T r sig) - marketwhile(abs(err) gt 000001 ampamp countlt1000)if(err lt 0)sigdown lt- sigsig lt- (sigup + sig)2elsesigup lt- sigsig lt- (sigdown + sig)2err lt- BS(S K T r sig) - marketcount lt- count + 1if(count==2000)return(NA)elsereturn(sig)market = 083K = 628T = 7 365S = 634r = 002impliedvol(S K T r market)

cells [ cell_type code execution_count null metadata outputs [] source [ from IPythoncoredisplay import display HTMLn display(HTML( )) ] cell_type code execution_count null metadata collapsed true outputs [] source [ import numpy as npn import scipystats as ssn import time n n Black and Scholesn def d1(S0 K r sigma T)n return (nplog(S0K) + (r + sigma2 2) T)(sigma npsqrt(T))n n def d2(S0 K r sigma T)n return (nplog(S0 K) + (r - sigma2 2) T) (sigma npsqrt(T))n n def BlackScholes(typeS0 K r sigma T)n if type==Cn return S0 ssnormcdf(d1(S0 K r sigma T)) - K npexp(-r T) ssnormcdf(d2(S0 K r sigma T))n elsen return K npexp(-r T) ssnormcdf(-d2(S0 K r sigma T)) - S0 ssnormcdf(-d1(S0 K r sigma T)) ] cell_type code execution_count null metadata outputs [] source [ BlackScholes(C1000 1200 002 015 10) ] cell_type code execution_count null metadata outputs [] source [ def difference(x p S K r t)n return BlackScholes(CS K r x t) - p ] cell_type code execution_count null metadata outputs [] source [ from scipyoptimize import bisectn bisect(difference00011args=(11541763731112766 1000 1200 002 10)) ] ] metadata anaconda-cloud kernelspec display_name Python 3 language python name python3 language_info codemirror_mode name ipython version 3 file_extension py mimetype textx-python name python nbconvert_exporter python pygments_lexer ipython3 version 375rc1 nbformat 4 nbformat_minor 1

Black-Scholes Pricing and Hedging

c) Compute the quantityξt =

partg

partx(tSt)

of risky assets in a self-financing portfolio hedging Cd) Repeat the above questions with the terminal condition g(T x) = x

Exercise 68a) Solve the Black-Scholes PDE

rg(tx) = partg

partt(tx) + rx

partg

partx(tx) + σ2

2 x2 part2g

partx2 (tx) (634)

with terminal condition g(T x) = 1 x gt 0

Hint Try a solution of the form g(tx) = f(t) and find f(t)

b) Find the respective quantities ξt and ηt of the risky asset St and risklessasset At = ert in the portfolio with value

Vt = g(tSt) = ξtSt + ηtAt

hedging the contract with payoff $1 at maturity

Exercise 69 Log-contracts see also Exercise 84a) Solve the PDE

0 =partg

partt(x t) + rx

partg

partx(x t) + σ2

2 x2 part2g

partx2 (x t)

with the terminal condition g(xT ) = log x x gt 0

Hint Try a solution of the form g(x t) = f(t) + log x and find f(t)b) Solve the Black-Scholes PDE

rh(x t) = parth

partt(x t) + rx

parth

partx(x t) + σ2

2 x2 part2h

partx2 (x t) (635)

with the terminal condition h(xT ) = log x x gt 0

Hint Try a solution of the form h(x t) = u(t)g(x t) and find u(t)c) Find the respective quantities ξt and ηt of the risky asset St and riskless

asset At = ert in the portfolio with value

Vt = g(St t) = ξtSt + ηtAt

hedging a log-contract with payoff logST at maturity 235

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

Exercise 610 Binary options Consider a price process (St)tisinR+ given by

dStSt

= rdt+ σdBt S0 = 1

under the risk-neutral probability measure Plowast The binary (or digital) calloption is a contract with maturity T strike price K and payoff

Cd = 1[Kinfin)(ST ) =

$1 if ST gt K

0 if ST lt K

a) Derive the Black-Schole PDE satisfied by the pricing function Cd(tSt) ofthe binary call option together with its terminal condition

b) Show that the solution Cd(tx) of the Black-Scholes PDE of Question (a)is given by

Cd(tx) = eminus(Tminust)rΦ((rminus σ22)(T minus t) + log(xK)

|σ|radicT minus t

)= eminus(Tminust)rΦ

(dminus(T minus t)

)

where

dminus(T minus t) =(rminus σ22)(T minus t) + log(StK)

|σ|radicT minus t

0 6 t lt T

Exercise 611

a) Bachelier (1900) model Solve the stochastic differential equation

dSt = αStdt+ σdBt (636)

in terms of ασ isin R and the initial condition S0b) Write down the Bachelier PDE satisfied by the function C(tx) where

C(tSt) is the price at time t isin [0T ] of the contingent claim with payoffφ(ST ) = exp(ST ) and identify the process Delta (ξt)tisin[0T ] that hedgesthis claim

c) Solve the Black-Scholes PDE of Question (b) with the terminal conditionφ(x) = ex x isin R

Hint Search for a solution of the form

C(tx) = exp(minus(T minus t)r+ xh(t) +

σ2

4r (h2(t)minus 1)

) (637)

where h(t) is a function to be determined with h(T ) = 1

236

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

d) Compute the portfolio strategy (ξt ηt)tisin[0T ] that hedges the contingentclaim with payoff exp(ST )

Exercise 612

a) Show that for every fixed value of S the function

d 7minusrarr h(S d) = SΦ(d+ |σ|

radicT)minusK eminusrTΦ(d)

reaches its maximum at dlowast(S) =log(SK) + (rminus σ22)T

|σ|radicT

b) By the differentiation rule

d

dSh(S dlowast(S)) =

parth

partS(S dlowast(S)) + dprimelowast(S)

parth

partd(S dlowast(S))

recover the value of the Black-Scholes Delta

Exercise 613 Compute the Black-Scholes Vega by differentiation of theBlack-Scholes function

gc(tx) = Bl(Kxσ rT minus t) = xΦ(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)

with respect to the volatility parameter σ knowing that

minus12(dminus(T minus t)

)2= minus1

2

(log(xK) + (rminus σ22)(T minus t)

|σ|radicT minus t

)2

= minus12(d+(T minus t)

)2+ (T minus t)r+ log x

K (638)

Exercise 614 Consider the backward induction relation (313) ie

v(tx) = (1minus plowastN )v (t+ 1x(1 + aN )) + plowastN v (t+ 1x(1 + bN ))

using the renormalizations rN = rTN and

aN = (1 + rN )(1minus |σ|radicTN)minus 1 bN = (1 + rN )(1 + |σ|

radicTN)minus 1

of Section 36 N gt 1 with

plowastN =rN minus aNbN minus aN

and plowastN =bN minus rNbN minus aN

a) Show that the Black-Scholes PDE (62) of Proposition 61 can be recoveredfrom the induction relation (313) when the number N of time steps tendsto infinity

237

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

b) Show that the expression of the Delta ξt =partgcpartx

(tSt) can be similarlyrecovered from the finite difference relation (319) ie

ξ(1)t (Stminus1) =

v (t (1 + bN )Stminus1)minus v (t (1 + aN )Stminus1)

Stminus1(bN minus aN )

as N tends to infinity

Problem 615 (Leung and Sircar (2015)) ProShares Ultra SampP500 andProShares UltraShort SampP500 are leveraged investment funds that seek dailyinvestment results before fees and expenses that correspond to β times (βx)the daily performance of the SampP500reg with respectively β = 2 for ProSharesUltra and β = minus2 for ProShares UltraShort Here leveraging with a factorβ 1 aims at multiplying the potential return of an investment by a factorβ The following 10 questions are interdependent and should be treated insequence

a) Consider a risky asset priced S0 = $4 at time t = 0 and taking twopossible values S1 = $5 and S1 = $2 at time t = 1 Compute the twopossible returns (in ) achieved when investing $4 in one share of the assetS and the expected return under the risk-neutral probability measureassuming that the risk-free interest rate is zero

b) Leveraging Still based on an initial $4 investment we decide to leverageby a factor β = 3 by borrowing another (β minus 1) times $4 = 2times $4 at ratezero to purchase a total of β = 3 shares of the asset S Compute thetwo returns (in ) possibly achieved in this case and the expected returnunder the risk-neutral probability measure assuming that the risk-freeinterest rate is zero

c) Denoting by Ft the ProShares value at time t how much should the fundinvest in the underlying asset priced St and how much $ should it borrowor save on the risk-free market at any time t in order to leverage with afactor β 1

d) Find the portfolio allocation (ξt ηt) for the fund value

Ft = ξtSt + ηtAt t isin R+

according to Question (c) where At = A0 ert is the riskless money marketaccount

e) We choose to model the SampP500 index St as the geometric Brownianmotion

dSt = rStdt+ σStdBt t isin R+

under the risk-neutral probability measure Plowast Find the stochastic dif-ferential equation satisfied by (Ft)tisinR+ under the self-financing conditiondFt = ξtdSt + ηtdAt

238

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

f) Is the discounted fund value ( eminusrtFt)tisinR+ a martingale under the risk-neutral probability measure Plowast

g) Find the relation between the fund value Ft and the index St by solvingthe stochastic differential equation obtained for Ft in Question (e) Forsimplicity we normalize F0 = Sβ0

h) Write the price at time t = 0 of the call option with payoff (FT minusK)+ onthe ProShares index using the Black-Scholes formula

i) Show that when β gt 0 the Delta at time t isin [0T ) of the call optionwith payoff (FT minusK)+ on ProShares Ultra is equal to the Delta of thecall option with payoff (ST minusKβ(t))

+ on the SampP500 for a certain strikeprice Kβ(t) to be determined explicitly

j) When β lt 0 find the relation between the Delta at time t isin [0T ) ofthe call option with payoff (FT minusK)+ on ProShares UltraShort and theDelta of the put option with payoff (Kβ(t)minus ST )+ on the SampP500

239

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

  1. pbsARFix223
  2. pbsARFix224
  3. pbsARFix225
  4. pbsARFix226
  5. pbsARFix227
  6. pbsARFix228
  7. pbsARFix229
  8. pbsARFix230
  9. fdrm1
  10. pbsARFix231
  11. 100
  12. 101
  13. 102
  14. 103
  15. 104
  16. 105
  17. 106
  18. 107
  19. 108
  20. 109
  21. 1010
  22. 1011
  23. 1012
  24. 1013
  25. 1014
  26. 1015
  27. 1016
  28. 1017
  29. 1018
  30. 1019
  31. anm10
  32. 10EndLeft
  33. 10StepLeft
  34. 10PauseLeft
  35. 10PlayLeft
  36. 10PlayPauseLeft
  37. 10PauseRight
  38. 10PlayRight
  39. 10PlayPauseRight
  40. 10StepRight
  41. 10EndRight
  42. 10Minus
  43. 10Reset
  44. 10Plus
  45. pbsARFix232
  46. pbsARFix233
  47. pbsARFix234
  48. pbsARFix235
  49. pbsARFix236
  50. pbsARFix237
  51. fdrm2
  52. 110
  53. 111
  54. 112
  55. 113
  56. 114
  57. 115
  58. 116
  59. 117
  60. 118
  61. 119
  62. 1110
  63. 1111
  64. 1112
  65. 1113
  66. 1114
  67. 1115
  68. 1116
  69. 1117
  70. 1118
  71. 1119
  72. anm11
  73. 11EndLeft
  74. 11StepLeft
  75. 11PauseLeft
  76. 11PlayLeft
  77. 11PlayPauseLeft
  78. 11PauseRight
  79. 11PlayRight
  80. 11PlayPauseRight
  81. 11StepRight
  82. 11EndRight
  83. 11Minus
  84. 11Reset
  85. 11Plus
  86. pbsARFix238
  87. pbsARFix239
  88. pbsARFix240
  89. pbsARFix241
  90. pbsARFix242
  91. 120
  92. 121
  93. 122
  94. 123
  95. 124
  96. 125
  97. 126
  98. 127
  99. 128
  100. 129
  101. 1210
  102. anm12
  103. 12EndLeft
  104. 12StepLeft
  105. 12PauseLeft
  106. 12PlayLeft
  107. 12PlayPauseLeft
  108. 12PauseRight
  109. 12PlayRight
  110. 12PlayPauseRight
  111. 12StepRight
  112. 12EndRight
  113. 12Minus
  114. 12Reset
  115. 12Plus
  116. 130
  117. 131
  118. 132
  119. 133
  120. 134
  121. 135
  122. 136
  123. 137
  124. 138
  125. 139
  126. 1310
  127. anm13
  128. 13EndLeft
  129. 13StepLeft
  130. 13PauseLeft
  131. 13PlayLeft
  132. 13PlayPauseLeft
  133. 13PauseRight
  134. 13PlayRight
  135. 13PlayPauseRight
  136. 13StepRight
  137. 13EndRight
  138. 13Minus
  139. 13Reset
  140. 13Plus
  141. pbsARFix243
  142. pbsARFix244
  143. pbsARFix245
  144. pbsARFix246
  145. 140
  146. 141
  147. 142
  148. 143
  149. 144
  150. 145
  151. 146
  152. 147
  153. 148
  154. 149
  155. 1410
  156. 1411
  157. 1412
  158. 1413
  159. 1414
  160. 1415
  161. 1416
  162. 1417
  163. 1418
  164. 1419
  165. 1420
  166. 1421
  167. 1422
  168. 1423
  169. 1424
  170. 1425
  171. 1426
  172. 1427
  173. 1428
  174. 1429
  175. 1430
  176. 1431
  177. 1432
  178. 1433
  179. 1434
  180. 1435
  181. 1436
  182. 1437
  183. 1438
  184. 1439
  185. 1440
  186. 1441
  187. 1442
  188. 1443
  189. 1444
  190. 1445
  191. 1446
  192. 1447
  193. 1448
  194. 1449
  195. 1450
  196. 1451
  197. 1452
  198. 1453
  199. 1454
  200. 1455
  201. 1456
  202. 1457
  203. 1458
  204. 1459
  205. 1460
  206. 1461
  207. 1462
  208. 1463
  209. 1464
  210. 1465
  211. 1466
  212. 1467
  213. 1468
  214. 1469
  215. 1470
  216. 1471
  217. 1472
  218. 1473
  219. 1474
  220. 1475
  221. 1476
  222. 1477
  223. 1478
  224. 1479
  225. 1480
  226. 1481
  227. 1482
  228. 1483
  229. 1484
  230. 1485
  231. 1486
  232. 1487
  233. 1488
  234. 1489
  235. 1490
  236. 1491
  237. 1492
  238. 1493
  239. 1494
  240. 1495
  241. 1496
  242. 1497
  243. 1498
  244. 1499
  245. 14100
  246. 14101
  247. 14102
  248. 14103
  249. 14104
  250. 14105
  251. 14106
  252. 14107
  253. 14108
  254. 14109
  255. 14110
  256. 14111
  257. 14112
  258. 14113
  259. 14114
  260. 14115
  261. 14116
  262. 14117
  263. 14118
  264. 14119
  265. 14120
  266. 14121
  267. 14122
  268. 14123
  269. 14124
  270. 14125
  271. 14126
  272. 14127
  273. 14128
  274. 14129
  275. 14130
  276. 14131
  277. 14132
  278. 14133
  279. 14134
  280. 14135
  281. 14136
  282. 14137
  283. 14138
  284. 14139
  285. 14140
  286. 14141
  287. 14142
  288. 14143
  289. 14144
  290. 14145
  291. 14146
  292. 14147
  293. 14148
  294. 14149
  295. 14150
  296. 14151
  297. 14152
  298. 14153
  299. 14154
  300. 14155
  301. 14156
  302. 14157
  303. 14158
  304. 14159
  305. 14160
  306. 14161
  307. 14162
  308. 14163
  309. 14164
  310. 14165
  311. 14166
  312. 14167
  313. 14168
  314. 14169
  315. 14170
  316. 14171
  317. 14172
  318. 14173
  319. 14174
  320. 14175
  321. 14176
  322. 14177
  323. 14178
  324. 14179
  325. 14180
  326. 14181
  327. 14182
  328. 14183
  329. 14184
  330. 14185
  331. 14186
  332. 14187
  333. 14188
  334. 14189
  335. 14190
  336. 14191
  337. 14192
  338. 14193
  339. 14194
  340. 14195
  341. 14196
  342. 14197
  343. anm14
  344. 14EndLeft
  345. 14StepLeft
  346. 14PauseLeft
  347. 14PlayLeft
  348. 14PlayPauseLeft
  349. 14PauseRight
  350. 14PlayRight
  351. 14PlayPauseRight
  352. 14StepRight
  353. 14EndRight
  354. 14Minus
  355. 14Reset
  356. 14Plus
  357. pbsARFix247
  358. pbsARFix248
  359. 150
  360. 151
  361. 152
  362. 153
  363. 154
  364. 155
  365. 156
  366. 157
  367. 158
  368. 159
  369. 1510
  370. 1511
  371. 1512
  372. 1513
  373. 1514
  374. 1515
  375. 1516
  376. 1517
  377. 1518
  378. 1519
  379. anm15
  380. 15EndLeft
  381. 15StepLeft
  382. 15PauseLeft
  383. 15PlayLeft
  384. 15PlayPauseLeft
  385. 15PauseRight
  386. 15PlayRight
  387. 15PlayPauseRight
  388. 15StepRight
  389. 15EndRight
  390. 15Minus
  391. 15Reset
  392. 15Plus
  393. pbsARFix249
  394. pbsARFix250
  395. pbsARFix251
  396. pbsARFix252
  397. pbsARFix253
  398. pbsARFix254
  399. pbsARFix255
  400. pbsARFix256
  401. pbsARFix257
  402. pbsARFix258
  403. pbsARFix259
  404. pbsARFix260
  405. pbsARFix261
Page 33: Black-ScholesPricingandHedging - NTU · to the Black-Scholes PDE (6.2) in order to price a claim payoff Cof the formC= h(S T).Asinthediscrete-timecase,thearbitragepriceπt(C) at

Black-Scholes Pricing and Hedging

a) Solve the Black-Scholes PDE

rg(x t) = partg

partt(x t) + rx

partg

partx(x t) + σ2

2 x2 part2g

partx2 (x t) (633)

with terminal condition g(xT ) = x2 x gt 0 t isin [0T ]

Hint Try a solution of the form g(x t) = x2f(t) and find f(t)b) Find the respective quantities ξt and ηt of the risky asset St and riskless

asset At = ert in the portfolio with value

Vt = g(St t) = ξtSt + ηtAt 0 6 t 6 T

hedging the contract with payoff S2T at maturity

Exercise 66 On December 18 2007 a call warrant has been issued byFortis Bank on the stock price S of the MTR Corporation with maturityT = 23122008 strike price K = HK$ 3608 and entitlement ratio=10Recall that in the Black-Scholes model the price at time t of the Europeanclaim on the underlying asset priced St with strike price K maturity T interest rate r and volatility σ gt 0 is given by the Black-Scholes formula as

f(tSt) = StΦ(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)

wheredminus(T minus t) =

(rminus σ22)(T minus t) + log(StK)

|σ|radicT minus t

d+(T minus t) = dminus(T minus t) + |σ|radicT minus t = (r+ σ22)(T minus t) + log(StK)

|σ|radicT minus t

Recall that by Proposition 64 we have

partf

partx(tSt) = Φ

(d+(T minus t)

) 0 6 t 6 T

a) Using the values of the Gaussian cumulative distribution function com-pute the Black-Scholes price of the corresponding call option at timet =November 07 2008 with St = HK$ 17200 assuming a volatility σ =90 = 090 and an annual risk-free interest rate r = 4377 = 004377

b) Still using the Gaussian cumulative distribution function compute thequantity of the risky asset required in your portfolio at time t =November07 2008 in order to hedge one such option at maturity T = 23122008

c) Figure 1 represents the Black-Scholes price of the call option as a functionof σ isin [05 15] = [50 150]

233

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

0

01

02

03

04

05

06

05 06 07 08 09 1 11 12 13 14 15σimp

Optio

n pr

ice

σ

Market price

Fig 621 Option price as a function of the volatility σ gt 0

1 BSCall lt- function(S K r T sigma)d1 lt- (log(SK)+(r+sigma^22)T)(sigmasqrt(T))d2 lt- d1 - sigma sqrt(T)

3 BSCall = Spnorm(d1) - Kexp(-rT)pnorm(d2)BSCallsigma lt- seq(0515 length=100)

5 plot(sigmaBSCall(172360800437746365sigma) type=llty=1 xlab=Sigmaylab=Black-Scholes Call Price ylim = c(006)col=bluelwd=3)grid()

abline(h=023col=redlwd=3)

Knowing that the closing price of the warrant on November 07 2008 wasHK$ 0023 which value can you infer for the implied volatility σ at thisdatelowast

Exercise 67 Forward contracts Recall that the price πt(C) of a claimpayoff C = h(ST ) of maturity T can be written as πt(C) = g(tSt) wherethe function g(tx) satisfies the Black-Scholes PDE

rg(tx) = partg

partt(tx) + rx

partg

partx(tx) + 1

2σ2x2 part

2g

partx2 (tx)

g(T x) = h(x) (1)

with terminal condition g(T x) = h(x) x gt 0

a) Assume that C is a forward contract with payoff

C = ST minusK

at time T Find the function h(x) in (1)b) Find the solution g(tx) of the above PDE and compute the price πt(C)

at time t isin [0T ]Hint search for a solution of the form g(tx) = xminus α(t) where α(t) is afunction of t to be determined

lowast Download the corresponding or the that can be runhere

234

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

BS lt- function(S K T r sig)d1 lt- (log(SK) + (r + sig^22)T) (sigsqrt(T))d2 lt- d1 - sigsqrt(T)return(Spnorm(d1) - Kexp(-rT)pnorm(d2))impliedvol lt- function(S K T r market)sig lt- 020sigup lt- 1sigdown lt- 0001count lt- 0err lt- BS(S K T r sig) - marketwhile(abs(err) gt 000001 ampamp countlt1000)if(err lt 0)sigdown lt- sigsig lt- (sigup + sig)2elsesigup lt- sigsig lt- (sigdown + sig)2err lt- BS(S K T r sig) - marketcount lt- count + 1if(count==2000)return(NA)elsereturn(sig)market = 083K = 628T = 7 365S = 634r = 002impliedvol(S K T r market)

cells [ cell_type code execution_count null metadata outputs [] source [ from IPythoncoredisplay import display HTMLn display(HTML( )) ] cell_type code execution_count null metadata collapsed true outputs [] source [ import numpy as npn import scipystats as ssn import time n n Black and Scholesn def d1(S0 K r sigma T)n return (nplog(S0K) + (r + sigma2 2) T)(sigma npsqrt(T))n n def d2(S0 K r sigma T)n return (nplog(S0 K) + (r - sigma2 2) T) (sigma npsqrt(T))n n def BlackScholes(typeS0 K r sigma T)n if type==Cn return S0 ssnormcdf(d1(S0 K r sigma T)) - K npexp(-r T) ssnormcdf(d2(S0 K r sigma T))n elsen return K npexp(-r T) ssnormcdf(-d2(S0 K r sigma T)) - S0 ssnormcdf(-d1(S0 K r sigma T)) ] cell_type code execution_count null metadata outputs [] source [ BlackScholes(C1000 1200 002 015 10) ] cell_type code execution_count null metadata outputs [] source [ def difference(x p S K r t)n return BlackScholes(CS K r x t) - p ] cell_type code execution_count null metadata outputs [] source [ from scipyoptimize import bisectn bisect(difference00011args=(11541763731112766 1000 1200 002 10)) ] ] metadata anaconda-cloud kernelspec display_name Python 3 language python name python3 language_info codemirror_mode name ipython version 3 file_extension py mimetype textx-python name python nbconvert_exporter python pygments_lexer ipython3 version 375rc1 nbformat 4 nbformat_minor 1

Black-Scholes Pricing and Hedging

c) Compute the quantityξt =

partg

partx(tSt)

of risky assets in a self-financing portfolio hedging Cd) Repeat the above questions with the terminal condition g(T x) = x

Exercise 68a) Solve the Black-Scholes PDE

rg(tx) = partg

partt(tx) + rx

partg

partx(tx) + σ2

2 x2 part2g

partx2 (tx) (634)

with terminal condition g(T x) = 1 x gt 0

Hint Try a solution of the form g(tx) = f(t) and find f(t)

b) Find the respective quantities ξt and ηt of the risky asset St and risklessasset At = ert in the portfolio with value

Vt = g(tSt) = ξtSt + ηtAt

hedging the contract with payoff $1 at maturity

Exercise 69 Log-contracts see also Exercise 84a) Solve the PDE

0 =partg

partt(x t) + rx

partg

partx(x t) + σ2

2 x2 part2g

partx2 (x t)

with the terminal condition g(xT ) = log x x gt 0

Hint Try a solution of the form g(x t) = f(t) + log x and find f(t)b) Solve the Black-Scholes PDE

rh(x t) = parth

partt(x t) + rx

parth

partx(x t) + σ2

2 x2 part2h

partx2 (x t) (635)

with the terminal condition h(xT ) = log x x gt 0

Hint Try a solution of the form h(x t) = u(t)g(x t) and find u(t)c) Find the respective quantities ξt and ηt of the risky asset St and riskless

asset At = ert in the portfolio with value

Vt = g(St t) = ξtSt + ηtAt

hedging a log-contract with payoff logST at maturity 235

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

Exercise 610 Binary options Consider a price process (St)tisinR+ given by

dStSt

= rdt+ σdBt S0 = 1

under the risk-neutral probability measure Plowast The binary (or digital) calloption is a contract with maturity T strike price K and payoff

Cd = 1[Kinfin)(ST ) =

$1 if ST gt K

0 if ST lt K

a) Derive the Black-Schole PDE satisfied by the pricing function Cd(tSt) ofthe binary call option together with its terminal condition

b) Show that the solution Cd(tx) of the Black-Scholes PDE of Question (a)is given by

Cd(tx) = eminus(Tminust)rΦ((rminus σ22)(T minus t) + log(xK)

|σ|radicT minus t

)= eminus(Tminust)rΦ

(dminus(T minus t)

)

where

dminus(T minus t) =(rminus σ22)(T minus t) + log(StK)

|σ|radicT minus t

0 6 t lt T

Exercise 611

a) Bachelier (1900) model Solve the stochastic differential equation

dSt = αStdt+ σdBt (636)

in terms of ασ isin R and the initial condition S0b) Write down the Bachelier PDE satisfied by the function C(tx) where

C(tSt) is the price at time t isin [0T ] of the contingent claim with payoffφ(ST ) = exp(ST ) and identify the process Delta (ξt)tisin[0T ] that hedgesthis claim

c) Solve the Black-Scholes PDE of Question (b) with the terminal conditionφ(x) = ex x isin R

Hint Search for a solution of the form

C(tx) = exp(minus(T minus t)r+ xh(t) +

σ2

4r (h2(t)minus 1)

) (637)

where h(t) is a function to be determined with h(T ) = 1

236

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

d) Compute the portfolio strategy (ξt ηt)tisin[0T ] that hedges the contingentclaim with payoff exp(ST )

Exercise 612

a) Show that for every fixed value of S the function

d 7minusrarr h(S d) = SΦ(d+ |σ|

radicT)minusK eminusrTΦ(d)

reaches its maximum at dlowast(S) =log(SK) + (rminus σ22)T

|σ|radicT

b) By the differentiation rule

d

dSh(S dlowast(S)) =

parth

partS(S dlowast(S)) + dprimelowast(S)

parth

partd(S dlowast(S))

recover the value of the Black-Scholes Delta

Exercise 613 Compute the Black-Scholes Vega by differentiation of theBlack-Scholes function

gc(tx) = Bl(Kxσ rT minus t) = xΦ(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)

with respect to the volatility parameter σ knowing that

minus12(dminus(T minus t)

)2= minus1

2

(log(xK) + (rminus σ22)(T minus t)

|σ|radicT minus t

)2

= minus12(d+(T minus t)

)2+ (T minus t)r+ log x

K (638)

Exercise 614 Consider the backward induction relation (313) ie

v(tx) = (1minus plowastN )v (t+ 1x(1 + aN )) + plowastN v (t+ 1x(1 + bN ))

using the renormalizations rN = rTN and

aN = (1 + rN )(1minus |σ|radicTN)minus 1 bN = (1 + rN )(1 + |σ|

radicTN)minus 1

of Section 36 N gt 1 with

plowastN =rN minus aNbN minus aN

and plowastN =bN minus rNbN minus aN

a) Show that the Black-Scholes PDE (62) of Proposition 61 can be recoveredfrom the induction relation (313) when the number N of time steps tendsto infinity

237

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

b) Show that the expression of the Delta ξt =partgcpartx

(tSt) can be similarlyrecovered from the finite difference relation (319) ie

ξ(1)t (Stminus1) =

v (t (1 + bN )Stminus1)minus v (t (1 + aN )Stminus1)

Stminus1(bN minus aN )

as N tends to infinity

Problem 615 (Leung and Sircar (2015)) ProShares Ultra SampP500 andProShares UltraShort SampP500 are leveraged investment funds that seek dailyinvestment results before fees and expenses that correspond to β times (βx)the daily performance of the SampP500reg with respectively β = 2 for ProSharesUltra and β = minus2 for ProShares UltraShort Here leveraging with a factorβ 1 aims at multiplying the potential return of an investment by a factorβ The following 10 questions are interdependent and should be treated insequence

a) Consider a risky asset priced S0 = $4 at time t = 0 and taking twopossible values S1 = $5 and S1 = $2 at time t = 1 Compute the twopossible returns (in ) achieved when investing $4 in one share of the assetS and the expected return under the risk-neutral probability measureassuming that the risk-free interest rate is zero

b) Leveraging Still based on an initial $4 investment we decide to leverageby a factor β = 3 by borrowing another (β minus 1) times $4 = 2times $4 at ratezero to purchase a total of β = 3 shares of the asset S Compute thetwo returns (in ) possibly achieved in this case and the expected returnunder the risk-neutral probability measure assuming that the risk-freeinterest rate is zero

c) Denoting by Ft the ProShares value at time t how much should the fundinvest in the underlying asset priced St and how much $ should it borrowor save on the risk-free market at any time t in order to leverage with afactor β 1

d) Find the portfolio allocation (ξt ηt) for the fund value

Ft = ξtSt + ηtAt t isin R+

according to Question (c) where At = A0 ert is the riskless money marketaccount

e) We choose to model the SampP500 index St as the geometric Brownianmotion

dSt = rStdt+ σStdBt t isin R+

under the risk-neutral probability measure Plowast Find the stochastic dif-ferential equation satisfied by (Ft)tisinR+ under the self-financing conditiondFt = ξtdSt + ηtdAt

238

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

f) Is the discounted fund value ( eminusrtFt)tisinR+ a martingale under the risk-neutral probability measure Plowast

g) Find the relation between the fund value Ft and the index St by solvingthe stochastic differential equation obtained for Ft in Question (e) Forsimplicity we normalize F0 = Sβ0

h) Write the price at time t = 0 of the call option with payoff (FT minusK)+ onthe ProShares index using the Black-Scholes formula

i) Show that when β gt 0 the Delta at time t isin [0T ) of the call optionwith payoff (FT minusK)+ on ProShares Ultra is equal to the Delta of thecall option with payoff (ST minusKβ(t))

+ on the SampP500 for a certain strikeprice Kβ(t) to be determined explicitly

j) When β lt 0 find the relation between the Delta at time t isin [0T ) ofthe call option with payoff (FT minusK)+ on ProShares UltraShort and theDelta of the put option with payoff (Kβ(t)minus ST )+ on the SampP500

239

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

  1. pbsARFix223
  2. pbsARFix224
  3. pbsARFix225
  4. pbsARFix226
  5. pbsARFix227
  6. pbsARFix228
  7. pbsARFix229
  8. pbsARFix230
  9. fdrm1
  10. pbsARFix231
  11. 100
  12. 101
  13. 102
  14. 103
  15. 104
  16. 105
  17. 106
  18. 107
  19. 108
  20. 109
  21. 1010
  22. 1011
  23. 1012
  24. 1013
  25. 1014
  26. 1015
  27. 1016
  28. 1017
  29. 1018
  30. 1019
  31. anm10
  32. 10EndLeft
  33. 10StepLeft
  34. 10PauseLeft
  35. 10PlayLeft
  36. 10PlayPauseLeft
  37. 10PauseRight
  38. 10PlayRight
  39. 10PlayPauseRight
  40. 10StepRight
  41. 10EndRight
  42. 10Minus
  43. 10Reset
  44. 10Plus
  45. pbsARFix232
  46. pbsARFix233
  47. pbsARFix234
  48. pbsARFix235
  49. pbsARFix236
  50. pbsARFix237
  51. fdrm2
  52. 110
  53. 111
  54. 112
  55. 113
  56. 114
  57. 115
  58. 116
  59. 117
  60. 118
  61. 119
  62. 1110
  63. 1111
  64. 1112
  65. 1113
  66. 1114
  67. 1115
  68. 1116
  69. 1117
  70. 1118
  71. 1119
  72. anm11
  73. 11EndLeft
  74. 11StepLeft
  75. 11PauseLeft
  76. 11PlayLeft
  77. 11PlayPauseLeft
  78. 11PauseRight
  79. 11PlayRight
  80. 11PlayPauseRight
  81. 11StepRight
  82. 11EndRight
  83. 11Minus
  84. 11Reset
  85. 11Plus
  86. pbsARFix238
  87. pbsARFix239
  88. pbsARFix240
  89. pbsARFix241
  90. pbsARFix242
  91. 120
  92. 121
  93. 122
  94. 123
  95. 124
  96. 125
  97. 126
  98. 127
  99. 128
  100. 129
  101. 1210
  102. anm12
  103. 12EndLeft
  104. 12StepLeft
  105. 12PauseLeft
  106. 12PlayLeft
  107. 12PlayPauseLeft
  108. 12PauseRight
  109. 12PlayRight
  110. 12PlayPauseRight
  111. 12StepRight
  112. 12EndRight
  113. 12Minus
  114. 12Reset
  115. 12Plus
  116. 130
  117. 131
  118. 132
  119. 133
  120. 134
  121. 135
  122. 136
  123. 137
  124. 138
  125. 139
  126. 1310
  127. anm13
  128. 13EndLeft
  129. 13StepLeft
  130. 13PauseLeft
  131. 13PlayLeft
  132. 13PlayPauseLeft
  133. 13PauseRight
  134. 13PlayRight
  135. 13PlayPauseRight
  136. 13StepRight
  137. 13EndRight
  138. 13Minus
  139. 13Reset
  140. 13Plus
  141. pbsARFix243
  142. pbsARFix244
  143. pbsARFix245
  144. pbsARFix246
  145. 140
  146. 141
  147. 142
  148. 143
  149. 144
  150. 145
  151. 146
  152. 147
  153. 148
  154. 149
  155. 1410
  156. 1411
  157. 1412
  158. 1413
  159. 1414
  160. 1415
  161. 1416
  162. 1417
  163. 1418
  164. 1419
  165. 1420
  166. 1421
  167. 1422
  168. 1423
  169. 1424
  170. 1425
  171. 1426
  172. 1427
  173. 1428
  174. 1429
  175. 1430
  176. 1431
  177. 1432
  178. 1433
  179. 1434
  180. 1435
  181. 1436
  182. 1437
  183. 1438
  184. 1439
  185. 1440
  186. 1441
  187. 1442
  188. 1443
  189. 1444
  190. 1445
  191. 1446
  192. 1447
  193. 1448
  194. 1449
  195. 1450
  196. 1451
  197. 1452
  198. 1453
  199. 1454
  200. 1455
  201. 1456
  202. 1457
  203. 1458
  204. 1459
  205. 1460
  206. 1461
  207. 1462
  208. 1463
  209. 1464
  210. 1465
  211. 1466
  212. 1467
  213. 1468
  214. 1469
  215. 1470
  216. 1471
  217. 1472
  218. 1473
  219. 1474
  220. 1475
  221. 1476
  222. 1477
  223. 1478
  224. 1479
  225. 1480
  226. 1481
  227. 1482
  228. 1483
  229. 1484
  230. 1485
  231. 1486
  232. 1487
  233. 1488
  234. 1489
  235. 1490
  236. 1491
  237. 1492
  238. 1493
  239. 1494
  240. 1495
  241. 1496
  242. 1497
  243. 1498
  244. 1499
  245. 14100
  246. 14101
  247. 14102
  248. 14103
  249. 14104
  250. 14105
  251. 14106
  252. 14107
  253. 14108
  254. 14109
  255. 14110
  256. 14111
  257. 14112
  258. 14113
  259. 14114
  260. 14115
  261. 14116
  262. 14117
  263. 14118
  264. 14119
  265. 14120
  266. 14121
  267. 14122
  268. 14123
  269. 14124
  270. 14125
  271. 14126
  272. 14127
  273. 14128
  274. 14129
  275. 14130
  276. 14131
  277. 14132
  278. 14133
  279. 14134
  280. 14135
  281. 14136
  282. 14137
  283. 14138
  284. 14139
  285. 14140
  286. 14141
  287. 14142
  288. 14143
  289. 14144
  290. 14145
  291. 14146
  292. 14147
  293. 14148
  294. 14149
  295. 14150
  296. 14151
  297. 14152
  298. 14153
  299. 14154
  300. 14155
  301. 14156
  302. 14157
  303. 14158
  304. 14159
  305. 14160
  306. 14161
  307. 14162
  308. 14163
  309. 14164
  310. 14165
  311. 14166
  312. 14167
  313. 14168
  314. 14169
  315. 14170
  316. 14171
  317. 14172
  318. 14173
  319. 14174
  320. 14175
  321. 14176
  322. 14177
  323. 14178
  324. 14179
  325. 14180
  326. 14181
  327. 14182
  328. 14183
  329. 14184
  330. 14185
  331. 14186
  332. 14187
  333. 14188
  334. 14189
  335. 14190
  336. 14191
  337. 14192
  338. 14193
  339. 14194
  340. 14195
  341. 14196
  342. 14197
  343. anm14
  344. 14EndLeft
  345. 14StepLeft
  346. 14PauseLeft
  347. 14PlayLeft
  348. 14PlayPauseLeft
  349. 14PauseRight
  350. 14PlayRight
  351. 14PlayPauseRight
  352. 14StepRight
  353. 14EndRight
  354. 14Minus
  355. 14Reset
  356. 14Plus
  357. pbsARFix247
  358. pbsARFix248
  359. 150
  360. 151
  361. 152
  362. 153
  363. 154
  364. 155
  365. 156
  366. 157
  367. 158
  368. 159
  369. 1510
  370. 1511
  371. 1512
  372. 1513
  373. 1514
  374. 1515
  375. 1516
  376. 1517
  377. 1518
  378. 1519
  379. anm15
  380. 15EndLeft
  381. 15StepLeft
  382. 15PauseLeft
  383. 15PlayLeft
  384. 15PlayPauseLeft
  385. 15PauseRight
  386. 15PlayRight
  387. 15PlayPauseRight
  388. 15StepRight
  389. 15EndRight
  390. 15Minus
  391. 15Reset
  392. 15Plus
  393. pbsARFix249
  394. pbsARFix250
  395. pbsARFix251
  396. pbsARFix252
  397. pbsARFix253
  398. pbsARFix254
  399. pbsARFix255
  400. pbsARFix256
  401. pbsARFix257
  402. pbsARFix258
  403. pbsARFix259
  404. pbsARFix260
  405. pbsARFix261
Page 34: Black-ScholesPricingandHedging - NTU · to the Black-Scholes PDE (6.2) in order to price a claim payoff Cof the formC= h(S T).Asinthediscrete-timecase,thearbitragepriceπt(C) at

N Privault

0

01

02

03

04

05

06

05 06 07 08 09 1 11 12 13 14 15σimp

Optio

n pr

ice

σ

Market price

Fig 621 Option price as a function of the volatility σ gt 0

1 BSCall lt- function(S K r T sigma)d1 lt- (log(SK)+(r+sigma^22)T)(sigmasqrt(T))d2 lt- d1 - sigma sqrt(T)

3 BSCall = Spnorm(d1) - Kexp(-rT)pnorm(d2)BSCallsigma lt- seq(0515 length=100)

5 plot(sigmaBSCall(172360800437746365sigma) type=llty=1 xlab=Sigmaylab=Black-Scholes Call Price ylim = c(006)col=bluelwd=3)grid()

abline(h=023col=redlwd=3)

Knowing that the closing price of the warrant on November 07 2008 wasHK$ 0023 which value can you infer for the implied volatility σ at thisdatelowast

Exercise 67 Forward contracts Recall that the price πt(C) of a claimpayoff C = h(ST ) of maturity T can be written as πt(C) = g(tSt) wherethe function g(tx) satisfies the Black-Scholes PDE

rg(tx) = partg

partt(tx) + rx

partg

partx(tx) + 1

2σ2x2 part

2g

partx2 (tx)

g(T x) = h(x) (1)

with terminal condition g(T x) = h(x) x gt 0

a) Assume that C is a forward contract with payoff

C = ST minusK

at time T Find the function h(x) in (1)b) Find the solution g(tx) of the above PDE and compute the price πt(C)

at time t isin [0T ]Hint search for a solution of the form g(tx) = xminus α(t) where α(t) is afunction of t to be determined

lowast Download the corresponding or the that can be runhere

234

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

BS lt- function(S K T r sig)d1 lt- (log(SK) + (r + sig^22)T) (sigsqrt(T))d2 lt- d1 - sigsqrt(T)return(Spnorm(d1) - Kexp(-rT)pnorm(d2))impliedvol lt- function(S K T r market)sig lt- 020sigup lt- 1sigdown lt- 0001count lt- 0err lt- BS(S K T r sig) - marketwhile(abs(err) gt 000001 ampamp countlt1000)if(err lt 0)sigdown lt- sigsig lt- (sigup + sig)2elsesigup lt- sigsig lt- (sigdown + sig)2err lt- BS(S K T r sig) - marketcount lt- count + 1if(count==2000)return(NA)elsereturn(sig)market = 083K = 628T = 7 365S = 634r = 002impliedvol(S K T r market)

cells [ cell_type code execution_count null metadata outputs [] source [ from IPythoncoredisplay import display HTMLn display(HTML( )) ] cell_type code execution_count null metadata collapsed true outputs [] source [ import numpy as npn import scipystats as ssn import time n n Black and Scholesn def d1(S0 K r sigma T)n return (nplog(S0K) + (r + sigma2 2) T)(sigma npsqrt(T))n n def d2(S0 K r sigma T)n return (nplog(S0 K) + (r - sigma2 2) T) (sigma npsqrt(T))n n def BlackScholes(typeS0 K r sigma T)n if type==Cn return S0 ssnormcdf(d1(S0 K r sigma T)) - K npexp(-r T) ssnormcdf(d2(S0 K r sigma T))n elsen return K npexp(-r T) ssnormcdf(-d2(S0 K r sigma T)) - S0 ssnormcdf(-d1(S0 K r sigma T)) ] cell_type code execution_count null metadata outputs [] source [ BlackScholes(C1000 1200 002 015 10) ] cell_type code execution_count null metadata outputs [] source [ def difference(x p S K r t)n return BlackScholes(CS K r x t) - p ] cell_type code execution_count null metadata outputs [] source [ from scipyoptimize import bisectn bisect(difference00011args=(11541763731112766 1000 1200 002 10)) ] ] metadata anaconda-cloud kernelspec display_name Python 3 language python name python3 language_info codemirror_mode name ipython version 3 file_extension py mimetype textx-python name python nbconvert_exporter python pygments_lexer ipython3 version 375rc1 nbformat 4 nbformat_minor 1

Black-Scholes Pricing and Hedging

c) Compute the quantityξt =

partg

partx(tSt)

of risky assets in a self-financing portfolio hedging Cd) Repeat the above questions with the terminal condition g(T x) = x

Exercise 68a) Solve the Black-Scholes PDE

rg(tx) = partg

partt(tx) + rx

partg

partx(tx) + σ2

2 x2 part2g

partx2 (tx) (634)

with terminal condition g(T x) = 1 x gt 0

Hint Try a solution of the form g(tx) = f(t) and find f(t)

b) Find the respective quantities ξt and ηt of the risky asset St and risklessasset At = ert in the portfolio with value

Vt = g(tSt) = ξtSt + ηtAt

hedging the contract with payoff $1 at maturity

Exercise 69 Log-contracts see also Exercise 84a) Solve the PDE

0 =partg

partt(x t) + rx

partg

partx(x t) + σ2

2 x2 part2g

partx2 (x t)

with the terminal condition g(xT ) = log x x gt 0

Hint Try a solution of the form g(x t) = f(t) + log x and find f(t)b) Solve the Black-Scholes PDE

rh(x t) = parth

partt(x t) + rx

parth

partx(x t) + σ2

2 x2 part2h

partx2 (x t) (635)

with the terminal condition h(xT ) = log x x gt 0

Hint Try a solution of the form h(x t) = u(t)g(x t) and find u(t)c) Find the respective quantities ξt and ηt of the risky asset St and riskless

asset At = ert in the portfolio with value

Vt = g(St t) = ξtSt + ηtAt

hedging a log-contract with payoff logST at maturity 235

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

Exercise 610 Binary options Consider a price process (St)tisinR+ given by

dStSt

= rdt+ σdBt S0 = 1

under the risk-neutral probability measure Plowast The binary (or digital) calloption is a contract with maturity T strike price K and payoff

Cd = 1[Kinfin)(ST ) =

$1 if ST gt K

0 if ST lt K

a) Derive the Black-Schole PDE satisfied by the pricing function Cd(tSt) ofthe binary call option together with its terminal condition

b) Show that the solution Cd(tx) of the Black-Scholes PDE of Question (a)is given by

Cd(tx) = eminus(Tminust)rΦ((rminus σ22)(T minus t) + log(xK)

|σ|radicT minus t

)= eminus(Tminust)rΦ

(dminus(T minus t)

)

where

dminus(T minus t) =(rminus σ22)(T minus t) + log(StK)

|σ|radicT minus t

0 6 t lt T

Exercise 611

a) Bachelier (1900) model Solve the stochastic differential equation

dSt = αStdt+ σdBt (636)

in terms of ασ isin R and the initial condition S0b) Write down the Bachelier PDE satisfied by the function C(tx) where

C(tSt) is the price at time t isin [0T ] of the contingent claim with payoffφ(ST ) = exp(ST ) and identify the process Delta (ξt)tisin[0T ] that hedgesthis claim

c) Solve the Black-Scholes PDE of Question (b) with the terminal conditionφ(x) = ex x isin R

Hint Search for a solution of the form

C(tx) = exp(minus(T minus t)r+ xh(t) +

σ2

4r (h2(t)minus 1)

) (637)

where h(t) is a function to be determined with h(T ) = 1

236

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

d) Compute the portfolio strategy (ξt ηt)tisin[0T ] that hedges the contingentclaim with payoff exp(ST )

Exercise 612

a) Show that for every fixed value of S the function

d 7minusrarr h(S d) = SΦ(d+ |σ|

radicT)minusK eminusrTΦ(d)

reaches its maximum at dlowast(S) =log(SK) + (rminus σ22)T

|σ|radicT

b) By the differentiation rule

d

dSh(S dlowast(S)) =

parth

partS(S dlowast(S)) + dprimelowast(S)

parth

partd(S dlowast(S))

recover the value of the Black-Scholes Delta

Exercise 613 Compute the Black-Scholes Vega by differentiation of theBlack-Scholes function

gc(tx) = Bl(Kxσ rT minus t) = xΦ(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)

with respect to the volatility parameter σ knowing that

minus12(dminus(T minus t)

)2= minus1

2

(log(xK) + (rminus σ22)(T minus t)

|σ|radicT minus t

)2

= minus12(d+(T minus t)

)2+ (T minus t)r+ log x

K (638)

Exercise 614 Consider the backward induction relation (313) ie

v(tx) = (1minus plowastN )v (t+ 1x(1 + aN )) + plowastN v (t+ 1x(1 + bN ))

using the renormalizations rN = rTN and

aN = (1 + rN )(1minus |σ|radicTN)minus 1 bN = (1 + rN )(1 + |σ|

radicTN)minus 1

of Section 36 N gt 1 with

plowastN =rN minus aNbN minus aN

and plowastN =bN minus rNbN minus aN

a) Show that the Black-Scholes PDE (62) of Proposition 61 can be recoveredfrom the induction relation (313) when the number N of time steps tendsto infinity

237

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

b) Show that the expression of the Delta ξt =partgcpartx

(tSt) can be similarlyrecovered from the finite difference relation (319) ie

ξ(1)t (Stminus1) =

v (t (1 + bN )Stminus1)minus v (t (1 + aN )Stminus1)

Stminus1(bN minus aN )

as N tends to infinity

Problem 615 (Leung and Sircar (2015)) ProShares Ultra SampP500 andProShares UltraShort SampP500 are leveraged investment funds that seek dailyinvestment results before fees and expenses that correspond to β times (βx)the daily performance of the SampP500reg with respectively β = 2 for ProSharesUltra and β = minus2 for ProShares UltraShort Here leveraging with a factorβ 1 aims at multiplying the potential return of an investment by a factorβ The following 10 questions are interdependent and should be treated insequence

a) Consider a risky asset priced S0 = $4 at time t = 0 and taking twopossible values S1 = $5 and S1 = $2 at time t = 1 Compute the twopossible returns (in ) achieved when investing $4 in one share of the assetS and the expected return under the risk-neutral probability measureassuming that the risk-free interest rate is zero

b) Leveraging Still based on an initial $4 investment we decide to leverageby a factor β = 3 by borrowing another (β minus 1) times $4 = 2times $4 at ratezero to purchase a total of β = 3 shares of the asset S Compute thetwo returns (in ) possibly achieved in this case and the expected returnunder the risk-neutral probability measure assuming that the risk-freeinterest rate is zero

c) Denoting by Ft the ProShares value at time t how much should the fundinvest in the underlying asset priced St and how much $ should it borrowor save on the risk-free market at any time t in order to leverage with afactor β 1

d) Find the portfolio allocation (ξt ηt) for the fund value

Ft = ξtSt + ηtAt t isin R+

according to Question (c) where At = A0 ert is the riskless money marketaccount

e) We choose to model the SampP500 index St as the geometric Brownianmotion

dSt = rStdt+ σStdBt t isin R+

under the risk-neutral probability measure Plowast Find the stochastic dif-ferential equation satisfied by (Ft)tisinR+ under the self-financing conditiondFt = ξtdSt + ηtdAt

238

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

f) Is the discounted fund value ( eminusrtFt)tisinR+ a martingale under the risk-neutral probability measure Plowast

g) Find the relation between the fund value Ft and the index St by solvingthe stochastic differential equation obtained for Ft in Question (e) Forsimplicity we normalize F0 = Sβ0

h) Write the price at time t = 0 of the call option with payoff (FT minusK)+ onthe ProShares index using the Black-Scholes formula

i) Show that when β gt 0 the Delta at time t isin [0T ) of the call optionwith payoff (FT minusK)+ on ProShares Ultra is equal to the Delta of thecall option with payoff (ST minusKβ(t))

+ on the SampP500 for a certain strikeprice Kβ(t) to be determined explicitly

j) When β lt 0 find the relation between the Delta at time t isin [0T ) ofthe call option with payoff (FT minusK)+ on ProShares UltraShort and theDelta of the put option with payoff (Kβ(t)minus ST )+ on the SampP500

239

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

  1. pbsARFix223
  2. pbsARFix224
  3. pbsARFix225
  4. pbsARFix226
  5. pbsARFix227
  6. pbsARFix228
  7. pbsARFix229
  8. pbsARFix230
  9. fdrm1
  10. pbsARFix231
  11. 100
  12. 101
  13. 102
  14. 103
  15. 104
  16. 105
  17. 106
  18. 107
  19. 108
  20. 109
  21. 1010
  22. 1011
  23. 1012
  24. 1013
  25. 1014
  26. 1015
  27. 1016
  28. 1017
  29. 1018
  30. 1019
  31. anm10
  32. 10EndLeft
  33. 10StepLeft
  34. 10PauseLeft
  35. 10PlayLeft
  36. 10PlayPauseLeft
  37. 10PauseRight
  38. 10PlayRight
  39. 10PlayPauseRight
  40. 10StepRight
  41. 10EndRight
  42. 10Minus
  43. 10Reset
  44. 10Plus
  45. pbsARFix232
  46. pbsARFix233
  47. pbsARFix234
  48. pbsARFix235
  49. pbsARFix236
  50. pbsARFix237
  51. fdrm2
  52. 110
  53. 111
  54. 112
  55. 113
  56. 114
  57. 115
  58. 116
  59. 117
  60. 118
  61. 119
  62. 1110
  63. 1111
  64. 1112
  65. 1113
  66. 1114
  67. 1115
  68. 1116
  69. 1117
  70. 1118
  71. 1119
  72. anm11
  73. 11EndLeft
  74. 11StepLeft
  75. 11PauseLeft
  76. 11PlayLeft
  77. 11PlayPauseLeft
  78. 11PauseRight
  79. 11PlayRight
  80. 11PlayPauseRight
  81. 11StepRight
  82. 11EndRight
  83. 11Minus
  84. 11Reset
  85. 11Plus
  86. pbsARFix238
  87. pbsARFix239
  88. pbsARFix240
  89. pbsARFix241
  90. pbsARFix242
  91. 120
  92. 121
  93. 122
  94. 123
  95. 124
  96. 125
  97. 126
  98. 127
  99. 128
  100. 129
  101. 1210
  102. anm12
  103. 12EndLeft
  104. 12StepLeft
  105. 12PauseLeft
  106. 12PlayLeft
  107. 12PlayPauseLeft
  108. 12PauseRight
  109. 12PlayRight
  110. 12PlayPauseRight
  111. 12StepRight
  112. 12EndRight
  113. 12Minus
  114. 12Reset
  115. 12Plus
  116. 130
  117. 131
  118. 132
  119. 133
  120. 134
  121. 135
  122. 136
  123. 137
  124. 138
  125. 139
  126. 1310
  127. anm13
  128. 13EndLeft
  129. 13StepLeft
  130. 13PauseLeft
  131. 13PlayLeft
  132. 13PlayPauseLeft
  133. 13PauseRight
  134. 13PlayRight
  135. 13PlayPauseRight
  136. 13StepRight
  137. 13EndRight
  138. 13Minus
  139. 13Reset
  140. 13Plus
  141. pbsARFix243
  142. pbsARFix244
  143. pbsARFix245
  144. pbsARFix246
  145. 140
  146. 141
  147. 142
  148. 143
  149. 144
  150. 145
  151. 146
  152. 147
  153. 148
  154. 149
  155. 1410
  156. 1411
  157. 1412
  158. 1413
  159. 1414
  160. 1415
  161. 1416
  162. 1417
  163. 1418
  164. 1419
  165. 1420
  166. 1421
  167. 1422
  168. 1423
  169. 1424
  170. 1425
  171. 1426
  172. 1427
  173. 1428
  174. 1429
  175. 1430
  176. 1431
  177. 1432
  178. 1433
  179. 1434
  180. 1435
  181. 1436
  182. 1437
  183. 1438
  184. 1439
  185. 1440
  186. 1441
  187. 1442
  188. 1443
  189. 1444
  190. 1445
  191. 1446
  192. 1447
  193. 1448
  194. 1449
  195. 1450
  196. 1451
  197. 1452
  198. 1453
  199. 1454
  200. 1455
  201. 1456
  202. 1457
  203. 1458
  204. 1459
  205. 1460
  206. 1461
  207. 1462
  208. 1463
  209. 1464
  210. 1465
  211. 1466
  212. 1467
  213. 1468
  214. 1469
  215. 1470
  216. 1471
  217. 1472
  218. 1473
  219. 1474
  220. 1475
  221. 1476
  222. 1477
  223. 1478
  224. 1479
  225. 1480
  226. 1481
  227. 1482
  228. 1483
  229. 1484
  230. 1485
  231. 1486
  232. 1487
  233. 1488
  234. 1489
  235. 1490
  236. 1491
  237. 1492
  238. 1493
  239. 1494
  240. 1495
  241. 1496
  242. 1497
  243. 1498
  244. 1499
  245. 14100
  246. 14101
  247. 14102
  248. 14103
  249. 14104
  250. 14105
  251. 14106
  252. 14107
  253. 14108
  254. 14109
  255. 14110
  256. 14111
  257. 14112
  258. 14113
  259. 14114
  260. 14115
  261. 14116
  262. 14117
  263. 14118
  264. 14119
  265. 14120
  266. 14121
  267. 14122
  268. 14123
  269. 14124
  270. 14125
  271. 14126
  272. 14127
  273. 14128
  274. 14129
  275. 14130
  276. 14131
  277. 14132
  278. 14133
  279. 14134
  280. 14135
  281. 14136
  282. 14137
  283. 14138
  284. 14139
  285. 14140
  286. 14141
  287. 14142
  288. 14143
  289. 14144
  290. 14145
  291. 14146
  292. 14147
  293. 14148
  294. 14149
  295. 14150
  296. 14151
  297. 14152
  298. 14153
  299. 14154
  300. 14155
  301. 14156
  302. 14157
  303. 14158
  304. 14159
  305. 14160
  306. 14161
  307. 14162
  308. 14163
  309. 14164
  310. 14165
  311. 14166
  312. 14167
  313. 14168
  314. 14169
  315. 14170
  316. 14171
  317. 14172
  318. 14173
  319. 14174
  320. 14175
  321. 14176
  322. 14177
  323. 14178
  324. 14179
  325. 14180
  326. 14181
  327. 14182
  328. 14183
  329. 14184
  330. 14185
  331. 14186
  332. 14187
  333. 14188
  334. 14189
  335. 14190
  336. 14191
  337. 14192
  338. 14193
  339. 14194
  340. 14195
  341. 14196
  342. 14197
  343. anm14
  344. 14EndLeft
  345. 14StepLeft
  346. 14PauseLeft
  347. 14PlayLeft
  348. 14PlayPauseLeft
  349. 14PauseRight
  350. 14PlayRight
  351. 14PlayPauseRight
  352. 14StepRight
  353. 14EndRight
  354. 14Minus
  355. 14Reset
  356. 14Plus
  357. pbsARFix247
  358. pbsARFix248
  359. 150
  360. 151
  361. 152
  362. 153
  363. 154
  364. 155
  365. 156
  366. 157
  367. 158
  368. 159
  369. 1510
  370. 1511
  371. 1512
  372. 1513
  373. 1514
  374. 1515
  375. 1516
  376. 1517
  377. 1518
  378. 1519
  379. anm15
  380. 15EndLeft
  381. 15StepLeft
  382. 15PauseLeft
  383. 15PlayLeft
  384. 15PlayPauseLeft
  385. 15PauseRight
  386. 15PlayRight
  387. 15PlayPauseRight
  388. 15StepRight
  389. 15EndRight
  390. 15Minus
  391. 15Reset
  392. 15Plus
  393. pbsARFix249
  394. pbsARFix250
  395. pbsARFix251
  396. pbsARFix252
  397. pbsARFix253
  398. pbsARFix254
  399. pbsARFix255
  400. pbsARFix256
  401. pbsARFix257
  402. pbsARFix258
  403. pbsARFix259
  404. pbsARFix260
  405. pbsARFix261
Page 35: Black-ScholesPricingandHedging - NTU · to the Black-Scholes PDE (6.2) in order to price a claim payoff Cof the formC= h(S T).Asinthediscrete-timecase,thearbitragepriceπt(C) at

Black-Scholes Pricing and Hedging

c) Compute the quantityξt =

partg

partx(tSt)

of risky assets in a self-financing portfolio hedging Cd) Repeat the above questions with the terminal condition g(T x) = x

Exercise 68a) Solve the Black-Scholes PDE

rg(tx) = partg

partt(tx) + rx

partg

partx(tx) + σ2

2 x2 part2g

partx2 (tx) (634)

with terminal condition g(T x) = 1 x gt 0

Hint Try a solution of the form g(tx) = f(t) and find f(t)

b) Find the respective quantities ξt and ηt of the risky asset St and risklessasset At = ert in the portfolio with value

Vt = g(tSt) = ξtSt + ηtAt

hedging the contract with payoff $1 at maturity

Exercise 69 Log-contracts see also Exercise 84a) Solve the PDE

0 =partg

partt(x t) + rx

partg

partx(x t) + σ2

2 x2 part2g

partx2 (x t)

with the terminal condition g(xT ) = log x x gt 0

Hint Try a solution of the form g(x t) = f(t) + log x and find f(t)b) Solve the Black-Scholes PDE

rh(x t) = parth

partt(x t) + rx

parth

partx(x t) + σ2

2 x2 part2h

partx2 (x t) (635)

with the terminal condition h(xT ) = log x x gt 0

Hint Try a solution of the form h(x t) = u(t)g(x t) and find u(t)c) Find the respective quantities ξt and ηt of the risky asset St and riskless

asset At = ert in the portfolio with value

Vt = g(St t) = ξtSt + ηtAt

hedging a log-contract with payoff logST at maturity 235

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

Exercise 610 Binary options Consider a price process (St)tisinR+ given by

dStSt

= rdt+ σdBt S0 = 1

under the risk-neutral probability measure Plowast The binary (or digital) calloption is a contract with maturity T strike price K and payoff

Cd = 1[Kinfin)(ST ) =

$1 if ST gt K

0 if ST lt K

a) Derive the Black-Schole PDE satisfied by the pricing function Cd(tSt) ofthe binary call option together with its terminal condition

b) Show that the solution Cd(tx) of the Black-Scholes PDE of Question (a)is given by

Cd(tx) = eminus(Tminust)rΦ((rminus σ22)(T minus t) + log(xK)

|σ|radicT minus t

)= eminus(Tminust)rΦ

(dminus(T minus t)

)

where

dminus(T minus t) =(rminus σ22)(T minus t) + log(StK)

|σ|radicT minus t

0 6 t lt T

Exercise 611

a) Bachelier (1900) model Solve the stochastic differential equation

dSt = αStdt+ σdBt (636)

in terms of ασ isin R and the initial condition S0b) Write down the Bachelier PDE satisfied by the function C(tx) where

C(tSt) is the price at time t isin [0T ] of the contingent claim with payoffφ(ST ) = exp(ST ) and identify the process Delta (ξt)tisin[0T ] that hedgesthis claim

c) Solve the Black-Scholes PDE of Question (b) with the terminal conditionφ(x) = ex x isin R

Hint Search for a solution of the form

C(tx) = exp(minus(T minus t)r+ xh(t) +

σ2

4r (h2(t)minus 1)

) (637)

where h(t) is a function to be determined with h(T ) = 1

236

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

d) Compute the portfolio strategy (ξt ηt)tisin[0T ] that hedges the contingentclaim with payoff exp(ST )

Exercise 612

a) Show that for every fixed value of S the function

d 7minusrarr h(S d) = SΦ(d+ |σ|

radicT)minusK eminusrTΦ(d)

reaches its maximum at dlowast(S) =log(SK) + (rminus σ22)T

|σ|radicT

b) By the differentiation rule

d

dSh(S dlowast(S)) =

parth

partS(S dlowast(S)) + dprimelowast(S)

parth

partd(S dlowast(S))

recover the value of the Black-Scholes Delta

Exercise 613 Compute the Black-Scholes Vega by differentiation of theBlack-Scholes function

gc(tx) = Bl(Kxσ rT minus t) = xΦ(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)

with respect to the volatility parameter σ knowing that

minus12(dminus(T minus t)

)2= minus1

2

(log(xK) + (rminus σ22)(T minus t)

|σ|radicT minus t

)2

= minus12(d+(T minus t)

)2+ (T minus t)r+ log x

K (638)

Exercise 614 Consider the backward induction relation (313) ie

v(tx) = (1minus plowastN )v (t+ 1x(1 + aN )) + plowastN v (t+ 1x(1 + bN ))

using the renormalizations rN = rTN and

aN = (1 + rN )(1minus |σ|radicTN)minus 1 bN = (1 + rN )(1 + |σ|

radicTN)minus 1

of Section 36 N gt 1 with

plowastN =rN minus aNbN minus aN

and plowastN =bN minus rNbN minus aN

a) Show that the Black-Scholes PDE (62) of Proposition 61 can be recoveredfrom the induction relation (313) when the number N of time steps tendsto infinity

237

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

b) Show that the expression of the Delta ξt =partgcpartx

(tSt) can be similarlyrecovered from the finite difference relation (319) ie

ξ(1)t (Stminus1) =

v (t (1 + bN )Stminus1)minus v (t (1 + aN )Stminus1)

Stminus1(bN minus aN )

as N tends to infinity

Problem 615 (Leung and Sircar (2015)) ProShares Ultra SampP500 andProShares UltraShort SampP500 are leveraged investment funds that seek dailyinvestment results before fees and expenses that correspond to β times (βx)the daily performance of the SampP500reg with respectively β = 2 for ProSharesUltra and β = minus2 for ProShares UltraShort Here leveraging with a factorβ 1 aims at multiplying the potential return of an investment by a factorβ The following 10 questions are interdependent and should be treated insequence

a) Consider a risky asset priced S0 = $4 at time t = 0 and taking twopossible values S1 = $5 and S1 = $2 at time t = 1 Compute the twopossible returns (in ) achieved when investing $4 in one share of the assetS and the expected return under the risk-neutral probability measureassuming that the risk-free interest rate is zero

b) Leveraging Still based on an initial $4 investment we decide to leverageby a factor β = 3 by borrowing another (β minus 1) times $4 = 2times $4 at ratezero to purchase a total of β = 3 shares of the asset S Compute thetwo returns (in ) possibly achieved in this case and the expected returnunder the risk-neutral probability measure assuming that the risk-freeinterest rate is zero

c) Denoting by Ft the ProShares value at time t how much should the fundinvest in the underlying asset priced St and how much $ should it borrowor save on the risk-free market at any time t in order to leverage with afactor β 1

d) Find the portfolio allocation (ξt ηt) for the fund value

Ft = ξtSt + ηtAt t isin R+

according to Question (c) where At = A0 ert is the riskless money marketaccount

e) We choose to model the SampP500 index St as the geometric Brownianmotion

dSt = rStdt+ σStdBt t isin R+

under the risk-neutral probability measure Plowast Find the stochastic dif-ferential equation satisfied by (Ft)tisinR+ under the self-financing conditiondFt = ξtdSt + ηtdAt

238

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

f) Is the discounted fund value ( eminusrtFt)tisinR+ a martingale under the risk-neutral probability measure Plowast

g) Find the relation between the fund value Ft and the index St by solvingthe stochastic differential equation obtained for Ft in Question (e) Forsimplicity we normalize F0 = Sβ0

h) Write the price at time t = 0 of the call option with payoff (FT minusK)+ onthe ProShares index using the Black-Scholes formula

i) Show that when β gt 0 the Delta at time t isin [0T ) of the call optionwith payoff (FT minusK)+ on ProShares Ultra is equal to the Delta of thecall option with payoff (ST minusKβ(t))

+ on the SampP500 for a certain strikeprice Kβ(t) to be determined explicitly

j) When β lt 0 find the relation between the Delta at time t isin [0T ) ofthe call option with payoff (FT minusK)+ on ProShares UltraShort and theDelta of the put option with payoff (Kβ(t)minus ST )+ on the SampP500

239

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

  1. pbsARFix223
  2. pbsARFix224
  3. pbsARFix225
  4. pbsARFix226
  5. pbsARFix227
  6. pbsARFix228
  7. pbsARFix229
  8. pbsARFix230
  9. fdrm1
  10. pbsARFix231
  11. 100
  12. 101
  13. 102
  14. 103
  15. 104
  16. 105
  17. 106
  18. 107
  19. 108
  20. 109
  21. 1010
  22. 1011
  23. 1012
  24. 1013
  25. 1014
  26. 1015
  27. 1016
  28. 1017
  29. 1018
  30. 1019
  31. anm10
  32. 10EndLeft
  33. 10StepLeft
  34. 10PauseLeft
  35. 10PlayLeft
  36. 10PlayPauseLeft
  37. 10PauseRight
  38. 10PlayRight
  39. 10PlayPauseRight
  40. 10StepRight
  41. 10EndRight
  42. 10Minus
  43. 10Reset
  44. 10Plus
  45. pbsARFix232
  46. pbsARFix233
  47. pbsARFix234
  48. pbsARFix235
  49. pbsARFix236
  50. pbsARFix237
  51. fdrm2
  52. 110
  53. 111
  54. 112
  55. 113
  56. 114
  57. 115
  58. 116
  59. 117
  60. 118
  61. 119
  62. 1110
  63. 1111
  64. 1112
  65. 1113
  66. 1114
  67. 1115
  68. 1116
  69. 1117
  70. 1118
  71. 1119
  72. anm11
  73. 11EndLeft
  74. 11StepLeft
  75. 11PauseLeft
  76. 11PlayLeft
  77. 11PlayPauseLeft
  78. 11PauseRight
  79. 11PlayRight
  80. 11PlayPauseRight
  81. 11StepRight
  82. 11EndRight
  83. 11Minus
  84. 11Reset
  85. 11Plus
  86. pbsARFix238
  87. pbsARFix239
  88. pbsARFix240
  89. pbsARFix241
  90. pbsARFix242
  91. 120
  92. 121
  93. 122
  94. 123
  95. 124
  96. 125
  97. 126
  98. 127
  99. 128
  100. 129
  101. 1210
  102. anm12
  103. 12EndLeft
  104. 12StepLeft
  105. 12PauseLeft
  106. 12PlayLeft
  107. 12PlayPauseLeft
  108. 12PauseRight
  109. 12PlayRight
  110. 12PlayPauseRight
  111. 12StepRight
  112. 12EndRight
  113. 12Minus
  114. 12Reset
  115. 12Plus
  116. 130
  117. 131
  118. 132
  119. 133
  120. 134
  121. 135
  122. 136
  123. 137
  124. 138
  125. 139
  126. 1310
  127. anm13
  128. 13EndLeft
  129. 13StepLeft
  130. 13PauseLeft
  131. 13PlayLeft
  132. 13PlayPauseLeft
  133. 13PauseRight
  134. 13PlayRight
  135. 13PlayPauseRight
  136. 13StepRight
  137. 13EndRight
  138. 13Minus
  139. 13Reset
  140. 13Plus
  141. pbsARFix243
  142. pbsARFix244
  143. pbsARFix245
  144. pbsARFix246
  145. 140
  146. 141
  147. 142
  148. 143
  149. 144
  150. 145
  151. 146
  152. 147
  153. 148
  154. 149
  155. 1410
  156. 1411
  157. 1412
  158. 1413
  159. 1414
  160. 1415
  161. 1416
  162. 1417
  163. 1418
  164. 1419
  165. 1420
  166. 1421
  167. 1422
  168. 1423
  169. 1424
  170. 1425
  171. 1426
  172. 1427
  173. 1428
  174. 1429
  175. 1430
  176. 1431
  177. 1432
  178. 1433
  179. 1434
  180. 1435
  181. 1436
  182. 1437
  183. 1438
  184. 1439
  185. 1440
  186. 1441
  187. 1442
  188. 1443
  189. 1444
  190. 1445
  191. 1446
  192. 1447
  193. 1448
  194. 1449
  195. 1450
  196. 1451
  197. 1452
  198. 1453
  199. 1454
  200. 1455
  201. 1456
  202. 1457
  203. 1458
  204. 1459
  205. 1460
  206. 1461
  207. 1462
  208. 1463
  209. 1464
  210. 1465
  211. 1466
  212. 1467
  213. 1468
  214. 1469
  215. 1470
  216. 1471
  217. 1472
  218. 1473
  219. 1474
  220. 1475
  221. 1476
  222. 1477
  223. 1478
  224. 1479
  225. 1480
  226. 1481
  227. 1482
  228. 1483
  229. 1484
  230. 1485
  231. 1486
  232. 1487
  233. 1488
  234. 1489
  235. 1490
  236. 1491
  237. 1492
  238. 1493
  239. 1494
  240. 1495
  241. 1496
  242. 1497
  243. 1498
  244. 1499
  245. 14100
  246. 14101
  247. 14102
  248. 14103
  249. 14104
  250. 14105
  251. 14106
  252. 14107
  253. 14108
  254. 14109
  255. 14110
  256. 14111
  257. 14112
  258. 14113
  259. 14114
  260. 14115
  261. 14116
  262. 14117
  263. 14118
  264. 14119
  265. 14120
  266. 14121
  267. 14122
  268. 14123
  269. 14124
  270. 14125
  271. 14126
  272. 14127
  273. 14128
  274. 14129
  275. 14130
  276. 14131
  277. 14132
  278. 14133
  279. 14134
  280. 14135
  281. 14136
  282. 14137
  283. 14138
  284. 14139
  285. 14140
  286. 14141
  287. 14142
  288. 14143
  289. 14144
  290. 14145
  291. 14146
  292. 14147
  293. 14148
  294. 14149
  295. 14150
  296. 14151
  297. 14152
  298. 14153
  299. 14154
  300. 14155
  301. 14156
  302. 14157
  303. 14158
  304. 14159
  305. 14160
  306. 14161
  307. 14162
  308. 14163
  309. 14164
  310. 14165
  311. 14166
  312. 14167
  313. 14168
  314. 14169
  315. 14170
  316. 14171
  317. 14172
  318. 14173
  319. 14174
  320. 14175
  321. 14176
  322. 14177
  323. 14178
  324. 14179
  325. 14180
  326. 14181
  327. 14182
  328. 14183
  329. 14184
  330. 14185
  331. 14186
  332. 14187
  333. 14188
  334. 14189
  335. 14190
  336. 14191
  337. 14192
  338. 14193
  339. 14194
  340. 14195
  341. 14196
  342. 14197
  343. anm14
  344. 14EndLeft
  345. 14StepLeft
  346. 14PauseLeft
  347. 14PlayLeft
  348. 14PlayPauseLeft
  349. 14PauseRight
  350. 14PlayRight
  351. 14PlayPauseRight
  352. 14StepRight
  353. 14EndRight
  354. 14Minus
  355. 14Reset
  356. 14Plus
  357. pbsARFix247
  358. pbsARFix248
  359. 150
  360. 151
  361. 152
  362. 153
  363. 154
  364. 155
  365. 156
  366. 157
  367. 158
  368. 159
  369. 1510
  370. 1511
  371. 1512
  372. 1513
  373. 1514
  374. 1515
  375. 1516
  376. 1517
  377. 1518
  378. 1519
  379. anm15
  380. 15EndLeft
  381. 15StepLeft
  382. 15PauseLeft
  383. 15PlayLeft
  384. 15PlayPauseLeft
  385. 15PauseRight
  386. 15PlayRight
  387. 15PlayPauseRight
  388. 15StepRight
  389. 15EndRight
  390. 15Minus
  391. 15Reset
  392. 15Plus
  393. pbsARFix249
  394. pbsARFix250
  395. pbsARFix251
  396. pbsARFix252
  397. pbsARFix253
  398. pbsARFix254
  399. pbsARFix255
  400. pbsARFix256
  401. pbsARFix257
  402. pbsARFix258
  403. pbsARFix259
  404. pbsARFix260
  405. pbsARFix261
Page 36: Black-ScholesPricingandHedging - NTU · to the Black-Scholes PDE (6.2) in order to price a claim payoff Cof the formC= h(S T).Asinthediscrete-timecase,thearbitragepriceπt(C) at

N Privault

Exercise 610 Binary options Consider a price process (St)tisinR+ given by

dStSt

= rdt+ σdBt S0 = 1

under the risk-neutral probability measure Plowast The binary (or digital) calloption is a contract with maturity T strike price K and payoff

Cd = 1[Kinfin)(ST ) =

$1 if ST gt K

0 if ST lt K

a) Derive the Black-Schole PDE satisfied by the pricing function Cd(tSt) ofthe binary call option together with its terminal condition

b) Show that the solution Cd(tx) of the Black-Scholes PDE of Question (a)is given by

Cd(tx) = eminus(Tminust)rΦ((rminus σ22)(T minus t) + log(xK)

|σ|radicT minus t

)= eminus(Tminust)rΦ

(dminus(T minus t)

)

where

dminus(T minus t) =(rminus σ22)(T minus t) + log(StK)

|σ|radicT minus t

0 6 t lt T

Exercise 611

a) Bachelier (1900) model Solve the stochastic differential equation

dSt = αStdt+ σdBt (636)

in terms of ασ isin R and the initial condition S0b) Write down the Bachelier PDE satisfied by the function C(tx) where

C(tSt) is the price at time t isin [0T ] of the contingent claim with payoffφ(ST ) = exp(ST ) and identify the process Delta (ξt)tisin[0T ] that hedgesthis claim

c) Solve the Black-Scholes PDE of Question (b) with the terminal conditionφ(x) = ex x isin R

Hint Search for a solution of the form

C(tx) = exp(minus(T minus t)r+ xh(t) +

σ2

4r (h2(t)minus 1)

) (637)

where h(t) is a function to be determined with h(T ) = 1

236

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

d) Compute the portfolio strategy (ξt ηt)tisin[0T ] that hedges the contingentclaim with payoff exp(ST )

Exercise 612

a) Show that for every fixed value of S the function

d 7minusrarr h(S d) = SΦ(d+ |σ|

radicT)minusK eminusrTΦ(d)

reaches its maximum at dlowast(S) =log(SK) + (rminus σ22)T

|σ|radicT

b) By the differentiation rule

d

dSh(S dlowast(S)) =

parth

partS(S dlowast(S)) + dprimelowast(S)

parth

partd(S dlowast(S))

recover the value of the Black-Scholes Delta

Exercise 613 Compute the Black-Scholes Vega by differentiation of theBlack-Scholes function

gc(tx) = Bl(Kxσ rT minus t) = xΦ(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)

with respect to the volatility parameter σ knowing that

minus12(dminus(T minus t)

)2= minus1

2

(log(xK) + (rminus σ22)(T minus t)

|σ|radicT minus t

)2

= minus12(d+(T minus t)

)2+ (T minus t)r+ log x

K (638)

Exercise 614 Consider the backward induction relation (313) ie

v(tx) = (1minus plowastN )v (t+ 1x(1 + aN )) + plowastN v (t+ 1x(1 + bN ))

using the renormalizations rN = rTN and

aN = (1 + rN )(1minus |σ|radicTN)minus 1 bN = (1 + rN )(1 + |σ|

radicTN)minus 1

of Section 36 N gt 1 with

plowastN =rN minus aNbN minus aN

and plowastN =bN minus rNbN minus aN

a) Show that the Black-Scholes PDE (62) of Proposition 61 can be recoveredfrom the induction relation (313) when the number N of time steps tendsto infinity

237

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

b) Show that the expression of the Delta ξt =partgcpartx

(tSt) can be similarlyrecovered from the finite difference relation (319) ie

ξ(1)t (Stminus1) =

v (t (1 + bN )Stminus1)minus v (t (1 + aN )Stminus1)

Stminus1(bN minus aN )

as N tends to infinity

Problem 615 (Leung and Sircar (2015)) ProShares Ultra SampP500 andProShares UltraShort SampP500 are leveraged investment funds that seek dailyinvestment results before fees and expenses that correspond to β times (βx)the daily performance of the SampP500reg with respectively β = 2 for ProSharesUltra and β = minus2 for ProShares UltraShort Here leveraging with a factorβ 1 aims at multiplying the potential return of an investment by a factorβ The following 10 questions are interdependent and should be treated insequence

a) Consider a risky asset priced S0 = $4 at time t = 0 and taking twopossible values S1 = $5 and S1 = $2 at time t = 1 Compute the twopossible returns (in ) achieved when investing $4 in one share of the assetS and the expected return under the risk-neutral probability measureassuming that the risk-free interest rate is zero

b) Leveraging Still based on an initial $4 investment we decide to leverageby a factor β = 3 by borrowing another (β minus 1) times $4 = 2times $4 at ratezero to purchase a total of β = 3 shares of the asset S Compute thetwo returns (in ) possibly achieved in this case and the expected returnunder the risk-neutral probability measure assuming that the risk-freeinterest rate is zero

c) Denoting by Ft the ProShares value at time t how much should the fundinvest in the underlying asset priced St and how much $ should it borrowor save on the risk-free market at any time t in order to leverage with afactor β 1

d) Find the portfolio allocation (ξt ηt) for the fund value

Ft = ξtSt + ηtAt t isin R+

according to Question (c) where At = A0 ert is the riskless money marketaccount

e) We choose to model the SampP500 index St as the geometric Brownianmotion

dSt = rStdt+ σStdBt t isin R+

under the risk-neutral probability measure Plowast Find the stochastic dif-ferential equation satisfied by (Ft)tisinR+ under the self-financing conditiondFt = ξtdSt + ηtdAt

238

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

f) Is the discounted fund value ( eminusrtFt)tisinR+ a martingale under the risk-neutral probability measure Plowast

g) Find the relation between the fund value Ft and the index St by solvingthe stochastic differential equation obtained for Ft in Question (e) Forsimplicity we normalize F0 = Sβ0

h) Write the price at time t = 0 of the call option with payoff (FT minusK)+ onthe ProShares index using the Black-Scholes formula

i) Show that when β gt 0 the Delta at time t isin [0T ) of the call optionwith payoff (FT minusK)+ on ProShares Ultra is equal to the Delta of thecall option with payoff (ST minusKβ(t))

+ on the SampP500 for a certain strikeprice Kβ(t) to be determined explicitly

j) When β lt 0 find the relation between the Delta at time t isin [0T ) ofthe call option with payoff (FT minusK)+ on ProShares UltraShort and theDelta of the put option with payoff (Kβ(t)minus ST )+ on the SampP500

239

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

  1. pbsARFix223
  2. pbsARFix224
  3. pbsARFix225
  4. pbsARFix226
  5. pbsARFix227
  6. pbsARFix228
  7. pbsARFix229
  8. pbsARFix230
  9. fdrm1
  10. pbsARFix231
  11. 100
  12. 101
  13. 102
  14. 103
  15. 104
  16. 105
  17. 106
  18. 107
  19. 108
  20. 109
  21. 1010
  22. 1011
  23. 1012
  24. 1013
  25. 1014
  26. 1015
  27. 1016
  28. 1017
  29. 1018
  30. 1019
  31. anm10
  32. 10EndLeft
  33. 10StepLeft
  34. 10PauseLeft
  35. 10PlayLeft
  36. 10PlayPauseLeft
  37. 10PauseRight
  38. 10PlayRight
  39. 10PlayPauseRight
  40. 10StepRight
  41. 10EndRight
  42. 10Minus
  43. 10Reset
  44. 10Plus
  45. pbsARFix232
  46. pbsARFix233
  47. pbsARFix234
  48. pbsARFix235
  49. pbsARFix236
  50. pbsARFix237
  51. fdrm2
  52. 110
  53. 111
  54. 112
  55. 113
  56. 114
  57. 115
  58. 116
  59. 117
  60. 118
  61. 119
  62. 1110
  63. 1111
  64. 1112
  65. 1113
  66. 1114
  67. 1115
  68. 1116
  69. 1117
  70. 1118
  71. 1119
  72. anm11
  73. 11EndLeft
  74. 11StepLeft
  75. 11PauseLeft
  76. 11PlayLeft
  77. 11PlayPauseLeft
  78. 11PauseRight
  79. 11PlayRight
  80. 11PlayPauseRight
  81. 11StepRight
  82. 11EndRight
  83. 11Minus
  84. 11Reset
  85. 11Plus
  86. pbsARFix238
  87. pbsARFix239
  88. pbsARFix240
  89. pbsARFix241
  90. pbsARFix242
  91. 120
  92. 121
  93. 122
  94. 123
  95. 124
  96. 125
  97. 126
  98. 127
  99. 128
  100. 129
  101. 1210
  102. anm12
  103. 12EndLeft
  104. 12StepLeft
  105. 12PauseLeft
  106. 12PlayLeft
  107. 12PlayPauseLeft
  108. 12PauseRight
  109. 12PlayRight
  110. 12PlayPauseRight
  111. 12StepRight
  112. 12EndRight
  113. 12Minus
  114. 12Reset
  115. 12Plus
  116. 130
  117. 131
  118. 132
  119. 133
  120. 134
  121. 135
  122. 136
  123. 137
  124. 138
  125. 139
  126. 1310
  127. anm13
  128. 13EndLeft
  129. 13StepLeft
  130. 13PauseLeft
  131. 13PlayLeft
  132. 13PlayPauseLeft
  133. 13PauseRight
  134. 13PlayRight
  135. 13PlayPauseRight
  136. 13StepRight
  137. 13EndRight
  138. 13Minus
  139. 13Reset
  140. 13Plus
  141. pbsARFix243
  142. pbsARFix244
  143. pbsARFix245
  144. pbsARFix246
  145. 140
  146. 141
  147. 142
  148. 143
  149. 144
  150. 145
  151. 146
  152. 147
  153. 148
  154. 149
  155. 1410
  156. 1411
  157. 1412
  158. 1413
  159. 1414
  160. 1415
  161. 1416
  162. 1417
  163. 1418
  164. 1419
  165. 1420
  166. 1421
  167. 1422
  168. 1423
  169. 1424
  170. 1425
  171. 1426
  172. 1427
  173. 1428
  174. 1429
  175. 1430
  176. 1431
  177. 1432
  178. 1433
  179. 1434
  180. 1435
  181. 1436
  182. 1437
  183. 1438
  184. 1439
  185. 1440
  186. 1441
  187. 1442
  188. 1443
  189. 1444
  190. 1445
  191. 1446
  192. 1447
  193. 1448
  194. 1449
  195. 1450
  196. 1451
  197. 1452
  198. 1453
  199. 1454
  200. 1455
  201. 1456
  202. 1457
  203. 1458
  204. 1459
  205. 1460
  206. 1461
  207. 1462
  208. 1463
  209. 1464
  210. 1465
  211. 1466
  212. 1467
  213. 1468
  214. 1469
  215. 1470
  216. 1471
  217. 1472
  218. 1473
  219. 1474
  220. 1475
  221. 1476
  222. 1477
  223. 1478
  224. 1479
  225. 1480
  226. 1481
  227. 1482
  228. 1483
  229. 1484
  230. 1485
  231. 1486
  232. 1487
  233. 1488
  234. 1489
  235. 1490
  236. 1491
  237. 1492
  238. 1493
  239. 1494
  240. 1495
  241. 1496
  242. 1497
  243. 1498
  244. 1499
  245. 14100
  246. 14101
  247. 14102
  248. 14103
  249. 14104
  250. 14105
  251. 14106
  252. 14107
  253. 14108
  254. 14109
  255. 14110
  256. 14111
  257. 14112
  258. 14113
  259. 14114
  260. 14115
  261. 14116
  262. 14117
  263. 14118
  264. 14119
  265. 14120
  266. 14121
  267. 14122
  268. 14123
  269. 14124
  270. 14125
  271. 14126
  272. 14127
  273. 14128
  274. 14129
  275. 14130
  276. 14131
  277. 14132
  278. 14133
  279. 14134
  280. 14135
  281. 14136
  282. 14137
  283. 14138
  284. 14139
  285. 14140
  286. 14141
  287. 14142
  288. 14143
  289. 14144
  290. 14145
  291. 14146
  292. 14147
  293. 14148
  294. 14149
  295. 14150
  296. 14151
  297. 14152
  298. 14153
  299. 14154
  300. 14155
  301. 14156
  302. 14157
  303. 14158
  304. 14159
  305. 14160
  306. 14161
  307. 14162
  308. 14163
  309. 14164
  310. 14165
  311. 14166
  312. 14167
  313. 14168
  314. 14169
  315. 14170
  316. 14171
  317. 14172
  318. 14173
  319. 14174
  320. 14175
  321. 14176
  322. 14177
  323. 14178
  324. 14179
  325. 14180
  326. 14181
  327. 14182
  328. 14183
  329. 14184
  330. 14185
  331. 14186
  332. 14187
  333. 14188
  334. 14189
  335. 14190
  336. 14191
  337. 14192
  338. 14193
  339. 14194
  340. 14195
  341. 14196
  342. 14197
  343. anm14
  344. 14EndLeft
  345. 14StepLeft
  346. 14PauseLeft
  347. 14PlayLeft
  348. 14PlayPauseLeft
  349. 14PauseRight
  350. 14PlayRight
  351. 14PlayPauseRight
  352. 14StepRight
  353. 14EndRight
  354. 14Minus
  355. 14Reset
  356. 14Plus
  357. pbsARFix247
  358. pbsARFix248
  359. 150
  360. 151
  361. 152
  362. 153
  363. 154
  364. 155
  365. 156
  366. 157
  367. 158
  368. 159
  369. 1510
  370. 1511
  371. 1512
  372. 1513
  373. 1514
  374. 1515
  375. 1516
  376. 1517
  377. 1518
  378. 1519
  379. anm15
  380. 15EndLeft
  381. 15StepLeft
  382. 15PauseLeft
  383. 15PlayLeft
  384. 15PlayPauseLeft
  385. 15PauseRight
  386. 15PlayRight
  387. 15PlayPauseRight
  388. 15StepRight
  389. 15EndRight
  390. 15Minus
  391. 15Reset
  392. 15Plus
  393. pbsARFix249
  394. pbsARFix250
  395. pbsARFix251
  396. pbsARFix252
  397. pbsARFix253
  398. pbsARFix254
  399. pbsARFix255
  400. pbsARFix256
  401. pbsARFix257
  402. pbsARFix258
  403. pbsARFix259
  404. pbsARFix260
  405. pbsARFix261
Page 37: Black-ScholesPricingandHedging - NTU · to the Black-Scholes PDE (6.2) in order to price a claim payoff Cof the formC= h(S T).Asinthediscrete-timecase,thearbitragepriceπt(C) at

Black-Scholes Pricing and Hedging

d) Compute the portfolio strategy (ξt ηt)tisin[0T ] that hedges the contingentclaim with payoff exp(ST )

Exercise 612

a) Show that for every fixed value of S the function

d 7minusrarr h(S d) = SΦ(d+ |σ|

radicT)minusK eminusrTΦ(d)

reaches its maximum at dlowast(S) =log(SK) + (rminus σ22)T

|σ|radicT

b) By the differentiation rule

d

dSh(S dlowast(S)) =

parth

partS(S dlowast(S)) + dprimelowast(S)

parth

partd(S dlowast(S))

recover the value of the Black-Scholes Delta

Exercise 613 Compute the Black-Scholes Vega by differentiation of theBlack-Scholes function

gc(tx) = Bl(Kxσ rT minus t) = xΦ(d+(T minus t)

)minusK eminus(Tminust)rΦ

(dminus(T minus t)

)

with respect to the volatility parameter σ knowing that

minus12(dminus(T minus t)

)2= minus1

2

(log(xK) + (rminus σ22)(T minus t)

|σ|radicT minus t

)2

= minus12(d+(T minus t)

)2+ (T minus t)r+ log x

K (638)

Exercise 614 Consider the backward induction relation (313) ie

v(tx) = (1minus plowastN )v (t+ 1x(1 + aN )) + plowastN v (t+ 1x(1 + bN ))

using the renormalizations rN = rTN and

aN = (1 + rN )(1minus |σ|radicTN)minus 1 bN = (1 + rN )(1 + |σ|

radicTN)minus 1

of Section 36 N gt 1 with

plowastN =rN minus aNbN minus aN

and plowastN =bN minus rNbN minus aN

a) Show that the Black-Scholes PDE (62) of Proposition 61 can be recoveredfrom the induction relation (313) when the number N of time steps tendsto infinity

237

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

N Privault

b) Show that the expression of the Delta ξt =partgcpartx

(tSt) can be similarlyrecovered from the finite difference relation (319) ie

ξ(1)t (Stminus1) =

v (t (1 + bN )Stminus1)minus v (t (1 + aN )Stminus1)

Stminus1(bN minus aN )

as N tends to infinity

Problem 615 (Leung and Sircar (2015)) ProShares Ultra SampP500 andProShares UltraShort SampP500 are leveraged investment funds that seek dailyinvestment results before fees and expenses that correspond to β times (βx)the daily performance of the SampP500reg with respectively β = 2 for ProSharesUltra and β = minus2 for ProShares UltraShort Here leveraging with a factorβ 1 aims at multiplying the potential return of an investment by a factorβ The following 10 questions are interdependent and should be treated insequence

a) Consider a risky asset priced S0 = $4 at time t = 0 and taking twopossible values S1 = $5 and S1 = $2 at time t = 1 Compute the twopossible returns (in ) achieved when investing $4 in one share of the assetS and the expected return under the risk-neutral probability measureassuming that the risk-free interest rate is zero

b) Leveraging Still based on an initial $4 investment we decide to leverageby a factor β = 3 by borrowing another (β minus 1) times $4 = 2times $4 at ratezero to purchase a total of β = 3 shares of the asset S Compute thetwo returns (in ) possibly achieved in this case and the expected returnunder the risk-neutral probability measure assuming that the risk-freeinterest rate is zero

c) Denoting by Ft the ProShares value at time t how much should the fundinvest in the underlying asset priced St and how much $ should it borrowor save on the risk-free market at any time t in order to leverage with afactor β 1

d) Find the portfolio allocation (ξt ηt) for the fund value

Ft = ξtSt + ηtAt t isin R+

according to Question (c) where At = A0 ert is the riskless money marketaccount

e) We choose to model the SampP500 index St as the geometric Brownianmotion

dSt = rStdt+ σStdBt t isin R+

under the risk-neutral probability measure Plowast Find the stochastic dif-ferential equation satisfied by (Ft)tisinR+ under the self-financing conditiondFt = ξtdSt + ηtdAt

238

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

f) Is the discounted fund value ( eminusrtFt)tisinR+ a martingale under the risk-neutral probability measure Plowast

g) Find the relation between the fund value Ft and the index St by solvingthe stochastic differential equation obtained for Ft in Question (e) Forsimplicity we normalize F0 = Sβ0

h) Write the price at time t = 0 of the call option with payoff (FT minusK)+ onthe ProShares index using the Black-Scholes formula

i) Show that when β gt 0 the Delta at time t isin [0T ) of the call optionwith payoff (FT minusK)+ on ProShares Ultra is equal to the Delta of thecall option with payoff (ST minusKβ(t))

+ on the SampP500 for a certain strikeprice Kβ(t) to be determined explicitly

j) When β lt 0 find the relation between the Delta at time t isin [0T ) ofthe call option with payoff (FT minusK)+ on ProShares UltraShort and theDelta of the put option with payoff (Kβ(t)minus ST )+ on the SampP500

239

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

  1. pbsARFix223
  2. pbsARFix224
  3. pbsARFix225
  4. pbsARFix226
  5. pbsARFix227
  6. pbsARFix228
  7. pbsARFix229
  8. pbsARFix230
  9. fdrm1
  10. pbsARFix231
  11. 100
  12. 101
  13. 102
  14. 103
  15. 104
  16. 105
  17. 106
  18. 107
  19. 108
  20. 109
  21. 1010
  22. 1011
  23. 1012
  24. 1013
  25. 1014
  26. 1015
  27. 1016
  28. 1017
  29. 1018
  30. 1019
  31. anm10
  32. 10EndLeft
  33. 10StepLeft
  34. 10PauseLeft
  35. 10PlayLeft
  36. 10PlayPauseLeft
  37. 10PauseRight
  38. 10PlayRight
  39. 10PlayPauseRight
  40. 10StepRight
  41. 10EndRight
  42. 10Minus
  43. 10Reset
  44. 10Plus
  45. pbsARFix232
  46. pbsARFix233
  47. pbsARFix234
  48. pbsARFix235
  49. pbsARFix236
  50. pbsARFix237
  51. fdrm2
  52. 110
  53. 111
  54. 112
  55. 113
  56. 114
  57. 115
  58. 116
  59. 117
  60. 118
  61. 119
  62. 1110
  63. 1111
  64. 1112
  65. 1113
  66. 1114
  67. 1115
  68. 1116
  69. 1117
  70. 1118
  71. 1119
  72. anm11
  73. 11EndLeft
  74. 11StepLeft
  75. 11PauseLeft
  76. 11PlayLeft
  77. 11PlayPauseLeft
  78. 11PauseRight
  79. 11PlayRight
  80. 11PlayPauseRight
  81. 11StepRight
  82. 11EndRight
  83. 11Minus
  84. 11Reset
  85. 11Plus
  86. pbsARFix238
  87. pbsARFix239
  88. pbsARFix240
  89. pbsARFix241
  90. pbsARFix242
  91. 120
  92. 121
  93. 122
  94. 123
  95. 124
  96. 125
  97. 126
  98. 127
  99. 128
  100. 129
  101. 1210
  102. anm12
  103. 12EndLeft
  104. 12StepLeft
  105. 12PauseLeft
  106. 12PlayLeft
  107. 12PlayPauseLeft
  108. 12PauseRight
  109. 12PlayRight
  110. 12PlayPauseRight
  111. 12StepRight
  112. 12EndRight
  113. 12Minus
  114. 12Reset
  115. 12Plus
  116. 130
  117. 131
  118. 132
  119. 133
  120. 134
  121. 135
  122. 136
  123. 137
  124. 138
  125. 139
  126. 1310
  127. anm13
  128. 13EndLeft
  129. 13StepLeft
  130. 13PauseLeft
  131. 13PlayLeft
  132. 13PlayPauseLeft
  133. 13PauseRight
  134. 13PlayRight
  135. 13PlayPauseRight
  136. 13StepRight
  137. 13EndRight
  138. 13Minus
  139. 13Reset
  140. 13Plus
  141. pbsARFix243
  142. pbsARFix244
  143. pbsARFix245
  144. pbsARFix246
  145. 140
  146. 141
  147. 142
  148. 143
  149. 144
  150. 145
  151. 146
  152. 147
  153. 148
  154. 149
  155. 1410
  156. 1411
  157. 1412
  158. 1413
  159. 1414
  160. 1415
  161. 1416
  162. 1417
  163. 1418
  164. 1419
  165. 1420
  166. 1421
  167. 1422
  168. 1423
  169. 1424
  170. 1425
  171. 1426
  172. 1427
  173. 1428
  174. 1429
  175. 1430
  176. 1431
  177. 1432
  178. 1433
  179. 1434
  180. 1435
  181. 1436
  182. 1437
  183. 1438
  184. 1439
  185. 1440
  186. 1441
  187. 1442
  188. 1443
  189. 1444
  190. 1445
  191. 1446
  192. 1447
  193. 1448
  194. 1449
  195. 1450
  196. 1451
  197. 1452
  198. 1453
  199. 1454
  200. 1455
  201. 1456
  202. 1457
  203. 1458
  204. 1459
  205. 1460
  206. 1461
  207. 1462
  208. 1463
  209. 1464
  210. 1465
  211. 1466
  212. 1467
  213. 1468
  214. 1469
  215. 1470
  216. 1471
  217. 1472
  218. 1473
  219. 1474
  220. 1475
  221. 1476
  222. 1477
  223. 1478
  224. 1479
  225. 1480
  226. 1481
  227. 1482
  228. 1483
  229. 1484
  230. 1485
  231. 1486
  232. 1487
  233. 1488
  234. 1489
  235. 1490
  236. 1491
  237. 1492
  238. 1493
  239. 1494
  240. 1495
  241. 1496
  242. 1497
  243. 1498
  244. 1499
  245. 14100
  246. 14101
  247. 14102
  248. 14103
  249. 14104
  250. 14105
  251. 14106
  252. 14107
  253. 14108
  254. 14109
  255. 14110
  256. 14111
  257. 14112
  258. 14113
  259. 14114
  260. 14115
  261. 14116
  262. 14117
  263. 14118
  264. 14119
  265. 14120
  266. 14121
  267. 14122
  268. 14123
  269. 14124
  270. 14125
  271. 14126
  272. 14127
  273. 14128
  274. 14129
  275. 14130
  276. 14131
  277. 14132
  278. 14133
  279. 14134
  280. 14135
  281. 14136
  282. 14137
  283. 14138
  284. 14139
  285. 14140
  286. 14141
  287. 14142
  288. 14143
  289. 14144
  290. 14145
  291. 14146
  292. 14147
  293. 14148
  294. 14149
  295. 14150
  296. 14151
  297. 14152
  298. 14153
  299. 14154
  300. 14155
  301. 14156
  302. 14157
  303. 14158
  304. 14159
  305. 14160
  306. 14161
  307. 14162
  308. 14163
  309. 14164
  310. 14165
  311. 14166
  312. 14167
  313. 14168
  314. 14169
  315. 14170
  316. 14171
  317. 14172
  318. 14173
  319. 14174
  320. 14175
  321. 14176
  322. 14177
  323. 14178
  324. 14179
  325. 14180
  326. 14181
  327. 14182
  328. 14183
  329. 14184
  330. 14185
  331. 14186
  332. 14187
  333. 14188
  334. 14189
  335. 14190
  336. 14191
  337. 14192
  338. 14193
  339. 14194
  340. 14195
  341. 14196
  342. 14197
  343. anm14
  344. 14EndLeft
  345. 14StepLeft
  346. 14PauseLeft
  347. 14PlayLeft
  348. 14PlayPauseLeft
  349. 14PauseRight
  350. 14PlayRight
  351. 14PlayPauseRight
  352. 14StepRight
  353. 14EndRight
  354. 14Minus
  355. 14Reset
  356. 14Plus
  357. pbsARFix247
  358. pbsARFix248
  359. 150
  360. 151
  361. 152
  362. 153
  363. 154
  364. 155
  365. 156
  366. 157
  367. 158
  368. 159
  369. 1510
  370. 1511
  371. 1512
  372. 1513
  373. 1514
  374. 1515
  375. 1516
  376. 1517
  377. 1518
  378. 1519
  379. anm15
  380. 15EndLeft
  381. 15StepLeft
  382. 15PauseLeft
  383. 15PlayLeft
  384. 15PlayPauseLeft
  385. 15PauseRight
  386. 15PlayRight
  387. 15PlayPauseRight
  388. 15StepRight
  389. 15EndRight
  390. 15Minus
  391. 15Reset
  392. 15Plus
  393. pbsARFix249
  394. pbsARFix250
  395. pbsARFix251
  396. pbsARFix252
  397. pbsARFix253
  398. pbsARFix254
  399. pbsARFix255
  400. pbsARFix256
  401. pbsARFix257
  402. pbsARFix258
  403. pbsARFix259
  404. pbsARFix260
  405. pbsARFix261
Page 38: Black-ScholesPricingandHedging - NTU · to the Black-Scholes PDE (6.2) in order to price a claim payoff Cof the formC= h(S T).Asinthediscrete-timecase,thearbitragepriceπt(C) at

N Privault

b) Show that the expression of the Delta ξt =partgcpartx

(tSt) can be similarlyrecovered from the finite difference relation (319) ie

ξ(1)t (Stminus1) =

v (t (1 + bN )Stminus1)minus v (t (1 + aN )Stminus1)

Stminus1(bN minus aN )

as N tends to infinity

Problem 615 (Leung and Sircar (2015)) ProShares Ultra SampP500 andProShares UltraShort SampP500 are leveraged investment funds that seek dailyinvestment results before fees and expenses that correspond to β times (βx)the daily performance of the SampP500reg with respectively β = 2 for ProSharesUltra and β = minus2 for ProShares UltraShort Here leveraging with a factorβ 1 aims at multiplying the potential return of an investment by a factorβ The following 10 questions are interdependent and should be treated insequence

a) Consider a risky asset priced S0 = $4 at time t = 0 and taking twopossible values S1 = $5 and S1 = $2 at time t = 1 Compute the twopossible returns (in ) achieved when investing $4 in one share of the assetS and the expected return under the risk-neutral probability measureassuming that the risk-free interest rate is zero

b) Leveraging Still based on an initial $4 investment we decide to leverageby a factor β = 3 by borrowing another (β minus 1) times $4 = 2times $4 at ratezero to purchase a total of β = 3 shares of the asset S Compute thetwo returns (in ) possibly achieved in this case and the expected returnunder the risk-neutral probability measure assuming that the risk-freeinterest rate is zero

c) Denoting by Ft the ProShares value at time t how much should the fundinvest in the underlying asset priced St and how much $ should it borrowor save on the risk-free market at any time t in order to leverage with afactor β 1

d) Find the portfolio allocation (ξt ηt) for the fund value

Ft = ξtSt + ηtAt t isin R+

according to Question (c) where At = A0 ert is the riskless money marketaccount

e) We choose to model the SampP500 index St as the geometric Brownianmotion

dSt = rStdt+ σStdBt t isin R+

under the risk-neutral probability measure Plowast Find the stochastic dif-ferential equation satisfied by (Ft)tisinR+ under the self-financing conditiondFt = ξtdSt + ηtdAt

238

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

Black-Scholes Pricing and Hedging

f) Is the discounted fund value ( eminusrtFt)tisinR+ a martingale under the risk-neutral probability measure Plowast

g) Find the relation between the fund value Ft and the index St by solvingthe stochastic differential equation obtained for Ft in Question (e) Forsimplicity we normalize F0 = Sβ0

h) Write the price at time t = 0 of the call option with payoff (FT minusK)+ onthe ProShares index using the Black-Scholes formula

i) Show that when β gt 0 the Delta at time t isin [0T ) of the call optionwith payoff (FT minusK)+ on ProShares Ultra is equal to the Delta of thecall option with payoff (ST minusKβ(t))

+ on the SampP500 for a certain strikeprice Kβ(t) to be determined explicitly

j) When β lt 0 find the relation between the Delta at time t isin [0T ) ofthe call option with payoff (FT minusK)+ on ProShares UltraShort and theDelta of the put option with payoff (Kβ(t)minus ST )+ on the SampP500

239

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

  1. pbsARFix223
  2. pbsARFix224
  3. pbsARFix225
  4. pbsARFix226
  5. pbsARFix227
  6. pbsARFix228
  7. pbsARFix229
  8. pbsARFix230
  9. fdrm1
  10. pbsARFix231
  11. 100
  12. 101
  13. 102
  14. 103
  15. 104
  16. 105
  17. 106
  18. 107
  19. 108
  20. 109
  21. 1010
  22. 1011
  23. 1012
  24. 1013
  25. 1014
  26. 1015
  27. 1016
  28. 1017
  29. 1018
  30. 1019
  31. anm10
  32. 10EndLeft
  33. 10StepLeft
  34. 10PauseLeft
  35. 10PlayLeft
  36. 10PlayPauseLeft
  37. 10PauseRight
  38. 10PlayRight
  39. 10PlayPauseRight
  40. 10StepRight
  41. 10EndRight
  42. 10Minus
  43. 10Reset
  44. 10Plus
  45. pbsARFix232
  46. pbsARFix233
  47. pbsARFix234
  48. pbsARFix235
  49. pbsARFix236
  50. pbsARFix237
  51. fdrm2
  52. 110
  53. 111
  54. 112
  55. 113
  56. 114
  57. 115
  58. 116
  59. 117
  60. 118
  61. 119
  62. 1110
  63. 1111
  64. 1112
  65. 1113
  66. 1114
  67. 1115
  68. 1116
  69. 1117
  70. 1118
  71. 1119
  72. anm11
  73. 11EndLeft
  74. 11StepLeft
  75. 11PauseLeft
  76. 11PlayLeft
  77. 11PlayPauseLeft
  78. 11PauseRight
  79. 11PlayRight
  80. 11PlayPauseRight
  81. 11StepRight
  82. 11EndRight
  83. 11Minus
  84. 11Reset
  85. 11Plus
  86. pbsARFix238
  87. pbsARFix239
  88. pbsARFix240
  89. pbsARFix241
  90. pbsARFix242
  91. 120
  92. 121
  93. 122
  94. 123
  95. 124
  96. 125
  97. 126
  98. 127
  99. 128
  100. 129
  101. 1210
  102. anm12
  103. 12EndLeft
  104. 12StepLeft
  105. 12PauseLeft
  106. 12PlayLeft
  107. 12PlayPauseLeft
  108. 12PauseRight
  109. 12PlayRight
  110. 12PlayPauseRight
  111. 12StepRight
  112. 12EndRight
  113. 12Minus
  114. 12Reset
  115. 12Plus
  116. 130
  117. 131
  118. 132
  119. 133
  120. 134
  121. 135
  122. 136
  123. 137
  124. 138
  125. 139
  126. 1310
  127. anm13
  128. 13EndLeft
  129. 13StepLeft
  130. 13PauseLeft
  131. 13PlayLeft
  132. 13PlayPauseLeft
  133. 13PauseRight
  134. 13PlayRight
  135. 13PlayPauseRight
  136. 13StepRight
  137. 13EndRight
  138. 13Minus
  139. 13Reset
  140. 13Plus
  141. pbsARFix243
  142. pbsARFix244
  143. pbsARFix245
  144. pbsARFix246
  145. 140
  146. 141
  147. 142
  148. 143
  149. 144
  150. 145
  151. 146
  152. 147
  153. 148
  154. 149
  155. 1410
  156. 1411
  157. 1412
  158. 1413
  159. 1414
  160. 1415
  161. 1416
  162. 1417
  163. 1418
  164. 1419
  165. 1420
  166. 1421
  167. 1422
  168. 1423
  169. 1424
  170. 1425
  171. 1426
  172. 1427
  173. 1428
  174. 1429
  175. 1430
  176. 1431
  177. 1432
  178. 1433
  179. 1434
  180. 1435
  181. 1436
  182. 1437
  183. 1438
  184. 1439
  185. 1440
  186. 1441
  187. 1442
  188. 1443
  189. 1444
  190. 1445
  191. 1446
  192. 1447
  193. 1448
  194. 1449
  195. 1450
  196. 1451
  197. 1452
  198. 1453
  199. 1454
  200. 1455
  201. 1456
  202. 1457
  203. 1458
  204. 1459
  205. 1460
  206. 1461
  207. 1462
  208. 1463
  209. 1464
  210. 1465
  211. 1466
  212. 1467
  213. 1468
  214. 1469
  215. 1470
  216. 1471
  217. 1472
  218. 1473
  219. 1474
  220. 1475
  221. 1476
  222. 1477
  223. 1478
  224. 1479
  225. 1480
  226. 1481
  227. 1482
  228. 1483
  229. 1484
  230. 1485
  231. 1486
  232. 1487
  233. 1488
  234. 1489
  235. 1490
  236. 1491
  237. 1492
  238. 1493
  239. 1494
  240. 1495
  241. 1496
  242. 1497
  243. 1498
  244. 1499
  245. 14100
  246. 14101
  247. 14102
  248. 14103
  249. 14104
  250. 14105
  251. 14106
  252. 14107
  253. 14108
  254. 14109
  255. 14110
  256. 14111
  257. 14112
  258. 14113
  259. 14114
  260. 14115
  261. 14116
  262. 14117
  263. 14118
  264. 14119
  265. 14120
  266. 14121
  267. 14122
  268. 14123
  269. 14124
  270. 14125
  271. 14126
  272. 14127
  273. 14128
  274. 14129
  275. 14130
  276. 14131
  277. 14132
  278. 14133
  279. 14134
  280. 14135
  281. 14136
  282. 14137
  283. 14138
  284. 14139
  285. 14140
  286. 14141
  287. 14142
  288. 14143
  289. 14144
  290. 14145
  291. 14146
  292. 14147
  293. 14148
  294. 14149
  295. 14150
  296. 14151
  297. 14152
  298. 14153
  299. 14154
  300. 14155
  301. 14156
  302. 14157
  303. 14158
  304. 14159
  305. 14160
  306. 14161
  307. 14162
  308. 14163
  309. 14164
  310. 14165
  311. 14166
  312. 14167
  313. 14168
  314. 14169
  315. 14170
  316. 14171
  317. 14172
  318. 14173
  319. 14174
  320. 14175
  321. 14176
  322. 14177
  323. 14178
  324. 14179
  325. 14180
  326. 14181
  327. 14182
  328. 14183
  329. 14184
  330. 14185
  331. 14186
  332. 14187
  333. 14188
  334. 14189
  335. 14190
  336. 14191
  337. 14192
  338. 14193
  339. 14194
  340. 14195
  341. 14196
  342. 14197
  343. anm14
  344. 14EndLeft
  345. 14StepLeft
  346. 14PauseLeft
  347. 14PlayLeft
  348. 14PlayPauseLeft
  349. 14PauseRight
  350. 14PlayRight
  351. 14PlayPauseRight
  352. 14StepRight
  353. 14EndRight
  354. 14Minus
  355. 14Reset
  356. 14Plus
  357. pbsARFix247
  358. pbsARFix248
  359. 150
  360. 151
  361. 152
  362. 153
  363. 154
  364. 155
  365. 156
  366. 157
  367. 158
  368. 159
  369. 1510
  370. 1511
  371. 1512
  372. 1513
  373. 1514
  374. 1515
  375. 1516
  376. 1517
  377. 1518
  378. 1519
  379. anm15
  380. 15EndLeft
  381. 15StepLeft
  382. 15PauseLeft
  383. 15PlayLeft
  384. 15PlayPauseLeft
  385. 15PauseRight
  386. 15PlayRight
  387. 15PlayPauseRight
  388. 15StepRight
  389. 15EndRight
  390. 15Minus
  391. 15Reset
  392. 15Plus
  393. pbsARFix249
  394. pbsARFix250
  395. pbsARFix251
  396. pbsARFix252
  397. pbsARFix253
  398. pbsARFix254
  399. pbsARFix255
  400. pbsARFix256
  401. pbsARFix257
  402. pbsARFix258
  403. pbsARFix259
  404. pbsARFix260
  405. pbsARFix261
Page 39: Black-ScholesPricingandHedging - NTU · to the Black-Scholes PDE (6.2) in order to price a claim payoff Cof the formC= h(S T).Asinthediscrete-timecase,thearbitragepriceπt(C) at

Black-Scholes Pricing and Hedging

f) Is the discounted fund value ( eminusrtFt)tisinR+ a martingale under the risk-neutral probability measure Plowast

g) Find the relation between the fund value Ft and the index St by solvingthe stochastic differential equation obtained for Ft in Question (e) Forsimplicity we normalize F0 = Sβ0

h) Write the price at time t = 0 of the call option with payoff (FT minusK)+ onthe ProShares index using the Black-Scholes formula

i) Show that when β gt 0 the Delta at time t isin [0T ) of the call optionwith payoff (FT minusK)+ on ProShares Ultra is equal to the Delta of thecall option with payoff (ST minusKβ(t))

+ on the SampP500 for a certain strikeprice Kβ(t) to be determined explicitly

j) When β lt 0 find the relation between the Delta at time t isin [0T ) ofthe call option with payoff (FT minusK)+ on ProShares UltraShort and theDelta of the put option with payoff (Kβ(t)minus ST )+ on the SampP500

239

This version September 6 2020httpswwwntuedusghomenprivaultindexthtml

  1. pbsARFix223
  2. pbsARFix224
  3. pbsARFix225
  4. pbsARFix226
  5. pbsARFix227
  6. pbsARFix228
  7. pbsARFix229
  8. pbsARFix230
  9. fdrm1
  10. pbsARFix231
  11. 100
  12. 101
  13. 102
  14. 103
  15. 104
  16. 105
  17. 106
  18. 107
  19. 108
  20. 109
  21. 1010
  22. 1011
  23. 1012
  24. 1013
  25. 1014
  26. 1015
  27. 1016
  28. 1017
  29. 1018
  30. 1019
  31. anm10
  32. 10EndLeft
  33. 10StepLeft
  34. 10PauseLeft
  35. 10PlayLeft
  36. 10PlayPauseLeft
  37. 10PauseRight
  38. 10PlayRight
  39. 10PlayPauseRight
  40. 10StepRight
  41. 10EndRight
  42. 10Minus
  43. 10Reset
  44. 10Plus
  45. pbsARFix232
  46. pbsARFix233
  47. pbsARFix234
  48. pbsARFix235
  49. pbsARFix236
  50. pbsARFix237
  51. fdrm2
  52. 110
  53. 111
  54. 112
  55. 113
  56. 114
  57. 115
  58. 116
  59. 117
  60. 118
  61. 119
  62. 1110
  63. 1111
  64. 1112
  65. 1113
  66. 1114
  67. 1115
  68. 1116
  69. 1117
  70. 1118
  71. 1119
  72. anm11
  73. 11EndLeft
  74. 11StepLeft
  75. 11PauseLeft
  76. 11PlayLeft
  77. 11PlayPauseLeft
  78. 11PauseRight
  79. 11PlayRight
  80. 11PlayPauseRight
  81. 11StepRight
  82. 11EndRight
  83. 11Minus
  84. 11Reset
  85. 11Plus
  86. pbsARFix238
  87. pbsARFix239
  88. pbsARFix240
  89. pbsARFix241
  90. pbsARFix242
  91. 120
  92. 121
  93. 122
  94. 123
  95. 124
  96. 125
  97. 126
  98. 127
  99. 128
  100. 129
  101. 1210
  102. anm12
  103. 12EndLeft
  104. 12StepLeft
  105. 12PauseLeft
  106. 12PlayLeft
  107. 12PlayPauseLeft
  108. 12PauseRight
  109. 12PlayRight
  110. 12PlayPauseRight
  111. 12StepRight
  112. 12EndRight
  113. 12Minus
  114. 12Reset
  115. 12Plus
  116. 130
  117. 131
  118. 132
  119. 133
  120. 134
  121. 135
  122. 136
  123. 137
  124. 138
  125. 139
  126. 1310
  127. anm13
  128. 13EndLeft
  129. 13StepLeft
  130. 13PauseLeft
  131. 13PlayLeft
  132. 13PlayPauseLeft
  133. 13PauseRight
  134. 13PlayRight
  135. 13PlayPauseRight
  136. 13StepRight
  137. 13EndRight
  138. 13Minus
  139. 13Reset
  140. 13Plus
  141. pbsARFix243
  142. pbsARFix244
  143. pbsARFix245
  144. pbsARFix246
  145. 140
  146. 141
  147. 142
  148. 143
  149. 144
  150. 145
  151. 146
  152. 147
  153. 148
  154. 149
  155. 1410
  156. 1411
  157. 1412
  158. 1413
  159. 1414
  160. 1415
  161. 1416
  162. 1417
  163. 1418
  164. 1419
  165. 1420
  166. 1421
  167. 1422
  168. 1423
  169. 1424
  170. 1425
  171. 1426
  172. 1427
  173. 1428
  174. 1429
  175. 1430
  176. 1431
  177. 1432
  178. 1433
  179. 1434
  180. 1435
  181. 1436
  182. 1437
  183. 1438
  184. 1439
  185. 1440
  186. 1441
  187. 1442
  188. 1443
  189. 1444
  190. 1445
  191. 1446
  192. 1447
  193. 1448
  194. 1449
  195. 1450
  196. 1451
  197. 1452
  198. 1453
  199. 1454
  200. 1455
  201. 1456
  202. 1457
  203. 1458
  204. 1459
  205. 1460
  206. 1461
  207. 1462
  208. 1463
  209. 1464
  210. 1465
  211. 1466
  212. 1467
  213. 1468
  214. 1469
  215. 1470
  216. 1471
  217. 1472
  218. 1473
  219. 1474
  220. 1475
  221. 1476
  222. 1477
  223. 1478
  224. 1479
  225. 1480
  226. 1481
  227. 1482
  228. 1483
  229. 1484
  230. 1485
  231. 1486
  232. 1487
  233. 1488
  234. 1489
  235. 1490
  236. 1491
  237. 1492
  238. 1493
  239. 1494
  240. 1495
  241. 1496
  242. 1497
  243. 1498
  244. 1499
  245. 14100
  246. 14101
  247. 14102
  248. 14103
  249. 14104
  250. 14105
  251. 14106
  252. 14107
  253. 14108
  254. 14109
  255. 14110
  256. 14111
  257. 14112
  258. 14113
  259. 14114
  260. 14115
  261. 14116
  262. 14117
  263. 14118
  264. 14119
  265. 14120
  266. 14121
  267. 14122
  268. 14123
  269. 14124
  270. 14125
  271. 14126
  272. 14127
  273. 14128
  274. 14129
  275. 14130
  276. 14131
  277. 14132
  278. 14133
  279. 14134
  280. 14135
  281. 14136
  282. 14137
  283. 14138
  284. 14139
  285. 14140
  286. 14141
  287. 14142
  288. 14143
  289. 14144
  290. 14145
  291. 14146
  292. 14147
  293. 14148
  294. 14149
  295. 14150
  296. 14151
  297. 14152
  298. 14153
  299. 14154
  300. 14155
  301. 14156
  302. 14157
  303. 14158
  304. 14159
  305. 14160
  306. 14161
  307. 14162
  308. 14163
  309. 14164
  310. 14165
  311. 14166
  312. 14167
  313. 14168
  314. 14169
  315. 14170
  316. 14171
  317. 14172
  318. 14173
  319. 14174
  320. 14175
  321. 14176
  322. 14177
  323. 14178
  324. 14179
  325. 14180
  326. 14181
  327. 14182
  328. 14183
  329. 14184
  330. 14185
  331. 14186
  332. 14187
  333. 14188
  334. 14189
  335. 14190
  336. 14191
  337. 14192
  338. 14193
  339. 14194
  340. 14195
  341. 14196
  342. 14197
  343. anm14
  344. 14EndLeft
  345. 14StepLeft
  346. 14PauseLeft
  347. 14PlayLeft
  348. 14PlayPauseLeft
  349. 14PauseRight
  350. 14PlayRight
  351. 14PlayPauseRight
  352. 14StepRight
  353. 14EndRight
  354. 14Minus
  355. 14Reset
  356. 14Plus
  357. pbsARFix247
  358. pbsARFix248
  359. 150
  360. 151
  361. 152
  362. 153
  363. 154
  364. 155
  365. 156
  366. 157
  367. 158
  368. 159
  369. 1510
  370. 1511
  371. 1512
  372. 1513
  373. 1514
  374. 1515
  375. 1516
  376. 1517
  377. 1518
  378. 1519
  379. anm15
  380. 15EndLeft
  381. 15StepLeft
  382. 15PauseLeft
  383. 15PlayLeft
  384. 15PlayPauseLeft
  385. 15PauseRight
  386. 15PlayRight
  387. 15PlayPauseRight
  388. 15StepRight
  389. 15EndRight
  390. 15Minus
  391. 15Reset
  392. 15Plus
  393. pbsARFix249
  394. pbsARFix250
  395. pbsARFix251
  396. pbsARFix252
  397. pbsARFix253
  398. pbsARFix254
  399. pbsARFix255
  400. pbsARFix256
  401. pbsARFix257
  402. pbsARFix258
  403. pbsARFix259
  404. pbsARFix260
  405. pbsARFix261