Main Content

getDiscountFactors

Get discount factors for input dates for IRFunctionCurve

Description

example

F = getDiscountFactors(CurveObj,InpDates) computes discount factors for input dates for an IRFunctionCurve object.

Note

The parametercurve object and the associated discountfactors were introduced in R2020a as part of a new object-based framework in the Financial Instruments Toolbox™ which supports end-to-end workflows in instrument modeling and analysis. For more information, see Get Started with Workflows Using Object-Based Framework for Pricing Financial Instruments.

Examples

collapse all

This example shows how to get discount factors for input dates for an IRFunctionCurve.

irfc = IRFunctionCurve('Forward',today,@(t) polyval([-0.0001 0.003 0.02],t));
getDiscountFactors(irfc, today+30:30:today+720)
ans = 24×1

    0.9984
    0.9967
    0.9950
    0.9933
    0.9916
    0.9899
    0.9881
    0.9864
    0.9846
    0.9828
      ⋮

Input Arguments

collapse all

Interest-rate curve object, specified by using IRFunctionCurve.

Data Types: object

Input dates, specified as an NINST-by-1 vector using a datetime array, string array, or date character vectors. The input dates must be after the Settle date of IRFunctionCurve.

To support existing code, getDiscountFactors also accepts serial date numbers as inputs, but they are not recommended.

Output Arguments

collapse all

Discount factors, returned as a vector.

Version History

Introduced in R2008b

expand all