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

    %% Compute a Mortgage-Backed Security Convexity
% This example shows how to compute a mortgage-backed security convexity,
% given a mortgage-backed security with the following characteristics.
%%

% Copyright 2015 The MathWorks, Inc.

Price      = 101;
Settle     = '15-Apr-2002';
Maturity   = '1 Jan 2030';
IssueDate  = '1-Jan-2000';
GrossRate  = 0.08125;
CouponRate = 0.075;
Delay = 14;
Speed = 100;

Convexity = mbsconvp(Price, Settle, Maturity, IssueDate,... 
GrossRate, CouponRate, Delay, Speed)