www.gusucode.com > fininst 案例源码程序 matlab代码 > fininst/DeterminetheMortgageBackedSecurityPriceUsingaCustomizedPExample.m

    %% 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)