copstressMin {cops} | R Documentation |
Minimizing Copstress to obtain a clustered MDS configuration with given hyperparameters theta.
copstressMin(delta, kappa = 1, lambda = 1, nu = 1, theta = c(kappa, lambda, nu), weightmat = 1 - diag(nrow(delta)), ndim = 2, init = NULL, stressweight = 0.975, cordweight = 0.025, q = 1, minpts = ndim + 1, epsilon = 10, rang = NULL, optimmethod = c("Nelder-Mead", "Newuoa"), verbose = 0, scale = c("sd", "rmsq", "std", "proc", "none"), normed = TRUE, accuracy = 1e-07, itmax = 1e+05, stresstype = c("stress-1", "stress"), ...)
delta |
numeric matrix or dist object of a matrix of proximities |
kappa |
power transformation for fitted distances |
lambda |
power transformation for proximities |
nu |
power transformation for weights |
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 less than three elements are is given as argument, it will be recycled. Defaults to 1 1 1. Will override any kappa, lmabda, nu parameters if they are given and do not match |
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 |
stressweight |
weight to be used for the fit measure; defaults to 0.975 |
cordweight |
weight to be used for the cordillera; defaults to 0.025 |
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 reachabilities to be considered. If missing it is found from the initial configuration by taking 0 as the lower boundary and 1.5 times the maximal reachability of the initial fit as upper boundary. If NULL it will be normed to each configuration's minimum and maximum distance as lower and upper bound respectively, 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 optimizer to use? Defaults to NEWUOA, Nelder-Mead is also supported. |
verbose |
numeric value hat prints information on the fitting process; >2 is very verbose |
scale |
Allows to scale the configuration for the OC. One of none (so no scaling), sd (configuration divided by the maximum standard deviation of the columns), std (standardize all columns !NOTE: This does not preserve the relative distances of the optimal config), proc (procrustes adjustment to the initial fit) and rmsq (configuration divided by the maximum root mean square of the columns). Default is sd. |
normed |
should the cordillera be normed; defaults to TRUE |
accuracy |
numerical accuracy, defaults to 1e-8 |
itmax |
maximum number of iterations. Defaults to 100000 |
stresstype |
which stress to use in the copstress. Defaults to stress-1. If anything else is set, explicitly normed stress which is (stress-1)^2. Using stress-1 puts more weight on MDS fit. |
... |
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) #Copstress with equal weight to stress and cordillera res1<-copstressMin(dis,stressweight=0.5,cordweight=0.5) res1 summary(res1) plot(res1) #super clustered