On Mon, 26 Nov 2018, Allin Cottrell wrote:
The patch looks good to me, and I've now committed the change.
Perhaps Laura could tell us if the new "A" and "Z" matrices in the
$model
bundle -- after estimation with "dpanel" and the --keep-extra option -- do
the job for her.
(But note that this update is not yet in the gretl snapshots, only the git
source code. Snapshots should follow tomorrow.)
Thanks, Allin. The following scripts illustrates the usage of the new
items, by replicating a GMM-DIF estimate via matrix products (GMM-SYS
could also be done, but it's consideraly more involved)
<hansl>
set verbose off
open abdata.gdt
# compose list of regressors
list X = w w(-1) k k(-1)
list Z = w k
dpanel 1 ; n X const ; GMM(Z,2,99) --two-step --dpd --keep-extra
### --- re-do by hand ----------------------------
# fetch Z and A from model
A = $model.A
mZt = $model.Z # note: transposed
# create data matrices
series valid = ok($uhat)
series ddep = diff(n)
series dldep = ddep(-1)
list dreg = diff(X)
smpl valid --dummy
matrix m_reg = {dldep} ~ {dreg} ~ 1
matrix m_dep = {ddep}
matrix uno = mZt * m_reg
matrix due = qform(uno', A)
matrix tre = (uno'A) * (mZt * m_dep)
matrix coef = due\tre
print coef
</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
-------------------------------------------------------