Documentation Center |
Price swap instrument from Heath-Jarrow-Morton interest-rate tree
[Price, PriceTree, CFTree, SwapRate]
= swapbyhjm(HJMTree,
LegRate, Settle, Maturity)
[Price, PriceTree, CFTree, SwapRate]
= swapbyhjm(HJMTree,
LegRate, Settle, Maturity, LegReset,
Basis, Principal,
LegType, EndMonthRule)
[Price, PriceTree, CFTree, SwapRate]
= swapbyhjm(HJMTree,
LegRate, Settle, Maturity, Name,Value)
HJMTree | Forward-rate tree structure created by hjmtree. |
Number of instruments (NINST)-by-2 matrix, with each row defined as: [CouponRate Spread] or [Spread CouponRate] CouponRate is the decimal annual rate. Spread is the number of basis points over the reference rate. The first column represents the receiving leg, while the second column represents the paying leg. | |
Settle | Settlement date. NINST-by-1 vector of serial date numbers or date strings representing the settlement date for each swap. Settle must be earlier than Maturity. |
Maturity | Maturity date. NINST-by-1 vector of dates representing the maturity date for each swap. |
The Settle date for every swap is set to the ValuationDate of the HJM tree. The swap argument Settle is ignored.
This function also calculates the SwapRate (fixed rate) so that the value of the swap is initially zero. To do this, enter CouponRate as NaN.
Enter the following optional inputs using an ordered syntax or as name-value pair arguments. You cannot mix ordered syntax with name-value pair arguments.
LegReset |
NINST-by-2 matrix representing the reset frequency per year for each swap. NINST-by-1 vector representing the frequency of payments per year. Default: [1 1] |
Basis |
Day-count basis of the instrument. A vector of integers.
For more information, see basis. Default: 0 (actual/actual) |
Principal |
NINST-by-1 vector or NINST-by-1 cell array of the notional principal amounts or principal value schedules. For the latter case, each element of the cell array is a NumDates-by-2 call array where the first column is dates and the second column is its associated notional principal value. The date indicates the last day that the principal value is valid. Default: 100 |
LegType |
NINST-by-2 matrix. Each row represents an instrument. Each column indicates if the corresponding leg is fixed (1) or floating (0). This matrix defines the interpretation of the values entered in LegRate. Default: [1 0] for each instrument |
Options |
Derivatives pricing options structure created with derivset. |
EndMonthRule |
End-of-month rule. A NINST-by-1 vector. This rule applies only when Maturity is an end-of-month date for a month having 30 or fewer days.
Default: 1 |
Specify optional comma-separated pairs of Name,Value arguments. Name is the argument name and Value is the corresponding value. Name must appear inside single quotes (' '). You can specify several name and value pair arguments in any order as Name1,Value1,...,NameN,ValueN.
AdjustCashFlowsBasis |
Adjust the cash flows based on the actual period day count. NINST-by-1 of logicals. Default: false |
BusinessDayConvention |
Require payment dates to be business dates. NINST-by-1 cell array with possible choices of business day convention:
Default: actual |
Holidays |
Holidays used for business day convention. NHOLIDAYS-by-1 of MATLAB^{®} date numbers. Default: If no dates are specified, holidays.m is used. |
StartDate |
NINST-by-1 vector of dates when the swap actually starts. Use this argument to price forward swaps, i.e., swaps that start in a future date Default: Settle date |
[Price, PriceTree, CFTree, SwapRate]
= swapbyhjm(HJMTree,
LegRate, Settle, Maturity) computes
the price of a swap instrument from an HJM interest-rate tree.
[Price, PriceTree, CFTree, SwapRate]
= swapbyhjm(HJMTree,
LegRate, Settle, Maturity, LegReset,
Basis, Principal,
LegType, EndMonthRule) computes
the price of a swap instrument from an HJM interest-rate tree with
optional input arguments.
[Price, PriceTree, CFTree, SwapRate]
= swapbyhjm(HJMTree,
LegRate, Settle, Maturity, Name,Value) computes
the price of a swap instrument from an HJM interest-rate tree with
additional options specified by one or more Name,Value pair
arguments.
Price is the number of instruments (NINST-by-1) expected prices of the swap at time 0.
PriceTree is the tree structure with a vector of the swap values at each node.
CFTree is the tree structure with a vector of the swap cash flows at each node.
SwapRate is a NINST-by-1 vector of rates applicable to the fixed leg such that the swaps' values are zero at time 0. This rate is used in calculating the swaps' prices when the rate specified for the fixed leg in LegRate is NaN. The SwapRate output is padded with NaN for those instruments in which CouponRate is not set to NaN.
capbyhjm | cfbyhjm | floorbyhjm | hjmtree | treeviewer