Skip to content

createWeights.R (for Frescalo) contains arguably inappropriate hard-coded distance function #240

@sacrevert

Description

@sacrevert

Just noting that this function to create neighbourhood land cover-based weights uses dist() with default options. This is a Euclidean distance measure that is potentially inappropriate for very sparse matrices (because lots of shared zeros between items can have a strong influence on the distance measures -- a similar issue that often comes up in community ecology). A warning, and the option to use something like the cosine similarity measure, would be desirable. Efficient code for the latter is the second answer here: https://stats.stackexchange.com/questions/31565/compute-a-cosine-dissimilarity-matrix-in-r

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions