a little obscure matrix slicing bug (I think)
by Sven Schreiber
Hi,
here's the demo:
<hansl>
loop for (i=2; i>=1; i--)
matrix m = I(i)
m[diag] = ones(i)
print i
m[1:i, 1:i][diag] = ones(i) # fails (only) for i==1
endloop
</hansl>
I suspect that m[1:i, 1:i] is internally treated as scalar and/or that
diag doesn't work with the scalar type. My wish would be that x[diag]
for a scalar just refers to (returns) the scalar itself.
thanks
sven
4 years
error assigning matrix to series in a bundle (inside a function)
by Sven Schreiber
Hi,
inside a function I tried to do something like
series mybundle.myseries = mybundle.myvector
where the active sample length matches rows(mybundle.myvector), but I
got an error ("got null", or something).
If I workaround like this:
series myseries = mybundle.myvector
series mybundle.myseries = myseries
then it worked.
thanks
sven
4 years
matrix implicit line continuation
by Sven Schreiber
Hi,
would it be too much to ask that literal matrix lines can be broken
after the rows (after semicolon) without the explicit backslash line
continuation character? It's not needed very often, but when it is, then
it usually involves many lines.
thanks
sven
4 years
freq alignment problems with UTF-8
by Riccardo (Jack) Lucchetti
Dear all,
I just pushed a one-liner to git to fix an alignment problem with the
"freq" command in case there are UTF-8 characters in a stringified series.
For example, the script
<hansl>
nulldata 20
set seed 555
series y = ceil(uniform(0,4))
l = defarray("ca", "cà", "üß", "mò")
stringify(y, l)
freq y
</hansl>
now gives correct alignment.
We have a similar problem with xtab, but I believe that in order to fix
that I'd have to intervene on gretl_utf8_truncate() (from strutils.c) and
the implications are not very clear to me, so I'd rather wait for
instructions from Allin.
-------------------------------------------------------
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
-------------------------------------------------------
4 years
bug with TRUE as default for function argument
by Sven Schreiber
Hi,
a minor issue, consider this:
<hansl>
function void hey(bool yep[TRUE] "no way")
print "ha"
end function
hey()
</hansl>
I get a syntax error which goes away if either I remove the string label
for the argument or I replace TRUE with 1.
cheers
sven
4 years
line break problems with outfile on Windows
by Sven Schreiber
Hi,
I think I'm experiencing a small glitch with gretl's handling of
cross-platform line endings on Windows when printing to a file.
Consider this:
<hansl>
s = readfile("test.txt") # this file is attached
set verbose off
outfile test2.inp # this is also attached
print s
end outfile
</hansl>
The newlines in test.txt are Windows-style CRLF.
In test2.inp each CRLF appears to be replaced by CRCRLF. In gretl's
editor this shows up as a double line break (empty lines).
This is with 2020e.
thanks
sven
4 years
status of gretlmpi in 2020e on Windows
by Sven Schreiber
Hi Allin,
I saw in the git log an entry of yours "fix for gretlcli and gretlmpi on
Windows". I was wondering if that means that in 2020e gretlmpi isn't
working correctly (on Windows), and if that implies that hansl code
using an mpi block would also be affected?
thanks
sven
4 years
system: problems with specification details (instruments/endogenous)
by Sven Schreiber
Hi all system aficionados,
here are some examples where I don't quite understand the reasons for
the various failures. All are variations of the shipped example script
kmenta.inp. (I'm omitting the open kmenta.gdt line at the top to focus
on the important stuff.)
1)
<hansl>
Kmenta <- system
equation Q const P D ; const D F A
equation Q const P F A ; const D F A
end system
estimate Kmenta method=ols
</hansl>
The error message is: "OLS: tsls-style lists not supported"
Apart from the fact that the string is not translated (I'm running it in
German) I'm not sure why I can't use tsls-style there. OK, strictly
speaking the help for system only mentions this "for a system to be
estimated via Three-Stage Least Squares", but I thought the whole point
of the separate "estimate" line is to be able to apply different
estimators to the same system.
Or to put it differently: Shouldn't gretl be able to simply ignore the
instrument spec when method=ols is chosen?
2)
<hansl>
Kmenta <- system
equation Q const P D
equation Q const P F A
instr const D F A
end system
estimate Kmenta method=ols # (error the same for method=3sls)
</hansl>
Error: "Found 1 endogenous variables but 2 equations" (again untranslated)
This looks like an outright bug to me. Fron the "instr" line gretl
should understand that Q and P are endogenous. Remember it does that
alright in the original formulation with "endog Q P" instead of the
instr line. (In that original case $xlist actually evaluates to "const D
F A", i.e. exactly like the instr spec above.)
(BTW, the 'system' command reference often talks about syntax suitable
for Three-Stage Least Squares which kind of sounds as if it's not for
other supported estimation methods, but that's not what is meant, right?
I guess it's a historical thing (?).)
thanks
sven
4 years
--makepkg option silently failing?
by Sven Schreiber
Hi,
I'm sure I did something stupid but here's the thing that puzzles me:
Trying to build a function package on Windows via the CLI command
"gretlcli.exe --makepkg <filename.inp>" doesn't produce the wanted gfn
output, but also doesn't complain. It just silently returns control to
the shell. Am I right to assume that one of the two things (success or
error) should happen?
Starting gretlcli.exe by itself works alright. The path location is not
unusual AFAICT.
This was with 2020e, then I installed the latest snapshot. I'm not sure
I have ever built a package since 2020e came out. I haven't tried
restarting the computer yet.
thanks
sven
4 years
foreign Julia --no-compile option not working correctly
by Sven Schreiber
Hi,
I've tried the following:
<hansl>
foreign language=Julia --no-compile
print("Hello from Julia")
end foreign
</hansl>
and I'm getting the following verbatim output:
code missing for Hello from Julia_growbeg!(Array{Any, 1}, Int64) :
sysimg may not have been built with --compile=all
code missing for category_code(UInt32) : sysimg may not have been built
with --compile=all
Without --no-compile it works fine. This is yesterday's snapshot with
Julia 1.4.0 on Windows.
thanks
svne
4 years