| Financial Derivatives Toolbox™ | ![]() |
InstSet = instswap(InstSet, LegRate,
Settle, Maturity,
InstSetLegReset, Basis, Principal, LegType)
[FieldList, ClassList, TypeString]
= instswap
Instrument variable. This argument is specified only when adding a swap to an existing instrument set. See instget for more information on the InstSet variable. | |
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. Settle must be earlier than Maturity. |
Maturity | Maturity date. NINST-by-1 vector of dates representing the maturity date for each swap. |
LegReset | (Optional) NINST-by-2 matrix representing the reset frequency per year for each swap. Default = [1 1]. |
Basis | (Optional) Day-count basis of the instrument. A vector of integers.
|
Principal | (Optional) NINST-by-1 vector of the notional principal amounts. Default = 100. |
LegType | (Optional) 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 is [1,0] for each instrument. |
Data arguments are number of instruments (NINST)-by-1 vectors, scalar, or empty. Fill unspecified entries in vectors with NaN. Only one data argument is required to create the instrument; the others may be omitted or passed as empty matrices [].
InstSet = instswap(InstSet, LegRate, Settle, Maturity, InstSetLegReset, Basis, Principal, LegType) creates a new instrument set containing swap instruments or adds swap instruments to an existing instrument set.
[FieldList, ClassList, TypeString] = instswap displays the classes.
FieldList is a number of fields (NFIELDS)-by-1 cell array of strings listing the name of each data field for this instrument type.
ClassList is an NFIELDS-by-1 cell array of strings listing the data class of each field. The class determines how arguments are parsed. Valid strings are 'dble', 'date', and 'char'.
TypeString is a string specifying the type of instrument added. For a swap instrument, TypeString = 'Swap'.
Create a vanilla swap with the following data:
LegRate = [0.065, 0] Settle = 'jan-1-2007'; Maturity = 'jan-1-2012'; LegReset = [1, 1]; Basis = 0 Principal = 100 LegType = [1, 0] >> InstSet = instswap(LegRate, Settle, Maturity, LegReset, Basis, Principal, LegType);
View the swap instrument using instdisp:
>> instdisp(InstSet) Index Type LegRate Settle Maturity LegReset Basis Principal LegType 1 Swap [0.065 0] 01-Jan-2007 01-Jan-2012 1 1 0 100 [1 0]
hjmprice, instaddfield, instbond, instcap, instdisp, instfloor, intenvprice
![]() | instsetfield | instswaption | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |