Documentation Center

  • Trial Software
  • Product Updates

toRateSpec

Convert IRFunctionCurve object to RateSpec

Syntax

F = toRateSpec(CurveObj, InpDates)

Arguments

CurveObj

Interest-rate curve object that is constructed using IRFunctionCurve.

InpDates

Vector of input dates using MATLAB® date format. The input dates must be after the settle date.

Description

F = toRateSpec(CurveObj, InpDates) returns a RateSpec object that is identical to the RateSpec structure created by the Financial Instruments Toolbox™ function intenvset.

Examples

expand all

Convert an IRFunctionCurve Object to a RateSpec

This example shows how to convert an IRFunctionCurve object to a RateSpec. First, an IRFunctionCurve object is created using the function IRFunctionCurve constructor, then a RateSpec structure is created using the toRateSpec method.

irfc = IRFunctionCurve('Forward',today,@(t) polyval([-0.0001 0.003 0.02],t));
irfc.toRateSpec(today+30:30:today+365)
ans = 

           FinObj: 'RateSpec'
      Compounding: 2
             Disc: [12x1 double]
            Rates: [12x1 double]
         EndTimes: [12x1 double]
       StartTimes: [12x1 double]
         EndDates: [12x1 double]
       StartDates: 735616
    ValuationDate: 735616
            Basis: 0
     EndMonthRule: 1

Was this topic helpful?