Financial Derivatives Toolbox | ![]() ![]() |
Pricing
The main function used for pricing portfolios of instruments is intenvprice
. This function works with the family of functions that calculate the prices of individual types of instruments. When called, intenvprice
classifies the portfolio contained in InstSet
by instrument type, and calls the appropriate pricing functions. The map between instrument types and the pricing function intenvprice
calls is
bondbyzero : |
Price bond by a set of zero curves |
fixedbyzero : |
Price fixed rate note by a set of zero curves |
floatbyzero : |
Price floating rate note by a set of zero curves |
swapbyzero : |
Price swap by a set of zero curves |
Each of these functions can be used individually to price an instrument. Consult the reference pages for specific information on the use of these functions.
intenvprice
takes as input an interest rate term structure created with intenvset
, and a portfolio of interest rate contingent derivatives instruments created with instadd
. To learn more about instadd
, see Creating and Managing Instrument Portfolios, and to learn more about the interest rate term structure see Interest Rate Environment.
The syntax for using intenvprice
to price an entire portfolio is
Example: Pricing a Portfolio of Instruments
Consider this example of using the intenvprice
function to price a portfolio of instruments supplied with the Financial Derivatives Toolbox.
The provided MAT-file deriv.mat
stores a portfolio as an instrument set variable ZeroInstSet
. The MAT-file also contains the interest rate term structure ZeroRateSpec
. You can display the instruments with the function instdisp
.
load deriv.mat; instdisp(ZeroInstSet) Index Type CouponRate Settle Maturity Period Basis... 1 Bond 0.04 01-Jan-2000 01-Jan-2003 1 NaN... 2 Bond 0.04 01-Jan-2000 01-Jan-2004 2 NaN... Index Type CouponRate Settle Maturity FixedReset Basis... 3 Fixed 0.04 01-Jan-2000 01-Jan-2003 1 NaN... Index Type Spread Settle Maturity FloatReset Basis... 4 Float 20 01-Jan-2000 01-Jan-2003 1 NaN... Index Type LegRate Settle Maturity LegReset Basis... 5 Swap [0.06 20] 01-Jan-2000 01-Jan-2003 [1 1] NaN...
Use intenvprice
to calculate the prices for the instruments contained in the portfolio ZeroInstSet
.
The output Prices
is a vector containing the prices of all the instruments in the portfolio in the order indicated by the Index
column displayed by instdisp
. Consequently, the first two elements in Prices
correspond to the first two bonds; the third element corresponds to the fixed rate note; the fourth to the floating rate note; and the fifth element corresponds to the price of the swap.
![]() | Pricing and Sensitivity from Interest Rate Term Structure | Sensitivity | ![]() |