Price swap instrument from HeathJarrowMorton interestrate 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)
 Forwardrate tree structure created by 
 Number of instruments (

 Settlement date. 
 Maturity date. 
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 0
.
To do this, enter CouponRate
as NaN
.
Enter the following optional inputs using an ordered syntax or as namevalue pair arguments. You cannot mix ordered syntax with namevalue pair arguments.

Default: 

Daycount basis of the instrument. A vector of integers.
For more information, see basis. Default: 

Default: 

Default: 

Derivatives pricing options structure created with 

Endofmonth rule. A
Default: 
Specify optional commaseparated 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
.

Adjust the cash flows based on the actual period day count. Default: 

Require payment dates to be business dates.
Default: 

Holidays used for business day convention. Default: If no dates are specified, 

Default: 
[Price, PriceTree, CFTree, SwapRate]
= swapbyhjm(HJMTree,
computes
the price of a swap instrument from an HJM interestrate tree.
LegRate, Settle, Maturity)
[Price, PriceTree, CFTree, SwapRate]
= swapbyhjm(HJMTree,
computes
the price of a swap instrument from an HJM interestrate tree with
optional input arguments.
LegRate, Settle, Maturity, LegReset,
Basis, Principal,
LegType, EndMonthRule)
[Price, PriceTree, CFTree, SwapRate]
= swapbyhjm(HJMTree,
computes
the price of a swap instrument from an HJM interestrate tree with
additional options specified by one or more
LegRate, Settle, Maturity, Name,Value
)Name,Value
pair
arguments.
Price
is the number of instruments (NINST
by1
)
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
by1
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