I have a time series dataset of the amount of forest loss and the mean monsoon temperature and precipitation in 590 districts in a country. The format being a value for forest loss in kilometres, a value for temperature in Celsius and a value for precipitation in mm for each datapoint (district) for each year between 2000-2018.
There is spatial autocorrelation in the data which has been identified using a variogram and Moran's I.
The problem is I tried to run a lme model, with a random effect of the State that district is within:
mod.cor<-lme(FLkm ~ Monsoon.Precip +
Monsoon.Temp,correlation=corGaus(form=~x+y,nugget=TRUE),
data=NE1, random = ~1|State)
And it gives me the error:
Error in getCovariate.corSpatial(object, data = data) : cannot have zero distances in "corSpatial"
I have looked up whether I can add correlation structures to models with time series data and it seems it may be possible with other methods such as Ordinary Least Squares, Geographically Weighted Regression or spatial autoregressive lag methods but I cannot find out more than this.
Has anyone been able to model data like this while accounting for spatial autocorrelation and how did you do it?