Main Content

mbsdurp

Duration of mortgage pool given price

Description

example

[YearDuration,ModDuration] = mbsdurp(Price,Settle,Maturity,IssueDate,GrossRate) computes the mortgage-backed security Macaulay (YearDuration) in years and modified (ModDuration) durations in years, given time information, price at settlement, and optionally, a prepayment model.

example

[YearDuration,ModDuration] = mbsdurp(___,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.

Price = 101;
Settle = datenum('15-Apr-2002');
Maturity = datenum('1 Jan 2030');
IssueDate = datenum('1-Jan-2000');
GrossRate = 0.08125;
CouponRate = 0.075;;
Delay = 14;
Speed = 100;

[YearDuration, ModDuration] = mbsdurp(Price, Settle, Maturity,... 
IssueDate, GrossRate, CouponRate, Delay, Speed)
YearDuration = 6.4380
ModDuration = 6.2080

Input Arguments

collapse all

Clean price for every $100 face of issue, specified as an NMBS-by-1 vector.

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

Introduced before R2006a