I had managed to define the drifting coefficients, as I had asked in my previous post. I had a new question, so I just started a new topic. Apologies if I had started too many topics. I set up the below, as indicated in my previous post. My question is how do I derive the %xx for my coefficients? There are a total of 11 coefficients as seen from results below.
In my ceqn and ceqn1 equations, there are 2 fixed coefficients each using the command mu i.e. break 1, 2,3 and 4. The %xx derived from DLM formula includes variances of lsigsqv and lsigsqw, which are the variances themselves. So, it is incorrect to use the %xx values. I thought of using the vstates as variances, which I think should be the right one but I do not know how to derive %xx values for the covariance between the drifting and fixed coefficients.
How are the covariances in %xx derived? I had been trying to derive them for sometime but to no avail. I understand that the variances i.e. diagonal elements are the squares of standard errors. Also, the RATS user manual indicated that (X' X)−1 as well as sigma^2*(X' X)−1. which is the correct one to use as i understand the latter is for scaling.
I would like to clarify the difference between vstates and swhat=wHswhat as these figures are different.
I had tried to derive %xx values in a VAR model i.e. model with HH and WTIC using 1 lag but failed, There are 2 similar regressors in each equation. My concern is how to combine the 2 equations into a 2x2 %xx matrix since there are also similar regressors in both my equations (ceqn and ceqn1). I can't seem to find any solution to these, which would allow me to derive the %xx for my DLM model.
Hope that you could kindly guide me and clarify my doubts. Many thanks.
Code: Select all
=============================================
linreg(define=ceqn,noprint) wtic 1997:11:28 2011:6:24
# trend1 wtic{1}
linreg(define=ceqn1,noprint) hh 1997:11:28 2011:6:24
# trend1 hh{1}
dec vect[series] b(4) lower(4) upper(4) ts(4) vs(4) whv(2)
dec vect lsigsqw(4)
dec symm lsigsqv(2,2)
dec rect[ser] whsv(4,2) whsw(4,4)
nonlin lsigsqv lsigsqw break1 break2 break3 break4
compute lsigsqw=%log(||.0001,.0001,.0001,.0001||)
compute lsigsqv=%log(||.0001,.0001|.0001,.0001||)
compute break1=break2=.1, break3=break4=break5=break6=break7=break8=break9=.1
dlm(mu=||break1+BREAK2*HH{1},break3+BREAK4*wtic{1}||,c=%eqnxvector(ceqn,t)~\%eqnxvector(ceqn1,t),sw=%diag(%exp(lsigsqw)),sv=%exp(lsigsqv),presample=ergodic,y=||wtic,hh||,$
method=bfgs,iters=500,type=smooth,vhat=wHvhat,swhat=wHswhat,svhat=wHsvhat,yhat=wHyhat) 1997:11:28 2011:6:24 $ xstates vstates
=================================================
DLM - Estimation by BFGS
Convergence in 53 Iterations. Final criterion was 0.0000003 <= 0.0000100
Weekly Data From 1997:11:28 To 2011:06:24
Usable Observations 709
Rank of Observables 1414
Log Likelihood -813.1364
Variable Coeff Std Error T-Stat Signif
************************************************************************************
1. LSIGSQV(1,1) -4.36944872 0.24402764 -17.90555 0.00000000
2. LSIGSQV(2,1) -5.59570686 0.54673897 -10.23470 0.00000000
3. LSIGSQV(2,2) -5.43510740 0.74849166 -7.26141 0.00000000
4. LSIGSQW(1) -14.19777774 0.17103291 -83.01196 0.00000000
5. LSIGSQW(2) -6.85280373 0.22323802 -30.69730 0.00000000
6. LSIGSQW(3) -15.44172007 0.27018690 -57.15199 0.00000000
7. LSIGSQW(4) -4.80792450 0.08560003 -56.16732 0.00000000
8. BREAK1 1.76220698 0.44688346 3.94333 0.00008036
9. BREAK2 0.07439930 0.02657603 2.79949 0.00511836
10. BREAK3 1.59566462 0.38569948 4.13707 0.00003518
11. BREAK4 0.09031646 0.04115256 2.19467 0.02818699
================================================================