Main Content

bdtprice

Instrument prices from Black-Derman-Toy interest-rate tree

Description

[Price,PriceTree] = bdtprice(BDTTree,InstSet) computes arbitrage-free prices for instruments using an interest-rate tree created with bdttree. All instruments contained in a financial instrument variable, InstSet, are priced.

bdtprice handles instrument types: 'Bond', 'CashFlow', 'OptBond', 'OptEmBond', 'OptFloat', 'OptEmFloat', 'Fixed', 'Float', 'Cap', 'Floor', 'RangeFloat', 'Swap'. See instadd to construct defined types.

example

[Price,PriceTree] = bdtprice(___,Options) adds an optional input argument for Options.

example

Examples

collapse all

Load the BDT tree and instruments from the data file deriv.mat to price the Float and Cap instruments contained in the instrument set.

load deriv.mat; 
BDTSubSet = instselect(BDTInstSet,'Type', {'Float', 'Cap'});

instdisp(BDTSubSet)
Index Type  Spread Settle         Maturity       FloatReset Basis Principal Name       Quantity
1     Float 20     01-Jan-2000    01-Jan-2003    1          NaN   NaN       20BP Float 8       
 
Index Type Strike Settle         Maturity       CapReset Basis Principal Name    Quantity
2     Cap  0.15   01-Jan-2000    01-Jan-2004    1        NaN   NaN       15% Cap 30           

Price the Float and Cap.

[Price, PriceTree] = bdtprice(BDTTree, BDTSubSet)
Price =

  100.4865
    1.4375


PriceTree = 

  struct with fields:

    FinObj: 'BDTPriceTree'
     PTree: {[2×1 double]  [2×2 double]  [2×3 double]  [2×4 double]  [2×4 double]}
    AITree: {[2×1 double]  [2×2 double]  [2×3 double]  [2×4 double]  [2×4 double]}
      tObs: [0 1 2 3 4]

You can use the treeviewer function to see the prices of these instruments along the price tree.

Price the following multi-stepped coupon bonds using the following data:

Rates = [0.035; 0.042147; 0.047345; 0.052707];
ValuationDate = 'Jan-1-2010';
StartDates = ValuationDate;
EndDates = {'Jan-1-2011'; 'Jan-1-2012'; 'Jan-1-2013'; 'Jan-1-2014'};
Compounding = 1;

% Create RateSpec
RS = intenvset('ValuationDate', ValuationDate, 'StartDates', StartDates,...
'EndDates', EndDates,'Rates', Rates, 'Compounding', Compounding);

% Create a portfolio of stepped coupon bonds with different maturities
Settle = '01-Jan-2010';
Maturity = {'01-Jan-2011';'01-Jan-2012';'01-Jan-2013';'01-Jan-2014'};
CouponRate = {{'01-Jan-2011' .042;'01-Jan-2012' .05; '01-Jan-2013' .06; '01-Jan-2014' .07}};

% Display the instrument portfolio 
ISet = instbond(CouponRate, Settle, Maturity, 1);
instdisp(ISet)
Index Type CouponRate Settle         Maturity       Period Basis EndMonthRule IssueDate FirstCouponDate LastCouponDate StartDate Face
1     Bond [Cell]     01-Jan-2010    01-Jan-2011    1      0     1            NaN       NaN             NaN            NaN       100 
2     Bond [Cell]     01-Jan-2010    01-Jan-2012    1      0     1            NaN       NaN             NaN            NaN       100 
3     Bond [Cell]     01-Jan-2010    01-Jan-2013    1      0     1            NaN       NaN             NaN            NaN       100 
4     Bond [Cell]     01-Jan-2010    01-Jan-2014    1      0     1            NaN       NaN             NaN            NaN       100 
 

Build a BDTTree to price the stepped coupon bonds. Assume the volatility to be 10%

Sigma = 0.1; 
BDTTimeSpec = bdttimespec(ValuationDate, EndDates, Compounding);
BDTVolSpec = bdtvolspec(ValuationDate, EndDates, Sigma*ones(1, length(EndDates))');
BDTT = bdttree(BDTVolSpec, RS, BDTTimeSpec);

% Compute the price of the stepped coupon bonds
PBDT = bdtprice(BDTT, ISet)
PBDT = 4×1

  100.6763
  100.7368
  100.9266
  101.0115

Price a portfolio of stepped callable bonds and stepped vanilla bonds using the following data: The data for the interest rate term structure is as follows:

Rates = [0.035; 0.042147; 0.047345; 0.052707];
ValuationDate = 'Jan-1-2010';
StartDates = ValuationDate;
EndDates = {'Jan-1-2011'; 'Jan-1-2012'; 'Jan-1-2013'; 'Jan-1-2014'};
Compounding = 1;

%Create RateSpec
RS = intenvset('ValuationDate', ValuationDate, 'StartDates', StartDates,...
'EndDates', EndDates,'Rates', Rates, 'Compounding', Compounding);

% Create an instrument portfolio of 3 stepped callable bonds and three
% stepped vanilla bonds
Settle = '01-Jan-2010';
Maturity = {'01-Jan-2012';'01-Jan-2013';'01-Jan-2014'};
CouponRate = {{'01-Jan-2011' .042;'01-Jan-2012' .05; '01-Jan-2013' .06; '01-Jan-2014' .07}};
OptSpec='call';
Strike=100;
ExerciseDates='01-Jan-2011'; %Callable in one year

% Bonds with embedded option 
ISet = instoptembnd(CouponRate, Settle, Maturity, OptSpec, Strike,...
ExerciseDates, 'Period', 1);
                    
% Vanilla bonds 
ISet = instbond(ISet, CouponRate, Settle, Maturity, 1);

% Display the instrument portfolio
instdisp(ISet)
Index Type      CouponRate Settle         Maturity       OptSpec Strike ExerciseDates  Period Basis EndMonthRule IssueDate FirstCouponDate LastCouponDate StartDate Face AmericanOpt
1     OptEmBond [Cell]     01-Jan-2010    01-Jan-2012    call    100    01-Jan-2011    1      0     1            NaN       NaN             NaN            NaN       100  0          
2     OptEmBond [Cell]     01-Jan-2010    01-Jan-2013    call    100    01-Jan-2011    1      0     1            NaN       NaN             NaN            NaN       100  0          
3     OptEmBond [Cell]     01-Jan-2010    01-Jan-2014    call    100    01-Jan-2011    1      0     1            NaN       NaN             NaN            NaN       100  0          
 
Index Type CouponRate Settle         Maturity       Period Basis EndMonthRule IssueDate FirstCouponDate LastCouponDate StartDate Face
4     Bond [Cell]     01-Jan-2010    01-Jan-2012    1      0     1            NaN       NaN             NaN            NaN       100 
5     Bond [Cell]     01-Jan-2010    01-Jan-2013    1      0     1            NaN       NaN             NaN            NaN       100 
6     Bond [Cell]     01-Jan-2010    01-Jan-2014    1      0     1            NaN       NaN             NaN            NaN       100 
 

Build a BDTTree and price the instruments. Build the tree Assume the volatility to be 10%

Sigma = 0.1;  
BDTTimeSpec = bdttimespec(ValuationDate, EndDates, Compounding);
BDTVolSpec = bdtvolspec(ValuationDate, EndDates, Sigma*ones(1, length(EndDates))');
BDTT = bdttree(BDTVolSpec, RS, BDTTimeSpec);

%The first three rows corresponds to the price of the stepped callable bonds and the
%last three rows corresponds to the price of the stepped vanilla bonds.
PBDT = bdtprice(BDTT, ISet)
PBDT = 6×1

  100.4799
  100.3228
  100.0840
  100.7368
  100.9266
  101.0115

Compute the price of a portfolio with range notes and a floating rate note using the following data: The data for the interest rate term structure is as follows:

Rates = [0.035; 0.042147; 0.047345; 0.052707];
ValuationDate = 'Jan-1-2011';
StartDates = ValuationDate;
EndDates = {'Jan-1-2012'; 'Jan-1-2013'; 'Jan-1-2014'; 'Jan-1-2015'};
Compounding = 1;

%  Create RateSpec
RS = intenvset('ValuationDate', ValuationDate, 'StartDates', StartDates,...
'EndDates', EndDates,'Rates', Rates, 'Compounding', Compounding);
  
% Create an instrument portfolio with two range notes and a floating rate
% note with the following data:
Spread = 200;
Settle = 'Jan-1-2011';
Maturity = 'Jan-1-2014';

% First Range Note:
RateSched(1).Dates = {'Jan-1-2012'; 'Jan-1-2013'  ; 'Jan-1-2014'};
RateSched(1).Rates  = [0.045 0.055; 0.0525  0.0675; 0.06 0.08];

% Second Range Note:
RateSched(2).Dates = {'Jan-1-2012'; 'Jan-1-2013' ; 'Jan-1-2014'};
RateSched(2).Rates  = [0.048 0.059; 0.055  0.068 ; 0.07 0.09];

% Create InstSet
InstSet = instadd('RangeFloat', Spread, Settle, Maturity, RateSched);

% Add a floating-rate note
InstSet = instadd(InstSet, 'Float', Spread, Settle, Maturity);

% Display the portfolio instrument
instdisp(InstSet)
Index Type       Spread Settle         Maturity       RateSched FloatReset Basis Principal EndMonthRule
1     RangeFloat 200    01-Jan-2011    01-Jan-2014    [Struct]  1          0     100       1           
2     RangeFloat 200    01-Jan-2011    01-Jan-2014    [Struct]  1          0     100       1           
 
Index Type  Spread Settle         Maturity       FloatReset Basis Principal EndMonthRule CapRate FloorRate
3     Float 200    01-Jan-2011    01-Jan-2014    1          0     100       1            Inf     -Inf     
 

Build a BDTTree and price the instruments. Build the tree Assume the volatility to be 10%.

Sigma = 0.1;  
BDTTS = bdttimespec(ValuationDate, EndDates, Compounding);
BDTVS = bdtvolspec(ValuationDate, EndDates, Sigma*ones(1, length(EndDates))');
BDTT = bdttree(BDTVS, RS, BDTTS);

% Price the portfolio 
Price = bdtprice(BDTT, InstSet)
Price = 3×1

  100.2841
   98.0757
  105.5147

Use instswap to create a float-float swap and price the swap with bdtprice.

RateSpec = intenvset('Rates',.05,'StartDate',today,'EndDate',datemnth(today,60));
IS = instswap([.02 .03],today,datemnth(today,60),[], [], [], [1 1]);
VolSpec = bdtvolspec(today,datemnth(today,[10 60]),[.01 .02]);
TimeSpec = bdttimespec(today,cfdates(today,datemnth(today,60),1));
BDTTree = bdttree(VolSpec,RateSpec,TimeSpec);
bdtprice(BDTTree,IS)
ans = 
-4.3220

Use instswap to create multiple swaps and price the swaps with bdtprice.

RateSpec = intenvset('Rates',.05,'StartDate',today,'EndDate',datemnth(today,60));
IS = instswap([.03 .02],today,datemnth(today,60),[], [], [], [1 1]);
IS = instswap(IS,[200 300],today,datemnth(today,60),[], [], [], [0 0]);
IS = instswap(IS,[.08 300],today,datemnth(today,60),[], [], [], [1 0]);
VolSpec = bdtvolspec(today,datemnth(today,[10 60]),[.01 .02]);
TimeSpec = bdttimespec(today,cfdates(today,datemnth(today,60),1));
BDTTree = bdttree(VolSpec,RateSpec,TimeSpec);
bdtprice(BDTTree,IS)
ans = 3×1

    4.3220
   -4.3220
   -0.2701

Input Arguments

collapse all

Interest-rate tree structure, specified by using bdttree.

Data Types: struct

Instrument variable containing a collection of NINST instruments, specified using instadd. Instruments are categorized by type; each type can have different data fields. The stored data field is a row vector or character vector for each instrument.

Data Types: struct

(Optional) Derivatives pricing options structure, created using derivset.

Data Types: struct

Output Arguments

collapse all

Price for each instrument at time 0, returned as a NINST-by-1 vector. The prices are computed by backward dynamic programming on the interest-rate tree. If an instrument cannot be priced, a NaN is returned in that entry.

Related single-type pricing functions are:

  • bondbybdt — Price a bond from a BDT tree.

  • capbybdt — Price a cap from a BDT tree.

  • cfbybdt — Price an arbitrary set of cash flows from a BDT tree.

  • fixedbybdt — Price a fixed-rate note from a BDT tree.

  • floatbybdt — Price a floating-rate note from a BDT tree.

  • floorbybdt — Price a floor from a BDT tree.

  • optbndbybdt — Price a bond option from a BDT tree.

  • optfloatbybdt — Price a floating-rate note with an option from a BDT tree.

  • optemfloatbybdt — Price a floating-rate note with an embedded option from a BDT tree.

  • optembndbybdt — Price a bond with embedded option by a BDT tree.

  • rangefloatbybdt — Price range floating note using a BDT tree.

  • swapbybdt — Price a swap from a BDT tree.

  • swaptionbybdt — Price a swaption from a BDT tree.

Tree structure of instrument prices, returned as a MATLAB® structure of trees containing vectors of instrument prices and accrued interest, and a vector of observation times for each node. Within PriceTree:

  • PriceTree.PTree contains the clean prices.

  • PriceTree.AITree contains the accrued interest.

  • PriceTree.tObs contains the observation times.

Version History

Introduced before R2006a