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

    %% Compute the Price of an Amortizing Floor Using the Black Model   

% Copyright 2015 The MathWorks, Inc.


%% 
% Define the |RateSpec|. 
Rates = [0.0358; 0.0421; 0.0473; 0.0527; 0.0543];
ValuationDate = '15-Nov-2011';
StartDates = ValuationDate;
EndDates = {'15-Nov-2012';'15-Nov-2013';'15-Nov-2014' ;'15-Nov-2015';'15-Nov-2016'};
Compounding = 1;
RateSpec = intenvset('ValuationDate', ValuationDate,'StartDates', StartDates,...
             'EndDates', EndDates,'Rates', Rates, 'Compounding', Compounding)  

%% 
% Define the floor instrument. 
Settle ='15-Nov-2011';
Maturity = '15-Nov-2015';
Strike = 0.05;
Reset = 2;
Principal ={{'15-Nov-2012' 100;'15-Nov-2013' 70;'15-Nov-2014' 40;'15-Nov-2015' 10}};  

%% 
% Price the amortizing floor. 
Volatility = 0.20;
Price = floorbyblk(RateSpec, Strike, Settle, Maturity, Volatility,...
'Reset',Reset,'Principal', Principal)