matlab程序如下,谁能告诉我,是怎么实现一个节点到另一个节点的?
B(t) A(t) Y(t)之间的关系是怎么来的啊?实在是看不懂啊,谢谢各位大侠。
SimulDFs=zeros(1,Step);
SimulRates=zeros(1,Step);
SimulDates=zeros(1,Step);
NewRandom=zeros(1,Step+1);
dt=1/365;
for i=2:Step+1
t=(i-1)*dt;
T=t+Swap.Length;
B1=(1-exp(-Swap.Alpha*t))/Swap.Alpha; % B(t)
B2=(1-exp(-Swap.Alpha*Swap.Length))/Swap.Alpha; % B(T-t)
B3=(1-exp(-Swap.Alpha*2*t))/Swap.Alpha; % B(2t)
A=(Swap.Sigma)^2*B2/2*(B2*B3/2+B1^2);
DF1=exp(-t*RateInterpolation(TermStructure(2,:),TermStructure(1,:),t)); %Dt
DF2=exp(-T*RateInterpolation(TermStructure(2,:),TermStructure(1,:),T)); %DT
NewRandom(1,i)=exp(-Swap.Alpha*dt)*NewRandom(1,i-1)+sqrt((1-exp(-2*Swap.Alpha*dt))/2/Swap.Alpha)*RandomNum(i-1,1); % Yt
SimulDFs(1,i-1)=DF2/DF1*exp(-A-Swap.Sigma*B2*NewRandom(1,i));
SimulRates(1,i-1)=log(SimulDFs(1,i-1))/(-0.5033);%(-Swap.Length);
SimulDates(1,i-1)=datenum(Swap.ReferenceDate)+i-1;
end


雷达卡




京公网安备 11010802022788号







