 Finance - Maple Programming Help

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

Finance

 BlackScholesRho
 compute the Rho of a European-style option with given payoff

 Calling Sequence BlackScholesRho(${S}_{0}$, K, T, sigma, r, d, optiontype) BlackScholesRho(${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 Rho of an option or a portfolio of options is the sensitivity of the option or portfolio to changes in the risk-free rate

$\mathrm{Ρ}=\frac{\partial }{\partial r}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}S$

 • The BlackScholesRho command computes the Rho 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

 > with(Finance):

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

 > BlackScholesRho(100, 100, 1, sigma, r, d, 'call');
 ${-}{50}{}{{ⅇ}}^{{-}{r}}{}\left({\mathrm{erf}}{}\left(\frac{\left({{\mathrm{\sigma }}}^{{2}}{+}{2}{}{d}{-}{2}{}{r}\right){}\sqrt{{2}}}{{4}{}{\mathrm{\sigma }}}\right){-}{1}\right)$ (1)

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

 > BlackScholesRho(100, 100, 1, 0.3, 0.05, 0.03, 'call');
 ${44.4027473}$ (2)

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

 > BlackScholesRho(100, t -> max(t-100, 0), 1, sigma, r, d);
 ${-}{50}{}{{ⅇ}}^{{-}{r}}{}\left({\mathrm{erf}}{}\left(\frac{\left({{\mathrm{\sigma }}}^{{2}}{+}{2}{}{d}{-}{2}{}{r}\right){}\sqrt{{2}}}{{4}{}{\mathrm{\sigma }}}\right){-}{1}\right)$ (3)
 > BlackScholesRho(100, t -> max(t-100, 0), 1, 0.3, 0.05, 0.03);
 ${44.40274728}$ (4)
 > Rho := BlackScholesRho(100, K, 1, sigma, 0.05, 0.03, 'call');
 ${\mathrm{Ρ}}{≔}\frac{{38.71517541}{}{{ⅇ}}^{{-}\frac{{0.4999999997}{}{\left({4.625170186}{+}{\mathrm{ln}}{}\left(\frac{{1}}{{K}}\right){+}{0.5}{}{{\mathrm{\sigma }}}^{{2}}\right)}^{{2}}}{{{\mathrm{\sigma }}}^{{2}}}}{+}{0.4756147122}{}{K}{}{\mathrm{\sigma }}{+}{0.4756147122}{}{K}{}{\mathrm{\sigma }}{}{\mathrm{erf}}{}\left(\frac{{3.270489202}{+}{0.707106781}{}{\mathrm{ln}}{}\left(\frac{{1}}{{K}}\right){-}{0.3535533905}{}{{\mathrm{\sigma }}}^{{2}}}{{\mathrm{\sigma }}}\right){-}{0.3794856357}{}{K}{}{{ⅇ}}^{{-}\frac{{1.}{}{\left({3.270489202}{+}{0.707106781}{}{\mathrm{ln}}{}\left(\frac{{1}}{{K}}\right){-}{0.3535533905}{}{{\mathrm{\sigma }}}^{{2}}\right)}^{{2}}}{{{\mathrm{\sigma }}}^{{2}}}}}{{\mathrm{\sigma }}}$ (5)
 > plot3d(Rho, sigma = 0..1, K = 70..120, axes = BOXED); Here are similar examples for the European put option.

 > BlackScholesRho(50, 100, 1, sigma, r, d, 'put');
 $\frac{{25}{}\left({-}{2}{}{{ⅇ}}^{{-}{r}}{}{\mathrm{erf}}{}\left(\frac{\left({{\mathrm{\sigma }}}^{{2}}{+}{2}{}{\mathrm{ln}}{}\left({2}\right){+}{2}{}{d}{-}{2}{}{r}\right){}\sqrt{{2}}}{{4}{}{\mathrm{\sigma }}}\right){}\sqrt{{\mathrm{\pi }}}{}{\mathrm{\sigma }}{-}{2}{}{{ⅇ}}^{{-}{r}}{}\sqrt{{\mathrm{\pi }}}{}{\mathrm{\sigma }}{+}{{ⅇ}}^{{-}\frac{{{\mathrm{\sigma }}}^{{4}}{-}{4}{}{\mathrm{ln}}{}\left({2}\right){}{{\mathrm{\sigma }}}^{{2}}{+}{4}{}{d}{}{{\mathrm{\sigma }}}^{{2}}{+}{4}{}{r}{}{{\mathrm{\sigma }}}^{{2}}{+}{4}{}{{\mathrm{ln}}{}\left({2}\right)}^{{2}}{+}{8}{}{\mathrm{ln}}{}\left({2}\right){}{d}{-}{8}{}{\mathrm{ln}}{}\left({2}\right){}{r}{+}{4}{}{{d}}^{{2}}{-}{8}{}{d}{}{r}{+}{4}{}{{r}}^{{2}}}{{8}{}{{\mathrm{\sigma }}}^{{2}}}}{}\sqrt{{2}}{-}{2}{}\sqrt{{2}}{}{{ⅇ}}^{{-}\frac{{{\mathrm{\sigma }}}^{{4}}{+}{4}{}{\mathrm{ln}}{}\left({2}\right){}{{\mathrm{\sigma }}}^{{2}}{+}{4}{}{d}{}{{\mathrm{\sigma }}}^{{2}}{+}{4}{}{r}{}{{\mathrm{\sigma }}}^{{2}}{+}{4}{}{{\mathrm{ln}}{}\left({2}\right)}^{{2}}{+}{8}{}{\mathrm{ln}}{}\left({2}\right){}{d}{-}{8}{}{\mathrm{ln}}{}\left({2}\right){}{r}{+}{4}{}{{d}}^{{2}}{-}{8}{}{d}{}{r}{+}{4}{}{{r}}^{{2}}}{{8}{}{{\mathrm{\sigma }}}^{{2}}}}\right)}{\sqrt{{\mathrm{\pi }}}{}{\mathrm{\sigma }}}$ (6)
 > BlackScholesRho(50, 100, 1, 0.3, 0.05, 0.03, 'put');
 ${-94.32991431}$ (7)
 > BlackScholesRho(50, t -> max(100-t, 0), 1, sigma, r, d);
 ${-}\frac{{25}{}{{ⅇ}}^{{-}{r}}{}\left({2}{}{\mathrm{erf}}{}\left(\frac{\left({{\mathrm{\sigma }}}^{{2}}{+}{2}{}{\mathrm{ln}}{}\left({2}\right){+}{2}{}{d}{-}{2}{}{r}\right){}\sqrt{{2}}}{{4}{}{\mathrm{\sigma }}}\right){}\sqrt{{\mathrm{\pi }}}{}{\mathrm{\sigma }}{+}{2}{}{{ⅇ}}^{{-}\frac{{\left({{\mathrm{\sigma }}}^{{2}}{+}{2}{}{\mathrm{ln}}{}\left({2}\right){+}{2}{}{d}{-}{2}{}{r}\right)}^{{2}}}{{8}{}{{\mathrm{\sigma }}}^{{2}}}}{}\sqrt{{2}}{-}{{ⅇ}}^{{-}\frac{{{\mathrm{\sigma }}}^{{4}}{-}{4}{}{\mathrm{ln}}{}\left({2}\right){}{{\mathrm{\sigma }}}^{{2}}{+}{4}{}{d}{}{{\mathrm{\sigma }}}^{{2}}{-}{4}{}{r}{}{{\mathrm{\sigma }}}^{{2}}{+}{4}{}{{\mathrm{ln}}{}\left({2}\right)}^{{2}}{+}{8}{}{\mathrm{ln}}{}\left({2}\right){}{d}{-}{8}{}{\mathrm{ln}}{}\left({2}\right){}{r}{+}{4}{}{{d}}^{{2}}{-}{8}{}{d}{}{r}{+}{4}{}{{r}}^{{2}}}{{8}{}{{\mathrm{\sigma }}}^{{2}}}}{}\sqrt{{2}}{+}{2}{}\sqrt{{\mathrm{\pi }}}{}{\mathrm{\sigma }}\right)}{\sqrt{{\mathrm{\pi }}}{}{\mathrm{\sigma }}}$ (8)
 > BlackScholesRho(50, t -> max(100-t, 0), 1, 0.3, 0.05, 0.03, d);
 ${-94.32991433}$ (9)

In this example, you will compute the Rho of a strangle.

 > S := BlackScholesRho(100, t -> piecewise(t < 50, 50-t, t < 100, 0, t-100), 1, sigma, r, d);
 ${S}{≔}\frac{{25}{}{{ⅇ}}^{{-}{r}}{}\left({2}{}\sqrt{{2}}{}{{ⅇ}}^{{-}\frac{{{\mathrm{\sigma }}}^{{4}}{+}{4}{}{\mathrm{ln}}{}\left({2}\right){}{{\mathrm{\sigma }}}^{{2}}{+}{4}{}{d}{}{{\mathrm{\sigma }}}^{{2}}{-}{4}{}{r}{}{{\mathrm{\sigma }}}^{{2}}{+}{4}{}{{\mathrm{ln}}{}\left({2}\right)}^{{2}}{-}{8}{}{\mathrm{ln}}{}\left({2}\right){}{d}{+}{8}{}{\mathrm{ln}}{}\left({2}\right){}{r}{+}{4}{}{{d}}^{{2}}{-}{8}{}{d}{}{r}{+}{4}{}{{r}}^{{2}}}{{8}{}{{\mathrm{\sigma }}}^{{2}}}}{+}{\mathrm{erf}}{}\left(\frac{\sqrt{{2}}{}\left({-}{{\mathrm{\sigma }}}^{{2}}{+}{2}{}{\mathrm{ln}}{}\left({2}\right){-}{2}{}{d}{+}{2}{}{r}\right)}{{4}{}{\mathrm{\sigma }}}\right){}\sqrt{{\mathrm{\pi }}}{}{\mathrm{\sigma }}{-}{2}{}\sqrt{{\mathrm{\pi }}}{}{\mathrm{erf}}{}\left(\frac{\left({{\mathrm{\sigma }}}^{{2}}{+}{2}{}{d}{-}{2}{}{r}\right){}\sqrt{{2}}}{{4}{}{\mathrm{\sigma }}}\right){}{\mathrm{\sigma }}{-}{{ⅇ}}^{{-}\frac{{\left({-}{{\mathrm{\sigma }}}^{{2}}{+}{2}{}{\mathrm{ln}}{}\left({2}\right){-}{2}{}{d}{+}{2}{}{r}\right)}^{{2}}}{{8}{}{{\mathrm{\sigma }}}^{{2}}}}{}\sqrt{{2}}{+}\sqrt{{\mathrm{\pi }}}{}{\mathrm{\sigma }}\right)}{\sqrt{{\mathrm{\pi }}}{}{\mathrm{\sigma }}}$ (10)
 > C := BlackScholesRho(100, 100, 1, sigma, r, d, 'call');
 ${C}{≔}{-}{50}{}{{ⅇ}}^{{-}{r}}{}\left({\mathrm{erf}}{}\left(\frac{\left({{\mathrm{\sigma }}}^{{2}}{+}{2}{}{d}{-}{2}{}{r}\right){}\sqrt{{2}}}{{4}{}{\mathrm{\sigma }}}\right){-}{1}\right)$ (11)
 > P := BlackScholesRho(100, 50, 1, sigma, r, d, 'put');
 ${P}{≔}{-}\frac{{25}{}\left({-}{{ⅇ}}^{{-}{r}}{}{\mathrm{erf}}{}\left(\frac{\sqrt{{2}}{}\left({-}{{\mathrm{\sigma }}}^{{2}}{+}{2}{}{\mathrm{ln}}{}\left({2}\right){-}{2}{}{d}{+}{2}{}{r}\right)}{{4}{}{\mathrm{\sigma }}}\right){}\sqrt{{\mathrm{\pi }}}{}{\mathrm{\sigma }}{+}{{ⅇ}}^{{-}{r}}{}\sqrt{{\mathrm{\pi }}}{}{\mathrm{\sigma }}{+}\sqrt{{2}}{}{{ⅇ}}^{{-}\frac{{{\mathrm{\sigma }}}^{{4}}{-}{4}{}{\mathrm{ln}}{}\left({2}\right){}{{\mathrm{\sigma }}}^{{2}}{+}{4}{}{d}{}{{\mathrm{\sigma }}}^{{2}}{+}{4}{}{r}{}{{\mathrm{\sigma }}}^{{2}}{+}{4}{}{{\mathrm{ln}}{}\left({2}\right)}^{{2}}{-}{8}{}{\mathrm{ln}}{}\left({2}\right){}{d}{+}{8}{}{\mathrm{ln}}{}\left({2}\right){}{r}{+}{4}{}{{d}}^{{2}}{-}{8}{}{d}{}{r}{+}{4}{}{{r}}^{{2}}}{{8}{}{{\mathrm{\sigma }}}^{{2}}}}{-}{2}{}\sqrt{{2}}{}{{ⅇ}}^{{-}\frac{{{\mathrm{\sigma }}}^{{4}}{+}{4}{}{\mathrm{ln}}{}\left({2}\right){}{{\mathrm{\sigma }}}^{{2}}{+}{4}{}{d}{}{{\mathrm{\sigma }}}^{{2}}{+}{4}{}{r}{}{{\mathrm{\sigma }}}^{{2}}{+}{4}{}{{\mathrm{ln}}{}\left({2}\right)}^{{2}}{-}{8}{}{\mathrm{ln}}{}\left({2}\right){}{d}{+}{8}{}{\mathrm{ln}}{}\left({2}\right){}{r}{+}{4}{}{{d}}^{{2}}{-}{8}{}{d}{}{r}{+}{4}{}{{r}}^{{2}}}{{8}{}{{\mathrm{\sigma }}}^{{2}}}}\right)}{\sqrt{{\mathrm{\pi }}}{}{\mathrm{\sigma }}}$ (12)

Check:

 > simplify(S-C-P);
 ${0}$ (13)

References

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

Compatibility

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