new version, old (?) bug
by Sven Schreiber
Hi,
I don't think this is a new bug, but who knows, and anyway:
<hansl>
function scalar rc(void)
loop i=1..2
return i
endloop
end function
rc()
</hansl>
I get an error saying the function doesn't return the proper type.
If I replace "return i" with the two lines:
out = i
return out
then it works.
This is with the brand new 2016d.
Thanks,
sven
8 years
function to locate a string in a strings array
by Sven Schreiber
Hi,
I find the following function useful:
<hansl>
function scalar arrindex(strings S, string s)
loop i = 1..nelem(S) -q
if S[i] == s
out = i
return out
endif
endloop
return 0 # no match was found
end function
strings checks = defarray("hey", "ho", "let's", "go")
eval arrindex(checks, "go")
eval arrindex(checks, "No go")
</hansl>
(The "out=i / return out" redundancy is due to the bug I just posted.)
That way you can have an array of strings serving as labels for an
accompanying array of matrices, and you can pick the right matrix in the
array by searching the strings array for a match.
Dreaming on in terms of syntax, it would be wonderful if one could loop
over an array like this: "loop foreach i S", but it would of course be
just syntactic sugar.
thanks,
sven
8 years
no iteration message after simple count loop
by Sven Schreiber
Hi,
today is trivial-questions-day, hope you don't mind.
I'm wondering why the following doesn't print out the usual message
about how many iterations were done:
<hansl>
c = 3
loop c --verbose # or w/o any option
b = 4
endloop
</hansl>
You might say that for a count loop it's a no-brainer how many
iterations there are, but the same would be true for "loop i=1..3", and
still we get the message there. So I'm just asking for reasons of coherency.
thanks,
sven
8 years
passing an array element in pointer form
by Sven Schreiber
Hi,
say 'ms' is an array of matrices, then it isn't currently possible to
pass an element to a function like this, in pointer form: "fcall(&ms[1])"
It is of course easy to work around this by making a temporary copy.
However, if one wants to use the pointer form for performance reasons to
avoid that copy, then it's a pity that arrays cannot be used. Are there
any plans to allow this, or perhaps recommendations what to do instead?
thanks,
sven
8 years
New strings for translation
by Henrique Andrade
Dear Allin,
I think the string "For a matrix composed of the selected series plus a
constant:" is not marked for translation. Am I correct? ;-)
Best,
Henrique Andrade
8 years, 1 month
Preserve row and col names of a matrix after functions
by Henrique Andrade
Dear Gretl Team,
Is it possible to preserve row and col names of a matrix after
"mreverse" and "trimr" functions? Please take a look at the following
code:
<hansl>
matrix M = {1, 2; 2, 1; 4, 1}
strings Row = defarray("Row1", "Row2", "Row3")
strings Col = defarray("Col1", "Col2")
rownames(M, Row)
colnames(M, Col)
matrix Msortby = msortby(M, 1)
matrix Mreverse = mreverse(M)
matrix Mtrimr = trimr(M, 1, 1)
print M Msortby Mreverse Mtrimr
</hansl>
In my humble opinion, "reverse" and "trimr" could have the same
behavior of "msortby", i.e., keep col and row names as in "msortby".
Best,
Henrique Andrade
8 years, 1 month
Wiki (not) and other forums
by Sven Schreiber
Hi,
this is an old topic, but I'm bringing it up because nothing much seems
to be happening.
First, we have agreed in the past that the wiki is dead, irrespective of
whether it's a good or a bad thing. So could the link "gretl wiki" on
the left of the homepage be removed?
Secondly, people seem to be dreaming of stackexchange, but we're not
going to get our own area there in the foreseeable future. So instead my
suggestion is to do what others also do, namely use the existing
CrossValidated (= stats.stackexchange.com) for our purposes simply by
leveraging the "gretl" tag. So far there isn't much there of course, see:
http://stats.stackexchange.com/questions/tagged/gretl?sort=newest
That would mean: (1) We mention on the gretl frontpage that people can
post questions at CrossValidated with the "gretl" tag, and (2) we
(whoever that is exactly) will keep on eye on it and will post comments
and answers there.
BTW, the "gretl" tag also exists in stackoverflow.com
(http://stackoverflow.com/questions/tagged/gretl) -- and this is the
minor drawback that I can see: questions about how to do something in
gretl will always be in a grey area between CrossValidated and
stackoverflow.
Opinions?
thanks,
sven
8 years, 1 month
bug reminder (easy fix I think)
by Sven Schreiber
Hi,
given that the next release doesn't seem to be too far away, I was
wondering whether the following bug could perhaps be fixed by then:
https://sourceforge.net/p/gretl/bugs/202/
IMO the fix would simply consist of printing out a warning like:
"Robust s.e. not available for probit random effects estimation, using
classical variance estimates."
when a user calls for "probit ... --random-effects --robust".
thanks,
sven
8 years, 1 month
Digamma function: possible mistake
by Henrique Andrade
Dear Allin and Jack,
I think there is an error in the definition of the digamma function in
Gretl Command Reference.
Now we have:
<tex>
\psi(x) = d\Gamma(x)/dx
<\tex>
And I think it should be:
<tex>
\psi(x) = d\Gamma'(x)/dx
<\tex>
Um abraço,
Henrique Andrade
8 years, 1 month
function packages: browsing vs editing
by Allin Cottrell
Hello all,
For one thing, we have had reports from both Sven and Artur about
problems with the GUI function-package editor (see
http://lists.wfu.edu/pipermail/gretl-devel/2016-November/007060.html
and follow-ups for the latest case). I haven't been able to
reproduce the reported problems, but that doesn't mean I don't
believe they're real; I suppose they can arise under subtle
combinations of circumstances.
For another thing, we've had several instances over the last few
months where people other than the editors of certain function
packages have uploaded "updated versions" of these packages to the
gretl server. It seems unlikely that such incidents were malicious;
more likely it was just a matter of people clicking certain buttons
"to see what would happen."
For both of these reasons, it seems to me it would be good to
separate the mechanism for browsing function packages from the
mechanisms for editing and creating packages. Therefore, in current
git, I have removed the toolbar-icons and popup-menu items for
editing and creating packages from the gfn browser window.
The package browser window is now just a browser; if you need GUI
package editing or creation tools, please look under the main-window
menu item "/Tools/Function packages."
I haven't yet updated the Function Package Guide, but that will
happen before the next release, which should be fairly soon.
Allin
8 years, 1 month