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

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

Pricing European Options Using the Finance Package

Simulation

 >

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

 >
 ${Y}{:=}{\mathrm{_X}}$ (1.1)
 >

Here ae sample paths for ${ⅇ}^{Y\left(t\right)}$.

 > $\mathrm{PathPlot}\left({ⅇ}^{Y\left(t\right)},t=0..2,\mathrm{timesteps}=50,\mathrm{replications}=10,\mathrm{thickness}=3,\mathrm{color}=\mathrm{red}..\mathrm{blue},\mathrm{axes}=\mathrm{BOXED},\mathrm{gridlines}=\mathrm{true},\mathrm{tickmarks}=\left(\left[10,10\right]\right)\right)$

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

 > $\mathrm{ExpectedValue}\left(\mathrm{max}\left({ⅇ}^{Y\left(3\right)}-0.5,0\right),\mathrm{replications}={10}^{5}\right)$
 $\left[{\mathrm{value}}{=}{0.5000000000}{,}{\mathrm{standarderror}}{=}{0.}\right]$ (1.2)

Consider another stochastic process.

 > $Z:=\mathrm{GeometricBrownianMotion}\left(1,0.1,0.3\right)$
 ${Z}{:=}{\mathrm{_X3}}$ (1.3)
 > $\frac{\mathrm{Drift}\left(Z\left(t\right)\right)}{Z\left(t\right)}=\frac{\mathrm{Drift}\left({ⅇ}^{Y\left(t\right)}\right)}{{ⅇ}^{Y\left(t\right)}}$
 ${0.1}{=}{0.1000000000}$ (1.4)
 > $\frac{\mathrm{Diffusion}\left(Z\left(t\right)\right)}{Z\left(t\right)}=\frac{\mathrm{Diffusion}\left(\mathrm{exp}\left(Y\left(t\right)\right)\right)}{\mathrm{exp}\left(Y\left(t\right)\right)}$
 ${0.3}{=}{0.3}$ (1.5)

So $Z\left(t\right)$ define the same stochastic process.

 > $\mathrm{ExpectedValue}\left(\mathrm{max}\left(Z\left(3\right)-1,0\right),\mathrm{replications}={10}^{5}\right)$
 $\left[{\mathrm{value}}{=}{0.4506814169}{,}{\mathrm{standarderror}}{=}{0.002083752433}\right]$ (1.6)

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

 > $\mathrm{DiscountFactor}\left(3,0.1\right)\mathrm{ExpectedValue}\left(\mathrm{max}\left(Z\left(3\right)-1,0\right),\mathrm{replications}={10}^{5},\mathrm{output}=\mathrm{value}\right)$
 ${0.3354146746}$ (1.7)

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

 >
 ${0.3360448376}$ (1.8)

Try to compute some market sensitivities of the option price.

 > $W:=t→\frac{\mathrm{ln}\left(Z\left(t\right)\right)-0.055t}{0.3}$
 ${W}{:=}{t}{→}\frac{{\mathrm{ln}}{}\left({Z}{}\left({t}\right)\right){+}\left({-}{1}\right){\cdot }{0.055}{}{t}}{{0.3}}$ (1.9)
 > $\mathrm{Drift}\left(W\left(t\right)\right);$
 ${0.}$ (1.10)
 > $\mathrm{Diffusion}\left(W\left(t\right)\right);$
 ${0.9999999999}$ (1.11)

So is the standard Wiener process. Using tools from the Malliavin Calculus you can show that for any payoff function  $f\left(t\right)$

 > ${ⅇ}^{-0.1\cdot 3}\mathrm{ExpectedValue}\left(\frac{\mathrm{max}\left(Z\left(3\right)-1,0\right)W\left(3\right)}{0.3\cdot 3},\mathrm{replications}={10}^{6},\mathrm{output}=\mathrm{value}\right)$
 ${0.8034185612}$ (1.12)
 > $\mathrm{BlackScholesDelta}\left(1,1,3,0.3,0.1\right);$
 ${0.7987480882}$ (1.13)

Here are multiple stocks.

 > ${W}_{1}:=\mathrm{WienerProcess}\left(\right)$
 ${{W}}_{{1}}{:=}{\mathrm{_W}}$ (1.14)
 > ${S}_{1}:=t→100{ⅇ}^{0.055t+0.3{W}_{1}\left(t\right)}$
 ${{S}}_{{1}}{:=}{t}{→}{100}{}{{ⅇ}}^{{0.055}{}{t}{+}{0.3}{}{{W}}_{{1}}{}\left({t}\right)}$ (1.15)
 > ${W}_{2}:=\mathrm{WienerProcess}\left(\right)$
 ${{W}}_{{2}}{:=}{\mathrm{_W0}}$ (1.16)
 > ${S}_{2}:=t→100{ⅇ}^{0.055t+0.3{W}_{2}\left(t\right)}$
 ${{S}}_{{2}}{:=}{t}{→}{100}{}{{ⅇ}}^{{0.055}{}{t}{+}{0.3}{}{{W}}_{{2}}{}\left({t}\right)}$ (1.17)
 > ${ⅇ}^{-0.1\cdot 1}\mathrm{ExpectedValue}\left(\mathrm{max}\left({S}_{1}\left(1\right)-{S}_{2}\left(1\right),0\right),\mathrm{timesteps}=100,\mathrm{replications}={10}^{4},\mathrm{output}=\mathrm{value}\right)$
 ${16.87358420}$ (1.18)
 > ${ⅇ}^{-0.1\cdot 1}\mathrm{ExpectedValue}\left(\mathrm{max}\left({S}_{2}\left(1\right)-{S}_{1}\left(1\right),0\right),\mathrm{timesteps}=100,\mathrm{replications}={10}^{4},\mathrm{output}=\mathrm{value}\right)$
 ${16.94221984}$ (1.19)

This is the correlation structure.

 > ${W}_{3}:=\mathrm{WienerProcess}\left(\right)$
 ${{W}}_{{3}}{:=}{\mathrm{_W1}}$ (1.20)
 > ${S}_{1}:=t→100{ⅇ}^{0.055t+0.3\left(0.00001{W}_{1}\left(t\right)+{W}_{3}\left(t\right)\right)}$
 ${{S}}_{{1}}{:=}{t}{→}{100}{}{{ⅇ}}^{{0.055}{}{t}{+}{0.3}{}\left({0.00001}{}{{W}}_{{1}}{}\left({t}\right){+}{{W}}_{{3}}{}\left({t}\right)\right)}$ (1.21)
 > ${S}_{2}:=t→100{ⅇ}^{0.055t+0.3\left(0.000001{W}_{2}\left(t\right)+{W}_{3}\left(t\right)\right)}$
 ${{S}}_{{2}}{:=}{t}{→}{100}{}{{ⅇ}}^{{0.055}{}{t}{+}{0.3}{}\left({0.000001}{}{{W}}_{{2}}{}\left({t}\right){+}{{W}}_{{3}}{}\left({t}\right)\right)}$ (1.22)
 > ${ⅇ}^{-0.1\cdot 1}\mathrm{ExpectedValue}\left(\mathrm{max}\left({S}_{2}\left(1\right)-{S}_{1}\left(1\right),0\right),\mathrm{timesteps}=100,\mathrm{replications}={10}^{4},\mathrm{output}=\mathrm{value}\right)$
 ${0.0001198987355}$ (1.23)
{"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 50, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "url": "https://cn.maplesoft.com/support/help/view.aspx?path=Finance/Examples/EuropeanOptions&L=C", "fetch_time": 1726351256000000000, "content_mime_type": "text/html", "warc_filename": "crawl-data/CC-MAIN-2024-38/segments/1725700651580.74/warc/CC-MAIN-20240914193334-20240914223334-00568.warc.gz", "warc_record_offset": 160945156, "warc_record_length": 24702, "token_count": 2046, "char_count": 5220, "score": 3.546875, "int_score": 4, "crawl": "CC-MAIN-2024-38", "snapshot_type": "latest", "language": "en", "language_score": 0.415258526802063, "file_path": "/sailhome/yjruan/project/latent-lm/data/processed/finemath-4plus/finemath-4plus/train-00027-of-00064.parquet"}