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

    %% Compute the Agency |Price|
% This example shows how to compute the agency |Price|.
%%

% Copyright 2015 The MathWorks, Inc.

Settle = datenum('20-Jan-2010');
ZeroRates = [.07 .164 .253 1.002 1.732 2.226 2.605 3.316 ...
3.474 4.188 4.902]'/100;
ZeroDates = daysadd(Settle,360*[.25 .5 1 2 3 4 5 7 10 20 30],1);
ZeroData = [ZeroDates ZeroRates];
 
Maturity = datenum('30-Dec-2013');
CouponRate = .022;
OAS = 6.53/10000;
Vol = .5117;
CallDate = datenum('30-Dec-2010');
Price = agencyprice(ZeroData, OAS, CouponRate, Settle, Maturity, Vol, CallDate)