Construct interest-rate curve object from function handle or function and fit to market data
CurveObj = IRFunctionCurve(Type,Settle,FunctionHandle) CurveObj = IRFunctionCurve(Type,Settle,FunctionHandle,Name,Value)
Type | Type of interest-rate curve: |
Settle | Scalar for the |
Compounding | (Optional) Scalar that sets the compounding frequency
per year for the
|
Basis | (Optional) Day-count basis of the bond. A scalar of integers.
For more information, see Basis. |
FunctionHandle | Function handle that defines the interest-rate curve. The function handle requires one numeric input (time-to-maturity) and returns one numeric output (interest rate or discount factor). For more information on defining a function handle, see the MATLAB® Programming Fundamentals documentation. |
Parameters | Fitted parameters for function. |
CurveObj = IRFunctionCurve(Type,Settle,FunctionHandle,Name,Value)
constructs an interest-rate curve object directly by specifying a function handle. You must
enter the optional arguments for Basis
and Compounding
as comma-separated pairs of Name
,Value
arguments.
Name
is the argument name and Value
is the
corresponding value. Name
must appear inside quotes. You can specify
several name and value pair arguments in any order as
Name1
,Value1
,...,NameN
,ValueN
.
After you use the IRFunctionCurve
constructor
to create an IRFunctionCurve
object, you can fit
the bond using the following methods.
Method | Description |
---|---|
getForwardRates | Returns forward rates for input dates. |
getZeroRates | Returns zero rates for input dates. |
getDiscountFactors | Returns discount factors for input dates. |
getParYields | Returns par yields for input dates. |
toRateSpec | Converts to be a This |
Alternatively, you can construct an IRFunctionCurve
object
using the following static methods.
Static Method | Description |
---|---|
fitNelsonSiegel | Fits a Nelson-Siegel function to market data. |
fitSvensson | Fits a Svensson function to market data. |
fitSmoothingSpline | Fits a smoothing spline function to market data. |
fitFunction | Fits a custom function to market data. |
irfc = IRFunctionCurve('Forward',today,@(t) polyval([-0.0001 0.003 0.02],t))
irfc = Type: Forward Settle: 737406 (12-Dec-2018) Compounding: 2 Basis: 0 (actual/actual)