Documentation

mbsprice

Mortgage-backed security price given yield

Syntax

[Price, AccrInt] = mbsprice(Yield, Settle, Maturity, IssueDate,
GrossRate, CouponRate, Delay, PrepaySpeed, PrepayMatrix)

Arguments

Yield

Mortgage yield, compounded monthly (in decimal).

Settle

Settlement date. A serial date number or date string. Settle must be earlier than Maturity.

Maturity

Maturity date. A serial date number or date string.

IssueDate

Issue date. A serial date number or date string.

GrossRate

Gross coupon rate (including fees), in decimal.

CouponRate

(Optional) Net coupon rate, in decimal. Default = GrossRate.

Delay

(Optional) Delay (in days) between payment from homeowner and receipt by bondholder. Default = 0 (no delay between payment and receipt.

PrepaySpeed

(Optional) Relation of the conditional payment rate (CPR) to the benchmark model. Default = 0 (no prepayment). Set PrepaySpeed to [] if you input a customized prepayment matrix.

PrepayMatrix

(Optional) Customized prepayment matrix. A matrix of size max(TermRemaining)-by-NMBS. Missing values are padded with NaNs. Each column corresponds to a mortgage-backed security, and each row corresponds to each month after settlement.

All inputs (except PrepayMatrix) are number of mortgage-backed securities (NMBS) by 1 vectors.

Description

[Price, AccrInt] = mbsprice(Yield, Settle, Maturity, IssueDate, GrossRate, CouponRate, Delay, PrepaySpeed, PrepayMatrix) computes a mortgage-backed security price, given time information, mortgage yield at settlement, and optionally, a prepayment model.

All outputs are scalar values.

Price is the clean price for every $100 face value of the securities.

AccrInt is the accrued interest of the mortgage-backed securities.

Examples

collapse all

Determine the Mortgage-Backed Security Price Given the Yield

This example shows how to determine the mortgage-backed security price given a mortgage-backed security with the following characteristics.

Yield = 0.0725;
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;

[Price AccrInt] = mbsprice(Yield, Settle, Maturity, IssueDate,...
GrossRate, CouponRate, Delay, Speed)
Price =

  101.3147


AccrInt =

    0.2917

Determine the Mortgage-Backed Security Price Using a Customized PrePaytMatrix

This example shows how to determine the mortgage-backed security price, given a mortgage-backed security, and PrePaytMatrix with the following characteristics:

Yield = 0.0725;
Settle = datenum('15-Apr-2002');
Maturity = datenum('1 Jan 2030');
IssueDate = datenum('1-Jan-2000');
GrossRate = 0.08125;
PrepayMatrix = 0.005*ones(360,1);

[Price AccrInt] = mbsprice(Yield, Settle, Maturity, IssueDate,...
GrossRate, PrepayMatrix)
Price =

   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583
   34.8583


AccrInt =

    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194
    0.0194

Related Examples

References

[1] PSA Uniform Practices, SF-49

See Also

Introduced before R2006a

Was this topic helpful?