[R] correlation range estimates with nlme::gls

From: Ben Bolker <bolker_at_zoo.ufl.edu>
Date: Tue 12 Apr 2005 - 07:52:50 EST

   I'm trying to do a simple (?) analysis of a 1D spatial data set, allowing for spatial autocorrelation. (Actually, I'm comparing expected vs. observed for a spatial model of a 1D spatial data set.) I'm using models like




  This form is supposed to fit a linear model of obs=a*exp+b using an autocorrelation model based on the position variable "pos".

   The problem: I get reasonable answers for the slope & intercept, but the estimated ranges for the autocorrelation functions are huge and seemingly unconnected to the pictures I get when I plot acf(resid(M0)) [where M0 is the OLS fit to the data]. I tried simulating a bunch of "data" with different data sizes: the disturbing thing is that the range results get (much) worse, not better, as the number of data points goes up [from n=30, around the real size, to n=50, to n=100]. When I am able to get confidence intervals on the range, they often don't make sense either. On the other hand, the estimates of slope and intercept are reasonable in reality and in the simulations.

   I've skipped the gory details at this point. A more complete write-up is at http://www.zoo.ufl.edu/bolker/tiwari-new-reg.pdf if anyone wants more information ...

   Should I be concerned about this? Are there any obvious diagnostics of non-convergence etc.? (Reported AIC values suggest that the models with autocorrelation *are* preferable, by quite a bit -- I could pursue this further.) Or should I just not worry about it and move on?

   Ben Bolker

simulation code:

simdata <- function(sd=200,range=2,n=NULL,mmin=0) {

   if (is.null(n)) mile <- seq(mmin,17.5,by=0.5) else {      mile <- seq(mmin,17.5,length=n)
   mean <- 3000-50*(mile-10)^2
   v <- sd^2
   dist <- abs(outer(mile,mile,"-"))
   Sigma <- v*exp(-dist/range)
   X <- mvrnorm(1,mu=mean,Sigma=Sigma)

620B Bartram Hall                            bolker@zoo.ufl.edu
Zoology Department, University of Florida    http://www.zoo.ufl.edu/bolker
Box 118525                                   (ph)  352-392-5697
Gainesville, FL 32611-8525                   (fax) 352-392-3704

R-help@stat.math.ethz.ch mailing list
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Received on Tue Apr 12 11:05:43 2005

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