# discountfactors

Calculate discount factors for `parametercurve` object

Since R2020a

## Syntax

``outDF = discountfactors(obj,inpDates)``

## Description

example

````outDF = discountfactors(obj,inpDates)` calculates the discount factors for a `parametercurve` object. ```

## Examples

collapse all

Create a `parametercurve` object using `parametercurve`.

`PCobj = parametercurve('zero',datetime(2019,9,15),@(t)polyval([-0.0001 0.003 0.02],t),'Compounding',4,'Basis',5,'Parameters',[-0.0001 0.003 0.02])`
```PCobj = parametercurve with properties: Type: "zero" Settle: 15-Sep-2019 Compounding: 4 Basis: 5 FunctionHandle: @(t)polyval([-0.0001,0.003,0.02],t) Parameters: [-1.0000e-04 0.0030 0.0200] ```

Compute the discount factors using `discountfactors`.

```CurveSettle = datetime(2019,9,15); outDF = discountfactors(PCobj,CurveSettle+30:30:CurveSettle+720)```
```outDF = 1×24 0.9983 0.9967 0.9949 0.9932 0.9914 0.9895 0.9876 0.9857 0.9838 0.9818 0.9798 0.9778 0.9757 0.9737 0.9715 0.9694 0.9673 0.9649 0.9627 0.9604 0.9581 0.9558 0.9535 0.9511 ```

## Input Arguments

collapse all

`parametercurve` object, specified as a previously created `parametercurve` object.

Data Types: `object`

Input dates, specified as a scalar or an `NPOINTS`-by-`1` vector using a datetime array, string array, or date character vectors.

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

## Output Arguments

collapse all

Discount factors, returned as a numeric.

## Version History

Introduced in R2020a

expand all