On Tue, 25 Jan 2022, Riccardo (Jack) Lucchetti wrote:
On Tue, 25 Jan 2022, Paolo Chirico wrote:
> Dears,
> for a simulation study I want to repeat the estimate of a state space model
> /N/ times. Repeating the estimate is not a problem, but if I call the
> ksmooth function after each estimate (MLE block), gretl allows me it on the
> first iteration, but not the following ones.
> It appears that the function cannot find the bundle in subsequent
> iterations
> This happens if the repetitions occur in a single script run.
> Obviously it doesn't happen if every rep has its own run.
> It's really strange!
> Is it a bag or am I missing something?
It sounds like a bug, Paolo, thanks for the report.
Could you send us an example script exposing the problem?
This script runs without problems here, but I'm running current git: in
the
next version (due real soon) the whole Kalman apparatus has been revised
quite thouroughly. Or maybe I misunderstood the problem. Paolo, could you
check if this script runs on your machine?
<hansl>
set verbose off
nulldata 100
setobs 1 1 --special-time-series
loop i = 1 .. 4
# ma(1) example with known variance
e = normal()
theta = 0.8
y = e + theta * e(-1)
smpl +1 ;
par = 0.8
T = {0,0;1,0}
Q = {1,0;0,0}
mod = ksetup(y, {1; par}, T, Q)
mle ll = misszero(llik)
mod.obsymat[2] = par
kfilter(&mod)
series llik = mod.llt
params par
end mle --hessian
ksmooth(&mod)
series e$i = mod.state[,1]
smpl full
endloop
</hansl>
-------------------------------------------------------
Riccardo (Jack) Lucchetti
Dipartimento di Scienze Economiche e Sociali (DiSES)
Università Politecnica delle Marche
(formerly known as Università di Ancona)
r.lucchetti(a)univpm.it
http://www2.econ.univpm.it/servizi/hpp/lucchetti
-------------------------------------------------------