Help with translate Gauss code into Rats code

Use this forum to post questions about syntax problems or general programming issues. Questions on implementing a particular aspect of econometrics should go in "Econometrics Issues" below.
fan
Posts: 215
Joined: Wed Jun 19, 2013 5:14 pm

Help with translate Gauss code into Rats code

Unread post by fan »

Hi, I am looking for help to translate the attached Gauss code into Rats code. Any help is highly appreciated.
Attachments
Dynamicfactormodel.txt
(12.61 KiB) Downloaded 1000 times
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Help with translate Gauss code into Rats code

Unread post by TomDoan »

That's almost never the correct approach. Most of that program is for doing the Kalman filter, which is handled in RATS using DLM, not 200 lines of matrix calculations. What you need to do is to figure out what is being done with the output from the Kalman filter. That appears to be a set of regressions, but what's regressed on what is the key.
fan
Posts: 215
Joined: Wed Jun 19, 2013 5:14 pm

Re: Help with translate Gauss code into Rats code

Unread post by fan »

TomDoan wrote:That's almost never the correct approach. Most of that program is for doing the Kalman filter, which is handled in RATS using DLM, not 200 lines of matrix calculations. What you need to do is to figure out what is being done with the output from the Kalman filter. That appears to be a set of regressions, but what's regressed on what is the key.
Thanks, Tom. Actually, what I am interested in is that how they did Fama-MecBeth Two-Pass Regression with the time series data they have. That will be highly appreciated if you would kindly give some suggestions on how to do the two-pass regression in Rats.
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Help with translate Gauss code into Rats code

Unread post by TomDoan »

Did they provide the data as well?

Their data is structured as a several collections of data with N (differing from collection to collection) separate series of T data points, where T is the same for all. The Kalman filter factors are generated using one collection of data, and they run various tests based upon a second collection of data.
fan
Posts: 215
Joined: Wed Jun 19, 2013 5:14 pm

Re: Help with translate Gauss code into Rats code

Unread post by fan »

TomDoan wrote:Did they provide the data as well?

Their data is structured as a several collections of data with N (differing from collection to collection) separate series of T data points, where T is the same for all. The Kalman filter factors are generated using one collection of data, and they run various tests based upon a second collection of data.
Hi, Tom. I do not have their data. I attached the data and the code I used to replicate the Kalman filter part. Every thing works fine until the two pass regressions. I am looking forward to hearing from you.
Attachments
he.xlsx
(543.71 KiB) Downloaded 817 times
He(2010).RPF
(4.27 KiB) Downloaded 1014 times
Post Reply