R/evaluateSpaceFilling.R
, R/utilitiesEvaluate.R
phi_p.Rd
phi_p calculates the discrepancy
phi_p calculates the discrepancy
phi_p(D, dmethod = "manhattan", p = 50)
mindist(D, dmethod = "manhattan")
phi_p(D, dmethod = "manhattan", p = 50)
an array or an object of class SOA or MDLE
the distance to use, "manhattan"
(default) or "euclidean"
the value for p to use in the formula for phi_p
both functions return a number
a number
Small values of phi_p tend to be associated with good performance on the maximin distance criterion, i.e. with a larger minimum distance.
small values of phi_p are associated with good performance on the maximin distance criterion
A <- DoE.base::L25.5.6 ## levels 1:5 for each factor
phi_p(A)
#> [1] 0.2056228
mindist(A) # 5
#> [1] 5
A2 <- phi_optimize(A)
phi_p(A2) ## improved
#> [1] 0.1737517
mindist(A2) ## 6, improved
#> [1] 6
A <- DoE.base::L16.4.5 ## levels 1:4 for each factor
phi_p(A)
#> [1] 0.2612313
phi_p(A, dmethod="euclidean")
#> [1] 0.5224622
A2 <- A
A2[,4] <- c(2,4,3,1)[A[,4]]
phi_p(A2)
#> [1] 0.257029
if (FALSE) {
## A2 has fewer minimal distances
par(mfrow=c(2,1))
hist(dist(A), xlim=c(2,6), ylim=c(0,40))
hist(dist(A2), xlim=c(2,6), ylim=c(0,40))
}