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
5 years, 11 months
diagonal matrix created from the row or column vector in GRETL
by Antonio Di Paolo
Dear GRETL users,
I would like to create a diagonal matrix M created from a vector V, that is I have a vector of dimension “n” and I would like to obtain an nXn matrix with the elements of the vector V in the main diagonal of the matrix X (which contains zeros outside the main diagonal).
This can be done in Stata with the “diag” command or in Eviews with the “@makediagonal” command, but I’m still unable to find the same command in GRETL.
Any suggestion? Thanks in advance.
Best,
Antonio
Aquest correu electrònic i els annexos poden contenir informació confidencial o protegida legalment i està adreçat exclusivament a la persona o entitat destinatària. Si no sou el destinatari final o la persona encarregada de rebre’l, no esteu autoritzat a llegir-lo, retenir-lo, modificar-lo, distribuir-lo, copiar-lo ni a revelar-ne el contingut. Si heu rebut aquest correu electrònic per error, us preguem que n’informeu al remitent i que elimineu del sistema el missatge i el material annex que pugui contenir. Gràcies per la vostra col·laboració.
Este correo electrónico y sus anexos pueden contener información confidencial o legalmente protegida y está exclusivamente dirigido a la persona o entidad destinataria. Si usted no es el destinatario final o la persona encargada de recibirlo, no está autorizado a leerlo, retenerlo, modificarlo, distribuirlo, copiarlo ni a revelar su contenido. Si ha recibido este mensaje electrónico por error, le rogamos que informe al remitente y elimine del sistema el mensaje y el material anexo que pueda contener. Gracias por su colaboración.
This email message and any documents attached to it may contain confidential or legally protected material and are intended solely for the use of the individual or organization to whom they are addressed. We remind you that if you are not the intended recipient of this email message or the person responsible for processing it, then you are not authorized to read, save, modify, send, copy or disclose any of its contents. If you have received this email message by mistake, we kindly ask you to inform the sender of this and to eliminate both the message and any attachments it carries from your account. Thank you for your collaboration.
7 years, 4 months
What happened to Gretl english version?
by PJoshi
Hello, I am wondering whatever happened to the English version of Gretl (for MacOS)? The distributions available on the greets home page seem to be both german (de)?
Thanks for the help in advance,
PJ.
7 years, 4 months
Re: [Gretl-users] Installation question
by Alecos Papadopoulos
I run Windows-7 64bit.
I installed the 2017a Gretl build.
I went for other reasons to the "uninstall software: facility of the
computer. I noticed that in the facility's list, appeared to exist two
gretl versions, the one being what I had just installed and another
saying "Gretl version 2016c" if I recall correctly, and of smaller size
(around 72MB I think).
I thought the latter was a left-over from the past and I uninstalled it.
Then, while the Gretl 2017a icon still appeared in the "uninstall
software" facility list, Gretl has disappeared from the Programs menu
and all Gretl files I have created were no longer recognized.
I re-installed the current build and everything returned to normal. No
second Gretl icon appeared.
This is technical but I guess it may be of some value for users like me
to know (and so not worry about, just re-install) why this temporary
"incapacitation" of the Gretl software may have happened, when an older
version got erased from the computer.
--
Alecos Papadopoulos
PhD Candidate
Athens University of Economics and Business, Greece
School of Economic Sciences
Department of Economics
https://alecospapadopoulos.wordpress.com/
7 years, 4 months
gnuplot in gretl 2017a
by Allin Cottrell
Question for those using gretl 2017a on 32-bit Windows (well, maybe
64-bit too): anyone having trouble with graphs not being produced?
I'm particularly interested in the case where a Windows username
contains non-ASCII characters. I thought we'd fixed the encoding
problem associated with that (bug 204) but now it seems to have come
up again (bug 206).
Allin Cottrell
7 years, 4 months
Some small issues with gnuplot
by Artur Tarassow
Dear all,
I am experiencing some minor issues when trying to plot things.
Actually, I am not sure whether these are problems related to gnuplot or
to gretl.
First, I really like the new "--font=fontspec" option; thanks again for
implementing this. I wrote a small function for plotting vectors which
allows the user to set a bunch of different options. You can find the
function at the bottom
I ran the following 5 scenarios of which only scenario 1 works as intended.
First there seems to be a problem with the ""literal set mono" option
which rules out controlling the line width under both the "display" and
"pdf" output.
Second, when the output format is pdf, I also can't control the font
size; irrespective of the dashed and monochrome options.
Thanks for help and Happy Easter!
Artur
<hansl>
# Example
clear
set verbose off
open denmark.gdt -q
mat = {LRM}~{LRY}
string fname="display"
string title = ""
string xlab = ""
string ylab = ""
timedim = 1
dashed = 1
single = 0
fonts = 25
leg = 0
psleg = 0
lw = 5
ps = 0.5
pival = 0
ymin = -999
ymax = -999
# 1) Dashed and colored, png: works fine
mono = 0
matlineplot (mat,fname,title,xlab,ylab,timedim, \
dashed,mono,single,fonts,leg,psleg,lw, \
ps,pival,ymin,ymax)
# 2) Dashed and mono, png: line width not correct
mono=1
matlineplot (mat,fname,title,xlab,ylab,timedim, \
dashed,mono,single,fonts,leg,psleg,lw, \
ps,pival,ymin,ymax)
# 3) Solid and colored, pdf: font size not correct
dashed = 0
mono=0
string fname="out3.pdf"
matlineplot (mat,fname,title,xlab,ylab,timedim, \
dashed,mono,single,fonts,leg,psleg,lw, \
ps,pival,ymin,ymax)
# 4) Dashed and colored, pdf: font size not correct
mono=0
string fname="out1.pdf"
matlineplot (mat,fname,title,xlab,ylab,timedim, \
dashed,mono,single,fonts,leg,psleg,lw, \
ps,pival,ymin,ymax)
# 5) Dashed and mono, pdf: font size not correct
mono=1
string fname="out2.pdf"
matlineplot (mat,fname,title,xlab,ylab,timedim, \
dashed,mono,single,fonts,leg,psleg,lw, \
ps,pival,ymin,ymax)
</hansl>
<hansl-fun>
function void matlineplot (matrix mplot,
string fname, string title, string xlab, string ylab,
int timedim "0=NO-->last col =x-axis, 1=YES",
int dashed[0:1:0] "Dashed lines: 0=NO, 1=YES",
int mono[0:1:0] "Monochrome: 0=No, 1=YES",
int singleyaxis[0:1:0] "Single y-axis: 0=no, 1=yes",
int fontsize "Set font size in pt",
int legend [0:1:1] "0=off, 1=on",
int poslegend "Legend position",
scalar lw "linewidth",
scalar ps "point size",
int pival[0::4] "Point interval",
scalar ymin "Min. y-value or -999", scalar ymax "Max. y-value or
-999")
# Inspired by http://www.gnuplotting.org/attractive-plots/
sprintf PS "%.2f", ps
sprintf LW "%.2f", lw
sprintf PIV "%d", pival
if legend==0
sprintf strLEG "set nokey"
else
if poslegend == 0
string strLEG = "set key outside below"
elif poslegend == 1
string strLEG = "set key top left"
elif poslegend == 2
string strLEG = "set key top right"
elif poslegend == 3
string strLEG = "set key bottom left"
elif poslegend == 4
string strLEG = "set key bottom right"
endif
endif
if timedim==0
string optts = ""
else
string optts = "time-series"
endif
if dashed==0
string optdash = ""
else
string optdash = "literal set for [i=1:5] linetype i dashtype i"
endif
if mono==0
string optmono = ""
else
string optmono = "literal set mono"
endif
if singleyaxis==0
string syax = ""
else
string syax = "single-yaxis"
endif
sprintf optfs "font=\"sans,%d\"", fontsize
if ymin!=-999 && ymax!=-999
sprintf syrange "set yrange[%.5f:%.5f] \n", ymin, ymax
elif ymin!=-999 && ymax==-999
sprintf syrange "set yrange[%.5f:] \n", ymin
elif ymin==-999 && ymax!=-999
sprintf syrange "set yrange[:%.5f] \n", ymax
else
sprintf syrange "set yrange[:] \n"
endif
plot mplot
options with-lp @optts @syax @optfs
#printf "set term pdfcairo lw %.2f", lw
literal @strLEG # Legend options
@optdash
@optmono
literal set title "@title"
literal set xlabel "@xlab" offset 0,1 # Move xlabel closer to
the x-axis
literal set ylabel "@ylab"
literal set y2tics
literal set xtics out offset 0,0.7 # Move xtics cloer to the
x-axis
literal set ytics out
literal @syrange
#2) put the border more to the background by applying it
# only on the left and bottom part and put it and the tics in gray
literal set style line 11 lc rgb "#808080" lt 1
literal set border 3 back ls 11 # get rid of upper + left border
literal set tics nomirror
#add a slight grid to make it easier to follow the exact
position of the curves
literal set style line 12 lc rgb "#808080" lt 0 lw 1 # light
grey color
literal set grid back ls 12
# Line Styles
literal set linetype 1 lc rgb "black" pt 5 ps @PS lw @LW
pointinterval @PIV # --- blue
literal set linetype 2 lc rgb "cyan" pt 7 ps @PS lw @LW
pointinterval @PIV # --- grey
literal set linetype 3 lc rgb "red" pt 3 ps @PS lw @LW
pointinterval @PIV # --- blue
literal set linetype 4 lc rgb "#0000ff" pt 1 ps @PS lw @LW
pointinterval @PIV # --- red
literal set linetype 5 lc rgb "#5e9c36" pt 2 ps @PS lw @LW
pointinterval @PIV # --- green
literal set linetype 6 lc rgb "grey" pt 2 ps @PS lw @LW
pointinterval @PIV # --- green
end plot --output="@fname"
end function
</hansl-fun>
7 years, 4 months
Lags (or not) of restricted terms in VECM/coint2
by Sven Schreiber
Hi,
I cannot find the answer in the docs whether restricted exogenous terms
in the 'vecm' or 'coint2' commands are included with a lag or as-is.
This concerns the "rxlist" or "zlist" arguments to the commands.
I remember some discussion about it years ago on one of the lists (users
or devel), but I cannot find it in a web search. (And because I do not
agree to google's non-privacy policy, I cannot directly search in the
mailing list search interface which is powered by google.)
Obviously, for the standard and automatically included deterministic
terms like a constant or a trend it doesn't matter, but for others it does.
It would be helpful if that info could be added to the docs.
Thanks and happy Easter,
Sven
7 years, 4 months
MPI: connecting multiple PC via LAN
by Artur Tarassow
Dear gretl users,
I have a three laptops (some of them are about 5 years old but have fast
CPUs implemented) and a desktop computer available, and was thinking to
set up a small-scale cluster.
It seems to me that the MPI interface which gretl supports is just
designed for such a task. Is this correct? Does anybody have some
experience with it?
Best,
Artur
7 years, 4 months