questions on examples from Kim and Nelson

Discussion of State Space and Dynamic Stochastic General Equilibrium Models
fan
Posts: 215
Joined: Wed Jun 19, 2013 5:14 pm

questions on examples from Kim and Nelson

Unread post by fan »

Dear Tom,

I have several questions regarding to the examples from Kim and Nelson's book, "State-Space Models with Regime Switching". I am looking for your help.

Question 1

Code: Select all

 KIMNP037_UNI.RPF
* 3.3 Application 1 from pp 38-43 of Kim and Nelson, "State-space Models
* with Regime Switching".
*
 Use a linear regression to get some ballpark estimates for the
* standard deviations.
*
linreg lgdp
# lgdp{1 to 4}
I would like to why you chose to use 4 lags. Is there any particular reason?

Question2

Code: Select all

* KIMNP048.RPF
* 3.5 Application 3 from pp 48-55 of Kim and Nelson, "State-space Models
* with Regime Switching".
*
* Dynamic factor model
stats(noprint) ipgrow
compute beta(1)=%mean,sigma(1)=%variance*.5
compute gamma(1)=%fill(1,1,0.6)
stats(noprint) incgrow
compute beta(2)=%mean,sigma(2)=%variance*.5
compute gamma(2)=%fill(1,1,0.5)
stats(noprint) salesgrow
compute beta(3)=%mean,sigma(3)=%variance*.5
compute gamma(3)=%fill(1,1,0.4)
stats(noprint) empgrow
compute beta(4)=%mean,sigma(4)=%variance*.5
compute gamma(4)=%fill(4,1,0.2)
I am wondering whether there is a typo. I think the corrected codes should be

Code: Select all

stats(noprint) ipgrow
compute beta(1)=%mean,sigma(1)=%variance*.5
compute gamma(1)=%fill(1,1,0.6)
stats(noprint) incgrow
compute beta(2)=%mean,sigma(2)=%variance*.5
compute gamma(2)=%fill(2,1,0.5)
stats(noprint) salesgrow
compute beta(3)=%mean,sigma(3)=%variance*.5
compute gamma(3)=%fill(3,1,0.4)
stats(noprint) empgrow
compute beta(4)=%mean,sigma(4)=%variance*.5
compute gamma(4)=%fill(4,1,0.2)
In addition, I would like to know where the numbers (0.6,0.5,0.4 and 0.2) are from.
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: questions on examples from Kim and Nelson

Unread post by TomDoan »

fan wrote:Dear Tom,

I have several questions regarding to the examples from Kim and Nelson's book, "State-Space Models with Regime Switching". I am looking for your help.

Question 1

Code: Select all

 KIMNP037_UNI.RPF
* 3.3 Application 1 from pp 38-43 of Kim and Nelson, "State-space Models
* with Regime Switching".
*
 Use a linear regression to get some ballpark estimates for the
* standard deviations.
*
linreg lgdp
# lgdp{1 to 4}
I would like to why you chose to use 4 lags. Is there any particular reason?
Since it's just for getting variance guesses, the number isn't all that important, but a 4 lag AR has about the same complexity of dynamics as the 4 state UC model.
fan wrote: Question2

Code: Select all

* KIMNP048.RPF
* 3.5 Application 3 from pp 48-55 of Kim and Nelson, "State-space Models
* with Regime Switching".
*
* Dynamic factor model
stats(noprint) ipgrow
compute beta(1)=%mean,sigma(1)=%variance*.5
compute gamma(1)=%fill(1,1,0.6)
stats(noprint) incgrow
compute beta(2)=%mean,sigma(2)=%variance*.5
compute gamma(2)=%fill(1,1,0.5)
stats(noprint) salesgrow
compute beta(3)=%mean,sigma(3)=%variance*.5
compute gamma(3)=%fill(1,1,0.4)
stats(noprint) empgrow
compute beta(4)=%mean,sigma(4)=%variance*.5
compute gamma(4)=%fill(4,1,0.2)
I am wondering whether there is a typo. I think the corrected codes should be

Code: Select all

stats(noprint) ipgrow
compute beta(1)=%mean,sigma(1)=%variance*.5
compute gamma(1)=%fill(1,1,0.6)
stats(noprint) incgrow
compute beta(2)=%mean,sigma(2)=%variance*.5
compute gamma(2)=%fill(2,1,0.5)
stats(noprint) salesgrow
compute beta(3)=%mean,sigma(3)=%variance*.5
compute gamma(3)=%fill(3,1,0.4)
stats(noprint) empgrow
compute beta(4)=%mean,sigma(4)=%variance*.5
compute gamma(4)=%fill(4,1,0.2)
No. The original code is correct. The 1's in the first three variables are because they each only load on the current cycle, while employment (which is more of a lagging indicator) needs current and three, thus the 4.
fan wrote: In addition, I would like to know where the numbers (0.6,0.5,0.4 and 0.2) are from.
Those are guess values. They are fairly arbitrary. You expect them to be positive and probably less than one (in total).
fan
Posts: 215
Joined: Wed Jun 19, 2013 5:14 pm

Re: questions on examples from Kim and Nelson

Unread post by fan »

TomDoan wrote:
fan wrote:Dear Tom,

I have several questions regarding to the examples from Kim and Nelson's book, "State-Space Models with Regime Switching". I am looking for your help.

Question 1

Code: Select all

 KIMNP037_UNI.RPF
* 3.3 Application 1 from pp 38-43 of Kim and Nelson, "State-space Models
* with Regime Switching".
*
 Use a linear regression to get some ballpark estimates for the
* standard deviations.
*
linreg lgdp
# lgdp{1 to 4}
I would like to why you chose to use 4 lags. Is there any particular reason?
Since it's just for getting variance guesses, the number isn't all that important, but a 4 lag AR has about the same complexity of dynamics as the 4 state UC model.
fan wrote: Question2

Code: Select all

* KIMNP048.RPF
* 3.5 Application 3 from pp 48-55 of Kim and Nelson, "State-space Models
* with Regime Switching".
*
* Dynamic factor model
stats(noprint) ipgrow
compute beta(1)=%mean,sigma(1)=%variance*.5
compute gamma(1)=%fill(1,1,0.6)
stats(noprint) incgrow
compute beta(2)=%mean,sigma(2)=%variance*.5
compute gamma(2)=%fill(1,1,0.5)
stats(noprint) salesgrow
compute beta(3)=%mean,sigma(3)=%variance*.5
compute gamma(3)=%fill(1,1,0.4)
stats(noprint) empgrow
compute beta(4)=%mean,sigma(4)=%variance*.5
compute gamma(4)=%fill(4,1,0.2)
I am wondering whether there is a typo. I think the corrected codes should be

Code: Select all

stats(noprint) ipgrow
compute beta(1)=%mean,sigma(1)=%variance*.5
compute gamma(1)=%fill(1,1,0.6)
stats(noprint) incgrow
compute beta(2)=%mean,sigma(2)=%variance*.5
compute gamma(2)=%fill(2,1,0.5)
stats(noprint) salesgrow
compute beta(3)=%mean,sigma(3)=%variance*.5
compute gamma(3)=%fill(3,1,0.4)
stats(noprint) empgrow
compute beta(4)=%mean,sigma(4)=%variance*.5
compute gamma(4)=%fill(4,1,0.2)
No. The original code is correct. The 1's in the first three variables are because they each only load on the current cycle, while employment (which is more of a lagging indicator) needs current and three, thus the 4.
fan wrote: In addition, I would like to know where the numbers (0.6,0.5,0.4 and 0.2) are from.
Those are guess values. They are fairly arbitrary. You expect them to be positive and probably less than one (in total).

I see. Thank you for your quick reply.
Post Reply