Finance - Maple Programming Help

Home : Support : Online Help : Mathematics : Finance : Financial Instruments : Greeks : Finance/BlackScholesTheta

Finance

 BlackScholesTheta
 compute the Theta of a European-style option with given payoff

 Calling Sequence BlackScholesTheta(${S}_{0}$, K, T, sigma, r, d, optiontype) BlackScholesTheta(${S}_{0}$, P, T, sigma, r, d)

Parameters

 ${S}_{0}$ - algebraic expression; initial (current) value of the underlying asset K - algebraic expression; strike price T - algebraic expression; time to maturity sigma - algebraic expression; volatility r - algebraic expression; continuously compounded risk-free rate d - algebraic expression; continuously compounded dividend yield P - operator or procedure; payoff function optiontype - call or put; option type

Description

 • The Theta of an option or a portfolio of options is the rate of change of the option price or the portfolio price with time. As time progresses, the time to maturity decreases; this explains the minus sign in the following definition:

$\mathrm{\Theta }=-\left(\frac{\partial }{\partial T}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}S\right)$

 • The BlackScholesTheta command computes the Theta of a European-style option with the specified payoff function.
 • The parameter ${S}_{0}$ is the initial (current) value of the underlying asset. The parameter T is the time to maturity in years.
 • The parameter K specifies the strike price if this is a vanilla put or call option. Any payoff function can be specified using the second calling sequence. In this case the parameter P must be given in the form of an operator, which accepts one parameter (spot price at maturity) and returns the corresponding payoff.
 • The sigma, r, and d parameters are the volatility, the risk-free rate, and the dividend yield of the underlying asset. These parameters can be given in either the algebraic form or the operator form. The parameter d is optional. By default, the dividend yield is taken to be 0.

Examples

 > $\mathrm{with}\left(\mathrm{Finance}\right):$
 > $r≔0.05$
 ${r}{≔}{0.05}$ (1)
 > $d≔0.03$
 ${d}{≔}{0.03}$ (2)

First you compute the Theta of a European call option with strike price 100, which matures in 1 year. This will define the Theta as a function of the risk-free rate, the dividend yield, and the volatility.

 > $\mathrm{expand}\left(\mathrm{BlackScholesTheta}\left(100,100,1,\mathrm{σ},r,d,'\mathrm{call}'\right)\right)$
 ${-}{0.922405261}{+}{1.4556683}{}{\mathrm{erf}}{}\left(\frac{{0.01414213562}}{{\mathrm{σ}}}{+}{0.3535533905}{}{\mathrm{σ}}\right){-}\frac{{1.}{}{{10}}^{{-10}}{}{{ⅇ}}^{{-}{0.1249999999}{}{{\mathrm{σ}}}^{{2}}}{}{{ⅇ}}^{{-}\frac{{0.0001999999998}}{{{\mathrm{σ}}}^{{2}}}}}{{\mathrm{σ}}}{-}{19.16497649}{}{\mathrm{σ}}{}{{ⅇ}}^{{-}{0.1249999999}{}{{\mathrm{σ}}}^{{2}}}{}{{ⅇ}}^{{-}\frac{{0.0001999999998}}{{{\mathrm{σ}}}^{{2}}}}{+}{2.378073561}{}{\mathrm{erf}}{}\left({-}\frac{{0.01414213562}}{{\mathrm{σ}}}{+}{0.3535533905}{}{\mathrm{σ}}\right)$ (3)

In this example you will use numeric values for the risk-free rate, the dividend yield, and the volatility.

 > $\mathrm{expand}\left(\mathrm{BlackScholesTheta}\left(100,100,1,0.3,0.05,0.03,'\mathrm{call}'\right)\right)$
 ${-}{6.187329487}$ (4)

You can also use the generic method in which the option is defined through its payoff function.

 > $\mathrm{BlackScholesTheta}\left(100,t→\mathrm{max}\left(t-100,0\right),1,0.3,0.05,0.03\right)$
 ${-}{6.187329483}$ (5)
 > $\mathrm{Θ}≔\mathrm{expand}\left(\mathrm{BlackScholesTheta}\left(100,K,1,\mathrm{σ},r,d,'\mathrm{call}'\right)\right)$
 ${\mathrm{Θ}}{≔}{1.4556683}{+}{1.4556683}{}{\mathrm{erf}}{}\left(\frac{{3.270489202}}{{\mathrm{σ}}}{+}\frac{{0.707106781}{}{\mathrm{ln}}{}\left(\frac{{1}}{{K}}\right)}{{\mathrm{σ}}}{+}{0.3535533905}{}{\mathrm{σ}}\right){+}\frac{{8.787467889}{}{{ⅇ}}^{{-}\frac{{10.69609962}}{{{\mathrm{σ}}}^{{2}}}}{}{\left(\frac{{1}}{{K}}\right)}^{{-}\frac{{4.625170183}}{{{\mathrm{σ}}}^{{2}}}}{}{{ⅇ}}^{{-}\frac{{0.4999999997}{}{{\mathrm{ln}}{}\left(\frac{{1}}{{K}}\right)}^{{2}}}{{{\mathrm{σ}}}^{{2}}}}{}{{ⅇ}}^{{-}{0.1249999999}{}{{\mathrm{σ}}}^{{2}}}}{{\mathrm{σ}}{}{\left(\frac{{1}}{{K}}\right)}^{{0.4999999997}}}{-}\frac{{0.9582488253}{}{\mathrm{σ}}{}{{ⅇ}}^{{-}\frac{{10.69609962}}{{{\mathrm{σ}}}^{{2}}}}{}{\left(\frac{{1}}{{K}}\right)}^{{-}\frac{{4.625170183}}{{{\mathrm{σ}}}^{{2}}}}{}{{ⅇ}}^{{-}\frac{{0.4999999997}{}{{\mathrm{ln}}{}\left(\frac{{1}}{{K}}\right)}^{{2}}}{{{\mathrm{σ}}}^{{2}}}}{}{{ⅇ}}^{{-}{0.1249999999}{}{{\mathrm{σ}}}^{{2}}}}{{\left(\frac{{1}}{{K}}\right)}^{{0.4999999997}}}{+}\frac{{1.916497650}{}{\mathrm{ln}}{}\left(\frac{{1}}{{K}}\right){}{{ⅇ}}^{{-}\frac{{10.69609962}}{{{\mathrm{σ}}}^{{2}}}}{}{\left(\frac{{1}}{{K}}\right)}^{{-}\frac{{4.625170183}}{{{\mathrm{σ}}}^{{2}}}}{}{{ⅇ}}^{{-}\frac{{0.4999999997}{}{{\mathrm{ln}}{}\left(\frac{{1}}{{K}}\right)}^{{2}}}{{{\mathrm{σ}}}^{{2}}}}{}{{ⅇ}}^{{-}{0.1249999999}{}{{\mathrm{σ}}}^{{2}}}}{{\mathrm{σ}}{}{\left(\frac{{1}}{{K}}\right)}^{{0.4999999997}}}{-}{0.02378073561}{}{K}{+}{0.02378073561}{}{K}{}{\mathrm{erf}}{}\left({-}\frac{{3.270489202}}{{\mathrm{σ}}}{-}\frac{{0.707106781}{}{\mathrm{ln}}{}\left(\frac{{1}}{{K}}\right)}{{\mathrm{σ}}}{+}{0.3535533905}{}{\mathrm{σ}}\right){-}\frac{{8.787467868}{}{K}{}{{ⅇ}}^{{-}\frac{{10.69609962}}{{{\mathrm{σ}}}^{{2}}}}{}{\left(\frac{{1}}{{K}}\right)}^{{-}\frac{{4.625170184}}{{{\mathrm{σ}}}^{{2}}}}{}{{ⅇ}}^{{-}\frac{{0.4999999997}{}{{\mathrm{ln}}{}\left(\frac{{1}}{{K}}\right)}^{{2}}}{{{\mathrm{σ}}}^{{2}}}}{}{\left(\frac{{1}}{{K}}\right)}^{{0.4999999998}}{}{{ⅇ}}^{{-}{0.1249999999}{}{{\mathrm{σ}}}^{{2}}}}{{\mathrm{σ}}}{-}{0.9582488230}{}{\mathrm{σ}}{}{K}{}{{ⅇ}}^{{-}\frac{{10.69609962}}{{{\mathrm{σ}}}^{{2}}}}{}{\left(\frac{{1}}{{K}}\right)}^{{-}\frac{{4.625170184}}{{{\mathrm{σ}}}^{{2}}}}{}{{ⅇ}}^{{-}\frac{{0.4999999997}{}{{\mathrm{ln}}{}\left(\frac{{1}}{{K}}\right)}^{{2}}}{{{\mathrm{σ}}}^{{2}}}}{}{\left(\frac{{1}}{{K}}\right)}^{{0.4999999998}}{}{{ⅇ}}^{{-}{0.1249999999}{}{{\mathrm{σ}}}^{{2}}}{-}\frac{{1.916497646}{}{K}{}{\mathrm{ln}}{}\left(\frac{{1}}{{K}}\right){}{{ⅇ}}^{{-}\frac{{10.69609962}}{{{\mathrm{σ}}}^{{2}}}}{}{\left(\frac{{1}}{{K}}\right)}^{{-}\frac{{4.625170184}}{{{\mathrm{σ}}}^{{2}}}}{}{{ⅇ}}^{{-}\frac{{0.4999999997}{}{{\mathrm{ln}}{}\left(\frac{{1}}{{K}}\right)}^{{2}}}{{{\mathrm{σ}}}^{{2}}}}{}{\left(\frac{{1}}{{K}}\right)}^{{0.4999999998}}{}{{ⅇ}}^{{-}{0.1249999999}{}{{\mathrm{σ}}}^{{2}}}}{{\mathrm{σ}}}$ (6)
 > $\mathrm{plot3d}\left(\mathrm{Θ},\mathrm{σ}=0..1,K=70..120,\mathrm{axes}=\mathrm{BOXED}\right)$

Here are similar examples for the European put option.

 > $\mathrm{BlackScholesTheta}\left(100,120,1,\mathrm{σ},r,d,'\mathrm{put}'\right)$
 $\frac{{1.398019973}{}{\mathrm{σ}}{+}{2.853688273}{}{\mathrm{erf}}{}\left(\frac{{0.1147786735}{+}{0.3535533905}{}{{\mathrm{σ}}}^{{2}}}{{\mathrm{σ}}}\right){}{\mathrm{σ}}{+}{4.606687476}{}{{ⅇ}}^{{-}\frac{{1.}{}{\left({0.1147786735}{+}{0.3535533905}{}{{\mathrm{σ}}}^{{2}}\right)}^{{2}}}{{{\mathrm{σ}}}^{{2}}}}{-}{11.38456907}{}{{ⅇ}}^{{-}\frac{{1.}{}{\left({0.1147786735}{+}{0.3535533905}{}{{\mathrm{σ}}}^{{2}}\right)}^{{2}}}{{{\mathrm{σ}}}^{{2}}}}{}{{\mathrm{σ}}}^{{2}}{+}{1.4556683}{}{\mathrm{erf}}{}\left(\frac{{-}{0.1147786735}{+}{0.3535533905}{}{{\mathrm{σ}}}^{{2}}}{{\mathrm{σ}}}\right){}{\mathrm{σ}}{-}{3.91645728}{}{{ⅇ}}^{{-}\frac{{0.1249999999}{}{\left({-}{0.3246431136}{+}{{\mathrm{σ}}}^{{2}}\right)}^{{2}}}{{{\mathrm{σ}}}^{{2}}}}{-}{9.678793854}{}{{ⅇ}}^{{-}\frac{{0.1249999999}{}{\left({-}{0.3246431136}{+}{{\mathrm{σ}}}^{{2}}\right)}^{{2}}}{{{\mathrm{σ}}}^{{2}}}}{}{{\mathrm{σ}}}^{{2}}}{{\mathrm{σ}}}$ (7)
 > $\mathrm{BlackScholesTheta}\left(100,120,1,0.3,0.05,0.03,'\mathrm{put}'\right)$
 ${-}{2.96788222}$ (8)
 > $\mathrm{BlackScholesTheta}\left(100,t→\mathrm{max}\left(120-t,0\right),1,\mathrm{σ},r,d\right)$
 $\frac{{1.4556683}{}{\mathrm{erf}}{}\left(\frac{{-}{0.1147786735}{+}{0.3535533905}{}{{\mathrm{σ}}}^{{2}}}{{\mathrm{σ}}}\right){}{\mathrm{σ}}{-}{3.916457279}{}{{ⅇ}}^{{-}\frac{{1.279999999}{}{{10}}^{{-18}}{}{\left({3.12500000}{}{{10}}^{{8}}{}{{\mathrm{σ}}}^{{2}}{-}{1.01450973}{}{{10}}^{{8}}\right)}^{{2}}}{{{\mathrm{σ}}}^{{2}}}}{-}{9.678793852}{}{{ⅇ}}^{{-}\frac{{1.279999999}{}{{10}}^{{-18}}{}{\left({3.12500000}{}{{10}}^{{8}}{}{{\mathrm{σ}}}^{{2}}{-}{1.01450973}{}{{10}}^{{8}}\right)}^{{2}}}{{{\mathrm{σ}}}^{{2}}}}{}{{\mathrm{σ}}}^{{2}}{-}{11.38456907}{}{{ⅇ}}^{{-}\frac{{1.279999999}{}{{10}}^{{-18}}{}{\left({3.12500000}{}{{10}}^{{8}}{}{{\mathrm{σ}}}^{{2}}{+}{1.01450973}{}{{10}}^{{8}}\right)}^{{2}}}{{{\mathrm{σ}}}^{{2}}}}{}{{\mathrm{σ}}}^{{2}}{+}{4.606687474}{}{{ⅇ}}^{{-}\frac{{1.279999999}{}{{10}}^{{-18}}{}{\left({3.12500000}{}{{10}}^{{8}}{}{{\mathrm{σ}}}^{{2}}{+}{1.01450973}{}{{10}}^{{8}}\right)}^{{2}}}{{{\mathrm{σ}}}^{{2}}}}{+}{1.398019974}{}{\mathrm{σ}}{+}{2.853688274}{}{\mathrm{erf}}{}\left(\frac{{0.1147786735}{+}{0.3535533905}{}{{\mathrm{σ}}}^{{2}}}{{\mathrm{σ}}}\right){}{\mathrm{σ}}}{{\mathrm{σ}}}$ (9)

Compare with

 > $\mathrm{BlackScholesTheta}\left(100,t→\mathrm{max}\left(t-100,0\right),1,\mathrm{σ},r,d\right)$
 $\frac{{1.455668301}{}{\mathrm{erf}}{}\left(\frac{{0.01414213562}{+}{0.3535533905}{}{{\mathrm{σ}}}^{{2}}}{{\mathrm{σ}}}\right){}{\mathrm{σ}}{-}{9.67879385}{}{{ⅇ}}^{{-}\frac{{0.0001999999999}{}{\left({25.}{}{{\mathrm{σ}}}^{{2}}{+}{1.}\right)}^{{2}}}{{{\mathrm{σ}}}^{{2}}}}{}{{\mathrm{σ}}}^{{2}}{-}{0.387151754}{}{{ⅇ}}^{{-}\frac{{0.0001999999999}{}{\left({25.}{}{{\mathrm{σ}}}^{{2}}{+}{1.}\right)}^{{2}}}{{{\mathrm{σ}}}^{{2}}}}{-}{0.9224052608}{}{\mathrm{σ}}{-}{9.48714089}{}{{ⅇ}}^{{-}\frac{{0.0001999999999}{}{\left({5.}{}{\mathrm{σ}}{-}{1.}\right)}^{{2}}{}{\left({5.}{}{\mathrm{σ}}{+}{1.}\right)}^{{2}}}{{{\mathrm{σ}}}^{{2}}}}{}{{\mathrm{σ}}}^{{2}}{+}{0.3794856356}{}{{ⅇ}}^{{-}\frac{{0.0001999999999}{}{\left({5.}{}{\mathrm{σ}}{-}{1.}\right)}^{{2}}{}{\left({5.}{}{\mathrm{σ}}{+}{1.}\right)}^{{2}}}{{{\mathrm{σ}}}^{{2}}}}{+}{2.378073561}{}{\mathrm{erf}}{}\left(\frac{{-}{0.01414213562}{+}{0.3535533905}{}{{\mathrm{σ}}}^{{2}}}{{\mathrm{σ}}}\right){}{\mathrm{σ}}}{{\mathrm{σ}}}$ (10)
 > $\mathrm{BlackScholesTheta}\left(100,t→\mathrm{max}\left(120-t,0\right),1,0.3,0.05,0.03,d\right)$
 ${-}{2.967882245}$ (11)

References

 Hull, J., Options, Futures, and Other Derivatives, 5th. edition. Upper Saddle River, New Jersey: Prentice Hall, 2003.

Compatibility

 • The Finance[BlackScholesTheta] command was introduced in Maple 15.
 • For more information on Maple 15 changes, see Updates in Maple 15.