Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use R dist() function to compute similarity across spatial units #1

Open
mbacou opened this issue May 24, 2017 · 0 comments
Open

Use R dist() function to compute similarity across spatial units #1

mbacou opened this issue May 24, 2017 · 0 comments
Assignees

Comments

@mbacou
Copy link
Contributor

mbacou commented May 24, 2017

Would be an improvement to hcapi::similar() https://ifpri.github.io/sda-hcapi3/reference/similar.html choosing one of:

  • Euclidean - The most common measurement of distance. sqrt(sum((x - y)^2))
  • Maximum - Maximum difference between elements of two vectors.
  • Manhattan - Sum of difference in each elements of two vectors.
  • Canberra - Manhattan distance weighted by the elements. sum(|x_i - y_i| / |x_i + y_i|)
  • Binary - non-zero elements are regarded as 1 and zero elements are regarded as 0. The distance is the number of elements only one is 1 divided by numbers of them at least one is 1.
  • Minkowski - This is generalized case of euclidean and manhattan. If p=2, it becomes euclidean and if p=1, it becomes manhattan. sum((x - y)^p)^(1/p)
@mbacou mbacou self-assigned this May 24, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant