removing nan and inf from a matrix
by Logan Kelly
Hello,
I need to take the log difference of a matrix, i.e. log(M[2 rows(M):,]/M[1:rows(M)-1,]). Unfortunately, M has elements equal to zero. I need to replace the nan's and inf's with 0's. This almost works
M = isnan(M) ? 0 : M
but does not remove inf's. Any sugestions?
8 years, 7 months
bivariate probit in a loop
by Artur Bala
Dear all,
I'm currently estimating a bootstraped bivariate probit through a
progressive loop and retrieve each time the $yhat matrix. At some point,
the execution is interrupted with the "warning":
The statistic you requested is not available
>> genr series predict_external = $yhat[,1]
Is there a perfect prediction symptom behind this message isn't it?
Can one, in such a loop, skip cases where the MLE estimation is not
technically possible?
Best,
Artur
9 years, 11 months
Computing an index for unique combinations of discrete variables
by Giuseppe Vittucci
Hi,
I have firm level data and two categorical variables (region and
sector).
I need to define another variable which is an index identifying the
unique combinations region-sector each firm belongs to, so I can use it
in computing cluster-robust s.e.
One way to do this is to use the command "values" for region and sector
and then use a nested loop, but this seems quite time-consuming...
Is there a simpler way in gretl to do it?
BTW, it could be useful to allow one to use the option "cluster" also
with the FE estimator.
Since the robust s.e. used in FE is the Arellano estimator and this is a
s.e. clusterized over cross-sectional units and thus it can be
considered a specification of the cluster-robust estimator, it seems
quite natural to allow one to identify clusters different from the
units.
Something like:
panel y 0 x --robust=cvar
or
panel y 0 x --cluster=cvar
where the default behavior
panel y 0 x --robust
is to clusterize over cross-sectional units.
Bye
Giuseppe
10 years, 7 months
configure: LaTeX Error: File `appendix.sty' not found
by oleg_komashko@ukr.net
On configuring CVS gretl on Debian/Jessie (on system with only texlive packages from Gretl dependencies) I got configure error message LaTeX Error: File `appendix.sty' not found
To fix this problem have installed texlive-latex-extra (very large) from Debian repositories because it seems there is no separate appendix package as deb at the repo. So, small corrections are to be made to "gretl dependencies" I have compiled .deb file from prm (attached) May be, someone who does'nt want to install whole texlive-latex-extra would test it on other pc? It is reasonable, I think, to make similar package downloadable from gretl site (may be this one if it will prove working)
10 years, 8 months
problem with directories on installing File->Open data->/Sample file on Debian and proposal
by oleg_komashko@ukr.net
When I chose File->Open data->Sample file and press "Look on server" button and install, for example, ashenfelter (small letter for option name, not for prof. Ashenfelter), directory ~/gretl/data/ashenfelter/ is created. When I restart Gretl "Ashenfelter" option doesn't appear in "gretl: data files" window as it should be. I resolve this problem by manually moving /ashenfelter to ~/gretl/ashenfelter/ The same with the other samples but for POE 4th. The files.gdt for POE4 are created in ~/data/ without forming POE4data directory. Some small changes are needed to unarchiving parameters, or, alternatively to reading paths to sample files
10 years, 8 months
small proposal on Sample file & Practice file for Linux distros
by oleg_komashko@ukr.net
I use cvs gretl updated taday at noon on debian/jassie What I have done to all textbooks datafiles and scripts worked properly from menu: 1 moved directories as shown
2 created >POE4data (as shown) and moved gdt files from /data to /POE4data 3 copied gdt files from data/stock_watson to /data and erased empty data/stock_watson 4 untared stock_watson_scripts.zip and POE4_scripts.zip to get stock_watson (yes) and POE4_scripts Proposal: make different names for SW data and scripts directories inside gretl site archives Make unpacking behavior the same for all textbooks data Change reading directory for sample data files from /gretl to /gretl/data
10 years, 8 months
Non-linear least squares
by Jan Tille
Dear All,
I was trying to estimate a non-linear least squares regression and found the following discussion from April 2008.
http://lists.wfu.edu/pipermail/gretl-users/2008-April/002337.html
I changed the code, so that it would accommodate my "model". All Xi's as well as Y are time series. Unfortunately, when I estimate the model, I get an error: b1: expect scalar or vector.
nls Y= w1*X1+ w2*X2 + w3*X3 + w4*X4 + w5*X5 + w6*X6
w1=b1^2
w2=b2^2
w3=b3^2
w4=b4^2
w5=b5^2
w6=1-w1-w2-w3-w4-w5
params b1 b2 b3 b4 b5
end nls
After this, I tried to define arbitrary scalars as starting values (no theory, just numbers that came to my mind)
scalar b1=0.1
scalar b2=0.2
scalar b3=-0.05
scalar b4=0.03
scalar b5=-0.015
and re-estimated the model, which delivered an output as well. However, I expected slightly different results, considering above mentioned post. Given that w6 was defined as 1 minus all the others, I expected positive coefficient estimates.
I am not sure, what went wrong, I suppose it's my model (which I likely set up very badly), but would nonetheless be grateful for any useful comments.
Thanks in advance and kind regards,
Jan
10 years, 8 months
String pointer?
by Logan Kelly
Hello,
Are pointers to strings allowed? (I am using 1.9.15cvs on Win7 64 bit) The following script:
function test(string *t)
t="Hello World"
end function
string MyTestString
test(&MyTestString)
print MyTestString
yields the following error
gretl version 1.9.15cvs
Current session: 2014-04-29 19:46
? function test(string *t)
> function test(string *t)
Unrecognized data type 'string *'
Error executing script: halting
> function test(string *t)
10 years, 8 months
Re: [Gretl-users] Re [2]: armax-auto option occasionally generates this error
by Tim Nall
Ah, I have already sent the exact subsample, in a follow-up email. Did it
not go through the list? I don't think I forgot to attach it.
Perhaps the zeroes in the sample cause the crash when they occur in a
specific location (first, second, next-to-last or last, perhaps?)
And thanks for the additional info about Tobit-style non-linear models.
TMN
On Sat, Apr 26, 2014 at 10:37 PM, <oleg_komashko(a)ukr.net> wrote:
> If you are interested in the reason for crushing armax I should have
> exact subsample causing crush.
> If you are interested in correct modelling of this data you should
> look for some nonlinear model for censored data,
> something Tobit-style: discrete zeros have non-zero
> probability in your sample
>
> --- Оригінальне повідомлення ---
> Від кого: Tim Nall <tnall.ling(a)gmail.com>
> Дата: 26 квітня 2014, 15:55:09
>
>
> This one likes to crash (attached as text file). I wonder, is
> armax_auto aware of the sample range I selected via GUI? Not that it
> matters to me, but it may be important.
>
> TMN
>
>
> On Sat, Apr 26, 2014 at 8:15 PM, <oleg_komashko(a)ukr.net> wrote:
>
> Can you supply the data set? As attachment, may be.
>
> --- Оригінальне повідомлення ---
> Від кого: "Tim Nall" <tnall.ling(a)gmail.com>
> Дата: 26 квітня 2014, 13:19:16
>
> Thanks to all for the replies. Will try to find TRAMO. meanwhile, the
> armax-auto option occasionally generates this error:
>
> ? armax(4, 4, BOTH, null, 1, 1, 0, 1, 0)
> BFGS: initial value of objective function is not finite
> *** error in function armax, line 82
> > loop q = 0..maxq
>
> On Sat, Apr 26, 2014 at 4:46 PM, Riccardo (Jack) Lucchetti
> <r.lucchetti(a)univpm.it> wrote:
> > On Sat, 26 Apr 2014, oleg_komashko(a)ukr.net wrote:
> >
> >> You can use armax_auto (see time series menu in Gretl GUI). The function
> >> has a drawback: the cycle crushes on encountering a unit root in MA part of
> >> the model Also you can use auto.arima{forecast} in R My experience tells it
> >> would be better to determine the order of integration (use unit root tests)
> >> beforehand and use, say "d=1" in auto.arima (type ?auto.arima in R console)
> >
> >
> > That's a function package, you may need to install it first: go to
> > Files>Function Files>On server.
> >
> > -------------------------------------------------------
> > Riccardo (Jack) Lucchetti
> > Dipartimento di Scienze Economiche e Sociali (DiSES)
> >
> > Università Politecnica delle Marche
> > (formerly known as Università di Ancona)
> >
> > r.lucchetti(a)univpm.it
> > http://www2.econ.univpm.it/servizi/hpp/lucchetti
> > -------------------------------------------------------
> > _______________________________________________
> > Gretl-users mailing list
> > Gretl-users(a)lists.wfu.edu
> > http://lists.wfu.edu/mailman/listinfo/gretl-users
>
>
>
> --
> Best regards,
> Timothy M. Nall
> Assistant Professor
> National Quemoy University
> Kinmen, Taiwan
>
> _______________________________________________
> Gretl-users mailing listGretl-users@lists.wfu.eduhttp://lists.wfu.edu/mailman/listinfo/gretl-users
>
> !
>
> _______________________________________________
> Gretl-users mailing list
> Gretl-users(a)lists.wfu.edu
> http://lists.wfu.edu/mailman/listinfo/gretl-users
>
>
>
>
> --
> Best regards,
> Timothy M. Nall
> Assistant Professor
> National Quemoy University
> Kinmen, Taiwan
>
> _______________________________________________
> Gretl-users mailing listGretl-users@lists.wfu.eduhttp://lists.wfu.edu/mailman/listinfo/gretl-users
>
> !
>
> _______________________________________________
> Gretl-users mailing list
> Gretl-users(a)lists.wfu.edu
> http://lists.wfu.edu/mailman/listinfo/gretl-users
>
--
Best regards,
Timothy M. Nall
Assistant Professor
National Quemoy University
Kinmen, Taiwan
10 years, 8 months