[R-sig-Geo] spatially correlated variable with a negative binomial distribution

Ana Nuno a.m.nuno at gmail.com
Thu Aug 9 13:28:01 CEST 2012


Dear all,

I'd like to obtain a random spatially correlated variable with a
negative binomial distribution. The goal is to simulate random
variables in which high values are close to high values (using rho to
simulate spatial autocorrelation) but different values of aggregation
(k parameter in a NBD) can also be controlled.

I was planning to adapt the generally suggested approach below:

#From Anselin's workbook
library(spdep)
data(columbus)
attach(columbus)
c05 <- invIrM(col.gal.nb, rho=0.5)
uu <- rnorm(49)
#uu2<-rnbinom(49,size=0.5,mu=2)
mean(uu);sd(uu)
e05 <- c05 %*% uu

just replacing uu with a NBD instead of a normal distribution.

While this seems to work to generate correlated NBDs, higher values of
rho actually increase the k parameter in the obtained variable. This
means that, for example, for a given initial k parameter, I obtain
increasingly lower variance to the mean when I increase rho (which
seems contradictory to expectations).

Any suggestions on how this could be achieved or improved?

Thank you!

--
Ana Nuno



More information about the R-sig-Geo mailing list