Kendall's tau
by Sven Schreiber
Hi,
there are the options --spearman and --kendall for the 'corr' command.
(And in the GUI, Model -> Robust estimation -> Rank correlation).
How to get the results of these computations, i.e. what is the
function-based variant? The corr() function doesn't do this, according
to the doc.
thanks,
sven
8 years, 6 months
removing nan and inf from a matrix
by Logan Kelly
Hello,
I need to take the log difference of a matrix, i.e. log(M[2 rows(M):,]/M[1:rows(M)-1,]). Unfortunately, M has elements equal to zero. I need to replace the nan's and inf's with 0's. This almost works
M = isnan(M) ? 0 : M
but does not remove inf's. Any sugestions?
8 years, 6 months
something in between values() and aggregate()
by Sven Schreiber
Hi again,
I want to check a series for ties, meaning exact values that occur more
than once in the series, and also get the respective counts of how many
occurrences there are at each of these ties.
The function values() gives me information about the ties, as it drops
repeated values. But it seems it doesn't have the counts.
The function aggregate() is very general, and so I think for a series y
I could do:
matrix m = aggregate(y, y, mean)
Here the "mean" thing is just a redundant dummy entry, it could be
anything from the allowed functions (see the doc for 'aggregate').
Another redundancy is the double entry of "y", the first "y" could also
be any other existing series, it's just needed to satisfy the number
(and position!) of arguments.
Then what I want to use are the first 2 cols of m: m[, 1:2].
So, is there a more elegant but still readable way to get the first two
columns of:
aggregate(<anyseries>, y, <anyfunction>)
Thanks,
sven
8 years, 6 months
Printf & sprintf: problems with accented names
by Henrique Andrade
Dear Jack and Allin,
I found a problem with format specifiers and printf and sprintf.
Please take a look at the following example:
<hansl>
printf "start->%10s<-end\n", "aeiou"
printf "start->%10s<-end\n", "áéíóú"
string s1 = sprintf("start->%10s<-end\n", "aeiou")
string s2 = sprintf("start->%10s<-end\n", "áéíóú")
print s1 s2
<\hansl>
I believe Gretl is ignoring accented names when formating the output.
Best regards,
Henrique Andrade
8 years, 6 months
Outfile and line breaks problem
by Henrique Andrade
Dear Allin and Jack,
I think Gretl is making something wrong regarding to line breaks :-(
Please take a look at the following script:
<hansl>
outfile "@dotdir/test1.txt" --write --quiet
loop i = 1..5 --quiet
print "We all love Gretl!"
endloop
outfile --close
outfile "@dotdir/test2.txt" --write --quiet
string s1 = readfile("@dotdir/test1.txt")
print s1
outfile --close
string s2 = readfile("@dotdir/test2.txt")
printf "\n# String 1:\n%s\n# String 2:\n%s", s1, s2
<\hansl>
I think the strings 1 and 2 are the same, but s1 has CR LF line breaks
and s2 has CR CR LF line breaks. This behavior is breaking my script
that generates markdown file format documents (.md).
Best regards,
Henrique Andrade
8 years, 6 months
How to Save the Results from "corr" command?
by Fernando Fernandes Neto
Hi there,
I am building a "rolling" correlation between two series, using a loop and
smpl command. Given that, I'd like to know how can I save the results of
the "corr" command...
Does anyone have any idea?
Thanks in advance,
Fernando
8 years, 6 months
Attention State Space Modellers!
by Riccardo (Jack) Lucchetti
Sorry for cross-posting, but this is very very important.
In the past few weeks, we have been working on a substantial rewrite of
the hansl interface to state space models.
The underlying computational engine is pretty much the same as before, but
the way a user can access it via hansl scripting has been completely
redesigned. The work isn't finished yet, but we're quite near completion
and we'll publish soon a document explaining the revised interface.
In fact, we're quite impatient to make the change for two reasons: (a) the
new style is WAY better than the old one under all respects: efficiency,
maintainability, generality, intuitiveness, you name it. (b) keeping both
approaches functioning at once is possible (in the git/snapshot version
you get just that, in fact), but very costly. Therefore, we'd like to drop
the old syntax as soon as possible.
Of course I hear you, Sven. This would be a MASSIVE backward-incompatible
change, much bigger than any we had in the whole history of the project.
For this reason, we'd like to have an idea of how many people out there
are using the "kalman" command in a "production" environment; that is,
hansl scripts that HAVE TO WORK. If it's just a few, we can arrange a
somewhat "ad personam" migration strategy. If there are hundreds of such
cases (but I doubt it), we'll have to find another solution.
So please speak up! The sooner the better.
-------------------------------------------------------
Riccardo (Jack) Lucchetti
Dipartimento di Scienze Economiche e Sociali (DiSES)
Università Politecnica delle Marche
(formerly known as Università di Ancona)
r.lucchetti(a)univpm.it
http://www2.econ.univpm.it/servizi/hpp/lucchetti
-------------------------------------------------------
8 years, 6 months
Re: [Gretl-users] Gretl-users Digest, Vol 113, Issue 2
by Francisco López Herrera
Have you considered that a better interface to state space models could encourage its use anyway?...Best regards...flh(Parameswara das anudas)
De: "gretl-users-request(a)lists.wfu.edu" <gretl-users-request(a)lists.wfu.edu>
Para: gretl-users(a)lists.wfu.edu
Enviado: Jueves, 2 de junio, 2016 11:00:32
Asunto: Gretl-users Digest, Vol 113, Issue 2
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. Attention State Space Modellers! (Riccardo (Jack) Lucchetti)
2. Re: Attention State Space Modellers! (Ignacio Diaz-Emparanza)
3. Re: Attention State Space Modellers! (Fernando Fernandes Neto)
4. Re: plots with "bands" (Sven Schreiber)
----------------------------------------------------------------------
Message: 1
Date: Wed, 1 Jun 2016 19:16:38 +0200 (CEST)
From: "Riccardo (Jack) Lucchetti" <r.lucchetti(a)univpm.it>
To: Gretl users mailing list <gretl-users(a)lists.wfu.edu>, Gretl
developers mailing list <gretl-devel(a)lists.wfu.edu>
Subject: [Gretl-users] Attention State Space Modellers!
Message-ID: <alpine.DEB.2.20.1606011903570.7452(a)ec-4.econ.univpm.it>
Content-Type: text/plain; charset="iso-8859-15"; Format="flowed"
Sorry for cross-posting, but this is very very important.
In the past few weeks, we have been working on a substantial rewrite of
the hansl interface to state space models.
The underlying computational engine is pretty much the same as before, but
the way a user can access it via hansl scripting has been completely
redesigned. The work isn't finished yet, but we're quite near completion
and we'll publish soon a document explaining the revised interface.
In fact, we're quite impatient to make the change for two reasons: (a) the
new style is WAY better than the old one under all respects: efficiency,
maintainability, generality, intuitiveness, you name it. (b) keeping both
approaches functioning at once is possible (in the git/snapshot version
you get just that, in fact), but very costly. Therefore, we'd like to drop
the old syntax as soon as possible.
Of course I hear you, Sven. This would be a MASSIVE backward-incompatible
change, much bigger than any we had in the whole history of the project.
For this reason, we'd like to have an idea of how many people out there
are using the "kalman" command in a "production" environment; that is,
hansl scripts that HAVE TO WORK. If it's just a few, we can arrange a
somewhat "ad personam" migration strategy. If there are hundreds of such
cases (but I doubt it), we'll have to find another solution.
So please speak up! The sooner the better.
-------------------------------------------------------
Riccardo (Jack) Lucchetti
Dipartimento di Scienze Economiche e Sociali (DiSES)
Universit? Politecnica delle Marche
(formerly known as Universit? di Ancona)
r.lucchetti(a)univpm.it
http://www2.econ.univpm.it/servizi/hpp/lucchetti
-------------------------------------------------------
------------------------------
Message: 2
Date: Thu, 2 Jun 2016 13:53:01 +0200
From: Ignacio Diaz-Emparanza <ignacio.diaz-emparanza(a)ehu.eus>
To: gretl-users(a)lists.wfu.edu
Subject: Re: [Gretl-users] Attention State Space Modellers!
Message-ID: <57501E1D.9070201(a)ehu.eus>
Content-Type: text/plain; charset=windows-1252; format=flowed
El 01/06/16 a las 19:16, Riccardo (Jack) Lucchetti escribi?:
>
> Sorry for cross-posting, but this is very very important.
>
> In the past few weeks, we have been working on a substantial rewrite
> of the hansl interface to state space models.
>
> The underlying computational engine is pretty much the same as before,
> but the way a user can access it via hansl scripting has been
> completely redesigned. The work isn't finished yet, but we're quite
> near completion and we'll publish soon a document explaining the
> revised interface.
>
> In fact, we're quite impatient to make the change for two reasons: (a)
> the new style is WAY better than the old one under all respects:
> efficiency, maintainability, generality, intuitiveness, you name it.
> (b) keeping both approaches functioning at once is possible (in the
> git/snapshot version you get just that, in fact), but very costly.
> Therefore, we'd like to drop the old syntax as soon as possible.
>
> Of course I hear you, Sven. This would be a MASSIVE
> backward-incompatible change, much bigger than any we had in the whole
> history of the project.
>
> For this reason, we'd like to have an idea of how many people out
> there are using the "kalman" command in a "production" environment;
> that is, hansl scripts that HAVE TO WORK. If it's just a few, we can
> arrange a somewhat "ad personam" migration strategy. If there are
> hundreds of such cases (but I doubt it), we'll have to find another
> solution.
>
> So please speak up! The sooner the better.
I was teaching State Space Models some years ago, and you already know I
prepared some packages (BSMestim LLTestim) when there was still no
native commands for the Kalman filter in gretl. I have checked the
native commands some times, but I have not used them seriously. So don't
worry about me, backward incompatibilites will not cause me any problem.
I look forward to the changes and I am sure that the improvements in
these commands will contribute to facilitate the use of state-space
models in gretl.
--
Ignacio D?az-Emparanza
Departamento de Econom?a Aplicada III (Econometr?a y Estad?stica)
Universidad del Pa?s Vasco - Euskalherriko Unibertsitatea, UPV/EHU
Tfno: (+34) 94 601 3732
http://www.ehu.eus/ea3
------------------------------
Message: 3
Date: Thu, 2 Jun 2016 09:09:20 -0300
From: Fernando Fernandes Neto <nando.fernandes.neto(a)gmail.com>
To: Gretl list <gretl-users(a)lists.wfu.edu>
Subject: Re: [Gretl-users] Attention State Space Modellers!
Message-ID:
<CADmZHNqScnU3j+_b8D7OniZLjsdqhzv1mnarusTPYX-uk=VM1Q(a)mail.gmail.com>
Content-Type: text/plain; charset="utf-8"
I'd love to see the new state space environment.
The old was good, but too complex to manage.
2016-06-02 8:53 GMT-03:00 Ignacio Diaz-Emparanza <
ignacio.diaz-emparanza(a)ehu.eus>:
> El 01/06/16 a las 19:16, Riccardo (Jack) Lucchetti escribi?:
>
>>
>> Sorry for cross-posting, but this is very very important.
>>
>> In the past few weeks, we have been working on a substantial rewrite of
>> the hansl interface to state space models.
>>
>> The underlying computational engine is pretty much the same as before,
>> but the way a user can access it via hansl scripting has been completely
>> redesigned. The work isn't finished yet, but we're quite near completion
>> and we'll publish soon a document explaining the revised interface.
>>
>> In fact, we're quite impatient to make the change for two reasons: (a)
>> the new style is WAY better than the old one under all respects:
>> efficiency, maintainability, generality, intuitiveness, you name it. (b)
>> keeping both approaches functioning at once is possible (in the
>> git/snapshot version you get just that, in fact), but very costly.
>> Therefore, we'd like to drop the old syntax as soon as possible.
>>
>> Of course I hear you, Sven. This would be a MASSIVE backward-incompatible
>> change, much bigger than any we had in the whole history of the project.
>>
>> For this reason, we'd like to have an idea of how many people out there
>> are using the "kalman" command in a "production" environment; that is,
>> hansl scripts that HAVE TO WORK. If it's just a few, we can arrange a
>> somewhat "ad personam" migration strategy. If there are hundreds of such
>> cases (but I doubt it), we'll have to find another solution.
>>
>> So please speak up! The sooner the better.
>>
>
> I was teaching State Space Models some years ago, and you already know I
> prepared some packages (BSMestim LLTestim) when there was still no native
> commands for the Kalman filter in gretl. I have checked the native commands
> some times, but I have not used them seriously. So don't worry about me,
> backward incompatibilites will not cause me any problem. I look forward to
> the changes and I am sure that the improvements in these commands will
> contribute to facilitate the use of state-space models in gretl.
>
> --
> Ignacio D?az-Emparanza
> Departamento de Econom?a Aplicada III (Econometr?a y Estad?stica)
> Universidad del Pa?s Vasco - Euskalherriko Unibertsitatea, UPV/EHU
> Tfno: (+34) 94 601 3732
> http://www.ehu.eus/ea3
>
> _______________________________________________
> Gretl-users mailing list
> Gretl-users(a)lists.wfu.edu
> http://lists.wfu.edu/mailman/listinfo/gretl-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.wfu.edu/pipermail/gretl-users/attachments/20160602/58ed176b/...>
------------------------------
Message: 4
Date: Thu, 2 Jun 2016 15:36:04 +0200
From: Sven Schreiber <svetosch(a)gmx.net>
To: gretl-users(a)lists.wfu.edu
Subject: Re: [Gretl-users] plots with "bands"
Message-ID: <1fb0bc7b-f6d5-759a-b8c6-baea5c887e41(a)gmx.net>
Content-Type: text/plain; charset=windows-1252; format=flowed
Am 12.05.2016 um 18:53 schrieb Allin Cottrell:
>
> Yes, it would be nice if you could also set the style of the band (e.g.
> make it a shaded area rather than two lines). That may come,
> but it's a lot more complicated.
>
I guess I'm sounding repetitive, but with gnuplot 5 and using the
compact inline data specification that you managed to get into gnuplot
it doesn't strike me as very difficult. It works for me when I do:
$testdata using 1:3:4 title "bands" w filledcurve
of course after having put the data in a suitable "$testdata" block.
But still, a nice feature of course.
thanks,
sven
------------------------------
_______________________________________________
Gretl-users mailing list
Gretl-users(a)lists.wfu.edu
http://lists.wfu.edu/mailman/listinfo/gretl-users
End of Gretl-users Digest, Vol 113, Issue 2
*******************************************
8 years, 6 months
"colname" and "rowname" after matrix functions
by Henrique
Dear Allin,
When I use matrix functions Gretl exhibits different behavior regarding column
names and row names. Please take a look at the following script:
<hansl>
matrix Mat = {1, 2; 2, 1; 4, 1}
strings Cols = defarray("Col. 1", "Col. 2")
strings Rows = defarray("Row 1", "Row 2", "Row 3")
colnames(Mat, Cols)
rownames(Mat, Rows)
matrix msortbyMat = msortby(Mat, 2)
matrix mreverseMat = mreverse(Mat)
print Mat
print msortbyMat
print mreverseMat
</hansl>
The msortby function keeps the names but the mreverse doesn't. Is this the
expected behavior?
Best regards,
Henrique Andrade
Sent from [Nylas N1](https://nylas.com/n1?ref=n1), the extensible, open source
mail client.
8 years, 6 months
Double loop
by Ma. jo Arteaga Garavito
Hi!
I’m new to gretl programming. Please, can anyone tell me why my code doesn’t recognize my double loop. I don’t understand.
# a 14 de mayo de 2016
# función que genera la contribución de Shapley
include drop_majo.inp
include R2_majo.inp
function matrix shapley(matrix X "Variables explicativas",
matrix y "Variable dependiente")
scalar T=rows(X) #número de observaciones
scalar N=cols(X) #número de variables explicativas
scalar M=2^N #número de regresiones factibles
scalar M2=M-1
scalar N2=N-1
matrix Z = zeros(M,1)
matrix C = zeros(1,N)
loop k=0..M2
matrix Xs=X
loop for (i=N; i=1;i-=1)
if floor((k%(2^i))/2^(i-1))==0
matrix Xs=dropcol(Xs,i)
endif
endloop
matrix Z[k+1]=R2(Xs,y)
endloop
print Z
loop j=1..N
loop m=0..M2
if floor(m%(2^j)/2^(j-1))==0
matrix C[j]=C[j]+Z[m+1]
else
matrix C[j]=C[j]-Z[m+1]
endif
endloop
matrix C[j]=C[j]/(2^(N-1))
endloop
print C
end
Also, sometimes the console freezes. It doesn’t respond to anything I write, so I have to constantly close Gretl.
Thanks!
María José
Enviado desde Correo para Windows 10
8 years, 6 months