These are some default design criteria to be minimized. There is a table in the details section that gives the formula for each design criterion and describes their usage. Note that the inputs for these functions come in 3 syntax flavors, namely Type-X, Type-D and Type-K. Users can define and use their owm design criteria as long as it has the Type-X syntax as shown with the examples.
AOPT(Train, Test, P, lambda = 1e-05, C=NULL)
CDMAX(Train, Test, P, lambda = 1e-05, C=NULL)
CDMAX0(Train, Test, P, lambda = 1e-05, C=NULL)
CDMAX2(Train, Test, P, lambda = 1e-05, C=NULL)
CDMEAN(Train, Test, P, lambda = 1e-05, C=NULL)
CDMEAN0(Train, Test, P, lambda = 1e-05, C=NULL)
CDMEAN2(Train, Test, P, lambda = 1e-05, C=NULL)
CDMEANMM(Train, Test, Kinv,K, lambda = 1e-05, C=NULL, Vg=NULL, Ve=NULL)
DOPT(Train, Test, P, lambda = 1e-05, C=NULL)
EOPT(Train, Test, P, lambda = 1e-05, C=NULL)
GAUSSMEANMM(Train, Test, Kinv, K, lambda = 1e-05, C=NULL, Vg=NULL, Ve=NULL)
GOPTPEV(Train, Test, P, lambda = 1e-05, C=NULL)
GOPTPEV2(Train, Test, P, lambda = 1e-05, C=NULL)
PEVMAX(Train, Test, P, lambda = 1e-05, C=NULL)
PEVMAX0(Train, Test, P, lambda = 1e-05, C=NULL)
PEVMAX2(Train, Test, P, lambda = 1e-05, C=NULL)
PEVMEAN(Train, Test, P, lambda = 1e-05, C=NULL)
PEVMEAN0(Train, Test, P, lambda = 1e-05, C=NULL)
PEVMEAN2(Train, Test, P, lambda = 1e-05, C=NULL)
PEVMEANMM(Train, Test, Kinv,K, lambda = 1e-05, C=NULL, Vg=NULL, Ve=NULL)
dist_to_test(Train, Test, Dst, lambda, C)
dist_to_test2(Train, Test, Dst, lambda, C)
neg_dist_in_train(Train, Test, Dst, lambda, C)
neg_dist_in_train2(Train, Test, Dst, lambda, C)
vector of identifiers for individuals in the training set
vector of identifiers for individuals in the test set
(Only for Type-X)
(Only for Type-D)
(Only for Type-K)
(Only for Type-K)
scalar shrinkage parameter (
Contrast Matrix.
(Only for PEVMEANMM) covariance matrix between traits generated by the relationship K (multi-trait version).
(Only for PEVMEANMM) residual covariance matrix for the traits (multi-trait version).
value of the criterion.
criterion name | formula | Type | AOPT |
|
X | CDMAX |
|
X | |
CDMAX0 |
|
X | |
|||||||
CDMAX2 |
|
X | |
CDMEAN |
|
X | |
CDMEAN0 |
|
X | |
CDMEAN2 |
|
X | ||||||
|
CDMEANMM |
|
K | |
DOPT |
|
X | EOPT |
|
X | ||||||||||
GAUSSMEANMM |
|
K | |
GOPTPEV |
|
X | GOPTPEV2 |
|
X | PEVMAX |
|
X | ||||||||
PEVMAX0 |
|
X | PEVMAX2 |
|
X | |
PEVMEAN |
|
X | |||||||||||
PEVMEAN0 |
|
X | PEVMEAN2 |
|
X | |
PEVMEANMM |
|
K | dist_to_test | maximum distance from training set to test set based on Dst | D | dist_to_test2 | mean distance from training set to test set based on Dst | D | |||||
neg_dist_in_train | negative of minimum distance between pairs in the training set based on Dst | D | neg_dist_in_train2 | negative of mean distance between distinct pairs in the training set based on Dst | D | criterion name | formula | Type | AOPT |
|
X | CDMAX |
|
X |
# NOT RUN {
# }
# NOT RUN {
#Examples to new criterion:
#1- PEVmax
STPGAUSERFUNC<-function(Train,Test, P, lambda=1e-6, C=NULL){
PTrain<-P[rownames(P)%in%Train,]
PTest<-P[rownames(P)%in%Test,]
if (length(Test)==1){PTest=matrix(PTest, nrow=1)}
if (!is.null(C)){ PTest<-C%*%PTest}
PEV<-PTest%*%solve(crossprod(PTrain)+lambda*diag(ncol(PTrain)),t(PTrain))
PEVmax<-max(diag(tcrossprod(PEV)))
return(PEVmax)
}
######Here is an example of usage
data(iris)
#We will try to estimate petal width from
#variables sepal length and width and petal length.
X<-as.matrix(iris[,1:4])
distX<-as.matrix(dist(X))
rownames(distX)<-colnames(distX)<-rownames(X)<-paste(iris[,5],rep(1:50,3),sep="_" )
#test data 25 iris plants selected at random from the virginica family,
#candidates are the plants in the setosa and versicolor families.
candidates<-rownames(X)[1:100]
test<-sample(setdiff(rownames(X),candidates), 25)
#want to select 25 examples using the criterion defined in STPGAUSERFUNC
#Increase niterations and npop substantially for better convergence.
ListTrain<-GenAlgForSubsetSelection(P=distX,Candidates=candidates,
Test=test,ntoselect=25,npop=50,
nelite=5, mutprob=.8, niterations=30,
lambda=1e-5, errorstat="STPGAUSERFUNC", plotiters=TRUE)
# }
Run the code above in your browser using DataLab