Yes, that is how I think I would attack it. I think a simple solution would be to create a
function that takes estimated parameters and writes them to a text file which BIMETS will
read as an identity. Then I think one would only need to pass this and the data needed for
the model (endogenous and exogenous variables) passed to R in a format that can be coerced
into a what BIMETS calls a TIMESERIES object - something easily achieved in the R
One challenge would be translating what is an acceptable way to express an equation in
GRETL into something that can be read in BIMETS for example:
"ln (Y/Y(-1)) = coef(1)*(ln(Y(-1))-coef(2)*ln(X(-1)))+coef(3)*ln (Y(-1)/ Y(-2)) +
While BIMETS it would be something like:
So I think a small task would be to parse a GRETL acceptable language (I'm not sure if
my equation above is an acceptable format for GRETL, but I hope illustrates the point?)
into something readable by BIMETS, i.e. replace the (-1) with TSLAG etc and hard code the
coefficient estimates from various estimation outputs in the GRETL environment to the text
file. The alternative would be to adopt the BIMETS syntax from the outset, then it one
would only need to hard code the coefficient values to the model text file. However, that
would require users to learn another syntax on top of the GRETL / HANSL environment.
I might try and do this over the coming week or so (my day job however is rather
demanding, so will see how I go with time).
From: Sven Schreiber <svetosch(a)gmx.net>
Sent: Sunday, 13 September 2020 11:33 PM
Subject: [Gretl-devel] Re: Simulate simultaneous equation model
Am 12.09.2020 um 23:59 schrieb Adam Elderfield:
The BIMETS package is really great. That might be a good starting point.
Although, and maybe I am wrong here, I would consider the parsing of
the model text one of the main programming challenge, I'm not sure
that would be any easier porting between two languages? Or would you
write your model file in BIMETS syntax, have your regression etc in
Gretl, which then are passed to the text file, and this data and text
are then passed to R?
I wasn't familiar with the bimets package until you mentioned it; now I've quickly
browsed its vignette.
I agree that doing the estimation in gretl makes sense, since that is what we already
have, and possibly even with more options than what's present in bimets.
The trick would then be to "inject" the estimation results into bimets, such
that the coefficients and so on are already given and no redundant estimation has to be
done there. (Of course if it's just the OLS option then any redundancy would be small,
but more general estimation approaches are reasonable and needed.) The point would then be
to take advantage of the simulation features of bimets, which is what we don't have in
Perhaps the author Andrea Luciani would be ready to help us by describing the interface
through which bimets would treat the estimation as done and how to specify the results
from that step exactly.
(Vectors/Matrices with certain names and so on.)
The nice thing about bimets is that it doesn't depend on other packages apparently, so
no dependency chain issues would arise.
Gretl-devel mailing list -- gretl-devel(a)gretlml.univpm.it To unsubscribe send an email to