Keywords - Function groups - @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

Library: finance
See also: american asset bitree european mcmillan optstart

Quantlet: bs1
Description: calculates option prices of a European option with different types of dividends using the Black and Scholes formula

Usage: {opvv,sel,ingred} = bs1(task) or {opvv} = bs1(S,K,r,sigma,tau,opt,typeofdiv,div)
Input:
task scalar, type of the dividend payment, if task = 1, no dividend (default), task = 2, continuously paid dividend, task = 3, a fixed dividend is paid, task = 4, an exchange rate is assumed as the underlier
S n x 1 vector, price of the underlying asset
K n x 1 vector, exercise price
r n x 1 vector, domestic interest rate out of the following interval [0%,100%]
sigma n x 1 vector, volatility per year which can be found in the interval: (0%,100%)
tau n x 1 vector, time to expiration in years
opt n x 1 vector, type of the option: opt = 1, when a call is considered, or opt = 0, in case of a put
typeofdiv n x 1 vector, type of the dividend payment, if typeofdiv = 0, no dividend is paid (default), typeofdiv = 1, continuously paid dividend, typeofdiv = 2, fixed dividend payment, typeofdiv = 3, an exchange rate is assumed as the underlier
div n x 1 vector of dividends; according to the type of dividend (typeofdiv) it can be a zero vector, a vector of dividend rates in the interval (0% - 100%), a vector of fixed dividend amounts or a vector of exchange rates in the interval (0% - 100%)
Output:
opvv scalar, price of the option if bs1(task) is used or n x 9 output matrix, if the second form is used. The first 8 columns contain the input parameters the last column the computed option prices.
sel 2 x 1 vector; sel = 1|0, when a 'call' is considered, sel = 0|1, 'put'
ingred 6 x 1 vector representing stock price, strike price, time to expiration, volatility, domain interest rate, dividend

Note:

Example:
library("finance")
bs1(1)

Result:
Opens two menus where you may specify the characteristics
of your option.
Example:
library("finance")
S = aseq(230,5,10)
K = aseq(210,5,15)
r = 5
sigma = aseq(25,5,-5)
tau  = 0.5
opt = #(1,1,0,0,0)
typeofdiv = #(0,1,2,3,2)
dividend = #(0,10,35,8,45)
; compute prices of options of these five different underlyings
o=bs1(S,K,r,sigma,tau,opt,typeofdiv,dividend)
o.opvv

Result:
Contents of opvv
[1,]      230      210  0.04879     0.25      0.5        1        0        0   30.986
[2,]      240      225  0.04879      0.2      0.5        1        1  0.09531     17.8
[3,]      250      240  0.04879     0.15      0.5        0        2   0.1431   10.632
[4,]      260      255  0.04879      0.1      0.5        0        3  0.076961   6.3923
[5,]      270      270  0.04879     0.05      0.5        0        2  0.17284   15.991

The first two columns represent the spot and the exercise prices
respectively, the third column contains the continuous interest rate,
the fourth column the volatilities, in the fifth column time to
maturity can be found, the sixth column represents the types of the option,
the seventh column the types of dividends paid, the eighth the dividends
themselves (where 0.09531 is the continuous dividend corresponding
to 10%, 0.1431 and 0.17284 are the computed fixed dividends
and 0.076961 is the continuous dividend corresponding to 8% if
the exchange rate is the underlier) and finally the last column
contains the computed option prices.



Author: K. Komorad, W. Haerdle, 20020111 license MD*Tech
(C) MD*TECH Method and Data Technologies, 05.02.2006