cosineMatchDist {YAPSA} | R Documentation

## Compute an altered cosine distance of two vectors

### Description

This is an altered cosine distance: it first reduced the dimension of the two input vectors to only those coordinates where both have non-zero entries. The cosine similarity is then computed on these reduced vectors, i.e. on a sub-vector space.

### Usage

    cosineMatchDist(a, b)

### Arguments

`a, b` | Numerical vectors of same length

### Value

The scalar product of the reduced input vectors divided by the product of the norms of the two reduced input vectors

### Examples

    ## 1. Orthogonal vectors:
    cosineMatchDist(c(1,0),c(0,1))
    ## 2. Non-orthogonal vectors:
    cosineMatchDist(c(1,0),c(1,1))

[Package YAPSA version 1.16.0 Index]