Main Content

cirprice

Instrument prices from Cox-Ingersoll-Ross interest-rate model

Description

Price = cirprice(CIRTree,InstSet) computes prices for instruments using a Cox-Ingersoll-Ross (CIR) interest rate tree created with cirtree. The CIR tree uses a CIR++ model with the Nawalka-Beliaeva (NB) approach.

cirprice handles the following instrument type values: 'Bond', 'CashFlow','OptBond', 'Fixed', 'Float', 'Cap', 'Floor', 'Swap','Swaption', 'RangeFloat', 'OptFloat', 'OptEmFloat'.

Note

Alternatively, you can use the Cap object to price cap instruments. For more information, see Get Started with Workflows Using Object-Based Framework for Pricing Financial Instruments.

example

[Price,PriceTree] = cirprice(CIRTree,InstSet) returns the optional output for PriceTree.

example

Examples

collapse all

Define two bond instruments.

CouponRate= [0.035;0.04];
Settle= 'Jan-1-2017'; 
Maturity = 'Jan-1-2019'; 
Period = 1; 
InstSet = instbond(CouponRate, Settle, Maturity, Period)
InstSet = struct with fields:
        FinObj: 'Instruments'
    IndexTable: [1x1 struct]
          Type: {'Bond'}
     FieldName: {{11x1 cell}}
    FieldClass: {{11x1 cell}}
     FieldData: {{11x1 cell}}

instdisp(InstSet)
Index Type CouponRate Settle         Maturity       Period Basis EndMonthRule IssueDate FirstCouponDate LastCouponDate StartDate Face
1     Bond 0.035      01-Jan-2017    01-Jan-2019    1      0     1            NaN       NaN             NaN            NaN       100 
2     Bond 0.04       01-Jan-2017    01-Jan-2019    1      0     1            NaN       NaN             NaN            NaN       100 
 

Create a RateSpec using the intenvset function.

Rates = [0.035; 0.042147; 0.047345; 0.052707]; 
Dates = {'Jan-1-2017'; 'Jan-1-2018'; 'Jan-1-2019'; 'Jan-1-2020'; 'Jan-1-2021'}; 
ValuationDate = 'Jan-1-2017'; 
EndDates = Dates(2:end)'; 
Compounding = 1; 
RateSpec = intenvset('ValuationDate', ValuationDate, 'StartDates', ValuationDate, 'EndDates',EndDates,'Rates', Rates, 'Compounding', Compounding); 

Create a CIR tree.

NumPeriods = length(EndDates); 
Alpha = 0.03; 
Theta = 0.02;  
Sigma = 0.1;   
Settle = '01-Jan-2017'; 
Maturity = '01-Jan-2019'; 
CIRTimeSpec = cirtimespec(ValuationDate, Maturity, NumPeriods); 
CIRVolSpec = cirvolspec(Sigma, Alpha, Theta); 

CIRT = cirtree(CIRVolSpec, RateSpec, CIRTimeSpec)
CIRT = struct with fields:
      FinObj: 'CIRFwdTree'
     VolSpec: [1x1 struct]
    TimeSpec: [1x1 struct]
    RateSpec: [1x1 struct]
        tObs: [0 0.5000 1 1.5000]
        dObs: [736696 736878 737061 737243]
     FwdTree: {[1.0173]  [1.0276 1.0175 1.0097]  [1.0456 1.0331 1.0229 1.0151 1.0096]  [1.0644 1.0494 1.0368 1.0267 1.0188 1.0133 1.0100]}
     Connect: {[3x1 double]  [3x3 double]  [3x5 double]}
       Probs: {[3x1 double]  [3x3 double]  [3x5 double]}

Price the bonds.

Price = cirprice(CIRT,InstSet) 
Price = 2×1

   98.6793
   99.6228

Input Arguments

collapse all

Interest-rate tree structure, specified by using cirtree.

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

Output Arguments

collapse all

Expected floating-rate note prices 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.

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.

References

[1] Cox, J., Ingersoll, J.,and S. Ross. "A Theory of the Term Structure of Interest Rates." Econometrica. Vol. 53, 1985.

[2] Brigo, D. and F. Mercurio. Interest Rate Models - Theory and Practice. Springer Finance, 2006.

[3] Hirsa, A. Computational Methods in Finance. CRC Press, 2012.

[4] Nawalka, S., Soto, G., and N. Beliaeva. Dynamic Term Structure Modeling. Wiley, 2007.

[5] Nelson, D. and K. Ramaswamy. "Simple Binomial Processes as Diffusion Approximations in Financial Models." The Review of Financial Studies. Vol 3. 1990, pp. 393–430.

Version History

Introduced in R2018a