Learn R Programming

SOAs (version 1.4)

phi_p: Functions to evaluate space filling of an array

Description

phi_p calculates the discrepancy

phi_p calculates the discrepancy

Usage

phi_p(D, dmethod = "manhattan", p = 50)

mindist(D, dmethod = "manhattan")

phi_p(D, dmethod = "manhattan", p = 50)

Value

both functions return a number

a number

Arguments

D

an array or an object of class SOA or MDLE

dmethod

the distance to use, "manhattan" (default) or "euclidean"

p

the value for p to use in the formula for phi_p

Author

Ulrike Groemping

Ulrike Groemping

Details

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

Examples

Run this code
A <- DoE.base::L25.5.6  ## levels 1:5 for each factor
phi_p(A)
mindist(A) # 5
A2 <- phi_optimize(A)
phi_p(A2)     ## improved
mindist(A2)   ## 6, improved
A <- DoE.base::L16.4.5  ## levels 1:4 for each factor
phi_p(A)
phi_p(A, dmethod="euclidean")
A2 <- A
A2[,4] <- c(2,4,3,1)[A[,4]]
phi_p(A2)
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))
}

Run the code above in your browser using DataLab