*
* DLMEST.PRG
* Manual example 12.4
*
cal 1959 1 4
all 2001:1
open data haversmp.rat
data(format=rats) / gdph
set ldiff = log(gdph/gdph{1})
*
* As this is parameterized, the y and c elements need to
* be put in as FRMLs. In general, the sx0 would also, but
* here the states are just current and lagged epsilons, so
* by assumption, the variance is just the identity matrix
* (times the unknown scale variance).
*
nonlin theta
dec rect a
dec symm sw
dec symm sx0
dec frml[rect] cf
dec frml[vect] yf
compute a=||0.0,0.0|1.0,0.0||
compute sw=||1.0|0.0,0.0||
compute sx0=||1.0|0.0,1.0||
frml yf = ||ldiff||
frml cf = ||1.0|theta||
*
compute theta=0.0
dlm(method=bfgs,a=a,c=cf,y=yf,sx0=sx0,sw=sw,scale) 1959:2 2001:1
*
* Same model estimated by BOXJENK with MAXL option
*
boxjenk(ma=1,noconst,maxl,method=bfgs) ldiff