[R-sig-ME] searching nlme source code to try turning off range bounds of > 0 for corExp

Ben Bolker bbolker at gmail.com
Fri May 17 19:28:25 CEST 2013


Seth Myers <sjmyers3142 at ...> writes:

> 
> Hi,
> 
> I have correlated residuals that are well described by an exponential
> function.  However, they exhibit negative spatial autocorrelation at short
> lags that decreases to little spatial autocorrelation at longer lags.  I
> have fit exponential functions to the residual variograms that fit well,
> but the range must be negative to achieve the fit.  I have been searching
> the nlme source code for an hour, and have found corExp (and corStruct and
> similar things) mentioned multiple time, but have not found how to
> eliminate the condition that the range be > 0.  Can anyone point me
> generally in the correct direction?  I will likely cause a cascade of
> errors if I even get that first part to work.  But just trying to move in
> some direction for now.  Thanks. -Seth Myers
> 

  There's probably not a range bound; my guess (not looking at the
code at this moment, but I have looked at it before) is that the
range parameter is estimated on the log scale, which would mean
that you'd have to do more serious architectural changes to get it
to work.  Anyway, putting a negative range in the exponential variogram
function sounds REALLY dicey to me.

  I'm sorry I haven't chimed in on this before.  My thought would
be that the best way to proceed would be to write your own corStruct.
Furthermore, the way I would approach that (rather than trying to
use the built-in e.g. corExp functionality as a guide, since the
nlme code for this stuff is pretty baroque) would to be look at
user-contributed corStructs: there are some in the ape package
(based on phylogenetic distance), and I think maybe some in the
ramps (?) package. You could use library("sos"); findFn("corStruct")
and see if you get anywhere with that ...

  good luck
    Ben Bolker



More information about the R-sig-mixed-models mailing list