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

    %% Construct a Hull-White One-Factor Model  

% Copyright 2015 The MathWorks, Inc.


%% 
% Construct a Hull-White one-factor model. 
Settle = datenum('15-Dec-2007');
CurveTimes = [1:5 7 10 20]';
ZeroRates = [.01 .018 .024 .029 .033 .034 .035 .034]';
CurveDates = daysadd(Settle,360*CurveTimes,1);
 
irdc = IRDataCurve('Zero',Settle,CurveDates,ZeroRates);
    
alpha = .1;
sigma = .01;
 
HW1F = HullWhite1F(irdc,alpha,sigma)  

%% 
% Use the |simTermStructs| method with the |HullWhite1F| model to simulate
% term structures. 
SimPaths = simTermStructs(HW1F, 10,'nTrials',100);