Page 1 of 1

Clarification for DLM likelihood results

Posted: Fri Nov 18, 2011 8:09 am
by chiade
Hi Tom,

I have set up the below using method=solve and method=bfgs. As u last mentioned, i can use the @regcrits to compare AIC/SIC with linear regression. Is the DLM (method=solve) the model to use to derive log likelihood? the number of nregs (3) is correct for this model whereas it is only 2 for DLM(method=bfgs). the loglikelihood for the latter is too large to be true. also the xstates and vhat are different for both. should i be using them from the DLM(method=solve)?
Thanks again.

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

Re: Clarification for DLM likelihood results

Posted: Fri Nov 18, 2011 11:39 am
by TomDoan
In comparing the TVP results with a linear regression, the TVP model has (# of regressors) MORE parameters than the linear regression. The linear regression is a special case of TVP with no "TV", that is, with the SW's pegged at zero, so the TVP model also includes the parameters for the time-varying variances which aren't present in the linear regression.