
Standardize a symmetric matrix (distances) to fixed row (column) totals
stsum.Rd
Standardizes a distance matrix to fixed rows and columns totals. The function iteratively constrains the rows sums of the matrix to know totals, and in order to keep the symmetry of the matrix, at each iteration performs an average with its transpose. When the known totals are all equal to a constant (e.g. 1), this method provides a simple and accurate way to scale a distance matrix to a doubly stochastic matrix.
Arguments
- mat
A distance matrix size NxN.
- con
A vector of row (column) constraints.
- differ
A scalar with the maximum accepted difference with the constraint (default = 1e-15).
- niter
An integer with the maximum number of iterations (default = 1000).
Value
Returns a list with the following components:
mat
, the standardized distance matrix of size NxN.iterations
, number of iterations run by the algorithm.conv
, convergence reached by the algorithm.
Details
The standardized matrix will not be affected by problems arising from units with different inclusion probabilities caused by undesired features of the spatial distribution of the population, as edge effects and/or isolated points.
References
Benedetti R, Piersimoni F (2017). A spatially balanced design with probability function proportional to the within sample distance. Biometrical Journal, 59(5), 1067-1084. doi:10.1002/bimj.201600194