Rank: 78908 based on 0 downloads (last 30 days) and 0 file submitted
photo

Steve G

E-mail

Personal Profile:

 

Watch this Author's files

 

Comments and Ratings by Steve G View all
Updated File Comments Rating
01 Aug 2011 Kalman Filter Application two factor CIR Estimates the parameters of the two factor CIR model on the UK German, and US term structures. Author: Nils Delava

I believe there is another problem in the code, LLtwoCIR, in the calculation of the Q matrix, the (1,1) element of which is,
(theta1*sigma1*sigma1*(1-exp(-kappa1*dt))^2/(2*kappa1)+sigma1*sigma1/kappa1*(exp(-kappa1*dt)-exp(-2*kappa1*dt)))*AdjS(1)
I think the correct code is,
theta1*sigma1*sigma1*(1-exp(-kappa1*dt))^2/(2*kappa1)+sigma1*sigma1/kappa1*(exp(-kappa1*dt)-exp(-2*kappa1*dt))*AdjS(1)
The AdjS only multiplies the second term, not both the first and second, see Chen and Scott (2003), page 147, second formula.
Thanks

01 Aug 2011 Kalman Filter Application CIR Estimates the parameters of the CIR model on a generated term structure Author: Nils Delava

I believe there is another problem in the code, LLtwoCIR, in the calculation of the Q matrix, the (1,1) element of which is,

(theta1*sigma1*sigma1*(1-exp(-kappa1*dt))^2/(2*kappa1)+sigma1*sigma1/kappa1*(exp(-kappa1*dt)-exp(-2*kappa1*dt)))*AdjS(1)

I think the correct code is,
theta1*sigma1*sigma1*(1-exp(-kappa1*dt))^2/(2*kappa1)+sigma1*sigma1/kappa1*(exp(-kappa1*dt)-exp(-2*kappa1*dt))*AdjS(1)
The AdjS only multiplies the second term, not both the first and second, see Chen and Scott (2003), page 147, second formula.

Thanks

29 Jul 2011 Kalman Filter Application two factor CIR Estimates the parameters of the two factor CIR model on the UK German, and US term structures. Author: Nils Delava

I like the simple code, however I donot understand the following code segment:
VarS=VarS*(1-KalmanGain*H);
Given the KalmanGain definition:
KalmanGain=VarS*H'*InvVarY;
The above VarS is not symmetric, and (1-KalmanGain*H) is not correct either. I believe the corrrect calculation should be:
VarS=(eye(2)-KalmanGain*H)*VarS;

Comment? Thanks.
Steve

19 Aug 2010 Learning the Kalman Filter Basic Kalman filter, heavily commented, for beginners to Kalman filtering. Author: Michael Kleder

Very clean example of KF, but not general enough to deal with state vectoc. For example, s.x = inv(s.H)*s.z; and s.P = inv(s.H)*s.R*inv(s.H') would not work if number of state and number of measurement are not the same.

Contact us