Description Usage Arguments Details Value Control arguments Author(s) References See Also Examples
The purpose of the function dgp.spq
is to generate a random dataset
with the dimensions and spatial structure decided by the user. This function may be useful in pure
simulation experiments or with the aim of showing specific properties and characteristics of a
spatial qualitative dataset ...
1 |
listw |
A |
p |
a vector with the percentage of elements of each categories. The lengths must be the number of categories. The sum of the elements of vector must be 1. |
rho |
the level of spatial dependence (values between -1 y 1) |
control |
List of additional control arguments. See control argument section. |
Aquí Antonio escribe una linda historia ...
La forma de generar datos es la descrita en Páez et al. 2010 (pag 291)
$$ Y = (I- rho W)^-1 epsilon $$
where $epsilon$ = N(0,1) and where I is the N x N identity matrix, q is a parameter of spatial dependence, and W is a connectivity matrix that determines the set of spatial relationships among points. the continuous spatially autocorrelated variable Y is used to define a discrete spatial process as follows. Let $b_ij$ be defined by ...
a factor of length N with levels the fist natural numbers.
seed to generate the data sets
Fernando López | fernando.lopez@upct.es |
Román Mínguez | roman.minguez@uclm.es |
Antonio Páez | paezha@gmail.com |
Manuel Ruiz | manuel.ruiz@upct.es |
Ruiz M, López FA, A Páez. (2010). Testing for spatial association of qualitative data using symbolic dynamics. Journal of Geographical Systems. 12 (3) 281-309
qtest
, sp.runs.test
, m_surr_no
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | #
rm(list = ls())
N <- 10
cx <- runif(N)
cy <- runif(N)
coor <- cbind(cx,cy)
p <- c(1/6,3/6,2/6)
rho = 0.5
listw <- spdep::nb2listw(knn2nb(knearneigh(cbind(cx,cy), k = 4)))
xf <- dgp.spq(list = listw, p = p, rho = rho)
rm(list = ls())
data(Spain)
listw <- spdep::poly2nb(spain.sf, queen = FALSE)
p <- c(1/6,3/6,2/6)
rho = 0.9
xf <- dgp.spq(p = p, listw = listw, rho = rho)
spain.sf$xf <- xf
plot(spain.sf["xf"])
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.