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

    %% Calculate the |RPV01| Value for a CDS

% Copyright 2015 The MathWorks, Inc.


%% 
% Calculate the |RPV01| value, given the following specification for a CDS. 
Settle = '17-Jul-2009'; % valuation date for the CDS
Zero_Time = [.5 1 2 3 4 5]';
Zero_Rate = [1.35 1.43 1.9 2.47 2.936 3.311]'/100;
Zero_Dates = daysadd(Settle,360*Zero_Time,1);
ZeroData = [Zero_Dates Zero_Rate];
ProbData = [daysadd(datenum(Settle),360,1), 0.0247];
Maturity = '20-Sep-2010'; 

RPV01 = cdsrpv01(ZeroData,ProbData,Settle,Maturity)