pcops {cops} | R Documentation |
Metaparameter selection for MDS models baseed on the Profile COPS approach (COPS Variant 2). It uses copstress for hyperparameter selection. It is a special case of a STOPS model.
pcops(dis, loss = c("stress", "smacofSym", "smacofSphere", "strain", "sammon", "rstress", "powermds", "sstress", "elastic", "powersammon", "powerelastic", "powerstress", "sammon2", "powerstrain", "apstress"), weightmat = NULL, ndim = 2, init = NULL, theta = c(1, 1, 1), stressweight = 1, cordweight, q = 2, minpts = ndim + 1, epsilon = 100, rang, optimmethod = c("ALJ", "pso", "SANN", "DIRECT", "DIRECTL", "stogo", "MADS", "hjk"), lower = c(1, 1, 0.5), upper = c(5, 5, 2), verbose = 0, scale = c("proc", "sd", "none", "std"), normed = TRUE, s = 4, stresstype = "default", acc = 1e-07, itmaxo = 200, itmaxi = 10000, ...)
dis |
numeric matrix or dist object of a matrix of proximities |
loss |
which loss function to be used for fitting, defaults to strain. Currently allows for the following models:
|
weightmat |
(optional) a matrix of nonnegative weights; defaults to 1 for all off diagonals |
ndim |
number of dimensions of the target space |
init |
(optional) initial configuration. If not supplied, the Torgerson scaling result of the dissimilarity matrix dis^theta[2]/enorm(dis^theta[2],weightmat) is used. |
theta |
the theta vector of powers; the first is kappa (for the fitted distances if it exists), the second lambda (for the observed proximities if it exist), the third is nu (for the weights if it exists) . If a scalar is given as argument, it will take the role designated by the loss argument. Defaults to 1 1 1 |
stressweight |
weight to be used for the fit measure; defaults to 1 |
cordweight |
weight to be used for the cordillera; if missing gets estimated from the initial configuration so that copstress = 0 for theta=c(1,1) |
q |
the norm of the corrdillera; defaults to 1 |
minpts |
the minimum points to make up a cluster in OPTICS; defaults to ndim+1 |
epsilon |
the epsilon parameter of OPTICS, the neighbourhood that is checked; defaults to 10 |
rang |
range of the minimum reachabilities to be considered. If missing it is found from the initial configuration by taking 1.5 times the maximal minimum reachability of the model with theta=c(1,1). If NULL it will be normed to each configuration's minimum and maximum distance, so an absolute value of goodness-of-clusteredness. Note that the latter is not necessarily desirable when comparing configurations for their relative clusteredness. See also |
optimmethod |
What general purpose optimizer to use? Defaults to our adaptive LJ version (ALJ). Also allows particle swarm optimization with s particles ("pso") and simulated annealing ("SANN"), "DIRECT" and "DIRECTL", Hooke-Jeeves ("hjk"), StoGo ("stogo"), and "MADS". We recommend not using SANN and pso with the rstress, sstress and the power stress models. We amde good experiences with ALJ, stogo, DIRECT and DIRECTL and also MADS. |
lower |
The lower contraints of the search region |
upper |
The upper contraints of the search region |
verbose |
numeric value hat prints information on the fitting process; >2 is extremely verbose |
scale |
should the configuration be scaled and/or centered for calculating the cordillera? "std" standardizes each column of the configurations to mean=0 and sd=1, "sd" scales the configuration by the maximum standard devation of any column, "proc" adjusts the fitted configuration to the init configuration (or the Togerson scaling solution if init=NULL). This parameter only has an effect for calculating the cordillera, the fitted and returned configuration is NOT scaled. |
normed |
should the cordillera be normed; defaults to TRUE |
s |
number of particles if pso is used |
stresstype |
what stress to be used for comparisons between solutions |
acc |
termination threshold difference of two successive outer minimization steps. |
itmaxo |
iterations of the outer step (optimization over the hyperparmeters; if solver allows it). Defaults to 200. |
itmaxi |
iterations of the inner step (optimization of the MDS). Defaults to 10000 (whichis huge). |
... |
additional arguments to be passed to the optimization procedure |
A list with the components
copstress: the weighted loss value
OC: the Optics cordillera
optim: the object returned from the optimization procedure
stress: the stress
stress.m: default normalized stress
parameters: the parameters used for fitting (kappa, lambda)
fit: the returned object of the fitting procedure
cordillera: the cordillera object
dis<-as.matrix(smacof::kinshipdelta) set.seed(210485) #configuration is scaled with highest column sd for calculating cordilera res1<-pcops(dis,loss="strain",lower=0.1,upper=5,minpts=2) res1 summary(res1) plot(res1) #only use cordillera for finding the parameters; res2<-pcops(dis,loss="strain",stressweight=0,lower=0.1,upper=5,minpts=2) res2 summary(res2) plot(res2) #With Procrustes adjustment to res1 res3<-pcops(dis,loss="strain",stressweight=0,lower=0.1,upper=5,minpts=2, init=res1$conf,scale="proc") res3 summary(res3) plot(res3) par(mfrow=c(1,3)) plot(res1,"reachplot") plot(res2,"reachplot") plot(res3,"reachplot") par(mfrow=c(1,1)) res1<-pcops(dis,loss="powerstress",theta=c(1,1,1),lower=rep(0.1,3),upper=rep(5,3),minpts=2,verbose=3,cordweight=0.25,rang=c(0,1),weightmat=dis) res1a<-pcops(dis,loss="apstress",lower=0.1,upper=5,minpts=2,verbose=3,cordweight=0.25,rang=c(0,1)) res1a summary(res1a) plot(res1a)