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

    %% Price a Floating-Rate Note Using an HJM Tree  
% Price a 20-basis point floating-rate note using an HJM forward-rate tree.   

% Copyright 2015 The MathWorks, Inc.


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

%% 
% Define the floating-rate note using the required arguments. Other arguments
% use defaults. 
Spread = 20;
Settle = '01-Jan-2000';
Maturity = '01-Jan-2003';  

%% 
% Use |floatbyhjm| to compute the price of the note. 
Price = floatbyhjm(HJMTree, Spread, Settle, Maturity)