force two y-axes in gnuplot
by Sven Schreiber
Hi,
the common problem (with known solution) is to tell gnuplot to use only
a single y-axis.
But now (and amazingly for the first time in all those years,
apparently) I have the opposite problem: I want to distribute the
plotted lines to two separate y-axes, but gnuplot (or rather its gretl
interface) won't let me do it. What can I do?
thanks,
sven
9 years, 3 months
Package getQuandl
by Carlos Andrade
Hi all,
Dear list members, how to download databases using package getQuandl?
--
Atenciosamente,
Prof. Carlos A. S. de Andrade
LAPEA - Laboratório de Pesquisa em Economia Aplicada e Engenharia de
Produção
Universidade Federal de Campina Grande.
Centro de Humanidades
Unidade Acadêmica de Economia
9 years, 3 months
Re: [Gretl-users] Package getQuandl
by Dr. Logan Kelly
The FRED database is another example of a database requiring https
Thanks for your quick response and hard work.
Cheers Logan
Sent from my T-Mobile 4G LTE Device
-------- Original message --------
From: Allin Cottrell <cottrell(a)wfu.edu>
Date: 2015/09/09 9:20 AM (GMT-06:00)
To: Gretl list <gretl-users(a)lists.wfu.edu>
Subject: Re: [Gretl-users] Package getQuandl
On Mon, 7 Sep 2015, Allin Cottrell wrote:
> The bottom line is that Quandl data access via gretl on Windows is
> not going to work until we rebuild libcurl. However, I find that it
> works fine on Linux using libcurl 7.44.0.
In the current Windows snapshots there's a new build of libcurl with
SSL support. So downloading from quandl now works. This will be in
gretl 1.10.2, which should be out in a day or two.
I thought this was worth doing not just because of quandl; the thing
is that many data sites seem to be going over to the https protocol.
Allin
_______________________________________________
Gretl-users mailing list
Gretl-users(a)lists.wfu.edu
http://lists.wfu.edu/mailman/listinfo/gretl-users
9 years, 3 months
Re: [Gretl-users] Maximum Likelihood estimation of Linear Probability specification (Binary Choice model)
by Alecos Papadopoulos
Jack,
thanks for the suggestions, but I may have been wasting your time (I
apologize). Why? Because "suddenly", the following simple script (assume
variables have been generated previously, and ols estimation has been run)
<hansl>
matrix b = $coeff
list X = const Bet E B
function series unifll(series Ybin, list X, matrix b)
series ndx = lincomb(X, b)
series liky = Ybin ? ln(ndx) : ln(1-ndx)
return liky
end function
catch mle logl = unifll(Ybin, X, b)
params b
end mle
</hansl>
returns in the output window a series of
<<Warning: log: Domain error>>
messages
but below them the mle estimation results! (and very sensible estimates
too). So it appears the mle command does "insist" on samples with non
admissible values without any help from "if" statements, at least when
the log-likelihood is embedded into a user-defined function.
I don't know what was happening before, evidently some silly mistake of
mine.
Thanks again.
Alecos Papadopoulos
PhD Candidate
Athens University of Economics and Business, Greece
Department of Economics
https://alecospapadopoulos.wordpress.com/
On 7/9/2015 12:15, gretl-users-request(a)lists.wfu.edu wrote:
> Message: 5
> Date: Mon, 7 Sep 2015 11:15:23 +0200 (CEST)
> From: "Riccardo (Jack) Lucchetti"<r.lucchetti(a)univpm.it>
> To: Gretl list<gretl-users(a)lists.wfu.edu>
> Subject: Re: [Gretl-users] Maximum Likelihood estimation of Linear
> Probability specification (Binary Choice model)
> Message-ID:<alpine.DEB.2.20.1509071045130.8887(a)ec-4.econ.univpm.it>
> Content-Type: text/plain; charset="iso-8859-15"; Format="flowed"
>
> On Mon, 7 Sep 2015, Alecos Papadopoulos wrote:
>
>> >I need to estimate a "Linear Probability" Specification in a Binary Choice
>> >model, using specifically maximum likelihood estimation.
>> >The log-likelihood of such a specification is
>> >
>> >loglik = y*log(x.*b) + (1-y)*(1-x.*b)
>> >
>> >where y is the scalar DepVar, "x" is the vector of regressors and "b" is the
>> >vector of unknown parameters.
> I guess you mean
>
> loglik = y*log(x.*b) + (1-y)*log(1-x.*b)
>
> and besides, since y is binary, you might want to use
>
> <hansl>
> series ndx = lincomb(X, b)
> series loglik = y ? ln(ndx) : ln(1-ln(ndx))
> </hansl>
>
> instead, which saves a few floating-point operations.
>
>> >The argument of the natural logarithm is not inherently constrained to range
>> >in (0,1), so in the iterative maximization process, negative values of x.*b
>> >or (1-x.*b) may be encountered at some of the observations, which is not
>> >admissible for the logarithm.
> The syntax I suggested above circumvents the problem somehow, since it
> ensures that you take the log only once per observation, instead of twice.
>
>> >Left as is, with a "catch" preceding the mle command, Gretl ignores the lot
>> >and moves to the next round of randomly generated regressors (this is a Monte
>> >Carlo study) etc. But there are cases where this happens with/all/ generated
>> >samples. Note that the true specification here is indeed the Linear
>> >Probability model (underlying error is Uniform).
>> >
>> >Is there a way to tell Gretl to continue "insisting" on the sample where at
>> >some step it encountered inadmissible values for the logarithm?
> I guess you can introduce a few checks via an ad-hoc function (sample code
> follows):
>
> <hansl>
> function scalar badobs(series m)
> scalar up = sum(m>1)
> scalar dn = sum(m<0)
> if xmax(up, dn) > 0
> printf "UP = %d, DOWN = %d\n", up, dn
> endif
> return up + dn
> end function
>
> nulldata 1000
> series x = uniform()
> series p = -0.5 + 2 * x
> series y = uniform() < p
>
> list X = const x
> ols y X
> matrix b = $coeff
> series loglik = NA
>
> mle loglik = y ? ln(ndx) : ln(1-ndx)
> series ndx = lincomb(X, b)
> scalar bad = badobs(ndx)
> params b
> end mle -v
>
> series B = missing(loglik)
> xtab y B
> </hansl>
>
> Note that with the solution above, having "bad" values for the index
> function is not really a problem if the happen to occur for the
> "appropriate" value of y (for example: ndx < 0 is not a problem if y=1).
>
> -------------------------------------------------------
> Riccardo (Jack) Lucchetti
> Dipartimento di Scienze Economiche e Sociali (DiSES)
9 years, 3 months
Maximum Likelihood estimation of Linear Probability specification (Binary Choice model)
by Alecos Papadopoulos
I need to estimate a "Linear Probability" Specification in a Binary
Choice model, using specifically maximum likelihood estimation.
The log-likelihood of such a specification is
loglik = y*log(x.*b) + (1-y)*(1-x.*b)
where y is the scalar DepVar, "x" is the vector of regressors and "b" is
the vector of unknown parameters.
The argument of the natural logarithm is not inherently constrained to
range in (0,1), so in the iterative maximization process, negative
values of x.*b or (1-x.*b) may be encountered at some of the
observations, which is not admissible for the logarithm.
Left as is, with a "catch" preceding the mle command, Gretl ignores the
lot and moves to the next round of randomly generated regressors (this
is a Monte Carlo study) etc. But there are cases where this happens with
/all/ generated samples. Note that the true specification here is indeed
the Linear Probability model (underlying error is Uniform).
Is there a way to tell Gretl to continue "insisting" on the sample where
at some step it encountered inadmissible values for the logarithm?
I tried to use functions, like (pseudo-code)
/
[generate X, y]
[initial parameter values through ols]
function series unifll(series y, series X, scalars b)
if (x.*b <=0) || (x.*b >=1)
series liky = NA
else
series liky = y*log(x.*b) + (1-y)*(1-x.*b)
endif
return liky
end function
catch mle logl = unifll(y, X, scalars b)
params b0 b1 b2 b3
end mle
/
but I get the message " error evaluating 'if' "
I cannot understand why I get this message, so I haven't actually seen
what happens with the mle-algorithm in such an approach.
Any suggestions?
--
Alecos Papadopoulos
PhD Candidate
Athens University of Economics and Business, Greece
Department of Economics
https://alecospapadopoulos.wordpress.com/
9 years, 3 months
things to test
by Allin Cottrell
Hello all,
We're (over-)due for a new release (which will be gretl 1.10.2) but
before doing that I'd appreciate hearing any feedback about some
innovations in our packages for Windows and OS X:
* Windows: I've added the option of using the "Clearlooks" GTK theme
on Windows: find it under /Tools/Preferences/General. It doesn't look
as Windows-y as the default but some people might find it clearer in
some respects, particularly in regard to the appearance of selected
text and selected rows in some of the gretl windows. This is in the
Windows snapshots.
* OS X: I've built a version of the quartz package using clang as
cross-compiler, and this has enabled me to add the "wxt" terminal to
the gnuplot that we package with gretl. This means that you can now
manipulate 3D plots with the mouse on OS X. (The Mac-specific "aqua"
terminal is still there if you want it, but it doesn't support this
sort of interaction.) This is in the special snapshot at
http://sourceforge.net/projects/gretl/files/snapshots/gretl-quartz-clang....
(Example of 3D plot: open Ramanathan data file data4-3; go to
/View/Graph specified vars/3D plot; select gnp for x-axis, intrate for
y-axis and housing for z-axis. Hold mouse button 1 down to rotate the
plot.)
I'm particularly on the lookout for any bad side effects of these
changes.
Allin Cottrell
9 years, 3 months