Re: [Gretl-users] Phillips-Perron Test
by Allin Cottrell
On Wed, 19 Jan 2011, Henrique Andrade wrote:
> Em 19 de janeiro Allin escreveu:
>
> (...)
> > Could you give a listing of files R* in
> > "C:\Users\henrique\Application Data\gretl" (if it exists) and
>
> It doesn't exist.
>
> > C:\Users\henrique\AppData\Roaming\gretl ?
>
> Rsrc, Rdata.tmp, R.out, gretl.Rprofile
>
> > And if there's a file Rsrc in either of those places, can you show
> > its content?
> >
>
> sink("C:/Users/henrique/AppData/Roaming/gretl/R.out", type="output")
[and so on]
Hmm, I see (from how Rsrc reads) that gretl is not using the R
shared library on your system, rather it's trying to use
Rterm.exe. Unless you specified "set R_lib off" this means there
was an error trying to open the library. Still, Rterm should work.
I'll try some testing.
Allin
13 years, 11 months
Re: [Gretl-users] select the sample in a function
by Allin Cottrell
On Wed, 19 Jan 2011, artur tarassow wrote:
> I am just writing a function for estimating the test statistics for
> the Johansen cointegration test recursively over time. So I have to
> define a base sample which is taken for the initial estimation and a
> horizon over which to add observations each round.
Sounds like you want something of ths sort:
<script>
function void slide_sample (series y, int max0, int incr, int n)
set messages on # see what's going on more fully
smpl ; max0
loop n
printf "sample mean of y = %g\n", mean(y)
smpl ; +incr
endloop
end function
open denmark.gdt
slide_sample(LRM, obsnum(1984:4), 4, 2)
</script>
In the function slide_sample(), max0 is the initial end-point
of the sample range, incr is the number of observations to
add at each step, and n is the number of steps to take.
Allin Cottrell
13 years, 11 months
gretl/gnuplot: "first-time" plots slow on Windows
by Allin Cottrell
Back in July 2010 we had an extensive discussion of this point:
the "first time" you generate a gnuplot graph via gretl on MS
Windows it can take an inordinate length of time for the plot to
appear. It wasn't clear that "first time" meant the same thing
thing in all reports, but the first plot after installing gretl +
gnuplot from scratch seemed most reliably problematic.
The discussion was inconclusive; we didn't up with a compelling
diagnosis.
I think I now have the answer: what's taking so long is the
fontconfig library building its initial font cache. This accounts
for the ambiguity over when exactly the problem arises, since
various system changes can provoke rebuilding of the cache
from time to time.
In the current Windows snapshot I've rebuilt gnuplot so that it
does not call fontconfig, and so cache-building time shouldn't be
a problem any more. Windows users, please test! We're looking for
(a) absence of any wait of more than a couple of seconds for a
plot to appear (should usually be faster than that) and (b) any
fallout from this change in the form of font-handling errors
(e.g. text on plots appears clipped, with bits of letters
missing).
For enquiring minds: gnuplot calls the cairo library in its
generation of PNG plots, and cairo has two different font-handling
"backends" that can be used on Windows: a native win32 one, and
FreeType plus fontconfig. In November 2009 gnuplot switched away
from using the cairo-win32 backend because it was found to be
buggy, with glyphs getting clipped. FreeType plus fontconfig
produces flawless plots, but the downside is an occasional long
wait as fontconfig (re-)builds its cache. By now, with cairo
1.10.2, the win32 bugs that were spoiling gnuplot PNG output seem
to be fixed, hence my experiment of going back to the win32
backend.
Allin Cottrell
13 years, 11 months
Re: [Gretl-users] Manage non convergent NLS in a loop
by Allin Cottrell
On Wed, 19 Jan 2011, Giuseppe Vittucci wrote:
> I have to do a series of non linear least squares estimation within a
> loop and save the results in a matrix.
>
> The problem is that, when it happens that for some set of the parameters
> the NLS does not converge, instead of returning a null vector and going
> on with the loop, the program stops.
>
> Is there a way in gretl to tell the program not to stop? Something like
> the command "try" in R?
Yes, use "catch":
catch nls ...
...
end nls
Allin Cottrell
13 years, 11 months
Manage non convergent NLS in a loop
by Giuseppe Vittucci
Dear all,
I have to do a series of non linear least squares estimation within a
loop and save the results in a matrix.
The problem is that, when it happens that for some set of the parameters
the NLS does not converge, instead of returning a null vector and going
on with the loop, the program stops.
Is there a way in gretl to tell the program not to stop? Something like
the command "try" in R?
Thanks
Giuseppe
13 years, 11 months
Re: [Gretl-users] Phillips-Perron Test
by Allin Cottrell
On Wed, 19 Jan 2011, Henrique Andrade wrote:
> > This could be a filename encoding issue, if there are non-ASCII
> > characters in the name of your "Application data" directory on
> > Windows. I'm not sure how those would be handled in R.
> >
>
> Dear Allin, there aren't non-ASCII characters:
> C:\Users\henrique\Application Data
Ah, OK.
> > What error message do you see, using the current Windows snapshot?
> >
>
> C:/Users/henrique/AppData/Roaming/gretl/R.msg: No such file or directory
Could you give a listing of files R* in
"C:\Users\henrique\Application Data\gretl" (if it exists) and
C:\Users\henrique\AppData\Roaming\gretl ?
And if there's a file Rsrc in either of those places, can you show
its content?
Thanks,
Allin.
13 years, 11 months
Re: [Gretl-users] Phillips-Perron Test
by Allin Cottrell
On Wed, 19 Jan 2011, Henrique Andrade wrote:
> Em 18 de janeiro de 2011Allin Cottrell <cottrell(a)wfu.edu> escreveu:
>
> (...)
> > Hmm, works fine on Vista here. Is the path to Rlib set correctly
> > (Preferences/General/Programs)?
> >
>
> No, it isn't [:(] But now I'm trying the following path:
>
> C:\Program Files\R\R-2.12.1\bin\i386\R.dll
>
> And it still doesn't work.
This could be a filename encoding issue, if there are non-ASCII
characters in the name of your "Application data" directory on
Windows. I'm not sure how those would be handled in R.
What error message do you see, using the current Windows snapshot?
Allin Cottrell
13 years, 11 months
Re: [Gretl-users] Phillips-Perron Test
by Allin Cottrell
On Tue, 18 Jan 2011, Berend Hasselman wrote:
> On 18-01-2011, at 21:14, Allin Cottrell wrote:
>
> >
> > Hmm, works fine on Vista here. Is the path to Rlib set correctly
> > (Preferences/General/Programs)?
>
> Started within Gretl.app (my version).
> Ran script. Got this on stderr:
>
> Error in eval.with.vis(expr, envir, enclos) :
> object 'gretldata' not found
>
> I have attached the Gretl generated script.
> I don't see where gretldata is loaded.
Hmm, it's not loaded. You're using --send-data OK?
In CVS and snapshots I've added some more error-reporting in this
area.
Just for reference, here's the complete test case that I'm
running (with no error on Linux or MS Vista):
open australia.gdt
foreign language=R --send-data
testedvar <- gretldata[,"lpau"]
PP.test(testedvar)
end foreign
Allin
13 years, 11 months
Re: [Gretl-users] Phillips-Perron Test
by Allin Cottrell
On Tue, 18 Jan 2011, Henrique Andrade wrote:
> Em 19 de janeiro de 2011 Allin escreveu:
>
> On Tue, 18 Jan 2011, Henrique Andrade wrote:
> >
> > > Em 18 de janeiro de 2011 Riccardo (Jack) Lucchetti
> > > <r.lucchetti(a)univpm.it>escreveu:
> > >
> > > On Tue, 18 Jan 2011, Henrique Andrade wrote:
> > > >
> > > > I'm trying to use R inside a Gretl script in order to perform the
> > > >> Phillips-Perron test. [ but getting an error ]
> > > >>
> > > >> Does anyone has a clue for what's going wrong?
> > > >
> > > > You need to use the "--send-data" option, as in
> > > >
> > > > foreign language=R --send-data
> > > >
> > >
> > > Dear Riccardo, thanks for your answer, but the "--send-data"
> > > option didn't fix my problem :( The only way to circumvent this
> > > is to choose the "Interactive R session" and enter the R
> > > commands manually.
> >
> > Is this on a Mac, or what? Your script (plus --send-data) works
> > fine on Linux and Windows here.
> >
> The error occurs only with my Windows Vista PC. With my Mac it works fine.
Hmm, works fine on Vista here. Is the path to Rlib set correctly
(Preferences/General/Programs)?
Allin
13 years, 11 months
select the sample in a function
by artur tarassow
Hello gretl community,
I am just writing a function for estimating the test statistics for
the Johansen cointegration test recursively over time. So I have to
define a base sample which is taken for the initial estimation and a
horizon over which to add observations each round. I did not find
anything which refers to this problem. I was thiking to use a string
but am not sure how to do this there.
ATM I've got something like:
function matrix joh_coint_exog (scalar model "1=no exogenous variables, \
2=only unrestricted exogenous, 3=only restricted exogenous,\
4=unrestricted and restricted exogenous", scalar p "lag length",\
list Y "List of endogenous", list X "List of unrestricted \
exogenous", list R "List of weakly exogenous", \
scalar case "1=nc, 2=rc, 3=default, 4=crt, 5=ct")
Setting the base and recursive samples is still needed. Does anybody
know how to implement these things?
Best,
Artur
13 years, 11 months