| hausdorff {HDCD} | R Documentation |
Hausdorff distance between two sets
Description
Computes the Hausdorff distance between two sets represented as vectors v1 and v2. If v1 == NULL and v2 != NULL, then the largest distance between an element of v1 and the set \{1,n\} is returned, and vice versa. If both vectors are NULL, 0 is returned.
Usage
hausdorff(v1, v2, n)
Arguments
v1 |
Vector representing set 1 |
v2 |
Vector representing set 2 |
n |
Sample size (only relevant when either |
Value
The Hausdorff distance between v1 and v2
Examples
library(HDCD)
n = 400
true_changepoints = c(50,100)
est_changepoints = c(51,110)
hausdorff(true_changepoints, est_changepoints,n)
hausdorff(true_changepoints, NULL,n)
hausdorff(NULL, est_changepoints,n)
hausdorff(NULL,NULL)
[Package HDCD version 1.1 Index]