clean-up of the "Cheat sheet" guide chapter
by Sven Schreiber
Hello everybody,
I'm currently looking at ch. 21 of the guide, "Cheat sheet". I'd propose
the following cleanups (which I could apply if people agree):
section 21.1:
- Time averaging of panel datasets: I think it would be nice to use a
real-world dataset such as grunfeld.gdt instead of having the slightly
distracting code for creation of artificial data.
section 21.2:
- Generating a dummy variable for a specific observation: Instead of
t=="Italy" one can also write obs=="Italy", which may be more intuitive
for cross-sectional data.
- Generating a “subset of values” dummy: Nowadays one could use the
contains() function I think, which would be more readable.
section 21.3:
- Interaction dummies (p. 194 of the A4 guide version from October):
remove the old string-substitution-based code that pre-dates the
interaction operator (^; which is also already mentioned there).
- Realized volatility: Is this example even consistent? It starts by
talking about minutes and hours, but then switches over to seconds and
minutes. Maybe that's part of the clever trick, I don't know... Apart
from that, it seems that another trick in the cheat sheet could be
re-used here, namely "Moving functions for time series".
- Looping over two paired lists: Can't this one be generalized, by using
Lx[i] and Ly[i] instead of y$i and x$i ?
- Cross-validation: Could it be that using some feature of the regls
apparatus or a contributed package (by Artur?) would be more practical
nowadays?
- Is my matrix result broken? - One could now use sum() instead of
sumc(sumr()).
cheers
sven
5 days, 21 hours
levels forecast of log model
by Sven Schreiber
Hi all,
this is the announced follow-up post about the message on the users list
regarding transforming log predictions to levels. Perhaps it might be an
idea to have a little function package that offers this in the context
of an estimated single-equation model.
As an example, take the following estimate and the calculations that
only depend on the $model bundle that should be available for a function
package inside the model window:
<hansl>
open banks91.gdt # not only for time series
series lout = log(Q1)
list lprices = log(deflist(P1,P2,P3))
ols lout const lprices
# post-model calculations
scalar s = $model.sigma
series lyhat = $model.yhat
string lyname = varname($model.ylist)
modtest --normality --quiet
if $pvalue < 0.10
print "Warning: normality assumption is dubious"
endif
series exp_@lyname = exp(lyhat) + exp(s^2) # would have to be the return
value
</hansl>
cheers
sven
6 days, 9 hours
remaining auto-translated argument labels in contributed packages
by Sven Schreiber
Hi,
this concerns the language "mish-mash" in the GUI dialog windows of
contributed function packages, when running in a local language
(non-English). Since contributed packages are not / cannot be translated
like native gretl, last year we decided to try to avoid this in the
sense that gretl should stop applying auto-translations in that context.
What I'm seeing with gretl 2024d is that labels like "dependent
variable" and "exogenous regressors" are still auto-translated. See for
example the StrucTiSM package, or Canova_Hansen. I think there are also
other examples.
Am I missing something, or has the policy change not yet been implemented?
thanks
sven
1 week
"empty" keyword
by Sven Schreiber
Hi all,
since "empty" has been a keyword for a while (as in: 'bundle B =
empty'), I'm wondering when it was introduced? I cannot find it in the
changelog.
thanks
sven
1 week
$portmanteau accessor after VAR hidden
by Sven Schreiber
Hi all,
I just realized that the $portmanteau accessor which is available after
a VAR does not appear in the function/accessor reference. It's a
4-element vector with the test result that is also printed out regularly.
Usage example, which also shows that some but not all of the information
can be retrieved via a $system member:
<hansl>
open denmark
var 2 LRM LRY
eval $pmanteau[1]
eval $system.Ljung_Box
eval $pmanteau[2]
eval $system.LB_order
eval $pmanteau[3:4] # not in $system?
</hansl>
Any important reason why it's not really made public, or just an
oversight? Or should the content rather be moved into the $system bundle
altogether?
thanks
sven
1 week, 2 days
some explanation of hyp2f1() needed
by Sven Schreiber
Hi again,
I think the built-in hyp2f1() function needs some more documentation in
the function reference, where it basically just says that it's the Gauss
hypergeometric function with four arguments, and that the fourth
argument should be real-valued.
For example, on Wikipedia
(https://en.wikipedia.org/wiki/Hypergeometric_function) it becomes
relatively clear that this fourth argument should have modulus less than
one. If this is actually correct, then I think it wouldn't hurt to add
this to the docs.
There's also more things that are not so clear: Wikipedia says "It is
undefined (or infinite) if c equals a non-positive integer", but using a
call with a negative integer like hyp2f1(-1,-2,-3, 0.4) yields a finite
result 0.73333. I'm sure there's just a mis-interpretation on my side,
but again, that's why I think some more basic remarks in the function
ref would be needed.
thanks
sven
1 week, 6 days
on the LaTeX "listings" package and hansl
by Sven Schreiber
Dear all,
here's just a little information and update about how "listings" for
LaTeX works with hansl. The background is that a couple of years ago
Jack and I had been in contact with the maintainer and provided some
more input. (A long time ago I believe it was Ignacio who had initially
managed to get hansl/gretl support into listings.)
So in current versions of "listings" a preferences file (.prf) for hansl
is included that provides some default formatting choices. This seems to
work OK with the Texlive distribution, but the needed file turns out to
be missing in a regular Miktex installation on Windows. I guess I will
file a bug report with Miktex about that.
The default formatting choices surely can be improved, to be honest;
especially in the black&white (non-color) variant. Some updates to the
language specification and definitions are also needed. I'm trying to
get in contact with the package maintainer about that. I might get back
to you guys for some help on the LaTeX formatting side. Let's see.
cheers
sven
2 weeks, 2 days
foreign block and string-valued series
by Sven Schreiber
Hi,
in applied work with a 'foreign' block where data is sent to R, I had
the case of a string-valued series which was transferred as strings and
then caused hiccups on the R side. I solved the problem by copying on
the gretl side the series to another one, which then --as described in
the guide-- only contains numbers.
However, I'm wondering whether it is an intended feature that the
"gretldata" object in the R context can contain non-number items?
Loosely related observation from working with 'foreign' and getting
errors: after an error occurred inside the block, re-starting the
containing hansl script sometimes then seems to stumble over leftovers
of the previous error. The cleanup of the transfer-to-R temp files is
not sufficient after an error, it seems. Having a "clear" statement at
the top of the script isn't enough, apparently. Doing a separate "clear"
in the console sometimes helps, and sometimes a gretl re-start is
necessary, too.
thanks
sven
3 weeks, 2 days