colors in .eps
by Ignacio Diaz-Emparanza
Two small questions on graphs (Not very important and not urgent at all):
Using gretl on Linux, if I draw a time series graph with two series, with the
default options, I can see on the screen the first series in red and the
second in blue, but if I click on the graph and select "save as EPS/color"
the second series is in a light green. I am trying to import some graphs to a
pdf presentation and the green color does not allow to apreciate well the
second series. Allin, could you change it to blue or do it respect the user
color selections? Thank you.
The second question is about the thickness of the graph lines. They appear
quite good at the screen but when I print a graph in a paper I think they are
too thin, and if I have to scale down the graph the lines are even thinner.
Could you look if there is a (non very problematic) way to improve this?
(I remember in R there is an option to scale up the thickness of the graphs
if you want to scale down the graph.)
--
Ignacio Diaz-Emparanza
DEPARTAMENTO DE ECONOMÍA APLICADA III (ECONOMETRÍA Y ESTADÍSTICA)
UPV/EHU
Avda. Lehendakari Aguirre, 83 | 48015 BILBAO
T.: +34 946013732 | F.: +34 946013754
www.et.bs.ehu.es
17 years
Bugs, missing features and a suggestion
by andreas.rosenblad@ltv.se
I don't know if this is a bug or a missing feature, but as the following
output tells, one can use the boolean expression X = 1 but not the combined
expression X = 1 & Y = 2 for matrices.
? X = ones(5,1)
Generated matrix X
? Y = X + 1
Generated matrix Y
? Z = (X = 1)
Generated matrix Z
? Z = (X = 1 & Y = 2)
Data types not conformable for operation
This is on Windows XP using version 1.6.6pre1 build date 09/18/2007
If it is a missing feature, please do implement it, so that the the
combined expression X = 1 & Y = 2 can be used for matrices
A second bug or missing feature: I want to initiate a matrix with missing
values, where some cells with missing values will later be replaced with
non-missing values. I got the following result when trying to initiate a
matrix with missing values:
? A = {NA, NA; NA, NA}
Generated matrix A
? A
A (2 x 2)
1.7977e+308 1.7977e+308
1.7977e+308 1.7977e+308
Third, I have a few feature requests:
1. It should be possible to use the xtab command with nx1 matrices, i.e.
the inputs are matrix vectors
2. The xtab command should be able to take a nxn matrix with discrete
values as input an calculate a cross table from this, where this matrix is
the inner square matrix of the cross table (i.e. the cross table except the
marginals)
3. After calculating a cross classification table from View > Cross
Tabulation in the GUI, one gets the possibility to save the output table as
a matrix. This feature should be available also from the command line
interface.
4. The parameterts of a function can currently be of six types: bool, int,
scalar, series, list, matrix. Please include a third type "discrete" or
"disc" for a discrete data series
5. Create a new boolean command isdiscrete() to check if a series or matrix
contains only discrete values, with outputs 1 if it is discrete and 0
otherwise.
Fourth, I have a suggestion and possibly feature request: To check that a
variable is discrete, accoriding to the User's Guide gretl currently checks
that all values are integer multiples of 0.25 and that the variable takes
on a “fairly small” set of distinct values, where “fairly small” is defined
as less than or equal to 8. Would it possible to use a more exact method?
For example, I use
if sum(foo-int(foo))=0
discrete foo
endif
Best regards and thanks for a great software,
Andreas
17 years
Re: Re: [Gretl-devel] Bugs, missing features and a suggestion
by andreas.rosenblad@ltv.se
r.lucchetti(a)univpm.it @ INTERNET skrev 2007-09-25 15:10:06 :
> On Tue, 25 Sep 2007, andreas.rosenblad(a)ltv.se wrote:
>
> > Third, I have a few feature requests:
> >
> > 1. It should be possible to use the xtab command with nx1 matrices,
i.e.
> > the inputs are matrix vectors
>
> matrix->series conversion is not that hard; are you sure you need this
> badly?
Well, currently I have to do as follows:
a = rows(A)
smpl 1 a
series Anew = A
series Bnew = B
xtab Anew Bnew
delete Anew bnew
smpl --full
Thus, I have to use 7 commands. Instead I would like to use just one
command:
xtab A B
It would be much easier and efficient, having to write less code. So I
would really appreciate it.
> > 2. The xtab command should be able to take a nxn matrix with discrete
> > values as input an calculate a cross table from this, where this matrix
is
> > the inner square matrix of the cross table (i.e. the cross table except
the
> > marginals)
>
> I'm afraid this is not very clear to me. What is the input, exactly? By
my
> possibly wrong impression, however, it looks like you can get this by
> using sumc(), sumr() and the concatenation operators "~" and "|".
For a matrix C = {3,2;2,3} gretl currently give the following output:
? C
C (2 x 2)
3 2
2 3
What I am asking for is following output
? xtab C
[ 1][ 2] TOT.
[ 1] 3 2 5
[ 2] 2 3 5
TOTAL 5 5 10
I need this function mainly for producing nice outputs with column and row
headings, and I thought this would be the easiest way to implement it.
A better solution, that better suits my needs, but maybe is harder to
implement, is to create a new "printtable" command that attaches column and
row names to a matrix (something like the dimnames argument in the matrix
command in R) as well as row and column headings.
Ideally, a command "printtable" would produce something like:
A = {3, 2, 5; 2, 3, 5; 5, 5, 10}
printtable A rownames={"row 1", "row2", "Total"} columnnames={"col 1", "col
2", "Total"} \
columnheading="Variable 1" rowheading="Variable 2"
And then with this input give the following output:
Variable 1
col 1 col 2 Total
row 1 3 2 5
Variable 2 row 2 2 3 5
Total 5 5 10
Would this be possible to implement in gretl?
> > 3. After calculating a cross classification table from View > Cross
> > Tabulation in the GUI, one gets the possibility to save the output
table as
> > a matrix. This feature should be available also from the command line
> > interface.
>
> This is exactly what the mxtab function is for. Am I missing something?
I'm sorry, I couldn't find anytning about that function in the Gretl
Command Reference, the Gretl User's Guide or the help files.
> > 4. The parameterts of a function can currently be of six types: bool,
int,
> > scalar, series, list, matrix. Please include a third type "discrete" or
> > "disc" for a discrete data series
> >
> > 5. Create a new boolean command isdiscrete() to check if a series or
matrix
> > contains only discrete values, with outputs 1 if it is discrete and 0
> > otherwise.
>
> This is doable quite easily and certainly useful. The availability of
such
> function, though, would probably make your item 4 redundant, wouldn't it?
Maybe.
Best regards,
Andreas
17 years
Ang. Re: [Gretl-devel] Bugs, missing features and a suggestion
by andreas.rosenblad@ltv.se
svetosch(a)gmx.net @ INTERNET skrev 2007-09-25 14:02:40 :
> andreas.rosenblad(a)ltv.se schrieb:
>
> >
> > If it is a missing feature, please do implement it, so that the the
> > combined expression X = 1 & Y = 2 can be used for matrices
>
> I'm not against that feature, but note that you can do for example
> ((x=1).*(y=2) = 1), or ((x=1)+(y=2) = 2).
Yes, but it is more cumbersome and less intuitive. Especially since X = 1 &
Y = 2 is allowed for scalars and data series, it should also be allowed for
matrices.
> > A second bug or missing feature: I want to initiate a matrix with
missing
> > values, where some cells with missing values will later be replaced
with
> > non-missing values. I got the following result when trying to initiate
a
> > matrix with missing values:
> >
> > ? A = {NA, NA; NA, NA}
> > Generated matrix A
> > ? A
> > A (2 x 2)
> >
> > 1.7977e+308 1.7977e+308
> > 1.7977e+308 1.7977e+308
>
> This may actually be correct, according to floating point representation
> of NAs (not 100% sure out of my head). Maybe it should be printed
> differently, however.
I think it would be better if it was printed
NA NA
NA NA
> > For example, I use
> >
> > if sum(foo-int(foo))=0
> > discrete foo
> > endif
>
> I don't understand; for example how would a discrete series with 0.5,
> -0.5, 0.5, .... turn out as discrete with your formula?
You are absolutely right. My fault. I am only using discrete series with
positive integers, and for these my formula works.
Andreas
17 years
major gmm bug
by Sven Schreiber
(Again, latest snapshot on windows.)
When I run the script below the first time (on a freshly started gretl)
it doesn't converge, and gretl tells me so. Fine.
(BTW, how can a user change the convergence criterion here, nls_toler
doesn't seem to apply?)
But when I run it again and again (silly I know), on the 3rd or 4th
attempt gretl crashes!
Is it leaking memory or what is it? If you need it of course I can also
send the datafile.
thanks,
sven
----------------------
#set nls_toler 1e-8
scalar c1 = 1
scalar c2 = 1
scalar c3 = 1
scalar c4 = 1
scalar c10 = 1
series pisquare = ld_pbar^2
series dur = diff(ur_sa)
series dip = diff(ip_sa)
series dffr = diff(ffr)
series dtbill3 = diff(tbill3)
list myinstr = const ld_pbar(-1) ld_pbar(-2) pisquare(-1) pisquare(-2)
dur(-1) dip(-1) dffr(-1) dtbill3(-1)
matrix matinstr = { myinstr }
series myres = 0
matrix W = inv(matinstr'matinstr)
gmm
series myres = -(-rpiv + c10 + c1*rpiv(-1) + c2*(ld_pbar -
c3*ld_pbar(-1) - c4)^2)
orthog myres ; matinstr
weights W
params c1 c2 c3 c4 c10
end gmm
17 years
minor gmm bug
by Sven Schreiber
(This is w/ the latest snapshot on windows, but also 1.6.5 I think.)
With a gmm script, after getting a correct error message due to a
mis-sized weighting matrix, it's not possible to run the script even
with a corrected weighting matrix anymore (a restart of gretl is
necessary), because gretl always complains that "orthogonality
conditions must come before the weights".
As I said, restarting cures this -- actually the behavior is similar to
a past bug with function packages, where a previous error message
screwed things up until a restart.
-sven
17 years
Cumbersome to enter new data
by andreas.rosenblad@ltv.se
It is quite cumbersome to create a new data set i gretl. In the edit data
window, when I insert a value in a column and press Enter, Down arrow or
Tab to come to the next row, I cannot enter a new value directly, but have
to press Enter first, before I can enter a new value.
Instead I would like to ba able to insert a new value directly, without
having to press Enter first each time. It would make it easier and faster
to enter new data.
Also, there is no possibility, when using the edit data window, to delete
an observation from the data set. I would find such a function useful.
Andreas
17 years
Ang. Re: [Gretl-devel] Cumbersome to enter new data
by andreas.rosenblad@ltv.se
cottrell(a)wfu.edu @ INTERNET skrev 2007-09-18 15:46:26 :
> On Tue, 18 Sep 2007, andreas.rosenblad(a)ltv.se wrote:
>
> > It is quite cumbersome to create a new data set i gretl. In the >
> edit data window, when I insert a value in a column and press >
> Enter, Down arrow or Tab to come to the next row, I cannot enter > a
> new value directly, but have to press Enter first, before I > can
> enter a new value.
>
> Hmm, this is on Windows?
Yes.
Andreas
17 years
Ang. Re: [Gretl-devel] Cumbersome to enter new data
by andreas.rosenblad@ltv.se
cottrell(a)wfu.edu @ INTERNET skrev 2007-09-18 15:46:26 :
> > Also, there is no possibility, when using the edit data window, >
> to delete an observation from the data set. I would find such a >
> function useful.
>
> You mean, to delete an entire observation row?
Yes.
Andreas
17 years
VECM restrictions and scaling
by Allin Cottrell
I've now implemented an algorithm for removing then replacing
scale factors in a set of VECM restrictions. (Thanks, Sven, for
the pointers.) Testing so far shows a big improvement in
performance, and the problems of initialization mentioned in my
document from August seem to be solved.
I'll set out the algorithm in detail so people can spot any
problems and suggest improvements.
First, we scan the matrices R and q (as in R*vec(beta) = q),
looking for rows that satisfy this criterion:
* There's exactly one non-zero entry, r_{ij}, in the given row of
R, and the corresponding q_i is non-zero.
For each such row we record the coordinates i and j and the
implied value of the associated beta element, v_j = q_i/r_{ij}.
Based on j we determine the associated column of the beta matrix:
k = j / p_1, where p_1 is the number of rows in beta (and '/'
indicates truncated integer division).
We then ask: Is row i the first such row pertaining to column k of
beta? If so, we flag this row (which I'll call a scaling row) for
removal. If not, we flag it for replacement with a homogeneous
restriction. For example, suppose we find two rows of R that
correspond to
b[2,1] = 1
b[2,3] = -1
We'll remove the first row, and replace the second with
b[2,1] + b[2,3] = 0
In general, the replacement R row is all zeros apart from a 1 in
column j0 and the value x in column j1, where
* j0 is the non-zero column in the scaling row pertaining to
column k of beta;
* j1 is the non-zero column in the row of R to be replaced; and
* x = -v_{j0} / v_{j1}
We then do the maximization using the switching algorithm. Once
that's done, but before computing the variance of the estimates,
we re-scale beta and alpha using the saved information from the
scaling rows.
For each column, k, of beta, if there's an associated scale factor
v_j (as defined above; strictly speaking, v_{j0}):
* Construct the value s_k = b_j / v_j, where b_j is the jth
element of the estimated vec(beta).
* Divide each non-zero element of the beta column by s_k; multiply
each non-zero element of column k of alpha by s_k.
We then recompute the relevant blocks of the observed information
matrix using the rescaled beta and alpha, and I think the variance
comes out right.
This is in CVS and the current Windows snapshot.
Note that the scaling business is _not_ done in case (a) the user
supplies a set of initial values ("set initvals") or (b) the user
specifies using LBFGS rather than switching.
Allin.
17 years