 BlackScholesProcess - Maple Help

Finance

 BlackScholesProcess
 create new Black-Scholes process Calling Sequence BlackScholesProcess(${S}_{0}$, sigma, r, d) BlackScholesProcess(${S}_{0}$, sigma, r, d, t, S) Parameters

 ${S}_{0}$ - non-negative constant; initial value r - non-negative constant, procedure or yield term structure; risk-free rate sigma - non-negative constant, procedure or a local volatility structure; volatility d - non-negative constant, procedure or yield term structure; dividend yield t - name; time variable S - name; state variable Description

 • The BlackScholesProcess command creates a new Black-Scholes process. This is a process $S\left(t\right)$ governed by the stochastic differential equation (SDE)

$\frac{\mathrm{dS}\left(t\right)}{S\left(t\right)}=\left(r\left(t\right)-d\left(t\right)-\frac{{\mathrm{\sigma }\left(S\left(t\right),t\right)}^{2}}{2}\right)\mathrm{dt}+\mathrm{\sigma }\left(S\left(t\right),t\right)\mathrm{dW}\left(t\right)$

where

 – $r=r\left(t\right)$ is the risk-free rate,
 – $\mathrm{\sigma }=\mathrm{\sigma }\left(S,t\right)$ is the local volatility,
 – $d=d\left(t\right)$ is the dividend yield,

and

 – $W\left(t\right)$ is the standard Wiener process.
 • The parameter ${S}_{0}$ defines the initial value of the underlying stochastic process. It must be a real constant.
 • The parameter r is the risk-free rate. The parameter d is the continuous dividend yield. Time-dependent risk-free rate and dividend yield can be given either as an algebraic expression, a Maple procedure, or a yield term structure. If r or d is given as an algebraic expression, then the fifth parameter t must be passed to specify which variable in r should be used as the time variable. Maple procedure defining a time-dependent drift must accept one parameter (the time) and return the corresponding value for the drift.
 • The sigma parameter is the local volatility. It can be constant or it can be given as a function of time and the value of the state variable. In the second case it can be specified as an algebraic expression, a Maple procedure or a local volatility term structure. If sigma is specified in the algebraic form, the parameters t and S must be given to specify which variable in sigma represents the time variable and which variable represents the value of the underlying. Examples

 > $\mathrm{with}\left(\mathrm{Finance}\right):$

First define a Black-Scholes process with constant parameters.

 > $\mathrm{S0}≔100.0$
 ${\mathrm{S0}}{≔}{100.0}$ (1)
 > $\mathrm{σ}≔0.3$
 ${\mathrm{\sigma }}{≔}{0.3}$ (2)
 > $r≔0.05$
 ${r}{≔}{0.05}$ (3)
 > $d≔0.01$
 ${d}{≔}{0.01}$ (4)
 > $S≔\mathrm{BlackScholesProcess}\left(\mathrm{S0},\mathrm{σ},r,d\right):$

You can compute the expected payoff of a European call option with strike 100 maturing in 1 year.

 > $T≔1.0$
 ${T}{≔}{1.0}$ (5)
 > $K≔100$
 ${K}{≔}{100}$ (6)
 > $\mathrm{DiscountFactor}\left(r,T\right)\mathrm{ExpectedValue}\left(\mathrm{max}\left(S\left(T\right)-K,0\right),\mathrm{timesteps}=100,\mathrm{replications}={10}^{5},\mathrm{output}=\mathrm{value}\right)$
 ${13.64080475}$ (7)

You can then compare the result to the theoretical price.

 > $\mathrm{BlackScholesPrice}\left(\mathrm{S0},K,T,\mathrm{σ},r,d,'\mathrm{call}'\right)$
 ${13.61641736}$ (8)

This is incorporating local volatility term structure.

 > $\mathrm{σ}≔\mathrm{LocalVolatilitySurface}\left(0.03+0.0001S,t,S\right):$
 > $X≔\mathrm{BlackScholesProcess}\left(\mathrm{S0},\mathrm{σ},r,d\right):$

Again, you can compute the expected payoff of a European call option with strike 100 maturing in 1 year.

 > $V≔\mathrm{DiscountFactor}\left(r,T\right)\mathrm{ExpectedValue}\left(\mathrm{max}\left(X\left(T\right)-K,0\right),\mathrm{timesteps}=100,\mathrm{replications}={10}^{3},\mathrm{output}=\mathrm{value}\right)$
 ${V}{≔}{4.142053200}$ (9)

Then you can compute the implied volatility.

 > $\mathrm{ImpliedVolatility}\left(V,\mathrm{S0},K,T,r,d\right)$
 ${0.03719843687}$ (10)

In this example we implied volatility surface obtained using a piecewise interpolation of known prices.

 > $r≔0.05$
 ${r}{≔}{0.05}$ (11)
 > $d≔0.0$
 ${d}{≔}{0.}$ (12)
 > $\mathrm{S0}≔87$
 ${\mathrm{S0}}{≔}{87}$ (13)
 > $K≔85$
 ${K}{≔}{85}$ (14)
 > $C≔\mathrm{BlackScholesPrice}\left(\mathrm{S0},k,t,0.03+0.0001k,r,d\right):$
 > $U≔⟨\mathrm{seq}\left(0.1i,i=1..20\right)⟩:$
 > $S≔⟨\mathrm{seq}\left(80+i,i=0..20\right)⟩:$
 > $V≔\mathrm{Finance}:-\mathrm{LocalVolatility}\left(C,S,U,r,d,t,k\right):$
 > $\mathrm{Σ}≔\mathrm{LocalVolatilitySurface}\left(U,S,V\right):$
 > $X≔\mathrm{BlackScholesProcess}\left(\mathrm{S0},\mathrm{Σ},r,d\right):$
 > $T≔0.35$
 ${T}{≔}{0.35}$ (15)
 > $P≔\mathrm{DiscountFactor}\left(r,T\right)\mathrm{ExpectedValue}\left(\mathrm{max}\left(X\left(T\right)-K,0\right),\mathrm{timesteps}=100,\mathrm{replications}={10}^{3},\mathrm{output}=\mathrm{value}\right)$
 ${P}{≔}{3.501775067}$ (16)
 > $\mathrm{ImpliedVolatility}\left(P,\mathrm{S0},K,T,r,d\right)$
 ${0.03818795821}$ (17) References

 Glasserman, P., Monte Carlo Methods in Financial Engineering. New York: Springer-Verlag, 2004.
 Hull, J., Options, Futures, and Other Derivatives, 5th. edition. Upper Saddle River, New Jersey: Prentice Hall, 2003. Compatibility

 • The Finance[BlackScholesProcess] command was introduced in Maple 15.