%% Create a Hull-White One-Factor Model Using a RateSpec
% Create a Hull-White one-factor model using a RateSpec.

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);
 
RateSpec = intenvset('Rates',ZeroRates,'EndDates',CurveDates,'StartDate',Settle);

alpha = .1;
sigma = .01;
 
HW1F = HullWhite1F(RateSpec,alpha,sigma)

%
% Use the simTermStructs method with the HullWhite1F model to simulate term structures.

SimPaths = simTermStructs(HW1F, 10,'nTrials',100);

% Copyright 2012 The MathWorks, Inc.