Hi Sven
progress - I have managed to get the Script to  run with time as indep var -but MLE crashes on reaching max 500 interations . It didn't like the year variable I defined  in an earlier run eg 2002, 2003  I think because it was a large magnitude different  eg 10^3  to the dependent variable. 

So is there a way to increase the max no. of iterations in the MLE routine?  see below for output..

? function void at_each_step(bundle *b)
> b.obsymat = transp(b.mX[b.t,])
> end function
? open WELSHEGGSCL.gdt --quiet
Read datafile C:\Users\Brian\Documents\gretl\WELSHEGGSCL.gdt
? smpl 2002 2019
Full data range: 2002 - 2024 (n = 23)
Current sample: 2002 - 2019 (n = 18)

/* parameter initialization */
? scalar b0 = mean(Severnadj)
Generated scalar b0 = 9.84213
? scalar s_obs = 0.1
Generated scalar s_obs = 0.1
? scalar s_state = 0.1
Generated scalar s_state = 0.1
/* bundle setup */
? bundle B = ksetup(Severnadj, 1, 1, 1)
? matrix B.mX = {time}
? 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
Using numerical derivatives
Tolerance = 1.81899e-012
Reached the maximum iterations (500)

Error executing script: halting
> end mle



On Tue, 1 Dec 2020 at 17:10, Sven Schreiber <svetosch@gmx.net> wrote:
Am 01.12.2020 um 17:20 schrieb Brian Revell:
Hi Sven
many 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? 
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.
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/