%% Simulate Term Structures for the LinearGaussian2F Model
% Create a two-factor additive Gaussian interest-rate 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);
    
a = .07;
b = .5;
sigma = .01;
eta = .006;
rho = -.7;
 
G2PP = LinearGaussian2F(irdc,a,b,sigma,eta,rho)

%
% Use the simTermStructs method to simulate term structures based on the LinearGaussian2F model.

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

% Copyright 2015 The MathWorks, Inc.