Problems calling R from Gretl
by JOSE FRANCISCO PERLES RIBES
Hi
First to congratulate the members of this great project that is Gretl.
Second I'am using the current version of Gretl (downloaded 12-1-2012)
and R version 2.14.0. All about Windows XP. Trying to call R from the
GUI (R-Console) comes an error message "Failed external instruction"
(Translated from Spanish version).
When I used Gretl 1.9.6 and R.2.13.0 there was not error message doing this.
What could be the problem?
Thanks in advance.
José Perles
Ayuntamiento de Calp
Agencia de Desarrollo Local
13 years, 2 months
ow, bullshit
by Claudio Shikida (敷田治誠 クラウジオ)
Ops,
Sorry, I just sent a stupid question. So easy as always.
Best Wishes.
Claudio
--
http://www.shikida.net and http://works.bepress.com/claudio_shikida/
Esta mensagem pode conter informação confidencial e/ou privilegiada. Se
você não for o destinatário ou a pessoa autorizada a receber esta mensagem,
não poderá usar, copiar ou divulgar as informações nela contidas ou tomar
qualquer ação baseada nessas informações. Se você recebeu esta mensagem por
engano, por favor avise imediatamente o remetente, respondendo o presente
e-mail e apague-o em seguida.
This message may contain confidential and/or privileged information. If you
are not the addressee or authorized to receive this for the addressee, you
must not use, copy, disclose or take any action based on this message or
any information herein. If you have received this message in error, please
advise the sender immediately by reply e-mail and delete this message.
13 years, 2 months
Question about ADL
by Claudio Shikida (敷田治誠 クラウジオ)
Hi
Here is something I cannot understand in Gretl. I am using two time series
in order to do an ADL model. To do this, I wanna use Bewley transformation
which is to estimate the following ADL: y = alpha + beta d_y + .... + gama
d_x + ...+ lambda x +...+ random. This has to be made using the lags of y
and x as instruments. So I "added" the lags in the gretl file and thought
it would be just easy as always.
However, when you open the Instrumental Variable window, the lags added are
not there. If I use the lags of this window, I cannot use them as
instruments, only as independent variables.
What should I do to solve this?
Thanks for your time and attention.
Claudio
--
http://www.shikida.net and http://works.bepress.com/claudio_shikida/
Esta mensagem pode conter informação confidencial e/ou privilegiada. Se
você não for o destinatário ou a pessoa autorizada a receber esta mensagem,
não poderá usar, copiar ou divulgar as informações nela contidas ou tomar
qualquer ação baseada nessas informações. Se você recebeu esta mensagem por
engano, por favor avise imediatamente o remetente, respondendo o presente
e-mail e apague-o em seguida.
This message may contain confidential and/or privileged information. If you
are not the addressee or authorized to receive this for the addressee, you
must not use, copy, disclose or take any action based on this message or
any information herein. If you have received this message in error, please
advise the sender immediately by reply e-mail and delete this message.
13 years, 2 months
"modeltab add" does not work after GMM
by Qi Shi
hi,
After i run a GMM, i want to add the results to the tab, using
"modeltab add", but it does not work. How can i fix it? thanks!
--
shi, qi
13 years, 2 months
Re: [Gretl-users] Gretl-users Digest, Vol 60, Issue 6
by Sung Jin Lim
Thank you for answer
I have checked the again my estimation procedure...
and I noticed that there is the some mistake in AIDS case...
that means that the estimated coefficients of AIDS model regressed by GRETL
has the same coefficient...
It is almost same in the 4th digit.
But the Rotterdam Case...I am not sure..
maybe there is a mistake on the estimation...method...I lost my confidence
on it
anyway..following is the code I wrote
and I attached the data
-----------------------------------------------------------------------
genr DivisiaQ = sw1*dq1 + sw2*dq2 + sw3*dq3 + sw4*dq4
genr wdq1 = sw1*dq1
genr wdq2 = sw2*dq2
genr wdq3 = sw1*dq3
genr wdq4 = sw2*dq4
genr rqa = wdq1+wdq2+wdq3+wdq4
genr ddp1=dp1-dp4
genr ddp2=dp2-dp4
genr ddp3=dp3-dp4
system name="Rotterdam"
equation wdq1 DivisiaQ ddp1 ddp2 ddp3
equation wdq2 DivisiaQ ddp1 ddp2 ddp3
equation wdq3 DivisiaQ ddp1 ddp2 ddp3
end system
restrict "Rotterdam"
b[1,3]-b[2,2]=0
b[1,4]-b[3,2]=0
b[2,4]-b[3,3]=0
end restrict
estimate "Rotterdam" method=sur --iterate
estimate "Rotterdam" method=3sls --iterate
------------------------------------------------------------------------------------------
This one is alternative but I think both are same
--------------------------------------
genr DivisiaQ = sw1*dq1 + sw2*dq2 + sw3*dq3 + sw4*dq4
genr wdq1 = sw1*dq1
genr wdq2 = sw2*dq2
genr wdq3 = sw1*dq3
genr wdq4 = sw2*dq4
genr rqa = wdq1+wdq2+wdq3+wdq4
system name="Rotterdam"
equation wdq1 DivisiaQ dp1 dp2 dp3 dp4
equation wdq2 DivisiaQ dp1 dp2 dp3 dp4
equation wdq3 DivisiaQ dp1 dp2 dp3 dp4
end system
restrict "Rotterdam"
b[1,2]+b[1,3]+b[1,4]+b[1,5]=0
b[2,2]+b[2,3]+b[2,4]+b[2,5]=0
b[3,2]+b[3,3]+b[3,4]+b[3,5]=0
b[1,3]-b[2,2]=0
b[1,4]-b[3,2]=0
b[2,4]-b[3,3]=0
end restrict
estimate "Rotterdam" method=sur --iterate
estimate "Rotterdam" method=3sls --iterate
------------------------------------------------------------------
estimation result
in this case I have the following estimation summery
theta p1 p2 p3 p4 0.59364 -0.1118 0.018 0.51994 -0.4262 0.03605 0.018
-0.0070 -0.0279 0.01695 0.33327 0.51994 -0.0279 -1.8410 1.349 0.03704
-0.4262 0.01695 1.349 -0.9398
But from R and RATS
I have
theta pi1
pi2
pi3
pi4
[1,] 0.44711 -0.9208 0.04375 0.87236 0.00473 [2,] 0.04094 0.04375 -0.0090
-0.0372 0.00242 [3,] 0.50526 0.87236 -0.0372 -0.8277 -0.0074 [4,] 0.00669
0.00473 0.00242 -0.0074 0.00029
Thank you
Sung Jin Lim
On Sun, Jan 8, 2012 at 11:00 AM, <gretl-users-request(a)lists.wfu.edu> wrote:
> Send Gretl-users mailing list submissions to
> gretl-users(a)lists.wfu.edu
>
> To subscribe or unsubscribe via the World Wide Web, visit
> http://lists.wfu.edu/mailman/listinfo/gretl-users
> or, via email, send a message with subject or body 'help' to
> gretl-users-request(a)lists.wfu.edu
>
> You can reach the person managing the list at
> gretl-users-owner(a)lists.wfu.edu
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of Gretl-users digest..."
>
>
> Today's Topics:
>
> 1. Different coefficient in ISUR (caspisun(a)gmail.com)
> 2. Re: Different coefficient in ISUR (Cottrell, Allin)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Sun, 8 Jan 2012 01:09:04 -0600
> From: "caspisun(a)gmail.com" <caspisun(a)gmail.com>
> Subject: [Gretl-users] Different coefficient in ISUR
> To: gretl-users(a)lists.wfu.edu
> Message-ID:
> <CAGn_d0vaP08adKzmyuQhEviQTbuwHw3b1dzm6Gpk+nEMJDf2Tw(a)mail.gmail.com
> >
> Content-Type: text/plain; charset="iso-8859-1"
>
> Hi all.
> I need helps and suggestion.
>
> I have estimated the AIDS(almost ideal demands system) and Rotterdam demand
> system using Iterative SUR(Seeming Unrelated Regression) and 3SLS.
> Recently, I have found that the estimated result from "Gretl" are quite
> different from the Other package (Such as R, RATS)
>
> In case of R and RATS...the estimated coefficient are same exactly.
> after I imposing the restriction on the model...
> the estimated coefficient are exactly same....
>
> But in CASE of GRETL....the estimated coefficient are different from above
> software.
>
> In my thought, it should be same if the estimation method is right.
> Of course, I have double check the model I estimated...No problems on it
>
> Any suggestion?
> or can you give answers..why this kinds of situation happened?
> or is it error in the method?
>
> Sincerely
>
>
> Sung Jin Lim
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL:
> http://lists.wfu.edu/pipermail/gretl-users/attachments/20120108/27594a0f/...
>
> ------------------------------
>
> Message: 2
> Date: Sun, 8 Jan 2012 16:49:23 +0000
> From: "Cottrell, Allin" <cottrell(a)wfu.edu>
> Subject: Re: [Gretl-users] Different coefficient in ISUR
> To: Gretl list <gretl-users(a)lists.wfu.edu>
> Message-ID:
> <CA+BOgOCH9SJWrHwoYVX4FGpXQXZN=C0q5D-9N=DzTC=BGT=zdw(a)mail.gmail.com
> >
> Content-Type: text/plain; charset=ISO-8859-1
>
> On Sun, Jan 8, 2012 at 7:09 AM, caspisun(a)gmail.com <caspisun(a)gmail.com>
> wrote:
> >
> > I have estimated the AIDS(almost ideal demands system) and Rotterdam
> demand
> > system using Iterative SUR(Seeming Unrelated Regression) and 3SLS.
> > Recently, I have found that the estimated result from "Gretl" are? quite
> > different from the Other package (Such as R, RATS)
> >
> > In case of R and RATS...the estimated coefficient are same exactly.
> > after I imposing the restriction on the model...
> > the estimated coefficient are exactly same....
> >
> > But in CASE of GRETL....the estimated coefficient are different from
> above
> > software.
> >
> > In my thought, it should be same if the estimation method is right.
> > Of course, I have double check the model I estimated...No problems on it
> >
> > Any suggestion?
> > or can you give answers..why this kinds of situation happened?
> > or is it error in the method?
>
> We can't answer this without seeing your model and data. Perhaps you can
> post a script specifying the model. If the data file is too big to
> post here, you
> can send it to me off-list (cottrell at wfu.edu).
>
> Allin Cottrell
>
>
>
> ------------------------------
>
> _______________________________________________
> Gretl-users mailing list
> Gretl-users(a)lists.wfu.edu
> http://lists.wfu.edu/mailman/listinfo/gretl-users
>
> End of Gretl-users Digest, Vol 60, Issue 6
> ******************************************
>
>
13 years, 2 months
Weak esogeneity and partial cointegrated VAR models
by Enrico Foscolo
Dear Users,
I would ask you how to estimate partial cointegrated VAR models
assuming that some variables in the original dataset are weakly
exogenous as in Juselius (2006), "The cointegrated VAR model",
sections 11.2 and 11.2.1.
Thank you in advanced,
EN
13 years, 2 months
Different coefficient in ISUR
by caspisun@gmail.com
Hi all.
I need helps and suggestion.
I have estimated the AIDS(almost ideal demands system) and Rotterdam demand
system using Iterative SUR(Seeming Unrelated Regression) and 3SLS.
Recently, I have found that the estimated result from "Gretl" are quite
different from the Other package (Such as R, RATS)
In case of R and RATS...the estimated coefficient are same exactly.
after I imposing the restriction on the model...
the estimated coefficient are exactly same....
But in CASE of GRETL....the estimated coefficient are different from above
software.
In my thought, it should be same if the estimation method is right.
Of course, I have double check the model I estimated...No problems on it
Any suggestion?
or can you give answers..why this kinds of situation happened?
or is it error in the method?
Sincerely
Sung Jin Lim
13 years, 2 months
Kalman Filter Example Error
by Henrique Andrade
Dear Gretl Team,
I'd tried to replicate the example 27.2 of the Gretl User’s Guide but
I'd found an error:
<error message>
'Uhat' is not the name of a variable
Error executing script: halting
</error message>
I think the problem is only due to the name "muhat" and "Uhat".
Um abraço,
Henrique
################################
# #
# Example 27.2: Local level model #
# #
################################
function matrix local_level (series y)
/* starting values */
scalar s1 = 1
scalar s2 = 1
/* Kalman filter set-up */
kalman
obsy y
obsymat 1
statemat 1
statevar s2
obsvar s1
end kalman --diffuse
/* ML estimation */
mle ll = ERR ? NA : $kalman_llt
ERR = kfilter()
params s1 s2
end mle
return s1 ~ s2
end function
function series loclev_sm (series y, scalar s1, scalar s2)
/* return the smoothed estimate of \mu_t */
kalman
obsy y
obsymat 1
statemat 1
statevar s2
obsvar s1
end kalman --diffuse
series ret = ksmooth()
return ret
end function
/* -------------------- main script -------------------- */
nulldata 200
set seed 202020
setobs 1 1 --special
true_s1 = 0.25
true_s2 = 0.5
v = normal() * sqrt(true_s1)
w = normal() * sqrt(true_s2)
mu = 2 + cum(w)
y = mu + v
matrix Vars = local_level(y) # estimate the variances
muhat = loclev_sm(y, Vars[1], Vars[2]) # compute the smoothed state
foreign language=R --send-data
y <- gretldata[,"y"]
a <- StructTS(y, type="level")
a
StateFromR <- as.ts(tsSmooth(a))
gretl.export(StateFromR)
end foreign
append @dotdir/StateFromR.csv
ols Uhat 0 StateFromR --simple
13 years, 2 months
Re: [Gretl-users] Help with using MINE wirh Gretl (Allin Cottrell)
by Ronald McEwan
Thanks
I got it working. My first mistake was in the change I made to the R script. I exported the Gretl Data to a .csv file and just ran MINE this way rather then using Gretl GNU R. Now I can import the results back to Gretl for any additional analysis or plotting.
source("MINE.R")
MINE("c:\\gretldata.csv","all.pairs",0)
MINE("c:\\gretldata.csv",0)
#will both run MINE on "gretldata"
#and have it analyze each variable only
#against the 0-th variable.
MINE("c:\\gretldata.csv","one.pair",0,5)
MINE("c:\\gretldata.csv",0,5)#
#will both run MINE on "gretldata"
#and have it analyze only the 0-th
#variable against the 5-th variable.
----------------------------------------------------------------------
Message: 1
Date: Tue, 3 Jan 2012 15:22:52 -0800 (PST)
From: Ronald McEwan <ronmac17(a)yahoo.com>
Subject: [Gretl-users] Help with using MINE wirh Gretl
To: "gretl-users(a)lists.wfu.edu" <gretl-users(a)lists.wfu.edu>
Message-ID:
<1325632972.23941.YahooMailNeo(a)web162102.mail.bf1.yahoo.com>
Content-Type: text/plain; charset="iso-8859-1"
I have recently been working with "MINE" (http://www.exploredata.net/). MINE is a java program that will work with R. Now that Gretl works with R (and flawlessly I must say) I would like to use MINE with Gretl via R. So far I am able to run MINE as a command line function, but not in R. I am not able to make the necessary adjustment to the MINE.r code to get this to run. Hopefully someone with more experience with R can provide some advice in making the MINE.r code adjustments I need to make. This example is from the MINE.r example file that I tried to modify. I get "Error: could not find function "MINE". I think part of the problem is the change I made in line 2. When I run Gretl>tools>Start GNU R this puts me in c:\Gretl and I have MINE in c:\ . Do I have to put MINE in c:\Gretl or change something else?
Thanks,
Ron McEwan
library("rJava")
.jinit("c:\\MINE.jar")
MINE("gretldata","all.pairs",0)
MINE("gretldata",0)
#?? will both run MINE on "gretldata"
#?? and have it analyze each variable only
#?? against the 0-th variable.
#
MINE("gretldata","one.pair",0,5)
MINE("gretldata",0,5)
Spellman#?? will both run MINE on "gretldata"
#?? and have it analyze only the 0-th
#?? variable against the 5-th variable.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.wfu.edu/pipermail/gretl-users/attachments/20120103/4c983b13/...
------------------------------
Message: 2
Date: Wed, 4 Jan 2012 12:38:21 +0000 (GMT)
From: Allin Cottrell <cottrell(a)wfu.edu>
Subject: Re: [Gretl-users] Help with using MINE wirh Gretl
To: Ronald McEwan <ronmac17(a)yahoo.com>, Gretl list
<gretl-users(a)lists.wfu.edu>
Message-ID:
<alpine.DEB.2.00.1201041232150.32303(a)localhost6.localdomain6>
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
On Tue, 3 Jan 2012, Ronald McEwan wrote:
> I have recently been working with "MINE"
> (http://www.exploredata.net/). MINE is a java program that will
> work with R. Now that Gretl works with R (and flawlessly I must
> say) I would like to use MINE with Gretl via R. So far I am able
> to run MINE as a command line function, but not in R. I am not
> able to make the necessary adjustment to the MINE.r code to get
> this to run. Hopefully someone with more experience with R can
> provide some advice in making the MINE.r code adjustments I need
> to make. This example is from the MINE.r example file that I tried
> to modify. I get "Error: could not find function "MINE".
The R function "MINE" is defined in MINE.r, so you'll have to
source() that file, or copy the required functions into an R file of
your own.
On a quick experiment, it appears that the R/java stuff doesn't work
if gretl calls R via its shared library (on Linux at any rate). I
found it necessary to do
set R_lib off
in my gretl script before the "foreign" block that calls for the
MINE analysis.
Allin Cottrell
------------------------------
_______________________________________________
Gretl-users mailing list
Gretl-users(a)lists.wfu.edu
http://lists.wfu.edu/mailman/listinfo/gretl-users
End of Gretl-users Digest, Vol 60, Issue 2
******************************************
13 years, 3 months
Help with using MINE wirh Gretl
by Ronald McEwan
I have recently been working with "MINE" (http://www.exploredata.net/). MINE is a java program that will work with R. Now that Gretl works with R (and flawlessly I must say) I would like to use MINE with Gretl via R. So far I am able to run MINE as a command line function, but not in R. I am not able to make the necessary adjustment to the MINE.r code to get this to run. Hopefully someone with more experience with R can provide some advice in making the MINE.r code adjustments I need to make. This example is from the MINE.r example file that I tried to modify. I get "Error: could not find function "MINE". I think part of the problem is the change I made in line 2. When I run Gretl>tools>Start GNU R this puts me in c:\Gretl and I have MINE in c:\ . Do I have to put MINE in c:\Gretl or change something else?
Thanks,
Ron McEwan
library("rJava")
.jinit("c:\\MINE.jar")
MINE("gretldata","all.pairs",0)
MINE("gretldata",0)
# will both run MINE on "gretldata"
# and have it analyze each variable only
# against the 0-th variable.
#
MINE("gretldata","one.pair",0,5)
MINE("gretldata",0,5)
Spellman# will both run MINE on "gretldata"
# and have it analyze only the 0-th
# variable against the 5-th variable.
13 years, 3 months