No BSD License  

Highlights from
Compute PSA-benchmarked prepayment metrics

image thumbnail
smmpsa(month,psa)
function[smm] = smmpsa(month,psa)
% SMMPSA    PSA-benchmarked single month mortality rate 
% INPUTS  : month - month(s), n*1 vector
%           psa   - PSA factor 
% OUTPUTS : smm   - monthly SMM, n*1 vector
% EXAMPLE : smm(5,100), smm(1:30,150)
% AUTHOR  : Dimitri Shvorob, dimitri.shvorob@vanderbilt.edu, 9/20/07
if ~isvector(month)
   error('Input argument "month" must be a scalar or vector')
end
if any(month ~= floor(month) | month < 0)
   error('Input argument "month" must contain non-negative integers')
end
if ~isscalar(psa) || psa < 0
   error('Input argument "psa" must be a non-negative scalar')
end
i = ones(length(month),1);
j = min([i month(:)/30],[],2);
cpr = .0006*psa*j;
smm = 1 - (1-cpr).^(1/12);

Contact us