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 |