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

    %% Determine a Mortgage-Backed Security Yield Given the Price 
% This example shows how to determine the mortgage-backed security yield,
% given a mortgage-backed security with the following characteristics.
%%

% Copyright 2015 The MathWorks, Inc.

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

[MYield, BEMBSYield] = mbsyield(Price, Settle, Maturity, ... 
IssueDate, GrossRate, CouponRate, Delay,  Speed)