Re: gretl crashed while searching for file within GUI (Allin Cottrell)
by Fred Engst
Great Allin,
It worked, for the search didn’t crash gretl. You are a genius!
I wish I can be your apprentice and learn all about computer and econometrics. :)
Since the search is working on my MacBook Pro, my further question is (he never stops does he):
1 how to limit the search to just within a folder?
2 how to limit the search to a file type?
3 how to change the search from by file content to by name, and vice versa?
Fred
5 years, 3 months
Resample without replacement (Artur Tarassow)
by Ioannis A. Venetis
I agree Artur. I was recently in need for a resample without replacement
function.
I have not check your code but I had a look on what I did and it could
be a refinement (following also Sven's answer).
Say a matrix A is nxm.
set k<=m.
rvec = ranking( mrandgen(u,0,1,m,1) )'
A=[,rvec[1:k]]
(keeps k randomly selectled columns of A)
I would like to see such a function in extra.gfn
Yiannis
--
**************************************************************************************************
Ioannis A. Venetis, Associate Professor
University of Patras, School of Economic Sciences and Business
Administration,
Department of Economics
University Campus, Rio, 26504, Greece Tel: 0030 2610 969964
http://www.econ.upatras.gr/en/people/teaching-staff/venetis-ioannis
[1]https://sites.google.com/site/ioannisavenetis/
[2]**************************************************************************************************
Links:
------
[1] http://application.econ.upatras.gr/en/node/130
[2] https://sites.google.com/site/ioannisavenetis/
5 years, 3 months
Why not delete missing observations?
by luis.salazar.ramirez
Good day for all.
I have had write a script for treatment of panel data. I have had
centered the observations with var - pmean(var), in the file I have a
SEM, before the SEM I put smpl --no-missing, by the error "Gretl have
find missing observations". Next when I run the script, again appear the
error "Gretl have find missing observations" and before it the message
"Isn't deleted any observation" in response to smpl command.
The question is, Why gretl in script mode not remove the missing values
if in mode console gretl is pretty obedient?.
The script next: (gretl versión 2018c)
<hansl>
open datosenapanel.csv --quiet
setobs Prod Anio --panel-vars
rename ImpB M
dummify Prod --drop-last
loop i=1..3
rename DProd_$i cons$i
endloop
list Vars = seq(3,11)
loop foreach i Vars
c$i = $i - pmean($i)
endloop
smpl --no-missing
Centrados <- system method=sur
equation cY 0 cAC cPR cRend cIPPB
equation cAC 0 cM(-1) cP(-1) cC(-1) cPR
equation cP 0 cY cM cIPPB
endog cY cAC cP
end system
</hansl>
Thanks.
Cordially,
Luis Salazar
5 years, 3 months
gretl crashed while searching for file within GUI
by Fred Engst
Hi Allin,
gretl crashed once again, but for a different reason this time.
It seems that whenever I tried to do a search for files within GUI after “file->Open data->User file...” or “file->Session files->Open session…”, it crashes right after it showed a list of files.
I can’t remember a time when I did a search like this without gretl crashing.
I suspect it has something to do with my character encoding. Even though I use standard English, I have Chinese on my system also.
This is more like a FYI, and it is not urgent, as I know how to get around it easily.
Attached is the crash report if it helps.
Fred
5 years, 3 months
Re: use of command "break"
by Alecos Papadopoulos
The Help says that
<<break: Break out of a loop. This command can be used only within a
loop; it causes command execution to break out of the current
(innermost) loop.>>
I tried to type the word "break" inside the loop command script while
the loop was running and then executing it. I first got the message "A
script is already running" and eventually Gretl crashed, loosing what
simulation work had been done up to then. Obviously I am doing this
wrong. Can somebody detail the exact micro-steps needed to use this command?
The script that was running had a loop embedded in another.
Thanks.
--
Alecos Papadopoulos PhD
Athens University of Economics and Business
web: alecospapadopoulos.wordpress.com/
5 years, 3 months
subsampling
by Stefano Fachin
dear all,
the points made by Allin and Sven are correct: if feasible, one takes
all subsamples of a given length b out of a time series of length n, so
there is nothing random. If the series is really long (super high
frequency data) one may need to take only some of the possible
subsamples, and that has to be a random choice
bye
Stefano
--
_________________________________________________________________________
Stefano Fachin
Professore Ordinario di Statistica Economica
Dip. di Scienze Statistiche
Università di Roma "La Sapienza"
P.le A. Moro 5 - 00185 Roma - Italia
Tel. +39-06-49910834
fax +39-06-49910072
web http://stefanofachin.site.uniroma1.it/
5 years, 3 months
Re: Gretl-users Digest, Vol 152, Issue 19 - alternative ranking function
by Alecos Papadopoulos
Sorry Jack, yes I tried it, something obvious must be slightly wrong
because your function misplaced the results, but I understood the logic,
simplified it to
<hansl>
function series rankingalt(series G)
matrix a = aggregate(const, G)
matrix b = cum(a[,2])
return replace(G, a[,1], b)
end function
</hansl>
and it works just fine.
Thanks!
Alecos Papadopoulos PhD
Athens University of Economics and Business
web: alecospapadopoulos.wordpress.com/
On 22/9/2019 01:00, gretl-users-request(a)gretlml.univpm.it wrote:
> Send Gretl-users mailing list submissions to
> gretl-users(a)gretlml.univpm.it
>
> To subscribe or unsubscribe via email, send a message with subject or
> body 'help' to
> gretl-users-request(a)gretlml.univpm.it
>
> You can reach the person managing the list at
> gretl-users-owner(a)gretlml.univpm.it
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of Gretl-users digest..."
>
> Today's Topics:
>
> 1. Re: an alternative "ranking" function (Riccardo (Jack) Lucchetti)
>
>
> ----------------------------------------------------------------------
>
> Date: Sat, 21 Sep 2019 22:23:50 +0200 (CEST)
> From: "Riccardo (Jack) Lucchetti" <r.lucchetti(a)univpm.it>
> Subject: [Gretl-users] Re: an alternative "ranking" function
> To: Gretl list <gretl-users(a)gretlml.univpm.it>
> Message-ID: <alpine.DEB.2.21.1909212223160.23293(a)ec-4.econ.univpm.it>
> Content-Type: multipart/mixed;
> boundary="-842988409-1783199259-1569097430=:23293"
>
> This message is in MIME format. The first part should be readable text,
> while the remaining parts are likely unreadable without MIME-aware tools.
>
> ---842988409-1783199259-1569097430=:23293
> Content-Type: text/plain; charset=ISO-8859-15; format=flowed
> Content-Transfer-Encoding: quoted-printable
>
> On Sat, 21 Sep 2019, Alecos Papadopoulos wrote:
>
>> [Jack] you mean, something like this?
>>
>> <hansl>
>> function series rankingalt(series x)
>> matrix a =3D aggregate(const, x)
>> return replace(x, a[,1], cum(0 | a[1:rows(a)-1,2]))
>> end function
>> </hansl>
>>
>> AP: To the extend I understand the code, I don't think so. I want a ser=
> ies=20
>> that has the length of the sample, exactly as the "ranking" function gi=
> ves.
>> The only difference between the "ranking" function and the "rankingalt=
> "=20
>> function is that the "rankingalt" function
> But this is what the function does. Have you tried it?
>
> -------------------------------------------------------
> Riccardo (Jack) Lucchetti
> Dipartimento di Scienze Economiche e Sociali (DiSES)
>
> Universit=E0 Politecnica delle Marche
> (formerly known as Universit=E0 di Ancona)
>
> r.lucchetti(a)univpm.it
> http://www2.econ.univpm.it/servizi/hpp/lucchetti
> -------------------------------------------------------
> ---842988409-1783199259-1569097430=:23293--
>
> ------------------------------
>
> Subject: Digest Footer
>
> _______________________________________________
> Gretl-users mailing list -- gretl-users(a)gretlml.univpm.it
> To unsubscribe send an email to gretl-users-leave(a)gretlml.univpm.it
> Website: https://gretlml.univpm.it/postorius/lists/gretl-users.gretlml.univpm.it/
>
>
> ------------------------------
>
> End of Gretl-users Digest, Vol 152, Issue 19
> ********************************************
>
5 years, 3 months
Re: a head scratcher
by Alecos Papadopoulos
[Allin] : <<I'm not sure what you mean by "the immediately smaller value".>>
Assume I have a discrete series X of size n= 5 as follows : x(1) = 5,
x(2) = -3, x(3)= 2, x(4) = 2, x(5) =5.
The range of the variable is discrete, X in {-3, 2, 5}.
Then the Y variable series I need would be
y(1) = 2 (because in the range of X, the immediately smaller value from
3, which is the value of x(1), is 2)
y(2) = Since x(2) has the minimum value in the range of X, the value of
y(2) should be set/fixed a priori.
y(3) = -3 (because in the range of X, the immediately smaller value from
2, which is the value of x(3), is -3)
y(4) = -3 (because in the range of X, the immediately smaller value from
2, which is the value of x(4), is -3)
y(5) = 2 (because in the range of X, the immediately smaller value from
5, which is the value of x(5), is 2)
The comparison/relation is not with previous values of X along the
index of the series, but it is related to the unique values in the range
of X.
Why do I want the Y-series ? Because I have a likelihood where at each
observation (i), an integral must be evaluated with upper limit x(i) and
lower limit y(i). The X series is part of the sample. The Y series must
be created.
Conceptually it requires a "lookup" action: we take the value of x(i),
we lookup the unique values in the range of X, we choose the
"immediately smaller" value in there, and we set it as the value of
y(i). If we find that the value of x(i) is the smallest value in the
range of X, we have set a priori a given value to be taken by y(i).
*Initial message*
2) I was unable to determine the combination of Gretl commands that will
give me the following:
Let X be a series, X(i), i=1,...,n. I want to create the following series
Y(i) = "the immediately smaller value than X(i) in the X series".
(If the Y series is created using a loop, I guess I can deal with what
happens when X(i) is the minimum value in the series by an "if" command)
E.g. if the X series has unique values {-3, -1, 5, 17}, then X(i)
= 5 => Y(i) = -1, X(j) = -1 => Y(j) = -3, etc. I would much appreciate
any ideas.
--
Alecos Papadopoulos PhD
Athens University of Economics and Business
web: alecospapadopoulos.wordpress.com/
cell:+30-6945-378680
skype:alecos.papadopoulos
5 years, 3 months
Re: an alternative "ranking" function
by Alecos Papadopoulos
[Jack] you mean, something like this?
<hansl>
function series rankingalt(series x)
matrix a = aggregate(const, x)
return replace(x, a[,1], cum(0 | a[1:rows(a)-1,2]))
end function
</hansl>
AP: To the extend I understand the code, I don't think so. I want a series that has the length of the sample, exactly as the "ranking" function gives.
The only difference between the "ranking" function and the "rankingalt" function is that the "rankingalt" function
<<Returns a series or vector with the ranks of y. The rank for observation
i here is the number of elements that are less or equal than y_i.>>
Namely we do not subtract half of ties, as we do in the "ranking" function.
I didn't suggest to replace the ranking function, just asked if we could have also the "rankingalt" function.
--
Alecos Papadopoulos PhD
Athens University of Economics and Business
web: alecospapadopoulos.wordpress.com/
cell:+30-6945-378680
skype:alecos.papadopoulos
5 years, 3 months
An alternative "ranking" Gretl function ?
by Alecos Papadopoulos
Apologies for the bombardment.
The following has substance for discrete random variables and samples
with many ties.
The Gretl function "ranking" does the following:
<<
ranking
Output: same type as input
Argument: y (series or vector)
Returns a series or vector with the ranks of y. The rank for observation
i is the number of elements that are less than y_i plus one half the
number of elements that are equal to yi.
>>
The function performs as stated in Help. To my understanding the above
is consistent with the concept of the "mid-Distribution Function"
introduced I think by Em. Parzen and associates. If we take the
resulting series and divide by sample size, we get a series where we
assign an empirical probability to each observation i. But these are
probabilities consistent with the empirical mid-distribution function.
But, there is not a Gretl function like, say,
<<
rankingalt
Output: same type as input
Argument: y (series or vector)
Returns a series or vector with the ranks of y. The rank for observation
i here is the number of elements that are less or equal than y_i.
See also ranking.
>>
So while using the "ecdf" Gretl function we get the unique values of the
empirical distribution function (as if it internally uses the
non-existent function "rankingalt"), if one wants to obtain a series
having the length of the sample, where at each observation i a
probability is assigned that is consistent with the empirical
distribution function (and not the empirical mid-distribution function),
one cannot achieve that, at least not in one obvious stroke.
It is not clear whether the empirical mid-distribution function is the
suitable tool to be used in all cases (my case relates to mixed
Copulas), so I was wondering whether Gretl could acquire a function like
"rankingalt" above.
Thanks.
--
Alecos Papadopoulos PhD
Athens University of Economics and Business
web: alecospapadopoulos.wordpress.com/
5 years, 3 months