Dear Gretl Community,
I'm trying to replicate the results from Commandeur & Koopman (2007)
(chapter 3, section 3.2, pp. 23-26) but I'm getting no success :-(
Please take a look at the code I'm running (the .inp file is
attached):
<hansl>
set echo off
set messages off
clear
open "UK-KSI.gdt" --frompkg=StrucTiSM
series y = log(KSI)
setinfo y --description="log UK drivers KSI against time (in months)"
--graph-name="log UK drivers KSI against time (in months)"
##### 3.2. Stochastic level and slope #####
/* parameter initialization */
scalar var_irreg = 1
scalar var_level = 1
scalar var_slope = 1
/* state-space model setup */
matrix H = {1 ; 0}
matrix F = {1, 1; 0, 1}
matrix Q = {var_level, 0; 0, var_slope}
bundle kalman = ksetup(y, H, F, Q)
kalman.obsvar = var_irreg
kalman.diffuse = 1
/* maximum likelihood estimation */
"stochastic KSI" <- mle ll = ERR ? NA : kalman.llt
kalman.obsvar = var_irreg
kalman.statevar[1, 1] = var_level
kalman.statevar[2, 2] = var_slope
ERR = kfilter(&kalman)
params var_irreg var_level var_slope
end mle --lbfgs
</hansl>
The results from Commandeur & Koopman (2017) are:
observation variance estimate (irregular): 0.002118
state variance estimate (level): 0.012128
state variance estimate (slope): 0.000000
Any help will be very appreciated.
Best regards,
Henrique Andrade