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
6 years, 1 month
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
8 years, 1 month
declare a list to a bundle
by Artur T.
Hi all,
I would like to declare a list "z" to a bundle "b" but I am surprised to
see that this doesn't seem to work:
<gretl>
open denmark.gdt --quiet
bundle b = null
list z = const LRM
b.z = z
</gretl>
Message: "The variable b is of type bundle, not acceptable in context"
Is this actually intended? Also, is there in alternative how to handle
this (I disregard the possibility to define a matrix which could be send
to "b" for the moment).
Best,
Artur
8 years, 2 months
MLE Advanced
by Mario Florez Porras
Anyone know how it is calculated the covariance matrix?
On User's Guide says is the multiplication of the gradients, and raised to
-1:
[image: Imágenes integradas 1]
But it is'nt worked.
Thank you.
8 years, 2 months
MLE Advanced
by Mario Florez Porras
Hello,dear Gretl Community.
I'm doing a nonlinear estimation via the maximum likelihood method. I want
to do a batch processing of data but in some cases the estimation don't
satisfise tolerance (1,81899e-012), don't met the convergence criterion.
Does anyone knows how it is calculated whether or not the model meets
tolerance?
An estimation that don't met tolerance;
[image: Imágenes integradas 1]
An estimation that met tolerance;
[image: Imágenes integradas 2]
[image: Imágenes integradas 3]
Suggestion: I think it's calculated by adding up logslikelihood or
gradients. But I do both and don't coincided with tolerance.
Another question, How can I save automatically results?
Beforehand, thank you for any help.
Mario Alberto Flórez Porras
Student of Industrial Engineering
8 years, 3 months
Panel plot in a loop
by cociuba mihai
I'm interested to know if there are any possibilities to generate panel
plots from a script, or to retrieve the mean of the selected series.
Also the panel plot command doesn't appear in the command log.
<HANSEL>
open abdata.gdt
summary
#there are some missing observation
smpl full
smpl YEAR>1978 --restrict
smpl YEAR<1983 --restrict
summary
#no missing observation
# for every industry in which the company operates do a panel plot for wage
#pseudo-code
loop i=1..8
smpl full
smpl IND=$i --restrict
summary WAGE --simple
# select WAGE, right click select panel plot/group means
#is it posibile to generate a panel plot in a loop
# or at least to retrive the information wich is used ( the mean of the
series for every year???
endloop
<HANSEL>
Best,
Mihai
8 years, 3 months
Forecasts of a restricted model
by Henrique Andrade
Dear Gretl Community,
Does anyone know how to retrieve the forecasts of a restricted OLS
model? Please take a look at the following code:
<code>
open australia.gdt
"non restricted" <- ols E const PAU PUS
fcast non_restricted
restrict
b[2] = 1
end restrict
fcast restricted
</code>
The series "non_restricted" and "restricted" are identical.
Best,
Henrique Andrade
8 years, 3 months
installing data sets on Macs
by Summers, Peter
Hi all,
I'm hoping one or more of you Mac-users out there can give me a quick step-by-step guide to installing the textbook data sets on a Mac. A couple of my students have asked about it, and since I haven't used a Mac since about 1986, I'm not much help.
Thanks in advance,
PS
Sent from my iPad
8 years, 3 months
about arrays as argument of yahoo_get
by guido giaume
Dear all
I spent some time before i realized the position of a declaration of
array as argument of a function seems to be very critical.
I mean that this following script is NOT working "as is", but if i
change the position of the declaration it works.
-----------------------------------------------------
#ARRAY DECLARATION far from yahoo_get
strings P = defarray("A2A.MI", "ANIM.MI")
# OPEN SET 10 DAYS
nulldata 10
# TIME SERIES
setobs 5 2016-07-01 --time-series
# CALL yahoo_get
include yahoo_get.gfn
######## QUESTION ITEM
######## strings P = defarray("A2A.MI", "ANIM.MI")
#DOWNLOAD LOOP
loop i=1..nelem(P)
A=yahoo_full(P[i])
endloop
------------------------------------------------------------
you easily can verify the script isn't working
BUT
if I put the array declaration near the yahoo_get the script works.
-----------------------------------------------------
######## cut off
the previous declaration
######## strings P = defarray("A2A.MI",
"ANIM.MI")
# OPEN SET 10 DAYS
nulldata 10
# TIME SERIES
setobs 5 2016-07-01 --time-series
# CALL yahoo_get
include yahoo_get.gfn
#ARRAY DECLARATION near yahoo_get
strings P = defarray("A2A.MI", "ANIM.MI")
loop i=1..nelem(P)
A=yahoo_full(P[i])
endloop
------------------------------------------------------------
now it works.
So maybe it's a trivial subjetc but i will appreciate some help to understand why it happens.
Cheers
Guido
8 years, 3 months
using "catch" with "include"
by Artur T.
Hey all,
I am writing a package "A" which makes use of another external gretl
package "B". At some stage I need to load "B" via "include B.gfn".
However, I would like to check first whether B.gfn is already installed
on the machine. If not I want to conduct the "install B.gfn" command.
The problem is that "catch include B.gfn" doesn't seem to work
currently. Is there any way to realize this?
Best,
Artur
8 years, 3 months