[R] nlme: correlation structure in gls and zero distance

Patrick Giraudoux patrick.giraudoux at univ-fcomte.fr
Sat Jul 1 18:57:10 CEST 2006


Dear listers,

I am trying to model the distribution of  fox density over years  in the 
Doubs department. Measurements have been taken on 470 plots in March 
each year and georeferenced. Average density is supposed to be different 
each year.

In a first approach, I would like to use a general model of this type, 
taking spatial correlation into account:

gls(IKAfox~an,correlation=corExp(2071,form=~x+y,nugget=1.22),data=renliev)

but I get

 > 
gls(IKAfox~an,correlation=corExp(2071,form=~x+y,nugget=1.22),data=renliev)
Error in getCovariate.corSpatial(object, data = data) :
        Cannot have zero distances in "corSpatial"

I understand that the 470 geographical coordinates are repeated three 
times (measurement are taken each of the three years at the same place) 
which obviously cannot be handled there.

Does anybody know a way to work around that except jittering slightly 
the geographical coordinates?

Thanks in advance,

Patrick



More information about the R-help mailing list