No BSD License  

Highlights from
Compute PSA-benchmarked prepayment metrics

image thumbnail
mgpmt(r,m)
function[p] = mgpmt(r,m)
% MGPMT     Payment on a fixed-rate, fully amortized mortgage, per dollar loaned 
% INPUTS  : r - annualized mortgage rate, decimal 
%           m - mortgage term, months
% OUTPUTS : p - monthly payment
% EXAMPLE : mgpmt(0.08125,360)
% AUTHOR  : Dimitri Shvorob, dimitri.shvorob@vanderbilt.edu, 9/20/07
if ~isscalar(m) || m < 1 || m ~= floor(m)
   error('Input argument "m" must be a positive scalar')
end
if ~isscalar(r) || r < 0
   error('Input argument "r" must a positive scalar')
end
r = r/12;  
a = (1+r)^(-m);
p = r/(1-a);

Contact us