Jacobs & van Norden(2011) Journal of Econometrics
Posted: Sun Feb 01, 2015 1:39 am
Dear Tom:
I try to replicate paper for Jacobs & van Norden(2011) "Modeling data revisions: Measurement error and dynamics of 'true’ values ". Journal of Econometrics.
I ask Prof. van Norden to get the Gauss codes and data. I try program the Rats codes, but it does converge. I do konw how to deal with it?
Additionally, The paper say in section 3.2.1 restrcting sigma_xi(m)<sigma_xi(m-1)<...<sigma_xi(1).
I do not know how to do in DLM. Whether or not it use with rejection option.
Please TOM help me.
Best regard.
Hardman
I try to replicate paper for Jacobs & van Norden(2011) "Modeling data revisions: Measurement error and dynamics of 'true’ values ". Journal of Econometrics.
I ask Prof. van Norden to get the Gauss codes and data. I try program the Rats codes, but it does converge. I do konw how to deal with it?
Additionally, The paper say in section 3.2.1 restrcting sigma_xi(m)<sigma_xi(m-1)<...<sigma_xi(1).
I do not know how to do in DLM. Whether or not it use with rejection option.
Code: Select all
open data YPhilly.xls
data(format=xls,org=columns) 1 153 dY_V01 dY_V02 dY_V03 dY_V04
* b is lags of dynamic of "true", eg. p of AR(p)
* m is number of vintage of data. JvN use l=4.
* the data comes from Prof. van Norden
compute b = 2
compute m = 4
dec vect beta(4)
dec real sigma_eps
compute sigma_eps = 1.0
dec vect sigma_nu(m)
dec vect sigma_xi(m)
stats(noprint) dy_v01
compute beta(1)=%mean,sigma_nu(1)=%variance*.25,sigma_xi(1)=%variance*.25
stats(noprint) dy_v02
compute beta(2)=%mean,sigma_nu(2)=%variance*.25,sigma_xi(2)=%variance*.25
stats(noprint) dy_v03
compute beta(3)=%mean,sigma_nu(3)=%variance*.25,sigma_xi(3)=%variance*.25
stats(noprint) dy_v04
compute beta(4)=%mean,sigma_nu(4)=%variance*.25,sigma_xi(4)=%variance*.25
* Construct fixed parts of the A matrix
*
dec vect phi(b)
compute phi=%zeros(b,1)
dec rect a(b+2*m,b+2*m)
dec vec at3(m)
dec vec at4(m)
compute ar2=||phi(1),phi(2)|1.0,0.0||
compute at3=%zeros(m,1)
compute at4=%zeros(m,1)
compute a=ar2~\%identity(4)~\%identity(4)
* Construct the C matrix (always fixed)
dec rect c(2+2*m,m)
dec rect c3(m,m)
dec rect c4(m,m)
compute c3=%identity(m)
compute c4=%identity(m)
compute c=(%zeros(1,4)+1)~~%zeros(1,4)~~c3~~c4
* Construct fixed parts of the F matrix
*
dec rect f(b+2*m,1+2*m)
dec rect f2(1,1)
dec rect f3(m,m)
dec rect f4(m,m)
dec rect f1(1,1+2*m)
dec vect sigma_nu(m)
dec vect sigma_xi(m)
compute f1 =%zeros(1,1+2*m)
compute f2 =%zeros(1,1)
compute f3 =%zeros(m,m)
compute f4 =%zeros(m,m)
compute f=f1~~(f2~\f3~\f4)
* Construct the SW matrix
dec symm sw(1+2*m,1+2*m)
function %%DLMSetup
compute %psubmat(a,1,1,tr(phi))
do i=1,m
comute a(2+i,2+i) = at3(i)
comute a(6+i,6+i) = at4(i)
end do i
do i=1,m
comute f(1,1+i) = sigma_nu(i)
end do i
do i=1,m
do j=i,m
comute f(2+i,j+1) = -1 * sigma_nu(j)
end do j
end do i
do i=1,m
comute f(6+i,5+i) = sigma_xi(i)
end do i
compute sw=%diag(sigma_eps~~sigma_nu~~sigma_xi)
end %%DLMSetup
dec frml[vect] yf
frml yf = ||dy_v01,dy_v02,dy_v03,dy_v04||
* Estimate the parameters by maximum likelihood.
nonlin at3 at4 sigma_nu sigma_xi phi
*
dlm(start=%%DLMSetup(),mu=beta,y=yf,sw=sw,c=c,a=a,f=f,$
presample=ergodic,type=filter,$
pmeth=simplex,piters=10,method=bfgs) / xstates
Please TOM help me.
Best regard.
Hardman