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

    %% Price a Floating-Rate Note Using a Hull-White Tree  
% Price a 20-basis point floating-rate note using a Hull-White interest-rate
% tree.   

% Copyright 2015 The MathWorks, Inc.


%% 
% Load the file |deriv.mat|, which provides |HWTree|. The |HWTree| 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-2005';
Maturity = '01-Jan-2006';  

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