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

    %% Price a 3% Cap Instrument Using a Black-Karasinski Interest-Rate Tree  

% Copyright 2015 The MathWorks, Inc.


%% 
% Load the file |deriv.mat|, which provides |BKTree|. The |BKTree| structure
% contains the time and interest-rate information needed to price the cap
% instrument. 
load deriv.mat;   

%% 
% Set the required values. Other arguments will use defaults. 
Strike = 0.03;
Settle = '01-Jan-2004';
Maturity = '01-Jan-2007';  

%% 
% Use |capbybk| to compute the price of the cap instrument. 
Price = capbybk(BKTree, Strike, Settle, Maturity)