mbsdury

Duration of mortgage pool given yield

Syntax

``[YearDuration,ModDuration] = mbsdury(Yield,Settle,Maturity,IssueDate,GrossRate)``
``[YearDuration,ModDuration] = mbsdury(___,CouponRate,Delay,PrepaySpeed,PrepayMatrix)``

Description

example

````[YearDuration,ModDuration] = mbsdury(Yield,Settle,Maturity,IssueDate,GrossRate)` computes the mortgage-backed security Macaulay (`YearDuration`) in years and modified (`ModDuration`) durations in years, given time information, yield to maturity, and optionally, a prepayment model.```

example

````[YearDuration,ModDuration] = mbsdury(___,CouponRate,Delay,PrepaySpeed,PrepayMatrix)` specifies options using one or more optional arguments in addition to the input arguments in the previous syntax.```

Examples

collapse all

This example shows how to find the duration of mortgage pool given a mortgage-backed security with the following characteristics.

```Yield = 0.07298413; Settle = '15-Apr-2002'; Maturity = '1 Jan 2030'; IssueDate = '1-Jan-2000'; GrossRate = 0.08125; Speed = 100; CouponRate = 0.075; Delay = 14; [YearDuration, ModDuration] = mbsdury(Yield, Settle, Maturity,... IssueDate, GrossRate, CouponRate, Delay, Speed)```
```YearDuration = 6.4380 ```
```ModDuration = 6.2080 ```

Input Arguments

collapse all

Mortgage yield, compounded monthly, specified as an `NMBS`-by-`1` vector in decimals.

Data Types: `double`

Settlement dates, specified as an `NMBS`-by-`1` vector of serial date numbers or a cell array of character vectors. `Settle` must be earlier than `Maturity`.

Data Types: `double` | `cell`

Maturity dates, specified as an `NMBS`-by-`1` vector of serial date numbers or a cell array of character vectors.

Data Types: `double` | `cell`

Maturity dates, specified as an `NMBS`-by-`1` vector of serial date numbers or a cell array of character vectors.

Data Types: `double` | `cell`

Gross coupon rate (including fees), specified as an `NMBS`-by-`1` vector of numeric decimals.

Data Types: `double`

(Optional) Net coupon rate, specified as an `NMBS`-by-`1` vector of numeric decimals.

Data Types: `double`

(Optional) Delay in days, specified as an `NMBS`-by-`1` vector.

Data Types: `double`

(Optional) Speed relative to PSA standard, specified as an `NMBS`-by-`1` vector. The PSA standard is `100`.

Note

Set the `PrepaySpeed` to `[]` if you input a customized `PrepayMatrix`.

Data Types: `double`

(Optional) Customized prepayment vector, specified as a `NaN`-padded matrix of size `max(TermRemaining)`-by-`NMBS`. Each column corresponds to each mortgage-backed security, and each row corresponds to each month after settlement.

Note

Use `PrepayMatrix` only when `PrepaySpeed` is unspecified.

Data Types: `double`

Output Arguments

collapse all

Macaulay duration in years, returned as a scalar numeric.

Modified duration in years, returned as a scalar numeric.

References

[1] PSA Uniform Practices, SF-49

Version History

Introduced before R2006a