Data messed up after 'append' with panel data
by Sven Schreiber
Hi,
this problem turned out to be easy to demonstrate, after it was
recognized and diagnosed:
First consider the workfile 'importcheck'. It is a 5 units by 5 periods
panel dataset, structured by the index variables 'ix' and 'tx'; the
existing values of 'ix' are 25, 27, 30, 35, 40. The only real variable
is called 'somedata' and has mostly missings.
The second file 'tobeimported' also has panel data identified by ix and
tx, but there is an additional ix=33 in there, so it's 6 units by 5 periods.
When you append the second file to the first, gretl says 'appended ok',
but in fact it does not honor the ix/tx-structure, such that the values
of the existing variable 'somedata' are moved around to different
observations. This is pretty bad, especially if you do not notice it
right away!
This is with today's snapshot on Windows, but must have existed before
the latest release.
thanks,
sven
10 years, 4 months
Need help to build gretl in CentOS 6.5
by Hélio Guilherme
Hi,
For sometime I did not update gretl files from CVS, and now I not able to
build.
I believe it was by changes regarding date/time functions.
Here is the output:
CC prescr.lo
CC seive.lo
LD libgretl-1.0.la
make[1]: Leaving directory `/home/helio/gretl/lib'
make -C cli
make[1]: Entering directory `/home/helio/gretl/cli'
CC gretlcli.o
CC complete.o
LD gretlcli
../lib/.libs/libgretl-1.0.so: undefined reference to `g_get_monotonic_time'
collect2: ld returned 1 exit status
make[1]: *** [gretlcli] Error 1
make[1]: Leaving directory `/home/helio/gretl/cli'
make: *** [cli] Error 2
---
Searching in Internet for g_get_monotonic_time, I see that it belongs in
GTK+, but even in GTK 2, is there.
Well, there is now a CentOS 7 released, maybe if I upgrade, this gets
solved.
Hélio
10 years, 4 months
omit in loops
by Sven Schreiber
Hi,
here's an example script:
<hansl>
open denmark
ols IDE const IBO LRM LRY
omit LRM LRY --auto
list tobeo = LRM LRY
list all = IBO IDE LRM LRY
loop foreach i IBO IDE
list rhs = all - $i
ols $i const rhs
omit tobeo --auto
endloop
</hansl>
After the first ols/omit command gretl prints out the restricted model.
In the final ols/omit command inside the loop, which is identical to the
first command, the test is done but the resulting model isn't printed.
Is this intended? (Given that 'omit' has '--quiet' and '--silent'
options, I would think not.)
thanks,
sven
10 years, 4 months
gnuplot in Windows build of gretl 1.9.91
by Allin Cottrell
Since I've heard from people who have been experimenting with the gnuplot
5.0 (rc1) build in recent Windows snapshots, here's a heads-up:
The Windows builds of gretl 1.9.91 (just released) do NOT include gnuplot
5.0. This is because gnulot 5.0 (CVS) currently has some bugs that we
don't want to foist on people. We have therefore dropped back to gnuplot
4.6.6 (that is, CVS on the 4.6 branch). This fixes some bugs in 4.6.5 and
does not, to our knowledge, contain new bugs.
No doubt gretl will transition to gnuplot 5.0 before long, but not yet.
Allin
10 years, 4 months
weird error with 'omit'
by Sven Schreiber
Hi,
I'm struggling with an error message after trying to do an 'omit' after
simple OLS. The message says (re-translated): "Can't do this: some vars
in original model have been redefined", and I traced this message back
to lib/src/gretl_list.c:2013.
There it says "Checks whether any variable in @list has been redefined
via gretl's %genr command since a previous model (identified by @ref_id)
was estimated." However, my script has the 'omit' right after the 'ols',
so how could that happen?
Also, changing some options (like --robust in the estimation, or --auto
in the omit command) or re-starting gretl sometimes seemed to work in
the sense that I got some omit tests, but then it wasn't and still isn't
reproducible. I also couldn't get the error with some example dataset,
sorry.
The sample here is an undated cross-section, coming from "slicing"
through a panel by restricting the sample to a single time period.
thanks,
sven
10 years, 4 months
Trivariate Probit
by David van Herick
Hello,
This is a "big" question, and I apologize in advance for the long message.
I'm new to this list, so I'm not sure if this is the right place to ask
about this.
I'm attempting to extend some of gretl's discrete choice models in my own
programming project (c, mingw, win32). One of the models I've been trying
to get working is trivariate probit (and hopefully eventually multivariate
probit) - I've adapted Alan Genz's matlab script for c (
http://www.math.wsu.edu/faculty/genz/software/matlab/tvnl.m) for
calculating trivariate normal cdfs (which matches his results), and I've
been using the code for gretl's bivariate model as a basis to attempt to
extend to three dimensions. In the bivariate case, there's a place in the
code (biprobit.c) where the first partials of the bivariate cdf are
computed (at least I'm pretty sure that's what d1 and d2 are):
ca = cosh(bp->arho);
sa = sinh(bp->arho);
u_ba = (ca*b - ssa*a);
u_ab = (ca*a - ssa*b);
d1 = exp(-0.5*a*a) * normal_cdf(u_ba) / (P * SQRT_2_PI);
d2 = exp(-0.5*b*b) * normal_cdf(u_ab) / (P * SQRT_2_PI);
After taking care of all the sign switches, I imagine the code for the
trivariate case is something along the lines of (but obviously not correct
since it's not working):
ca12 = cosh(tp->arho12);
sa12 = sinh(tp->arho12);
ca13 = cosh(tp->arho13);
sa13 = sinh(tp->arho13);
ca23 = cosh(tp->arho23);
sa23 = sinh(tp->arho23);
u_ba = (ca12*b - ssa12*a);
u_ab = (ca12*a - ssa12*b);
u_ca = (ca13*c - ssa13*a);
u_ac = (ca13*a - ssa13*c);
u_cb = (ca23*c - ssa23*b);
u_bc = (ca23*b - ssa23*c);
d1 = 2. * exp(-0.5*a*a) * normal_cdf(u_ba) * normal_cdf(u_ca) *
bvnorm_cdf(r23, u_ba, u_ca) / (P * SQRT_2_PI);
d2 = 2. * exp(-0.5*b*b) * normal_cdf(u_ab) * normal_cdf(u_cb) *
bvnorm_cdf(r13, u_ab, u_cb) / (P * SQRT_2_PI);
d3 = 2. * exp(-0.5*c*c) * normal_cdf(u_ac) * normal_cdf(u_bc) *
bvnorm_cdf(r12, u_ac, u_bc) / (P * SQRT_2_PI);
At this point, I'm just trying to follow patterns, though, and my knowledge
of derivatives of multivariate normal cdfs is somewhat limited.
Are there resources that give a more step-by-step derivation of the
derivatives, other than general calculus principle resources? And, given
what I've written above, does anyone know if I need a bivaraite PDF
somewhere in there?
Any help would be appreciated. My hope is that a discussion about this
might lead to this becoming a feature of gretl. I'm just trying to get
BFGS to work first, since there's less to go wrong. If I provide the
correct parameter estimates, the LL matches Limdep, so I think everything
is okay up through the calculation of the triviariate CDF, and it *may*
just be a matter of getting the right derivatives.
Thanks,
David
10 years, 4 months
small discrepancy after porting to js
by Al
Hello everybody and thanks for your work on gretl.
I am experimenting in porting parts of libgretl to javascript via
emscripten. After a couple of afternoons i have been able to "compile" to
javascript some unit root tests, mostly thanks to some kind soul who did
the same for GMP and mpfr and posted their work to github.
My first intent was to verify if there are differences in the output from
the C and JS versions, and the only one I could find is this, in adf_test()
:
diff OUTPUT_FROM_C.txt OUTPUT_FROM_JS
59c59
< lagged differences: F(3, 5) = 0.395 [0.7626]
---
> lagged differences: F(3, 5) = 0.344 [0.7954]
80c80
< lagged differences: F(3, 4) = 20.327 [0.0070]
---
> lagged differences: F(3, 4) = 1.297 [0.3904]
(all other results, pvalues, statistics and values were the same btw)
The results were created using the dataset generated in simple_client.c ;
the only relevant change I've made is stitching some plugin code in the
main code in order to avoid using dlopen() (which didnt work well in
emscripten). I then ran adf_test() and kpss_test() on the same dataset.
I was wondering if you had any insights into this small discrepancy; are
the lagged differences computed using GMP or lapack? I am thinking it is a
CLAPACK+emscripten+different architecture issue.
Output for both versions is attached.
10 years, 4 months
Posible issue with jsonget()
by Logan Kelly
Hello
The following does not work, and I cannot figure out why
OS = WIN 7 64 bit
gretl = cvs build date 2014-07-22
sprintf json "{\"status\":\"REQUEST_SUCCEEDED\",\"responseTime\":1103,\"message\":[\"No Data Available for Series LEU0254555900 Year: 1950\",\"No Data Available for Series LEU0254555900 Year: 1951\",\"No Data Available for Series LEU0254555900 Year: 1952\"],\"Results\":{\"series\":[{\"seriesID\":\"LEU0254555900\",\"data\":[]}]}}"
printf "%s\n", json
test = jsonget(json, "$.message")
printf "test = \n %s", test
When I use http://jsonpath.curiousconcept.com/ to test the path "$.message" it works fine. Note that to past the json string into the pathfinder tool use this string:
{"status":"REQUEST_SUCCEEDED","responseTime":1103,"message":["No Data Available for Series LEU0254555900 Year: 1950","No Data Available for Series LEU0254555900 Year: 1951","No Data Available for Series LEU0254555900 Year: 1952"],"Results":{"series":[{"seriesID":"LEU0254555900","data":[]}]}}
Thanks
10 years, 4 months
quantreg and lad
by Sven Schreiber
Hi,
I'm playing around with gretl's quantile regression stuff (for the first
time AFAIR). Inevitably some questions are coming up:
- Since 'quantreg' is a generalization of 'lad', it's odd that the
latter doesn't have the --robust option, while the former does. Of
course I understand why, historically, but perhaps 'lad' should be
transformed into an alias for 'quantreg 0.5'? Or at least 'lad ...
--robust' into 'quantreg 0.5 ... --robust', with a warning message.
Internally, are the algorithms for lad and 'quantreg 0.5' different?
- I get an error about a missing value which is correct, but aren't the
built-in commands supposed to handle (i.e. discard) missings automatically?
- not a question: it feels very fast!
- I can see the OLS error band in the graph here -- but not in the
example in the user manual! (figs 33.1 and 33.2). And BTW, how do I get
these nice graphs as a command/function in a script? (I mean, I know how
to construct those manually, but I mean with a short post-estimation
command.)
thanks,
sven
10 years, 4 months
Robust cov in between regression?
by Sven Schreiber
Hello again,
forgive me if this is a stupid question, but why are robust covariance
matrix estimations not supported for a panel 'between' regression? Since
this is just cross-section OLS it should be easy. Or am I missing something?
thanks,
sven
10 years, 4 months