Function to get the powerset
by Henrique Andrade

Dear Gretl Community,
I really stuck trying to define a function that gives a power set of a
set. Suppose I have a set S:
S = {"A", "B", "C"}
The associated power set, P(S), is:
P(S) = {{ }, {"A"}, {"B"}, {"C"}, {"A", "B"}, {"A", "C"}, {"B", "C"},
{"A", "B", "C"}}
All that I can think by now (shame on me!) is this:
strings S = defarray("A", "B", "C")
scalar P_S_len = 2^nelem(S) # the size of the power set
strings P_S = array(P_S_len) # an array with 8 spaces.
Does anyone have any ideas?
Best,
Henrique Andrade
2 years, 4 months

warning: gdt-reading bug
by Allin Cottrell

We've just noticed that a bug was introduced into our code for reading
native gretl .gdt data files in August of this year. The bug should be
triggered only rarely, but we thought it wise to issue a warning.
Description of bug: If a gdt file contains "subnormal" values (that
is, floating point values that are too close to zero to be represented
with the usual precision), then when such a file is read on Linux, the
first subnormal value to be found on a given row (observation) will be
incorrectly copied into the remaining columns (series) on that row.
Example: A gdt file containing 10 series has a subnormal for series
number 5 on row 25. Then when the file is read on Linux, that
subnormal will replace the correct values for series 6 to 10 for
observation 25.
Comment: This won't affect the reading of "primary" data (actual
micro- or macroeconomic measurements), which will never contain
subnormal values (we're talking about absolute values less than 10 to
the minus 307). And the bug is not triggered on MS Windows. However,
subnormal values may be produced by some data transformations (such as
squaring very small numbers, or computing the normal CDF of very big
negative values).
Fix: This is now fixed in the git source for gretl and also the
current snapshots. And we will put out a new release soon, gretl
2015d.
Diagnostic: If you think a dataset may suffer from this problem,
you can run the script checkdata.inp, from
http://ricardo.ecn.wfu.edu/pub/gretl/checkdata.inp
First load the dataset in question. Then open checkdata.inp and run
it. An affected dataset may produce something like this:
<script-output>
Total number of values examined: 164122
Check for subnormal floating-point values
-----------------------------------------
Total number found: 138
Longest (row) sequence: 138
(occurs at obs 210, starting series ID 461)
Number of sequences (of length >= 2): 1
</script-output>
The symptom of a problem is that we find a consecutive sequence of
subnormal values on one or more rows of the dataset. This could occur
for "natural" reasons but it may indicate corruption. Isolated
subnormals don't indicate the bug. And again, most datasets should
contain no subnormal values.
Allin Cottrell
4 years, 4 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?
4 years, 8 months

Holt-Winters package
by Raul Gimeno

Hello
I've been using the Holt-Winters package but I cannot replicate my
Excel-calculation results with this package.
The starting value from the package for the trend is 245 mine is 166.396. By
running a regression on the full sample I get completely different results
for these starting values, although the same methodology as described in the
help description has been used.
For replication purposes I send my excel spreadsheet and I would be glad to
understand how these starting values have been effectively calculated.
Thank you for your help
Raul Gimeno
**
4 years, 9 months

Mixed Data Sampling Regression
by Jan Tille

Dear list members,
please allow me a short question. Does anyone know whether there is a function package for Gretl that can perform MIDAS regression analysis, in the spirit of Eric Ghysels's Matlab toolbox or as provided in EViews 9.5?
Thanks in advance and kind regards
Jan
4 years, 10 months

panel model news
by Allin Cottrell

Thanks to persistent queries from "KTTK" on sourceforge, we now have
some fixes and refinements for the fixed-effects and random-effects
panel-data estimators.
For extended background see
https://sourceforge.net/p/gretl/bugs/193/
https://sourceforge.net/p/gretl/feature-requests/92/
https://sourceforge.net/p/gretl/feature-requests/93/
The following changes are in current git and snapshots.
1) I think this has been mentioned before but I'll state it for
completeness: when you give the --robust option with fixed effects,
the accompanying test for difference of group means is now also a
robust test.
2) Also pertaining to fixed effects with the robust option: we show
clustered (Arellano-type) standard errors and the joint F-test, based
on the covariance matrix, is also robust. However, we were using the
wrong denominator degrees of freedom for this test. In the clustered
case this should be based on the number of clusters (that is, groups,
in the panel case) and not the total number of observations. Now
fixed.
3) In the case of random-effects estimation (unlike most estimators),
we were not showing a joint test on the regressors. We now show a Wald
chi-square test by default.
4) While working on the above, I noticed a problem that hasn't been
reported yet: if you gave the --time-dummies option with random
effects, you could get a spurious "insufficient degrees of freedom"
error. That's because when we were checking the degrees of freedom for
the "between" model we were wrongly including the time dummies in the
parameter count -- wrongly, because of course these dummies will wash
out of the between model. Now fixed.
5) KTTK asked if it's just an oversight that there's no robust option
for random effects. No, not just an oversight; it's not so obvious
what "robust" variance estimation should look like in this case.
However, we'll take another look at this.
Allin
4 years, 11 months

times series format
by Raul Gimeno

Hello
I have the following script
setobs 4 1990:1 --time-series
nulldata 100
series u = normal()
u[1] = 0
series rwalk1 = 0
rwalk1 = rwalk1(-1) + u
store random.gdt u rwalk1
When I open the file random.gdt I cannot display a time series plot
(View/Graph/ time series plot) or use the correlogram menu function. I a way
gretl doesn't recognise the generated data as a time series.
What should I do?
Thank you in advance
Raul Gimeno
-----Ursprüngliche Nachricht-----
Von: gretl-users-bounces(a)lists.wfu.edu
[mailto:gretl-users-bounces@lists.wfu.edu] Im Auftrag von
gretl-users-request(a)lists.wfu.edu
Gesendet: Freitag, 25. März 2016 17:01
An: gretl-users(a)lists.wfu.edu
Betreff: Gretl-users Digest, Vol 110, Issue 17
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. Holt's trend (Raul Gimeno)
----------------------------------------------------------------------
Message: 1
Date: Fri, 25 Mar 2016 16:08:51 +0100
From: "Raul Gimeno" <mrexito(a)vtxmail.ch>
To: <gretl-users(a)lists.wfu.edu>
Subject: [Gretl-users] Holt's trend
Message-ID: <003401d186a8$3dd741c0$b985c540$(a)vtxmail.ch>
Content-Type: text/plain; charset="us-ascii"
Hello
I've installed the package Holt 1.0 for trend estimation.
I have two problems:
1. With gretl 1.10.2 for Mac with the system OS 10.11.4 installed I cannot
use the function Holt's trend since gretl closes automatically. I select the
variable and go to the menu Variable / Filter /Holt's trend and the program
closes automatically.
2. The package works on Windows 10 but there is a difference between my
calculations and the output windows.
I choose for the starting data the OLS with first half of the sample I get
L0 = 202.625 for the start level and b0 = -0.3682 for the start trend level.
The first forecast is h^1 for the first period based on period 0: h^1 = L0 +
b0 = 202.2568
With the gretl function I get 203.0051. Obviously there is a problem.
Thank you for your feedback.
Raul Gimeno
_______________________________________________
Gretl-users mailing list
Gretl-users(a)lists.wfu.edu
http://lists.wfu.edu/mailman/listinfo/gretl-users
End of Gretl-users Digest, Vol 110, Issue 16
********************************************
------------------------------
_______________________________________________
Gretl-users mailing list
Gretl-users(a)lists.wfu.edu
http://lists.wfu.edu/mailman/listinfo/gretl-users
End of Gretl-users Digest, Vol 110, Issue 17
********************************************
4 years, 11 months

Holt's trend
by Raul Gimeno

Hello
I've installed the package Holt 1.0 for trend estimation.
I have two problems:
1. With gretl 1.10.2 for Mac with the system OS 10.11.4 installed I cannot
use the function Holt's trend since gretl closes automatically. I select the
variable and go to the menu Variable / Filter /Holt's trend and the program
closes automatically.
2. The package works on Windows 10 but there is a difference between my
calculations and the output windows.
I choose for the starting data the OLS with first half of the sample
I get L0 = 202.625 for the start level and b0 = -0.3682 for the start trend
level.
The first forecast is h^1 for the first period based on period 0: h^1 = L0 +
b0 = 202.2568
With the gretl function I get 203.0051. Obviously there is a problem.
Thank you for your feedback.
Raul Gimeno
_______________________________________________
Gretl-users mailing list
Gretl-users(a)lists.wfu.edu
http://lists.wfu.edu/mailman/listinfo/gretl-users
End of Gretl-users Digest, Vol 110, Issue 16
********************************************
4 years, 11 months

new plot --tweaks option
by Allin Cottrell

This is a follow-up to the discussion started by Frederik Schaff at
http://lists.wfu.edu/pipermail/gretl-users/2016-March/011701.html
Frederik was asking, among other things, if we could generalize the
mechanism available for the "gnuplot" command, whereby you can add
extra gnuplot commands within a special string enclosed by "{" and
"}" -- for example, to customize frequency plots.
While I can see the case for this, I was a bit reluctant on the
grounds that the "{ ... }" mechanism is very much an ad hoc thing
and kind of an "unruly" element within hansl syntax.
I think I now have a better alternative, more consistent with modern
hansl syntax and capabilities. It's not yet documented, because I
want to leave space for discussion and possible improvements, but
here's the current status:
The commands "gnuplot", "boxplot", "scatters" and "freq" now have an
option --tweaks which requires as argument the name of an array of
strings. The strings in the array are inserted into the gnuplot
command file after the intial "boilerplate" lines but before the
"plot" command. Here's an illustration:
<hansl>
open data4-10
strings S = array(2)
S[1] = "set title 'My Preferred Title'"
S[2] = "set label 'Delaware' at 0.18,0.25"
gnuplot ENROLL CATHOL --tweaks=S --output=display
S[2] = "set yrange [0:0.5]"
freq ENROLL --silent --tweaks=S --plot=display
list X = CATHOL INCOME COLLEGE WHITE
S[1] = "set border 3"
S[2] = ""
scatters ENROLL ; X --tweaks=S --output=display
</hansl>
If we reckon this is worthwhile it could be generalized to all
commands that generate plots without too much difficulty. Note that
there's no need for the somewhat "fussy" syntax of wrapping in
braces and terminating gnuplot commands with semicolons.
Allin
4 years, 11 months

plot on screen
by Raul Gimeno

Dear all
I have the following script:
nulldata 100
series u = normal()
# just for comparability
u[1] = 0
series rwalk1 = cum(u)
series rwalk2 = 0
rwalk2 = rwalk2(-1) + u
# I want to visualize the graph on my screen. How should I proceed??
gnuplot rwalk1 rwalk2
#I stored the data in this file but I cannot display the data against time
like a time series. What should I do?
store random walk.gdt rwalk1 rwalk2
Thank you in advance
Raul
4 years, 11 months