%% Compute PSA Prepayment Speeds
% This example shows how to compute the equivalent PSA benchmark prepayment speeds for a mortgage pool with the following characteristics and prepayment matrix.

Price        = 101;
Settle       = datenum('1-Jan-2000');
Maturity     = datenum('1-Jan-2030');
IssueDate    = datenum('1-Jan-2000');
GrossRate    = 0.08125;
PrepayMatrix = 0.005*ones(360,1);
CouponRate   = 0.075;
Delay        = 14;

[ImpSpdOnPrc, ImpSpdOnDur, ImpSpdOnCnv] = ... 
mbsprice2speed(Price,Settle, Maturity, IssueDate, ... 
GrossRate, PrepayMatrix, CouponRate, Delay)

% Copyright 2015 The MathWorks, Inc.