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

    %% Stripping Floorlet Volatilities from Floors with the Same Strikes  

%% 
% Compute the zero curve for discounting and projecting forward rates. 
ValuationDate = datenum('10-Jun-2015');
ZeroRates = [0.02 0.10 0.28 0.75 1.15 1.80]/100;
CurveDates = datemnth(ValuationDate, [0.25 0.5 1 2 3 5]*12);
ZeroCurve = IRDataCurve('Zero',ValuationDate,CurveDates,ZeroRates)  
%% 
% Define the floor volatility data. 
FloorSettle = datenum('12-Jun-2015');
FloorMaturity = datenum({'13-Jun-2016';'12-Jun-2017';'12-Jun-2018';...
    '12-Jun-2019';'12-Jun-2020'});
FloorVolatility = [0.41;0.43;0.43;0.41;0.38];
FloorStrike = 0.015;   
%% 
% Strip floorlet volatilities from floors with the same strike. 
[FloorletVols, FloorletPaymentDates, FloorStrikes] = floorvolstrip(ZeroCurve, ...
    FloorSettle, FloorMaturity, FloorVolatility, 'Strike', FloorStrike);

PaymentDates = cellstr(datestr(FloorletPaymentDates));
format;
table(PaymentDates, FloorletVols, FloorStrikes)