I'm not getting any help from r-sig-mixed mailing list, so I thought I'd
ask this here as it is related to spatial modeling.

Questions:

1. Is there anything obviously wrong in concept or code with the following
approach?
2. How do I extract residuals from models using correlation= argument so
that the residuals are "adjusted" by the correlation among residuals that
is specified?

Background:

I have a nonlinear model with a continuous response variable (0<=resp.>=1).
 I know that least squares might not be optimal in this context, but the
models fit quite well.  It is measured on a spatial data set and a model
such as:

sx9<-gnls(sprawlchngx9~ 1/(1+exp(-1*(beta0+
    b1*hectare+
    b2*discityge100kmean

    ))),
    data=data5,
    start=list(beta0 = 0,b1=0 , b2=0))

returns residuals with negative spatial autocorrelation at small lag
distances between data points.


The built in functions to handle spatially correlated residuals (corExp,
etc) cannot (to my knowledge) handle negative spatial autocorrelation since
their range parameters are bounded to be positive.

To get around this issue, I extracted the residuals from the model above
and computed Moran's I values at several lag distances.  I then populated
an NxN matrix with these values as determined by the lag distance between
the row and column members.  For instance, if observations 1 and 2 are 30
meters apart, and the Moran's I value for the lag distance between 0 and 50
m was computed as -0.50, then the matrix position (1,2) or (2,1) would be
-0.50.

I then passed this correlation matrix to gnls function with the following
code:

sx9<-gnls(sprawlchngx9~ 1/(1+exp(-1*(beta0+
    b1*hectare+
    b2*discityge100kmean
    ))),
    data=data5,
    start=list(beta0 = 0,b1=0 , b2=0,

b16=0 , b17=0 , b18=0,b19=0,b20=0,b21=0 ),
correlation=corSymm(corr9x[lower.tri(newcorr9x)],fixed=TRUE)

     )

where corr9x is the NxN correlation matrix that I created.

Revisiting question 1, is there anything flawed in code or concept with
this approach?

Using residuals (), I have saved for this model "response", "pearson",
"normalized" residuals.  Based upon some digging, I thought that
"normalized" would return residuals that are adjusted by my correlation
matrix, but when variograms or correlograms are computed on all residuals
they seem overly similar to those calculated on residuals NOT from the
"normalized" option.

Revisiting question 2, if residuals ( , type='normalized') the proper
method to get residuals conditioned on the correlation structure (so that I
can show whether or not the correlation= argument in gnls worked as
intended)?  If not, any suggestions?

Thanks,
Seth Myers

	[[alternative HTML version deleted]]

