Page 1 of 1

G2++ numerical implementation

Posted: December 17th, 2008, 10:56 am
by gozzi84
I have the two mean reverting SDEs in the G2++ model in the form:where both and We have also a 2X2 covarince matix obtained through Cholesky.In Matlab we have:R = mvnrnd(zeros(2,1),covariance,nstep)X=zeros(length(R(:,1)+1,1)Y=zeros(length(R(:,1)+1,1)for j=1:length(R(:,1)) X(j+1)=X(j)*exp(-a*dt)+R(j,1) Y(j+1)=Y(j)*exp(-b*dt)+R(j,2)endIs that correct? The incrments of the 2 correlated Brownian motions already include the sigma*dt term we usually use in simulating SDE through MC?Thank you for yoor help.Regards

G2++ numerical implementation

Posted: December 19th, 2008, 5:27 am
by Church
It contains the sigma. Whether it contains the dt-term depends on how you determined the covariances in the covariance matrix.When you explicitly calculate the covariance over a time period dt, then it's in, otherwise it is not. So my guess is that it is not in in your case.