Hi eveyone
Can anyone tell me how to divide my GDP data to different sentiment of the business, let's say expansion and recession.
Thanks a lot!
Yangyang wrote:Thank you so much for your suggestions.
I have also one problem aboutthe two statements, how can i divide my data set to two states
accoding to Hamilton.
The mean the US GDP from the Markov switching model are both positive in two states, And i want to
divide it to two states and then compare with the NBER.
Yangyang wrote: I tried stock price and unemployment rate, they are positive in the state 1 and negative in the state 2.
What is the problem for the difference between GDP and stock price, How can i interpret it?
Thank you so much!
OPEN DATA "C:\Users\Yang\Desktop\Data of the thesis\GDP_1950_2012.XLS"
CALENDAR(Q) 1950:1
DATA(FORMAT=XLS,ORG=COLUMNS) 1950:01 2012:04 GDP
*******************************************************
set LGDP = log(GDP)
set DLGDP = LGDP - LGDP{1}
*******************************************************
**Markov switching for unemployment rate
@MSRegression(switch=ch, states=2) DLGDP
# constant
*
nonlin(parmset=regparms) betas sigsqv
nonlin(parmset=msparms) p
*
gset pt_t = %zeros(nstates,1)
gset pt_t1 = %zeros(nstates,1)
gset psmooth = %zeros(nstates,1)
*
compute gstart=1950:01,gend=2012:04
@MSRegInitial gstart gend
*
* Compute a lower bound on the permitted values of the variance to
* prevent convergence to a zero-variance spike.
*
compute sigmalimit=1.e-6*%minvalue(sigsqv)
*
frml logl = f=%MSRegFVec(t),pt_t1=%mcstate(p,pstar),$
pt_t=pstar=%msupdate(f,pt_t1,fpt),log(fpt)
maximize(start=(pstar=%mcergodic(p)),parmset=regparms+msparms,$
reject=%minvalue(sigsqv)<sigmalimit,$
method=bfgs,pmethod=simplex,piters=5) logl gstart gend
*
@%mssmooth p pt_t pt_t1 psmooth
*
* Smoothed probabilities of the regimes
*
set p1smooth = psmooth(t)(1)
graph(footer="Smoothed Probabilities of Regime 1",max=1.0,min=0.0)
# p1smooth
GRAPH(STYLE=LINE,OVERLAY=LINE,HEADER="GDP VS probability of bull state",KEY=UPLEFT,SCALE=BOTH,EXTEND) 2
# DLGDP
# P1SMOOTH
*
do i=1,2
disp "Conditional Mean for Regime" i $
betas(i)(1)/(1-betas(i)(2)-betas(i)(3))
end do i
**********************************************************************************************************MAXIMIZE - Estimation by BFGS
Convergence in 8 Iterations. Final criterion was 0.0000018 <= 0.0000100
Quarterly Data From 1950:01 To 2012:04
Usable Observations 251
Skipped/Missing (from 252) 1
Function Value 824.6962
Variable Coeff Std Error T-Stat Signif
************************************************************************************
1. BETAS(1)(1) 0.0134542133 0.0005377869 25.01774 0.00000000
2. BETAS(2)(1) 0.0188055081 0.0014353330 13.10184 0.00000000
3. SIGSQV(1) 0.0000249042 0.0000034692 7.17865 0.00000000
4. SIGSQV(2) 0.0001934011 0.0000304593 6.34949 0.00000000
5. P(1,1) 0.9626686590 0.0248750079 38.70024 0.00000000
6. P(1,2) 0.0360811756 0.0293281822 1.23026 0.21860121
**************************************************************************************Yangyang wrote:Thank you for the explaining!
Yes, should i say the structure breaks is from the volatility shift, because there is the narrow gap between mean
in two states.
If that is the case, which model should i choose?
Thank you!
Yangyang wrote:Thanks, i am writing my master thesis now, i guess i am not competent to use
the complicated model for seperating the variance and mean switching.
Return to Structural Breaks and Switching Models
Users browsing this forum: No registered users and 1 guest