function void at_each_step(bundle *b)
b.obsymat = transp(b.mX[b.t,])
end function
open WELSHEGGSCL.gdt --quiet
smpl 2002 2019
/* parameter initialization */
scalar b0 = mean(Severnadj)
scalar s_obs = 0.1
scalar s_state = 0.1
/* bundle setup */
bundle B = ksetup(Severnadj, 1, 1, 1)
matrix B.mX = {Year}
matrix B.depvar = {Severnadj}
B.timevar_call = "at_each_step"
B.diffuse = 1
/* ML estimation of intercept and the two variances */
mle LL = err ? NA : B.llt
B.obsy = B.depvar - b0
B.obsvar = s_obs^2
B.statevar = s_state^2
err = kfilter(&B)
params b0 s_obs s_state
end mle
/* display the smoothed time-varying slope */
ksmooth(&B)
series tvar_b1hat = B.state[,1]
series tvar_b1se = sqrt(B.stvar[,1])
gnuplot tvar_b1hat --time-series --with-lines --output=display \
--band=tvar_b1hat,tvar_b1se,1.96 --band-style=fill
___________________________________________________________
_______________________________________________Am 01.12.2020 um 17:20 schrieb Brian Revell:
The latter, yes, so basically in the built-in script editor. The MLE area is meant for even lower-level access, without the predefined Kalman filter objects.Hi Svenmany thanks for your prompt feedback. Where did you paste it in? In the Model MLE option from the GUI -or under File -Script File-menu option?
know where to do this. The manual is not helpful in this respect.In later parts of the guide it is pretty much assumed that people know the scripting interface of gretl. However, at the beginning this is explained, please see section 3.1.
(BTW, in my version of the guide the script listing is number 36.4 in ch. 36, I guess you have a slightly older version where some newer chapters do not exist yet. But this shouldn't make a difference in this context.)
cheers
sven
Gretl-users mailing list -- gretl-users@gretlml.univpm.it
To unsubscribe send an email to gretl-users-leave@gretlml.univpm.it
Website: https://gretlml.univpm.it/postorius/lists/gretl-users.gretlml.univpm.it/