Thank you for the quick reply. Here are my modified codes. Would you please kindly take a look? I think there is something wrong as the estimate for sn is negative. I am looking forward to receiving help from you.TomDoan wrote:What you're doing in that last post isn't estimating the reduced form model from earlier, though this is probably OK for getting guess values.
Neither the multiple step calculation that you just did nor the non-linear least squares reduced form estimation can separate out the two variances. Instead, they only estimate the variance of the sum. So you need to (somehow) split up the variances to add up the %SEESQ. What you're doing isn't far off from that since you have one taking %SEESQ and the other a small fraction of that.
linreg evwrd
# constant term{1} default{1} dyield{1}
frml(lastreg,vector=b) lineareq evwrd
set du = %resids-%resids{1}
linreg du
# dummy dummy{1}
compute se=sqrt(%seesq)
compute sn=sqrt(0.001*%seesq)
dec frml[symm] sw1 sv1 zf cf
nonlin b a d1 d2=-a*d1 se sn
compute a=0.0147, d1=0.009
(0.0147 and 0.009 are the estimates from the non-linear least squares reduced form estimation)
frml zf = ||d1*year34+d2*year34{1}||
frml sw1 = ||sn^2||
frml sv1 = ||se^2||
dlm(presample=ergodic, a=0.00147, c=1.0,z=zf,MU=lineareq,f=1.0,sv=sv1,sw=sw1,y=evwrd,method=bfgs,vhat=vhat,svhat=svhat, type=filter)
DLM - Estimation by BFGS
Convergence in 19 Iterations. Final criterion was 0.0000082 <= 0.0000100
Monthly Data From 1954:04 To 2007:12
Usable Observations 645
Rank of Observables 644
Log Likelihood 1162.0438
Variable Coeff Std Error T-Stat Signif
*************************************************************************************
1. B(1) -0.008695096 0.005835652 -1.49000 0.13622536
2. B(2) 0.431357123 0.149346201 2.88830 0.00387326
3. B(3) -0.189038411 0.047518991 -3.97817 0.00006945
4. B(4) 0.656453817 0.162374291 4.04284 0.00005281
5. A 0.585856777 0.201356895 2.90954 0.00361956
6. D1 0.020106149 0.007528431 2.67070 0.00756942
7. SE 0.039821238 0.001042602 38.19408 0.00000000
8. SN -0.000001359 0.007678411 -1.77026e-004 0.99985875