% ForwardRate function simulates the Forward rate from t0 up to T

function L = ForwardRate(sigma, L_0, tau, n, L)
L(1) = L_0(1).*exp((sigma.*(tau.*L_0(1).*sigma)/(1 + tau*L_0(1))...
    - 0.5*sigma).*tau + sigma.*sqrt(tau).*randn);
for i = 2:n
L(i) = L_0(i-1).*exp((sigma.*(tau.*L_0(i).*sigma)/(1 + tau*L_0(i))...
    - 0.5*sigma).*tau*.01 + sigma.*sqrt(tau*0.01).*randn);
end

end