Re: [R] multiple autocorrelation coefficients in spdep?

From: Roger Bivand <>
Date: Tue 26 Apr 2005 - 18:00:07 EST

On Mon, 25 Apr 2005, Ignacio Colonna wrote:

> Hello,
> Has anyone modified the errorsarlm in the R package spdep to
> allow for more than a single spatial autocorrelation coefficient (i.e.
> 'lambda')?
> Or, if not, any initial suggestions on how to make that
> modification? I have looked at the source code for the function and realize
> that any attempt to do it on my own would require much dedication, so would
> like to check whether someone has done it already. My R programming skills
> are very elementary.
> Specifically I would need to specify 2 different lambdas in a dataset, one
> for each group. I am performing a regression of grain yield against a number
> of soil variables, for 2 different years, where the regression includes
> terms for year*soil variables interaction. The spatial structure of the
> error is clearly different between these years, and I would thus like to fit
> different lambdas to them, if possible. Of course one option is to just run
> 2 separate regressions, but if the possibility of fitting more than 1 lambda
> does not seem too remote, I think fitting a single model offers some
> advantages.

As far as I am aware, as package maintainer, this has not been done, and is not easy to do, as you have noted. It might be possible to use the lm.gls() function in the MASS package once the compound weights matrix (including the coefficients) has been fixed, perhaps using optim(). Have you considered other options perhaps including some lme variant, and/or spatial panel variants?

> Thanks in advance,
> Ignacio

Roger Bivand
Economic Geography Section, Department of Economics, Norwegian School of
Economics and Business Administration, Helleveien 30, N-5045 Bergen,
Norway. voice: +47 55 95 93 55; fax +47 55 95 95 43

______________________________________________ mailing list
PLEASE do read the posting guide!
Received on Tue Apr 26 18:07:32 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:31:26 EST