 Black-Scholes Model - Maple Help

 Black-Scholes Model In this application, we compute the option price using three different methods. The first method is to derive the analytical solution to the option price based on the classical Black-Scholes model. Next, we compute the option price through Monte Carlo simulation based on the Black-Scholes model for stock price estimation.  Finally, we use the Black-Scholes differential equation model to estimate the option price. Model Overview Analytic Solution Monte Carlo Simulation Differential Equations  Overview of the Model

We consider the classical Black-Scholes model with single risky asset that follows a geometric Brownian motion:

$d{S}_{t}={\mathrm{rS}}_{t}\mathrm{dt}+{\mathrm{σS}}_{t}{\mathrm{dW}}_{t},$$t\ge 0,$

where (${W}_{t},t\ge 0$) is a standard Brownian motion, $\sigma \ge 0$ is the constant volatility, $r\ge 0$ is the constant risk-free rate and ${S}_{0}\ge 0$ is the initial asset price.

Under these conditions, for any $t\ge 0,$ the stock price ${S}_{t}$ is given by the following formula:

${S}_{t}={S}_{0}{e}^{\left(r-\frac{{\sigma }^{2}}{2}\right)t+{\mathrm{σW}}_{t}}$

We consider a security with time to maturity $T$ and the payoff function:

$P:=\left(S,K\right)\to {\begin{array}{cc}1& S>K\\ 0& S\le K\end{array}:$

Payoff of the form $P\left(S\right)={\begin{array}{cc}1& S>K\\ 0& S\le K\end{array}$ corresponds to a digital call options with strike price, $K$.

We will consider several methods for computing the price of this security.

Parameters Analytic Solution

$\mathrm{_EnvStatisticsRandomVariableName}≔\mathrm{Φ}:$

$\phantom{\rule[-0.0ex]{0.0em}{0.0ex}}\phantom{\rule[-0.0ex]{0.0em}{0.0ex}}{S}_{T}$ can be represented in the form:

${S}_{T}≔{S}_{0}\cdot U:$

where $\mathrm{\Phi }$ is a lognormal random variable with parameters $T\left(r-\frac{{\sigma }^{2}}{2}\right)$ and $\sigma \sqrt{T}$.

The price of this option can be computed as the discounted expected payoff of the option:

${ⅇ}^{-rT}𝔼(P({S}_{T}))$

 ${{}\begin{array}{cc}{1}& {K}{<}{{S}}_{{0}}{}{\mathrm{Φ}}\\ {0}& {{S}}_{{0}}{}{\mathrm{Φ}}{\le }{K}\end{array}$ (1)

 ${{ⅇ}}^{{-}{r}{}{T}}{}\left({-}\frac{{1}}{{2}}{}{\mathrm{erf}}{}\left(\frac{{1}}{{4}}{}\frac{\sqrt{{2}}{}\left({{\mathrm{σ}}}^{{2}}{}{T}{-}{2}{}{r}{}{T}{+}{2}{}{\mathrm{ln}}{}\left({K}\right){-}{2}{}{\mathrm{ln}}{}\left({{S}}_{{0}}\right)\right)}{{\mathrm{σ}}{}\sqrt{{T}}}\right){+}\frac{{1}}{{2}}\right)$ (2)

${}$

Analytic Price We can use the analytic result to study the various market sensitivities. For example, we can symbolically compute the delta of our option.

 $\frac{{1}}{{2}}{}\frac{{{ⅇ}}^{{-}{r}{}{T}}{}{{ⅇ}}^{{-}\frac{{1}}{{8}}{}\frac{{\left({{\mathrm{σ}}}^{{2}}{}{T}{-}{2}{}{r}{}{T}{+}{2}{}{\mathrm{ln}}{}\left({K}\right){-}{2}{}{\mathrm{ln}}{}\left({{S}}_{{0}}\right)\right)}^{{2}}}{{{\mathrm{σ}}}^{{2}}{}{T}}}{}\sqrt{{2}}}{\sqrt{{\mathrm{π}}}{}{{S}}_{{0}}{}{\mathrm{σ}}{}\sqrt{{T}}}$ (3)



Here is a formula for the Gamma:

 ${-}\frac{{1}}{{4}}{}\frac{{{ⅇ}}^{{-}{r}{}{T}}{}{{ⅇ}}^{{-}\frac{{1}}{{8}}{}\frac{{\left({-}{{\mathrm{σ}}}^{{2}}{}{T}{+}{2}{}{r}{}{T}{+}{2}{}{\mathrm{ln}}{}\left({{S}}_{{0}}\right){-}{2}{}{\mathrm{ln}}{}\left({K}\right)\right)}^{{2}}}{{{\mathrm{σ}}}^{{2}}{}{T}}}{}\sqrt{{2}}{}\left({{\mathrm{σ}}}^{{2}}{}{T}{+}{2}{}{r}{}{T}{+}{2}{}{\mathrm{ln}}{}\left({{S}}_{{0}}\right){-}{2}{}{\mathrm{ln}}{}\left({K}\right)\right)}{\sqrt{{\mathrm{π}}}{}{{\mathrm{σ}}}^{{3}}{}{{T}}^{{3}{/}{2}}{}{{S}}_{{0}}^{{2}}}$ (4)

We can also use the symbolic formula to plot the option price as a function of the parameters.   Monte Carlo Simulation

Alternatively, we can estimate the expectation using Monte Carlo simulation to compute the option price.

The discrete-time version of the model is:

${S}_{t+h}={S}_{t}\cdot \mathrm{Φ}$

where $h=\frac{1}{N}$, and $\mathrm{Φ}$ is drawn from the lognormal distribution with parameters $\left(r-\frac{{s}^{2}}{2}\right)h$ and $\mathrm{\sigma }\sqrt{h}$.

We can use this expression to generate a sample path for the price of our risky asset.

Simulating Stock Prices   *please be patient, it may take a few seconds to generate a sample Number of Replications Number of Updates Note: We know the distribution of the final stock price. To compute the option price, we need only to simulate the final stock price, and not the whole stock path.

We can verify the above analytic result using Monte Carlo simulation.

Monte Carlo Simulation

 Number of Replications Option Price Standard Error  Differential Equations

Finally, we can use the Black-Scholes differential equations to compute the option price.

$\mathrm{DE}≔\mathrm{diff}\left(V\left(S,t\right),t\right)+r\cdot S\cdot \mathrm{diff}\left(V\left(S,t\right),S\right)+\frac{1}{2}\cdot {\mathrm{σ}}^{2}\cdot {S}^{2}\cdot \mathrm{diff}\left(V\left(S,t\right),S,S\right)=r\cdot V\left(S,t\right)$

 $\frac{{\partial }}{{\partial }{t}}{}{V}{}\left({S}{,}{t}\right){+}{r}{}{S}{}\left(\frac{{\partial }}{{\partial }{S}}{}{V}{}\left({S}{,}{t}\right)\right){+}\frac{{1}}{{2}}{}{{\mathrm{σ}}}^{{2}}{}{{S}}^{{2}}{}\left(\frac{{{\partial }}^{{2}}}{{\partial }{{S}}^{{2}}}{}{V}{}\left({S}{,}{t}\right)\right){=}{r}{}{V}{}\left({S}{,}{t}\right)$ (5)

The key boundary condition is:

$\mathrm{BC1}≔V\left(S,T\right)=P\left(S,K\right)$

 ${V}{}\left({S}{,}{T}\right){=}{{}\begin{array}{cc}{1}& {K}{<}{S}\\ {0}& {S}{\le }{K}\end{array}$ (6)

Another obvious condition:

$\mathrm{BC2}≔V\left(0,t\right)=0$

 ${V}{}\left({0}{,}{t}\right){=}{0}$ (7)

Finally, if ${S}_{t}\gg K$ for some $t, then it holds with a high probability that ${S}_{T}\gg K$. Our option will thus be exercised and produce cash flow ${P(S}_{T}-K)\mathrm{≈P}\left({S}_{T}\right)$

$\mathrm{BC3}≔V\left(2\cdot 100,t\right)=1$

 ${V}{}\left({200}{,}{t}\right){=}{1}$ (8)

Numeric PDE Solver

 Space Step Time Step   Option Price