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)
Run the code above in your browser using DataLab