I have written the following code to generate an nverse square distance weight matrix for running spatial-autoregressive econometrics models. It avails itself of the spdep R package. Is it right?

s = coordinates(points) 
D = 1/(spDists(s)^2)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.