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 environment.  

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)) 
+ coef(4)*ln(X/X(-1))" 

While BIMETS it would be something like:

"TSDELTALOG(Y) = 
coef(1)*(TSLAG(LOG(Y),1)-coef(2)*TSLAG(LOG(X),1))+coef(3)*TSDELTALOG(Y,1) + 
coef(4)*TSDELTALOG (X)"

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).

Thanks

Adam


-----Original Message-----
From: Sven Schreiber <sveto...@gmx.net> 
Sent: Sunday, 13 September 2020 11:33 PM
To: gretl-devel@gretlml.univpm.it
Subject: [Gretl-devel] Re: Simulate simultaneous equation model

Am 12.09.2020 um 23:59 schrieb Adam Elderfield:
> Hi Sven,
>
> 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 gretl.

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.

cheers
sven
_______________________________________________
Gretl-devel mailing list -- gretl-devel@gretlml.univpm.it To unsubscribe send 
an email to gretl-devel-le...@gretlml.univpm.it
Website: 
https://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgretlml.univpm.it%2Fpostorius%2Flists%2Fgretl-devel.gretlml.univpm.it%2F&amp;data=02%7C01%7C%7C35b21cf02eea47dc7dd908d857e992bc%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637356007982509400&amp;sdata=GnvoCa10V0p4dW4IeC9%2BY7PA968rMexQnRZuD8bK8uk%3D&amp;reserved=0
_______________________________________________
Gretl-devel mailing list -- gretl-devel@gretlml.univpm.it
To unsubscribe send an email to gretl-devel-le...@gretlml.univpm.it
Website: 
https://gretlml.univpm.it/postorius/lists/gretl-devel.gretlml.univpm.it/

Reply via email to