wpikInv {WaveSampling} | R Documentation |
Stratification matrix from inverse inclusion probabilities
Description
The stratification matrix is calculated from the inverse inclusion probabilities. It is a direct implementation of the spatial weights specified in Tillé et al., (2018).
Usage
wpikInv(X, pik, tore = FALSE, shift = FALSE, toreBound = -1)
Arguments
X |
matrix representing the spatial coordinates. |
pik |
vector of the inclusion probabilities. The length should be equal to N. |
tore |
an optional logical value, if we are considering the distance on a tore. Default is |
shift |
an optional logical value, if you would use a shift perturbation. See Details for more informations. Default is |
toreBound |
a numeric value that specify the size of the grid. Default is -1. |
Details
Entries of the stratification matrix indicates how the units are close from each others. Hence a large value w_{kl}
means that the unit k
is close to the unit l
. This function considers that if unit k
were selected in the sample drawn from the population then
k
would represent 1/\pi_k
units in the population and, as a consequence, it would be natural to consider that
k
has n_k = (1/\pi_k - 1)
neighbours in the population. The n_k
neighbours are the nearest neighbours of k
according to distances.
The weights are so calculated as follows :
-
w_{kl} = 1
if unitl \in N_{\lfloor n_k \rfloor }
-
w_{kl} = n_k - \lfloor n_k \rfloor
if unitl
is the\lceil n_k \rceil
nearest neighbour ofk
. -
w_{kl} = 0
otherwise.
\lfloor n_k \rfloor
and \lceil n_k \rceil
are the inferior and the superior integers of n_k
.
The option shift
add a small normally distributed perturbation rnorm(0,0.01)
to the coordinates
of the centroid of the stratum considered. This could be useful if there are many unit that have the same distances.
Indeed, if two units have the same distance and are the last unit before that the bound is reached, then the weights
of the both units is updated. If a shift perturbation is used then all the distances are differents and only one unit
weight is update such that the bound is reached.
The shift perturbation is generated at the beginning of the procedure such that each stratum is shifted by the same perturbation.
Value
A sparse matrix representing the spatial weights.
Author(s)
Raphaël Jauslin raphael.jauslin@unine.ch
References
Tillé, Y., Dickson, M.M., Espa, G., and Guiliani, D. (2018). Measuring the spatial balance of a sample: A new measure based on Moran's I index. Spatial Statistics, 23, 182-192.
See Also
Examples
N <- 25
n <- 5
X <- as.matrix(cbind(runif(N),runif(N)))
pik <- rep(n/N,N)
W <- wpikInv(X,pik)