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: bitree american asset bs1 european mcmillan optstart IBTnicemat

Quantlet: bitree
Description: applying binomial model to calculate European and American option prices.

Reference(s):

Usage: {s,op,optionprice}=bitree(s0,k,i,sig,t,n,vers,opt,typeofdiv {,div}) or {s,op,optionprice}=bitree(vers,typeofdiv) or {s,op,optionprice}=bitree()
Input:
s0 scalar, the price of the underlying asset
k scalar, the exercise price
i scalar, domestic interest rate
sig scalar, yearly volatility
t scalar, time to expiration (in years)
n scalar, number of steps
vers scalar, if vers = 0, a European option (default) vers = 1, an American option is assumed
opt scalar, if opt = 0, a call option (default) opt = 1, a put option is assumed
typeofdiv scalar, if typeofdiv = 1, no dividend is paid (default), typeofdiv = 2, dividend is paid continuously, typeofdiv = 3, dividend payment "in % of the stock value", or typeofdiv = 4, fixed dividends are paid
div if typeofdiv == 1, div is considered as 0; typeofdiv == 2, div is a scalar determining the continuous dividend rate; typeofdiv == 3 or 4, div is a (m x 2) matrix, with the first column containing the time (in years) of the m dividend payments and the second column consisting of m dividends' ratios or amounts.
bitree() (i.e., usage without input parameters) Several interactive select windows will be opened, where user can specify features and characteristics of options. First window: Price of Underlying Asset, Exercise Price, Domestic Interest Rate per Year, Volatility per Year, Time to Expiration (Years), Number of steps Second window (Dividend type): No dividend, Continuous dividend, Discrete dividend as fixed percentage of stock, Discrete dividends as fixed amount Third window (Option type): Call Put Fourth window: European American
Output:
s (n+1) x (n+1) matrix (upper triangular), possible stock prices
op (n+1) x (n+1) matrix (upper triangular), option values at each step
optionprice scalar, the option price at time 0

Note:

Example:
library("finance")
b=bitree(230,210,0.04545,0.25,0.5,5,0,0,1,0)

Result:
Tree of stock prices
                                             341.5056
                                  315.5468
                       291.5613              291.5613
            269.3989              269.3989
 248.9212              248.9212              248.9212
230.0000              230.0000              230.0000
 212.5171              212.5171              212.5171
            196.3631              196.3631
                       181.4370              181.4370
                                  167.6455
                                             154.9023


Tree of option prices
                                             131.5056
                                  106.4968
                        83.4573               81.5613
             62.2370               60.3492
  44.3277               40.8178               38.9212
30.3779               26.1746               20.9506
  16.1996               11.2385                2.5171
              6.0101                1.2753
                         0.6462

Contents of option
[1,] " "
[2,] "-------------------------------------"
[3,] " The price of the option at time t_0 is "
[4,] " 30.3779"
[5,] "-------------------------------------"
[6,] " "
Example:
library("finance")
b=bitree(0,1)

Result:
Trees of stock prices and option prices,
as well as an option price given by user input.
Example:
library("finance")
b=bitree()

Result:
Trees of stock prices and option prices,
as well as an option price given by user input.



Author: W. Haerdle, Y. Chen 20030221 license MD*Tech
(C) MD*TECH Method and Data Technologies, 05.02.2006