www.gusucode.com > fininst 案例源码程序 matlab代码 > fininst/PriceFloorUsingaLinearGaussianTwoFactorModelExample.m
%% Price a Floor Using a Linear Gaussian Two-Factor Model % Copyright 2015 The MathWorks, Inc. %% % Define the |ZeroCurve|, |a|, |b|, |sigma|, |eta|, and |rho| parameters % to compute the floor price. Settle = datenum('15-Dec-2007'); ZeroTimes = [3/12 6/12 1 5 7 10 20 30]'; ZeroRates = [0.033 0.034 0.035 0.040 0.042 0.044 0.048 0.0475]'; CurveDates = daysadd(Settle,360*ZeroTimes,1); irdc = IRDataCurve('Zero',Settle,CurveDates,ZeroRates); a = .07; b = .5; sigma = .01; eta = .006; rho = -.7; FloorMaturity = daysadd(Settle,360*[1:5 7 10 15 20 25 30],1); Strike = [0.035 0.037 0.038 0.039 0.040 0.042 0.044 0.046 0.047 0.047 0.047]'; Price = floorbylg2f(irdc,a,b,sigma,eta,rho,Strike,FloorMaturity)