Hi Tom,
I have still some queries which I need to clarify. I have set up the following with HH as the dependent var and bsbc, wtic as the regressors. I tried variances from 0.0000001 to 1,000 and these are the output.
Code: Select all
linreg(define=ceqn,noprint) hh 1997:10:31 2011:6:24
# constant bsbc wtic
dec vect[series] bd(3) lower(3) upper(3) tsd(3) vsd(3)
dec vect sigsqw(3)
*
compute sigsqw=(||20.,20.,20.||)
compute sigsqv=20.
dlm(c=%eqnxvector(ceqn,t),sw=%diag(sigsqw),sv=sigsqv,PRESAMPLE=ERGODIC,y=wti,$
method=solve,type=filter,vhat=vhat,yhat=yhat) 1997:10:31 2011:6:24 xstates vstates
do i=1,3
set bd(i) 1997:11:28 2011:6:24 = xstates(t)(i)
set lower(i) 1997:11:28 2011:6:24 = bd(i)-2.0*sqrt(vstates(t)(i,i))
set upper(i) 1997:11:28 2011:6:24 = bd(i)+2.0*sqrt(vstates(t)(i,i))
set tsd(i) 1997:11:28 2011:6:24 = xstates(t)(i)/sqrt(vstates(t)(i,i))
set vsd(i) 1997:11:28 2011:6:24 = (vstates(t)(i,i))
end do i
*
set vd 1997:11:28 2011:6:24 = %scalar(vhat)
set yd 1997:11:28 2011:6:24 = %scalar(yhat)
nonlin sigsqv sigsqw
dlm(c=%eqnxvector(ceqn,t),sw=%diag(sigsqw),sv=sigsqv,PRESAMPLE=ERGODIC,y=wti,$
method=bfgs,iters=500,type=filter,vhat=vhat,yhat=yhat) 1997:10:31 2011:6:24 xstates vstates
*
do i=1,3
set bd(i) 1997:11:28 2011:6:24 = xstates(t)(i)
set lower(i) 1997:11:28 2011:6:24 = bd(i)-2.0*sqrt(vstates(t)(i,i))
set upper(i) 1997:11:28 2011:6:24 = bd(i)+2.0*sqrt(vstates(t)(i,i))
end do i
DLM - Estimation by BFGS
NO CONVERGENCE IN 25 ITERATIONS
LAST CRITERION WAS 0.0000000
SUBITERATIONS LIMIT EXCEEDED.
ESTIMATION POSSIBLY HAS STALLED OR MACHINE ROUNDOFF IS MAKING FURTHER PROGRESS DIFFICULT
TRY HIGHER SUBITERATIONS LIMIT, TIGHTER CVCRIT, DIFFERENT SETTING FOR EXACTLINE OR ALPHA ON NLPAR
RESTARTING ESTIMATION FROM LAST ESTIMATES OR DIFFERENT INITIAL GUESSES MIGHT ALSO WORK
Weekly Data From 1997:10:31 To 2011:06:24
Usable Observations 713
Rank of Observables 710
Log Likelihood -545.5534
Variable Coeff Std Error T-Stat Signif
************************************************************************************
1. SIGSQV 0.3896 2.7520e-003 141.58607 0.00000000
2. SIGSQW(1) 0.1071 8.4587e-004 126.57770 0.00000000
3. SIGSQW(2) -1.7802e-003 5.9034e-006 -301.55859 0.00000000
4. SIGSQW(3) 8.5825e-004 7.3743e-006 116.38481 0.00000000
DLM - Estimation by BFGS
NO CONVERGENCE IN 500 ITERATIONS
LAST CRITERION WAS NA
Weekly Data From 1997:10:31 To 2011:06:24
Usable Observations 713
Rank of Observables 0
Log Likelihood NA
Variable Coeff Std Error T-Stat Signif
************************************************************************************
1. SIGSQV NA 0.000000 0.00000 0.00000000
2. SIGSQW(1) NA 0.000000 0.00000 0.00000000
3. SIGSQW(2) NA 0.000000 0.00000 0.00000000
4. SIGSQW(3) NA 0.000000 0.00000 0.00000000
1) Does this mean that HH cannot be explained by WTIC/BSBC? when i switched the positions i.e. WTIC becoming dependent variable, there is quick convergence. whenever WTIC is involved as the regressor, there is no convergence. Does this mean HH/BSBC are exogenous variables?
This is the output with WTIC as dependent variable.
Code: Select all
Convergence in 23 Iterations. Final criterion was 0.0000069 <= 0.0000100
Weekly Data From 1997:10:31 To 2011:06:24
Usable Observations 713
Rank of Observables 710
Log Likelihood -1624.7511
Variable Coeff Std Error T-Stat Signif
************************************************************************************
1. SIGSQV -0.200010722 0.119048097 -1.68008 0.09294111
2. SIGSQW(1) 0.470404223 0.315520958 1.49088 0.13599272
3. SIGSQW(2) 0.027438327 0.015725289 1.74485 0.08101036
4. SIGSQW(3) 0.002532101 0.000264004 9.59113 0.00000000
Since SIGSQV is negative, i log it and get the following.
DLM - Estimation by BFGS (log 60,60,60 - .000001)
Convergence in 11 Iterations. Final criterion was 0.0000040 <= 0.0000100
Weekly Data From 1997:10:31 To 2011:06:24
Usable Observations 713
Rank of Observables 710
Log Likelihood -1708.1141
Variable Coeff Std Error T-Stat Signif
************************************************************************************
1. LSIGSQV -13.81476379 5.47587350 -2.52284 0.01164107
2. LSIGSQW(1) 0.40328655 0.30063744 1.34144 0.17977821
3. LSIGSQW(2) -1.43889055 0.12558052 -11.45791 0.00000000
4. LSIGSQW(3) -61.99362233 0.42639808 -145.38907 0.00000000
2) Since the lsigsqw is insignificant, can i infer that SIGSQW (w/o loggin) is also insignificant w/o running the regressions in the level form? If not, how can I find the significance of the SIGSQW by conversion back to level from logs if I opt not to run regression in level form?
Back to the first regression.....
Code: Select all
linreg(define=ceqn,noprint) hh 1997:10:31 2011:6:24
# constant bsbc wtic
dec vect[series] bd(3) lower(3) upper(3) tsd(3) vsd(3)
dec vect sigsqw(3)
*
compute sigsqw=(||20.,20.,20.||)
compute sigsqv=20.
dlm(c=%eqnxvector(ceqn,t),sw=%diag(sigsqw),sv=sigsqv,PRESAMPLE=ERGODIC,y=wti,$
method=solve,type=filter,vhat=vhat,yhat=yhat) 1997:10:31 2011:6:24 xstates vstates
do i=1,3
set bd(i) 1997:11:28 2011:6:24 = xstates(t)(i)
3) since the first few observations (my data is weekly) are normally volatile, to get my xstates from 1997:11:28-2011:6:24, i ran the linreg starting 1 month earlier i.e. from 1997:10:31 as well as the dlm instruction, retrieving the xstates for my required period. Is this a right approach, or what is your recommendation as to how many additional front points should be added?
4) what is the difference between the kalman filter and bai-perron? the t-stats i derived for the xtstates, where sharp spikes are evident happend to mostly coincide with the breaks indicated by bai-perron missed by a few lags.
5) i noticed that the state-space model doesnt include a trend. is a trend necessary like in a regression i.e.
linreg wtic
# constant trend hh bsbc
or the purpose of kalman filter is to reflect changing time trend?
6) is it possible and recommended to insert structural breaks into the kalman filter since the purpose of KF is to reflect the breaks?
7) you mentioned in your previous posts that even if i pegged
compute sigsqw=(||0.,20.,20.||)
and use the start=sigsqw(2) instruction
the coefficients will be changing if type=filter. So how do i fixed the variances which are insignifcant i.e. LSIGSQW(1) or it will be fixed automatically if i used the instructions?
Code: Select all
Variable Coeff Std Error T-Stat Signif
************************************************************************************
1. LSIGSQV -13.81476379 5.47587350 -2.52284 0.01164107
2. LSIGSQW(1) 0.40328655 0.30063744 1.34144 0.17977821
3. LSIGSQW(2) -1.43889055 0.12558052 -11.45791 0.00000000
4. LSIGSQW(3) -61.99362233 0.42639808 -145.38907 0.00000000
Many thanks once again for all your kind advice. RATS is really a difficult software but can do more in-depth analysis compared to eviews which is more user friendly.
Rgds,
Des