Open lionel68 opened 2 years ago
Hi Lionel,
I have indeed been playing around with adding a spatial variogram to the testSpatialAutocorrelation function, see also https://github.com/florianhartig/DHARMa/issues/311. Finally, I didn't include it in the last update because I was still hesitant with adding another dependency, generality of the plot and all those things. But I do agree that a graphical analysis of the lags could be useful.
About the question what to plot exactly: I have a slight tendency to prefer directional spatial variograms, such as this one
Over a general one. May I ask what purpose the plot should have in your case? I assume that you want to diagnose the form / distance of the RSA?
Just to add to that: if course, it's easy for people to just plot DHARMa residuals in whatever way they want - there are so many packages that provide plots for correlograms / variograms. If I implement something in DHARMa, it should be something super general, and ideally with very low dependencies.
Thanks for your swift reply Florian. The purpose would be to (I quote the reviewer) "understand the spatial structure of the data", which would point towards using directional variograms.
Just to be clear for the plot you produced you used something like:
gstat::variogram(residuals~x.coord+y.coord, data, alpha = c(0, 90, 135, 45))
Maybe there will be DHARMa add-ons with extended capacities and dependencies popping up :)
Hi, yes, this is what I did - I'm not sure if this really has to be added to the function, maybe enough to just add code in the help that demonstrates how to do further plots? I have become careful with hard CRAN dependencies after having had a number of issues with that.
Hello Florian,
A reviewer on an ongoing manuscript asked to provide "a supplementary figure showing Moran’s correlograms for each model residuals", I am not sure if it would make sense to compute Moran's I for every pair of residuals and to plot these against their distance, but I was wondering if it would make sense to derive (spline) correlogram from DHARMa scaled residuals via package ncf, as follow:
So do you think that it would make sense to allow for spline correlogram computation based on DHARMa scaled residuals?
Maybe it could be implemented via a new argument in the
testSpatialAutocorrelation
function.