Failed compiling on ubuntu 14.04
by Artur Tarassow
Hi all,
I am trying to compile gretl on ubuntu 14.04. This worked 4 months ago
without any problem using the following "configure"-options:
./configure \
--prefix=$HOME/software/gretl \
--disable-gnuplot-checks \
--disable-gnuplot-3d \
--with-odbc --with-ODBC-prefix=${ODBC_DRIVER}
At some compilation failed, however. The errors I get are:
<compilation>
ware/gretl/lib\" ../lib/src/dataset.c -fPIC -DPIC -o .libs/dataset.o
../lib/src/bhhh_max.c: In function ‘bhhh_numeric’:
../lib/src/bhhh_max.c:37:23: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or
‘__attribute__’ before ‘Lval’
double * restrict Lval = L->val;
^
../lib/src/bhhh_max.c:37:23: error: ‘Lval’ undeclared (first use in this
function)
../lib/src/bhhh_max.c:37:23: note: each undeclared identifier is
reported only once for each function it appears in
../lib/src/bhhh_max.c: In function ‘bhhh_max’:
../lib/src/bhhh_max.c:148:23: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or
‘__attribute__’ before ‘delta’
double * restrict delta = NULL;
^
../lib/src/bhhh_max.c:148:23: error: ‘delta’ undeclared (first use in
this function)
../lib/src/bhhh_max.c:149:23: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or
‘__attribute__’ before ‘ctemp’
double * restrict ctemp = NULL;
^
../lib/src/bhhh_max.c:149:23: error: ‘ctemp’ undeclared (first use in
this function)
../lib/src/bhhh_max.c:150:23: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or
‘__attribute__’ before ‘grad’
double * restrict grad;
^
../lib/src/bhhh_max.c:150:23: error: ‘grad’ undeclared (first use in
this function)
</compilation>
Does anybody have an idea how to deal with it? Are there any compilation
parameters which I could try?
Thanks,
Artur
4 years, 9 months
function execution in 'if' statement
by Artur Tarassow
Hi,
this is a point I don't understand and frequently stumble over.
Function main() calls checker(). When checker() is called first, it
correctly prints the message "Some error message" and correctly returns 1.
When checker() is called within the conditional-statement, <if
checker(1)>, it also returns correctly 1 which triggers printing the
message "Check returned some other error". However, printing the
checker's message "Some error message" 'fails' or is not done. Why is
this the case?
<hansl>
function scalar checker (scalar code)
if code
print "Some error message"
return 1
endif
return 0
end function
function void main(void)
scalar ret = checker(1)
if ret
print "Check returned some error"
# print-command in checker() properly shown
endif
# checker(1) evaluated and correctly returns '1'
# However, print-command in checker() not shown
if checker(1)
print "Check returned some other error"
endif
end function
main()
</hansl>
Thanks,
Artur
4 years, 9 months
Inquiry about a submitted package
by Daniel Ventosa-Santaulària
Hello,
I recently submitted a package, G2S, to the Gretl team. I never received
neither feedback nor acceptance/rejection of our proposal. The package G2S
is a simple General-2-Specific program, that sequentially eliminates the
non significant variables until only significant ones remain. There are
some nice features; the code ensures that there are no problems with
potencial colinearities (Gretl already does a lot in this sense, but our
packages goes further down on this). The package also allows to fix some
variables (this is, to exclude some variables from the algorithm), etc. Is
this the right email address to make inquiries about a lost submitted
package?
Friendly regards,
Daniel
* Daniel Ventosa-Santaulària*
* Banco de México & **CIDE*
- http://www.ventosa-santaularia.com
4 years, 9 months
slight convenience extension to funcerr()
by Sven Schreiber
Hi,
often in user-defined functions we have a bunch of error checks like this:
if maybe_bogus_input
funcerr("cannot do that")
endif
What about adding the if condition to the funcerr() function as a scalar
second argument? So the above would become:
funcerr("can't do that", maybe_bogus_input)
I admit right away that this is mainly one of my syntactic-sugar ideas,
to save 2/3 of the needed lines of code - because in my function
packages and addons the error and input checking block often becomes
quite long.
(However, perhaps there is even a little bit more to it, because one
could pass the extended funcerr() variant to feval() which might open up
new ways.)
Hope everybody's well!
cheers
sven
4 years, 9 months
ternary statement with non-existing bundles
by Sven Schreiber
Hi,
here's a glitch with current git:
<hansl>
eval (1 == 1 ? "hey" : nonexisting) # works
eval (exists(nonexisting) ? nonexisting : "hey") # works
# bundle style
eval (exists(nobundle) ? nobundle.whatever : "ouf") # fails (nobundle:
no such object)
</hansl>
thanks
sven
4 years, 9 months
Rdata import
by Sven Schreiber
Hi,
I stumbled again over the situation that gretl offers import support for
quite many third-party formats, but not explicitly for .Rdata files. I
have rechecked the mailing lists and AFAIU this was due to lack of
low-level standardization or unstable format specifications.
In practice I have been given a Rdata file which gretl apparently tries
to treat as a csv variant but cannot open. (I know I can go via native R
and that's what I will do, but that's not the point.)
So I was wondering if in the meantime things have stabilized enough;
perhaps this Library-of-Congress page is helpful? :
https://www.loc.gov/preservation/digital/formats/fdd/fdd000470.shtml
cheers
sven
4 years, 9 months
stack() within a loop-block
by Artur Tarassow
Hi,
in an application I need to loop over various article data sets and to
use the stack() function. However, currently stack() cannot be used
within a loop.
Alternative I was trying to use the <dataset addobs> command which is,
however, explicitly not usebale within a loop:
<hansl>
set verbose off
clear
scalar r = 10
loop i=1..r -q
open denmark.gdt -q -p
series x = stack(L*) # "The symbol 'stack' is undefined"
# dataset addobs 5 # does not work
endloop
</hansl>
Is there an alternative way on how to stack variables within a loop?
I was thinking to make use of "nulldata" for initializing a bigger data
set, join the actual dataset which is big enough to allow for stacking.
However, this requires that I know how big the initial data set has to be...
Thanks,
Artur
4 years, 9 months
ARCH test option for VARs
by Sven Schreiber
Hi,
I stumbled over the situation of ARCH diagnostic testing in VARs and
found the old thread from 2017 "multivariate ARCH test for VARs". (See
below for a snippet.) It talks about a "univariate" option which isn't
documented in current gretl 2020a. Is this a secret or has it never been
implemented?
thanks
sven
-------
From 2017:
Allin:
Here's one more thought. If the multivariate autocorrelation and ARCH
tests are fully validated, they should probably become the default for
VARs. But as Lutkepohl points out, they both chew up a lot of degrees of
freedom, and he talks about use of univariate tests as a fallback. So we
might go the other way from the current private option and add a
--univariate option to get the univariate versions even when testing a VAR.
Jack:
Excellent solution IMO.
4 years, 9 months
strvals() while dataset is restricted
by Artur Tarassow
Hi all,
I am bit puzzled about the following behaviour. Even though, the sample
is restricted to "t>3" obs. only, the strvals() function returns the
distinct string-values of series x of the full data set. Is this
intended, or a bug? I use latest git version on Ubuntu 19.04.
<hansl>
clear
set verbose off
nulldata 6 -p
genr time
series x = 1
smpl time > 3 --restrict
x = 2
smpl full
strings names = defarray("A", "B")
stringify(x, names)
eval strvals(x) # shows ["A", "B"]
smpl time > 3 --restrict
eval strvals(x) # still shows ["A", "B"]
</hansl>
Best,
Artur
4 years, 9 months
continue statement for flow control
by Artur Tarassow
Hi all,
from time to time I come up with nested if-else statements. I've
realized that code could be more readable if gretl would have a type of
the 'continue' command which is also known in C if I am not wrong.
The continue statement would continue with the next iteration of the
loop. This could also lead to less computation as the flow can be
changed early in the loop. Let me come up with a constructed example --
I hope it shows my point for the usefulness of such a statement:
<hansl>
scalar k = 2
loop i=1..3 -q
scalar n = randgen1(i, 0, 3)
if n == 0
# get out here and proceed with i++
else
if n == 1
# get out here and proceed with i++
else
# do something clever here
if k > 2
# get out here and proceed with i++
else
# do something clever here
endif
endif
endif
endloop
# Example with 'continue'
loop i=1..3 -q
scalar n = randgen1(i, 0, 3)
if n == 0
continue
endif
if n == 1
continue
endif
if k > 2
continue
else
# do something clever here
endif
endloop
</hansl>
What do you think about this feature?
Best,
Artur
4 years, 9 months