From nadaud@centre-cired.fr Fri Apr 25 06:40:09 2008 From: Franck Nadaud To: gretl-users@gretlml.univpm.it Subject: [Gretl-users] matrix sorting: you save the day ! Date: Fri, 25 Apr 2008 12:28:13 +0200 Message-ID: <2566.193.51.120.31.1209119293.squirrel@webmail.centre-cired.fr> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============4989733353555138824==" --===============4989733353555138824== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Hello all, Allin & Jack ! You really saved my day ! Let me sum up the situation. I tested both scripts, they run perfectly ! In fact the msortby command is not documented yet, this is why i had trouble to translate the find_nn command of James Lesage. Now I can compute the right neighborhood matrices from a whole sample and subsamples of interest. This is really neat because once they are created we can compute spatial autocorrelation coefficients directly using matrix commands or via regression with bootstrap of p-values :the moran scatterplots of Luc Anselin, which have the interest of providing real confidence intervals. My tests show small differences in results from GEODA and the GRETL scripts I use now. This is all good news and I will rest on your input to propose a few scripts and/or functions to compute tests for spatial autocorrelation I will submit to the community. I hope to write a short note and propose my scripts soon so that users can grasp the basics of those tests. Returning to the matter of neighbors, and programming, there are far smarter algorithms than the brute force hack I work on, but think it better to propose the simple scripts first before turning on the real smart ones which consist in exploring the neighborhood graph with special functions and pointers. More of this when the work will be more advanced. First i will propose the Moran spatial autocorrelation test as a function using two types of neighborhood structures: contiguity (common border) and nearest neighbors with choice in the number of neighbors on two kind of grids too: either square (checkboard) or hexagonal. Well, thanx very much Allin and Jack ! more about that soon ! cheers F. -- Franck Nadaud Economiste CIRED UMR 8568 CNRS - EHESS 45 bis avenue de la Belle Gabrielle 94736 Nogent-sur-Marne Cedex TEL 33-1-43-94-73-94 FAX: 33-1-43-94-73-70 MOB: 06-07-39-92-75 France --===============4989733353555138824==-- From r.lucchetti@univpm.it Fri Apr 25 07:04:08 2008 From: Riccardo (Jack) Lucchetti To: gretl-users@gretlml.univpm.it Subject: Re: [Gretl-users] matrix sorting: you save the day ! Date: Fri, 25 Apr 2008 13:04:04 +0200 Message-ID: In-Reply-To: 2566.193.51.120.31.1209119293.squirrel@webmail.centre-cired.fr MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0275798227387955840==" --===============0275798227387955840== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable On Fri, 25 Apr 2008, Franck Nadaud wrote: > Hello all, Allin & Jack ! > > You really saved my day ! Let me sum up the situation. > > I tested both scripts, they run perfectly ! Just for the record, let me post a version of the script that puts=20 together Allin's version and mine. > In fact the msortby command is not documented yet, this is why i had trouble > to translate the find_nn command of James Lesage. Isn't it? Which version of gretl are you using? With the current=20 version, it is in the reference manual and in the on-line help for functions. > Now I can compute the right neighborhood matrices from a whole sample and > subsamples of interest. This is really neat because once they are created we > can compute spatial autocorrelation coefficients directly using matrix > commands or via regression with bootstrap of p-values :the moran scatterplo= ts > of Luc Anselin, which have the interest of providing real confidence > intervals. > > My tests show small differences in results from GEODA and the GRETL scripts= I > use now. This is all good news and I will rest on your input to propose a f= ew > scripts and/or functions to compute tests for spatial autocorrelation I will > submit to the community. I hope to write a short note and propose my scripts > soon so that users can grasp the basics of those tests. This would be great. Spatial models have become a very hot topic in the=20 past few years, and the more we can do in gretl in this direction the better. > Returning to the matter of neighbors, and programming, there are far smarter > algorithms than the brute force hack I work on, but think it better to prop= ose > the simple scripts first before turning on the real smart ones which consist > in exploring the neighborhood graph with special functions and pointers. Mo= re > of this when the work will be more advanced. > > First i will propose the Moran spatial autocorrelation test as a function > using two types of neighborhood structures: contiguity (common border) and > nearest neighbors with choice in the number of neighbors on two kind of gri= ds > too: either square (checkboard) or hexagonal. > > Well, thanx very much Allin and Jack ! > > more about that soon ! Looking forward to it! Riccardo (Jack) Lucchetti Dipartimento di Economia Universit=C3=A0 Politecnica delle Marche r.lucchetti(a)univpm.it http://www.econ.univpm.it/lucchetti --===============0275798227387955840==-- From nadaud@centre-cired.fr Fri Apr 25 07:44:56 2008 From: Franck Nadaud To: gretl-users@gretlml.univpm.it Subject: Re: [Gretl-users] matrix sorting: you save the day ! Date: Fri, 25 Apr 2008 13:33:00 +0200 Message-ID: <2589.193.51.120.31.1209123180.squirrel@webmail.centre-cired.fr> In-Reply-To: alpine.DEB.1.10.0804251258470.23261@ec-4.econ.univpm.it MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============2596123937110855559==" --===============2596123937110855559== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Hi again ! Let me respond by inserts. > Isn't it? Which version of gretl are you using? With the current > version, it is in the reference manual and in the on-line help for functions. I use 1.7.4 but looking at the user guide pdf, I could not find msortby. I will check all that ! > This would be great. Spatial models have become a very hot topic in the > past few years, and the more we can do in gretl in this direction the better. Yep, I did a lot of spatial analysis for my thesis, and spatial econometrics is a mature field now but hard to implement. I will propose all my contribution the sooner the better ! > > Looking forward to it! Stay tuned ! cheers Franck --===============2596123937110855559==-- From r.lucchetti@univpm.it Fri Apr 25 08:43:05 2008 From: Riccardo (Jack) Lucchetti To: gretl-users@gretlml.univpm.it Subject: Re: [Gretl-users] matrix sorting: you save the day ! Date: Fri, 25 Apr 2008 14:43:03 +0200 Message-ID: In-Reply-To: 2589.193.51.120.31.1209123180.squirrel@webmail.centre-cired.fr MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============2718497200957313761==" --===============2718497200957313761== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable On Fri, 25 Apr 2008, Franck Nadaud wrote: > Hi again ! > > Let me respond by inserts. > >> Isn't it? Which version of gretl are you using? With the current >> version, it is in the reference manual and in the on-line help for functio= ns. > > I use 1.7.4 but looking at the user guide pdf, I could not find msortby. I > will check all that ! Umh, you're right. In fact, the matrix chapter of the user's guide is=20 somewhat outdated. I'll have a go at it soon. Please use the "Command=20 Reference": that is more up-to-date. Riccardo (Jack) Lucchetti Dipartimento di Economia Universit=C3=A0 Politecnica delle Marche r.lucchetti(a)univpm.it http://www.econ.univpm.it/lucchetti --===============2718497200957313761==--