mbsprice
Mortgage-backed security price given yield
Syntax
Description
[
specifies options using one or more optional arguments in addition to the input
arguments in the previous syntax. Price
,AccrInt
] = mbsprice(___CouponRate
,Delay
,PrepaySpeed
,PrepayMatrix
)
Examples
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 = 360×1
34.8583
34.8583
34.8583
34.8583
34.8583
34.8583
34.8583
34.8583
34.8583
34.8583
⋮
AccrInt = 360×1
0.0194
0.0194
0.0194
0.0194
0.0194
0.0194
0.0194
0.0194
0.0194
0.0194
⋮
Input Arguments
Yield
— Mortgage yield compounded monthly
vector of decimal values
Mortgage yield compounded monthly, specified as an
NMBS
-by-1
vector using decimal
values.
Data Types: double
Settle
— Settlement date
cell array of date character vectors | vector of serial date numbers
Settlement date, specified as an
NMBS
-by-1
vector using serial date
numbers or a cell array of date character vectors. Settle
must be earlier than Maturity
.
Data Types: double
| char
| cell
Maturity
— Maturity date
cell array of date character vectors | vector of serial date numbers
Maturity date, specified as an
NMBS
-by-1
vector using serial date
numbers or a cell array of date character vectors.
Data Types: double
| char
| cell
IssueDate
— Issue date
cell array of date character vectors | vector of serial date numbers
Issue date, specified as an
NMBS
-by-1
vector using serial date
numbers or a cell array of date character vectors.
Data Types: double
| char
| cell
GrossRate
— Gross coupon rate (including fees)
vector of decimal values
Gross coupon rate (including fees), specified as an
NMBS
-by-1
vector of decimal
values.
Data Types: double
CouponRate
— Net coupon rate
GrossRate
(default) | vector of decimal values
(Optional) Net coupon rate, specified as an
NMBS
-by-1
vector of decimal
values.
Data Types: double
Delay
— Delay (in days) between payment from homeowner and receipt by bondholder
0
(no delay between payment and
receipt) (default) | vector
(Optional) Delay (in days) between payment from homeowner and receipt by
bondholder, specified as an NMBS
-by-1
vector.
Data Types: double
PrepaySpeed
— Speed relative to PSA standard
0
(no prepayment) (default) | vector
(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
PrepayMatrix
— Customized prepayment vector
matrix
(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
Price
— Clean price for every $100 face value of the securities
vector
Clean price for every $100 face value of the securities, returned as a
NMBS
-by-1
vector.
AccrInt
— Accrued interest of the mortgage-backed securities
vector
Accrued interest of the mortgage-backed securities, returned as a
NMBS
-by-1
vector.
References
[1] PSA Uniform Practices, SF-49
Version History
Apri esempio
Si dispone di una versione modificata di questo esempio. Desideri aprire questo esempio con le tue modifiche?
Comando MATLAB
Hai fatto clic su un collegamento che corrisponde a questo comando MATLAB:
Esegui il comando inserendolo nella finestra di comando MATLAB. I browser web non supportano i comandi MATLAB.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)