compute_distance_matrix {GWlasso} | R Documentation |
Compute distance matrix
Description
compute_distance_matrix()
is a small helper function to help you compute a distance matrix.
For the geographically method to work, is is important that distances between points are not zero. This function allows to add a small random noise to avoid zero distances.
Usage
compute_distance_matrix(data, method = "euclidean", add.noise = FALSE)
Arguments
data |
A dataframe or matrix containing at least two numerical columns. |
method |
method to compute the distance matrix. Ultimately passed to |
add.noise |
TRUE/FALSE set to TRUE to add a small noise to the distance matrix. Noise |
Value
a distance matrix, usable in gwl_bw_estimation()
Examples
coords <- data.frame("Lat" = rnorm(200), "Long" = rnorm(200))
distance_matrix <- compute_distance_matrix(coords)
[Package GWlasso version 1.0.1 Index]