A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://blasbenito.github.io/spatialRF/reference/weights_from_distance_matrix.html below:

Transforms a distance matrix into a matrix of weights — weights_from_distance_matrix • spatialRF

Transforms a distance matrix into weights (1/distance.matrix) normalized by the row sums. Used to compute Moran's I values and Moran's Eigenvector Maps. Allows to apply a threshold to the distance matrix before computing the weights.

weights_from_distance_matrix(
  distance.matrix = NULL,
  distance.threshold = 0
)
Arguments
distance.matrix

Distance matrix. Default: NULL.

distance.threshold

Numeric, positive, in the range of values of distance.matrix. Distances below this value in the distance matrix are set to 0., Default: 0.

Value

A weighted distance matrix.

Examples
if(interactive()){

 #loading example distance matrix
 data(distance_matrix)

 #computing matrix of weights
 distance.matrix.weights <- weights_from_distance_matrix(
   distance.matrix = distance_matrix
   )

 distance.matrix.weights

}

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4