exactHausdorff: The Hausdorff distances between the convex hulls of unions of...

Description Usage Arguments Value Author(s) References Examples

View source: R/fun-disp2D.R

Description

Given a sample x1,...,x_n, it is evaluated the distribution of the Hausdorff distances between xi + B(m,r) and xj + B(m,r) where: xi and xj are two different points from the sample; m is the sample mean of the xi's; r is a positive value and B(m,r) is the disc centered at m with radius r. The i-th point xi has probability prob[i].

Usage

1
exactHausdorff(A, prob, r)

Arguments

A

A matrix where each row corresponds with a different point.

prob

The probabilities of each row of A. If we are dealing with the empirical distribution then all points are equiprobable and prob = rep(1/nrow(A),nrow(A)

r

A positive number.

Value

distance

The observed distances between xi + B(m,r) and xj + B(m,r) where: xi and xj are two different points from the sample.

probability

Probabilities of each distance.

alldistances

The whole set of distances with repetitions.

Author(s)

Guillermo Ayala <Guillermo.Ayala@uv.es>

References

Miguel Lopez-Diaz. An indexed multivariate dispersion ordering based on the Hausdorff distance. Journal of Multivariate Analysis, 97(7):1623 - 1637, 2006.

G. Ayala, M.C. Lopez-Diaz, M. Lopez-Diaz and L. Martinez-Costa. Methods and algorithms to test the simplex and Hausdorff dispersion orders with a simulation study and an ophthalmological application. Technical Report. 2012

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
library(disp2D)
library(geometry)
library(mvtnorm)

sigma1 = matrix(c(0.912897,1.092679,1.092679,1.336440),byrow=TRUE,ncol=2)
sigma2 = sigma1 + diag(1,ncol=2,nrow=2)

A = rmvnorm(200,mean=rep(0,2),sigma=sigma1)
B = rmvnorm(200,mean=rep(0,2),sigma=sigma2)
r=.1

prob = probA = probB =  rep(1/200,200)

HA = exactHausdorff(A,probA,r)
HB = exactHausdorff(B,probB,r)
plot(HA$distance, cumsum(HA$probability), type = "l", xlab = "",
     ylab = "DF", xlim = range(c(HA,HB)))
 lines(HB$distance, cumsum(HB$probability), lty = 2)

disp2D documentation built on May 30, 2017, 12:09 a.m.