Title: | Structure Optimized Proximity Scaling |
Version: | 1.9-1 |
Maintainer: | Thomas Rusch <thomas.rusch@wu.ac.at> |
Description: | Methods that use flexible variants of multidimensional scaling (MDS) which incorporate parametric nonlinear distance transformations and trade-off the goodness-of-fit fit with structure considerations to find optimal hyperparameters, also known as structure optimized proximity scaling (STOPS) (Rusch, Mair & Hornik, 2023,<doi:10.1007/s11222-022-10197-w>). The package contains various functions, wrappers, methods and classes for fitting, plotting and displaying different 1-way MDS models with ratio, interval, ordinal optimal scaling in a STOPS framework. These cover essentially the functionality of the package smacofx, including Torgerson (classical) scaling with power transformations of dissimilarities, SMACOF MDS with powers of dissimilarities, Sammon mapping with powers of dissimilarities, elastic scaling with powers of dissimilarities, spherical SMACOF with powers of dissimilarities, (ALSCAL) s-stress MDS with powers of dissimilarities, r-stress MDS, MDS with powers of dissimilarities and configuration distances, elastic scaling powers of dissimilarities and configuration distances, Sammon mapping powers of dissimilarities and configuration distances, power stress MDS (POST-MDS), approximate power stress, Box-Cox MDS, local MDS, Isomap, curvilinear component analysis (CLCA), curvilinear distance analysis (CLDA) and sparsified (power) multidimensional scaling and (power) multidimensional distance analysis (experimental models from smacofx influenced by CLCA). All of these models can also be fit by optimizing over hyperparameters based on goodness-of-fit fit only (i.e., no structure considerations). The package further contains functions for optimization, specifically the adaptive Luus-Jaakola algorithm and a wrapper for Bayesian optimization with treed Gaussian process with jumps to linear models, and functions for various c-structuredness indices. Hyperparameter optimization can be done with a number of techniques but we recommend either Bayesian optimization or particle swarm. For using "Kriging", users need to install a version of the archived 'DiceOptim' R package. |
Depends: | R (≥ 3.5.0), smacofx |
Imports: | acepack, clue, cmaes, cordillera, dfoptim, energy, minerva, nloptr, pomp, pso, registry, scagnostics, smacof, tgp, vegan |
Enhances: | stats |
Suggests: | R.rsp, DiceOptim, DiceKriging |
License: | GPL-2 | GPL-3 |
LazyData: | true |
URL: | https://r-forge.r-project.org/projects/stops/ |
VignetteBuilder: | R.rsp |
Encoding: | UTF-8 |
RoxygenNote: | 7.3.2 |
NeedsCompilation: | no |
Packaged: | 2025-04-28 08:44:54 UTC; trusch |
Author: | Thomas Rusch |
Repository: | CRAN |
Date/Publication: | 2025-04-28 09:10:02 UTC |
stops: Structure Optimized Proximity Scaling
Description
A package for "structure optimized proximity scaling" (STOPS), a collection of methods that fit nonlinear distance transformations in multidimensional scaling (MDS) and trade-off the fit with structure considerations to find optimal parameters or optimal configurations. The package contains various functions, wrappers, methods and classes for fitting, plotting and displaying different MDS models in a STOPS framework like Torgerson scaling, SMACOF, Sammon mapping, elastic scaling, symmetric SMACOF, spherical SMACOF, sstress, rstress, powermds, power elastic scaling, power sammon mapping, power stress, Isomap, approximate power stress, restricted power stress. All of these models can also be fit as MDS variants (i.e., no structuredness). The package further contains functions for optimization (Adaptive Luus-Jaakola and for Bayesian optimization with treed Gaussian process with jump to linear models) and functions for various structuredness indices
Details
The stops package provides five categories of important functions:
Models:
stops ... which fits STOPS models as described in Rusch et al. (2023) via argument loss with ratio, interval or ordinal optimal scaling (not all optimal scalings can be used with all loss arguments). By setting cordweight or strucweight to zero they can also be used to fit MDS for many different models:
loss="stress": One parameter theta, power transformations of dissimilarities. Via stop_smacofSym.
loss="sammon": One parameter theta, power transformations of dissimilarities. Via stop_sammon.
loss="strain": One parameter theta, power transformations of dissimilarities. Via stop_cmdscale.
loss="rstress": One parameter theta, power transformations of fitted distances. Via stop_rstress.
loss="smacofSphere": One parameter theta, power transformations of dissimilarities. Via stop_smacofSphere.
loss="sammon2": One parameter theta, power transformations of dissimilarities. Via stop_sammon2.
loss="elastic": One parameter theta, power transformations of dissimilarities. Via stop_elastic.
loss="sstress": One parameter theta, power transformations of dissimilarities. Via stop_sstress.
loss="isomap_k": One parameter theta, k neighborhood for geodesic distances. Via stop_isomap1.
loss="isomap_eps": One parameter theta, epsilon neighborhood for geodesic distances. Via stop_isomap2.
loss="smds": One parameter theta, neighborhood parameter tau. Via stop_smds.
loss="clca": One parameter theta, neighborhood parameters lambda0. Via stop_clca.
loss="powerelastic": Two parameter theta, power transformations of dissimilarities and fitted distances. Via stop_powerelastic.
loss="powersammon": Two parameter theta, power transformations of dissimilarities and fitted distances. Via stop_powersammon.
loss="powermds": Two parameter theta, power transformations of dissimilarities and fitted distances. Via stop_powermds.
loss="rpstress": Two parameter theta, power transformations of dissimilarities/fitted distances and weights. Via stop_rpowerstress.
loss="smdda_k": Two parameter theta, neighborhood parameters k (geodesic distance) and tau. Via stop_smmdak.
loss="smdda_eps": Two parameter theta, neighborhood parameters eps (geodesic distance) and tau. stop_smddae.
loss="lmds": Two parameter theta, neighbourhood parameters tau and k. Via stop_lmds.
loss="clda_eps": Two parameter theta, neighborhood parameters lambda0 and epsilon (geodesic distance). Via stop_cldae.
loss="clda_k": Two parameter theta, neighborhood parameters lambda0 and k (geodesic distance). Via stop_cldak.
loss="powerstress": Three parameter theta, power transformations of dissimilarities, fitted distances and weights. Via stop_powerstress.
loss="bcmds": Three parameter theta, Box-Cox transformations of dissimilarities, fitted distances and weights. Via stop_bcmds.
loss="apstress": Three parameter theta, power transformations of dissimilarities, fitted distances and weights. Via stop_apstress.
loss="spmds": Four parameter theta, power transformations of dissimilarities, fitted distances and weights and neighborhood parametr tau. Via stop_spmds.
loss="spmdda_k": Five parameter theta, power transformations for dissimilarities, fitted distances and weights and neighborhood parameters k (geodesic distance) and tau. Via stop_spmddak.
loss="spmdda_eps": Five parameter theta, power transformations for dissimilarities, fitted distances and weights and neighborhood parameters eps (geodesic distance) and tau. Via stop_spmddae.
Structuredness Indices: Various c-structuredness as c_foo(), where foo is the name of the structuredness. See Rusch et al. (2023).
Optimization functions:
ljoptim() ... An (adaptive) version of the Luus-Jakola random search
Methods: For most of the objects returned by the high-level functions S3 classes and methods for standard generics were implemented, including print, summary, plot, coef (extracting the hyperparameetrs).
References:
Rusch, T., Mair, P., & Hornik, K. (2023). Structure-based hyperparameter selection with Bayesian optimization in multidimensional scaling. Statistics & Computing, 33, [28]. https://doi.org/10.1007/s11222-022-10197-w
Author(s)
Maintainer: Thomas Rusch thomas.rusch@wu.ac.at (ORCID)
Authors:
Patrick Mair (ORCID)
Other contributors:
Kurt Hornik Kurt.Hornik@R-project.org (ORCID) [contributor]
See Also
Useful links:
Examples
#data(Swissroll)
#dissm<-as.matrix(dist(Swissroll[,1:3]))
#cols<-Swissroll[,4]
#structures<-c("cregularity","cdependence")
#strucweight<-c(-0.5,0.5)
#strucpars<-list(list(epsilon=10,minpts=2,scale=3),list(NULL))
dissm<-as.matrix(smacof::morse)
#Setting up structurenedness parameters
strucpars<-list(list(epsilon=10,scale=3),list(NULL))
structures<-c("cclusteredness","cdependence")
#STOPS with strain
resstrain<-stops(dissm,loss="strain",theta=1,structures=structures,
strucpars=strucpars,optimmethod="ALJ",lower=0.5,upper=5,itmax=10)
resstrain
summary(resstrain)
plot(resstrain)
#Fun fact: With strain clinearity must be 0 as the
#two principal axes are orthogonal
#and this can't be changed by taking
#the dissimilarities to a power
resstressm<-stops(dissm,loss="stress",theta=1,structures=structures,
strucpars=strucpars,optimmethod="ALJ",lower=0.5,upper=5,itmax=10,stoptype="multiplicative")
resstressm
plot(resstressm)
#STOPS with stress or smacofSym
im<-2 #this is the itmax argument used for testing; use higher itmax in practice
resstress<-stops(dissm,loss="stress",theta=1,
structures=structures,
strucpars=strucpars,optimmethod="ALJ",lower=0.5,upper=5,itmax=im)
resstress
summary(resstress)
plot(resstress)
plot(resstress,"Shepard")
#STOPS with smacofSphere
ressph<-stops(dissm,loss="smacofSphere",theta=1,
structures=structures,
strucpars=strucpars,optimmethod="ALJ",lower=0.5,upper=5,itmax=im)
ressph
summary(ressph)
plot(ressph)
#STOPS with sammon
ressam<-stops(dissm,loss="sammon",theta=1,
structures=structures,
strucpars=strucpars,optimmethod="ALJ",lower=0.5,upper=5,itmax=im)
ressam
summary(ressam)
plot(ressam)
plot(ressam,"transplot")
#STOPS with sammon2
ressam<-stops(dissm,loss="sammon2",theta=1,
structures=structures,
strucpars=strucpars,optimmethod="ALJ",lower=0.5,upper=5,itmax=im)
ressam
summary(ressam)
plot(ressam)
plot(ressam,"Shepard")
#STOPS with elastic
ressam<-stops(dissm,loss="elastic",theta=1,
structures=structures,
strucpars=strucpars,optimmethod="ALJ",lower=0.5,upper=5,itmax=im)
ressam
summary(ressam)
plot(ressam)
plot(ressam,"transplot")
#STOPS with sstress
resss<-stops(dissm,loss="sstress",theta=1,
structures=structures,
strucpars=strucpars,optimmethod="ALJ",lower=0.5,upper=5,itmax=im)
resss
summary(resss)
plot(resss)
plot(resss,"Shepard")
plot(resss,"transplot")
#STOPS with powerstress
respstress<-stops(dissm,loss="powerstress",
structures=structures,theta=c(1,1,1),
strucpars=strucpars,weightmat=dissm,
itmaxps=1000,optimmethod="ALJ",lower=c(0.5,0.5,1),upper=c(5,5,5),itmax=im)
respstress
summary(respstress)
plot(respstress)
#STOPS with restricted powerstress
respstressr<-stops(dissm,loss="powerstress",theta=c(1,1),
structures=structures,
strucpars=strucpars,weightmat=dissm,
itmaxps=1000,optimmethod="ALJ",lower=c(0.5,0.5),upper=c(5,5),itmax=im)
respstressr
summary(respstressr)
plot(respstressr)
#STOPS with powermds
respmds<-stops(dissm,loss="powermds",
structures=structures,theta=c(1,1),
strucpars=strucpars,weightmat=dissm,
itmaxps=1000,optimmethod="ALJ",lower=c(0.5,0.5),upper=c(5,5),itmax=im)
respmds
summary(respmds)
plot(respmds)
#STOPS with powersammon
respmds<-stops(dissm,loss="powersammon",theta=c(1,1),
structures=structures,
strucpars=strucpars,weightmat=dissm,
itmaxps=1000,optimmethod="ALJ",lower=c(0.5,0.5),upper=c(5,5),itmax=im)
respmds
summary(respmds)
plot(respmds)
#STOPS with powerelastic
respmds<-stops(dissm,loss="powerelastic",theta=c(1,1),
structures=structures,
strucpars=strucpars,weightmat=dissm,
itmaxps=1000,optimmethod="ALJ",lower=c(0.5,0.5,1),upper=c(5,5,5),itmax=im)
respmds
summary(respmds)
plot(respmds)
#STOPS with ordinal rstress
resr<-stops(dissm,loss="rstress",type="ordinal",theta=1,
structures=structures,
strucpars=strucpars,weightmat=dissm,
itmaxps=1000,optimmethod="ALJ",lower=0.5,upper=5,itmax=im)
resr
summary(resr)
plot(resr)
#STOPS with approximated powerstress
respstressa<-stops(dissm,loss="powerstress",
structures=structures,
strucpars=strucpars,weightmat=dissm,theta=c(1,1,1),
itmaxps=1000,optimmethod="ALJ",lower=c(0.5,0.5,1),upper=c(5,5,5),itmax=im)
respstressa
summary(respstressa)
plot(respstressa,"transplot")
#STOPS with bcmds
resbcstress<-stops(dissm,loss="bcmds",
structures=structures,
strucpars=strucpars,optimmethod="ALJ",lower=c(0.5,1,0.5),upper=c(5,5,5),itmax=im)
resbcstress
summary(resbcstress)
plot(resbcstress)
#STOPS with lmds
reslmds<-stops(dissm,loss="lmds",theta=c(1,1),
structures=structures,
strucpars=strucpars,optimmethod="ALJ",lower=c(2,0),upper=c(5,1),itmax=im)
reslmds
summary(reslmds)
plot(reslmds)
#STOPS with Isomap (the k version)
resiso2<-stops(dissm,loss="isomap",theta=5,
structures=structures,
strucpars=strucpars,optimmethod="ALJ",lower=3,upper=10,itmax=im)
resiso2
summary(resiso2)
plot(resiso2)
#STOPS with Isomap (the eps version)
resiso<-stops(dissm,loss="isomapeps",
structures=structures,
theta=40,
strucpars=strucpars,optimmethod="ALJ",lower=50,upper=120,itmax=im)
resiso
summary(resiso)
plot(resiso)
strucweight<-c(-0.5,-0.5)
#STOPS with smds
resclca<-stops(dissm,loss="smds",theta=0.3,
structures=structures, strucpars=strucpars,
strucweight=strucweight,lower=0.1,upper=5,
optimmethod="pso",itmax=im*4)
resclca
summary(resclca)
plot(resclca)
#STOPS with spmds
respclca<-stops(dissm,loss="spmds",theta=c(1,1,1,1),
structures=structures,strucpars=strucpars,
strucweight=strucweight,lower=c(0.1,0.1,0.1,0.1),upper=c(5,5,5,5),
optimmethod="ALJ",itmax=im)
respclca
coef(respclca)
summary(respclca)
plot(respclca)
#STOPS with smdda and k
rescldak<-stops(dissm,loss="smdda_k",theta=c(1,5),
structures=structures,strucpars=strucpars,
strucweight=strucweight,lower=c(0.2,4),upper=c(4,20),
optimmethod="pso",itmax=im*4)
rescldak
summary(rescldak)
plot(rescldak)
#STOPS with smdda in eps
set.seed(123)
rescldae<-stops(dissm,loss="smdda_eps",theta=c(1,2),
structures=structures,strucpars=strucpars,
strucweight=strucweight,lower=c(0.2,1),upper=c(4,10),
optimmethod="SANN",itmax=10*im,stoptype="multiplicative")
rescldae
summary(rescldae)
plot(rescldae)
#STOPS with spmdda with k (five parameters already..)
respcldak<-stops(dissm,loss="spmdda_k",theta=c(1,1,1,1,5),
structures=structures,strucpars=strucpars,
strucweight=strucweight,lower=c(0.8,0.8,0.8,0.8,4),upper=c(5,5,5,5,20),
optimmethod="tgp",itmax=im)
respcldak
summary(respcldak)
plot(respcldak)
#STOPS with spmdda with eps (five parameter already..)
set.seed(123)
respcldae<-stops(dissm,loss="spmdda_eps",theta=c(1,1,1,1,2),
structures=structures,strucpars=strucpars,
strucweight=strucweight,lower=c(0.8,0.8,0.8,0.8,1),upper=c(5,5,5,5,10),
optimmethod="tgp",itmax=im)
respcldae
summary(respcldae)
plot(respcldae)
#STOPS with clca
set.seed(123)
resclca<-stops(dissm,loss="clca",theta=c(1),
structures=structures,strucpars=strucpars,
strucweight=strucweight,lower=0.1,upper=5,itmax=im)
resclca
summary(resclca)
plot(resclca)
Banking Crises Distances
Description
Matrix of Jaccard distances between 70 countries (Hungary and Greece were combined to be the same observation) based on their binary time series of having had a banking crises in a year from 1800 to 2010 or not. See data(bankingCrises) in package Ecdat for more info. The last column is Reinhart & Rogoffs classification as a low (3), middle- (2) or high-income country (1).
Format
A 69 x 70 matrix.
Source
data(bankingCrises) in library(Ecdat)
Pen digits
Description
These data are a random sample of 500 of the 10992 pendigits data from Alimoglu (1996). The original data were from 44 writers who handwrote 250 times the digits 0,...,9. The digits were written inside a rectangular box with a resolution of 500 x 500 pixels and the first 10 per writer were ignored for further analysis. This led to 10992 digits. They were recorded in small time intervals by following the trajectory of the pen on the 500 x 500 grid and then normalized. From the normalized trajectory 8 points (x and y axis position) were randomly selected for each handwritten digit, leading to 16 predictors variables. We extarcted a random sample of 500 of them.
Usage
data(Pendigits500)
Format
A data frame with 500 rows and 17 variables
Details
The variables are
The rownames of Pendigits500 refer to the data point of the 10992 original data
V1-V16: trajectory points (x, y coordinate) of the grid
digits: The digit actually written (the label)
Source
From A. Izenman (2010) Modern multivariate statistical techniques. Springer.
Swiss roll
Description
A swiss roll data example where 150 data points are arranged on a swiss roll embedded in a 3D space.
Usage
data(Swissroll)
Format
A data frame with 150 rows and 4 columns
Details
A data frame with the variables (columns)
x The x axis coordinate for each point
y The y axis coordinate for each point
z The z axis coordinate for each point
col a color code for each point with points along the y axis having the same color (based on the viridis palette)
S3 method for stops objects
Description
S3 method for stops objects
Usage
## S3 method for class 'stops'
biplotmds(object, extvar, scale = TRUE)
Arguments
object |
An object of class stops |
extvar |
Data frame with external variables. |
scale |
if 'TRUE' external variables are standardized internally. |
Details
If a model for individual differences is provided, the external
variables are regressed on the group stimulus space
configurations. For objects returned from 'biplotmds' we use the plot method in
biplotmds
. In the biplot called with plot() only the relative length of the
vectors and their direction matters. Using the vecscale argument in plot() the
user can control for the relative length of the vectors. If
'vecscale = NULL', the 'vecscale()' function from the 'candisc'
package is used which tries to automatically calculate the scale
factor so that the vectors approximately fill the same space as
the configuration. In this method vecscale should usually be smaller than the one used in smacof
by a factor of 0.1.
Value
Returns an object belonging to classes 'mlm' and 'mdsbi'. See 'lm' for details.
R2vec: Vector containing the R2 values.
See also biplotmds
for the plot method.
MDS Bootstrap for stops objects
Description
Performs a bootstrap on an MDS solution. It works for derived dissimilarities only, i.e. generated by the call dist(data). The original data matrix needs to be provided, as well as the type of dissimilarity measure used to compute the input dissimilarities (note we cannot as of yet have any dissimilarity matrix).
Usage
## S3 method for class 'stops'
bootmds(
object,
data,
method.dat = "pearson",
nrep = 100,
alpha = 0.05,
verbose = FALSE,
...
)
Arguments
object |
Object of class stops or pcops. |
data |
Initial data (before dissimilarity computation). |
method.dat |
Dissimilarity computation used as MDS input. This must be one of "pearson", "spearman", "kendall", "euclidean", "maximum", "manhattan", "canberra", "binary". |
nrep |
Number of bootstrap replications. |
alpha |
Alpha level for condfidence ellipsoids. |
verbose |
If 'TRUE', bootstrap index is printed out. |
... |
Additional arguments needed for dissimilarity computation as specified in |
Details
In order to examine the stability solution of an MDS, a bootstrap on the raw data can be performed. This results in confidence ellipses in the configuration plot. The ellipses are returned as list which allows users to produce (and further customize) the plot by hand. See bootmds
for more.
Value
An object of class 'smacofboot', see bootmds
. With values
cov: Covariances for ellipse computation
bootconf: Configurations bootstrap samples
stressvec: Bootstrap stress values
bootci: Stress bootstrap percentile confidence interval
spp: Stress per point (based on stress.en)
stab: Stability coefficient
Examples
dats <- na.omit(PVQ40[,1:5])
diss <- dist(t(dats)) ## Euclidean distances
fit <- stops(diss,loss="rstress",itmax=5,lower=0.2,upper=3)
set.seed(123)
resboot <- bootmds(fit, dats, method.dat = "euclidean", nrep = 2)
resboot
c-association calculates the c-association based on the maximal information coefficient We define c-association as the aggregated association between any two columns in confs
Description
c-association calculates the c-association based on the maximal information coefficient We define c-association as the aggregated association between any two columns in confs
Usage
c_association(
confs,
aggr = NULL,
alpha = 0.6,
C = 15,
var.thr = 1e-05,
zeta = NULL
)
Arguments
confs |
a numeric matrix or data frame |
aggr |
the aggregation function for configurations of more than two dimensions. Defaults to max. |
alpha |
an optional number of cells allowed in the X-by-Y search-grid. Default value is 0.6 |
C |
an optional number determining the starting point of the X-by-Y search-grid. When trying to partition the x-axis into X columns, the algorithm will start with at most C X clumps. Default value is 15. |
var.thr |
minimum value allowed for the variance of the input variables, since mine can not be computed in case of variance close to 0. Default value is 1e-5. |
zeta |
integer in [0,1] (?). If NULL (default) it is set to 1-MIC. It can be set to zero for noiseless functions, but the default choice is the most appropriate parametrization for general cases (as stated in Reshef et al). It provides robustness. |
Value
a numeric value; association (aggregated maximal information coefficient MIC, see mine
)
Examples
x<-seq(-3,3,length.out=200)
y<-sqrt(3^2-x^2)
z<- sin(y-x)
confs<-cbind(x,y,z)
c_association(confs)
c-clumpiness
Description
Measures the c-clumpiness structure
Usage
c_clumpiness(conf, aggr = NULL)
Arguments
conf |
A numeric matrix. |
aggr |
the aggregation function for configurations of more than two dimensions. Defaults to max. |
Value
a numeric value; clumpiness (see scagnostics
)
Examples
delts<-smacof::kinshipdelta
conf<-smacof::smacofSym(delts)$conf
plot(conf,pch=19,asp=1)
c_clumpiness(conf)
c-clusteredness calculates c-clusteredness as the OPTICS cordillera. The higher the more clustered.
Description
c-clusteredness calculates c-clusteredness as the OPTICS cordillera. The higher the more clustered.
Usage
c_clusteredness(
confs,
voidarg = NULL,
minpts = 2,
q = 2,
epsilon = 2 * max(dist(confs)),
distmeth = "euclidean",
dmax = NULL,
digits = 10,
scale = 0,
...
)
Arguments
confs |
a numeric matrix or a dist object |
voidarg |
a placeholder to allow to pass NULL as strucpar and not interfere with the other arguments |
minpts |
The minimum number of points that must make up a cluster in OPTICS (corresponds to k in the paper). It is passed to |
q |
The norm used for the Cordillera. Defaults to 2. |
epsilon |
The epsilon parameter for OPTICS (called epsilon_max in the paper). Defaults to 2 times the maximum distance between any two points. |
distmeth |
The distance to be computed if X is not a symmetric matrix or a dist object (otherwise ignored). Defaults to Euclidean distance. |
dmax |
The winsorization value for the highest allowed reachability. If used for comparisons between different configurations this should be supplied. If no value is supplied, it is NULL (default); then dmax is taken from the data as the either epsilon or the largest reachability, whatever is smaller. |
digits |
The precision to round the raw Cordillera and the norm factor. Defaults to 10. |
scale |
Should X be scaled if it is an asymmetric matrix or data frame? Can take values TRUE or FALSE or a numeric value. If TRUE or 1, standardisation is to mean=0 and sd=1. If 2, no centering is applied and scaling of each column is done with the root mean square of each column. If 3, no centering is applied and scaling of all columns is done as X/max(standard deviation(allcolumns)). If 4, no centering is applied and scaling of all columns is done as X/max(rmsq(allcolumns)). If FALSE, 0 or any other numeric value, no standardisation is applied. Defaults to 0. |
... |
Additional arguments to be passed to |
Value
a numeric value; clusteredness (see cordillera
)
Examples
delts<-smacof::kinshipdelta
dis<-smacofSym(delts)$confdist
c_clusteredness(dis,minpts=3)
c-complexity Calculates the c-complexity based on the minimum cell number We define c-complexity as the aggregated minimum cell number between any two columns in confs This is one of few c-structuredness indices not between 0 and 1, but can be between 0 and (theoretically) infinity
Description
c-complexity Calculates the c-complexity based on the minimum cell number We define c-complexity as the aggregated minimum cell number between any two columns in confs This is one of few c-structuredness indices not between 0 and 1, but can be between 0 and (theoretically) infinity
Usage
c_complexity(
confs,
aggr = NULL,
alpha = 1,
C = 15,
var.thr = 1e-05,
zeta = NULL
)
Arguments
confs |
a numeric matrix or data frame |
aggr |
the aggregation function for configurations of more than two dimensions. Defaults to min. |
alpha |
an optional number of cells allowed in the X-by-Y search-grid. Default value is 1 |
C |
an optional number determining the starting point of the X-by-Y search-grid. When trying to partition the x-axis into X columns, the algorithm will start with at most C X clumps. Default value is 15. |
var.thr |
minimum value allowed for the variance of the input variables, since mine can not be computed in case of variance close to 0. Default value is 1e-5. |
zeta |
integer in [0,1] (?). If NULL (default) it is set to 1-MIC. It can be set to zero for noiseless functions, but the default choice is the most appropriate parametrization for general cases (as stated in Reshef et al.). It provides robustness. |
Value
a numeric value; complexity (aggregated minimum cell number MCN, see mine
)
Examples
x<-seq(-3,3,length.out=200)
y<-sqrt(3^2-x^2)
z<- sin(y-x)
confs<-cbind(x,y,z)
c_complexity(confs)
c-convexity
Description
Measures the c-convexity structure
Usage
c_convexity(conf, aggr = NULL)
Arguments
conf |
A numeric matrix. |
aggr |
the aggregation function for configurations of more than two dimensions. Defaults to max. |
Value
a numeric value; convexity (see scagnostics
)
Examples
delts<-smacof::kinshipdelta
conf<-smacof::smacofSym(delts)$conf
plot(conf,pch=19,asp=1)
c_convexity(conf)
c-dependence calculates c-dependence as the aggregated distance correlation of each pair if nonidentical columns
Description
c-dependence calculates c-dependence as the aggregated distance correlation of each pair if nonidentical columns
Usage
c_dependence(confs, aggr = NULL, index = 1)
Arguments
confs |
a numeric matrix or data frame |
aggr |
the aggregation function for configurations of more than two dimensions. Defaults to max. |
index |
exponent on Euclidean distance, in (0,2] |
Value
a numeric value; dependence (aggregated distance correlation)
Examples
x<-1:10
y<-2+3*x+rnorm(10)
confs<-cbind(x,y)
c_dependence(confs,1.5)
c-faithfulness calculates the c-faithfulness based on the index by Chen and Buja 2013 (M_adj) with equal input neigbourhoods
Description
c-faithfulness calculates the c-faithfulness based on the index by Chen and Buja 2013 (M_adj) with equal input neigbourhoods
Usage
c_faithfulness(confs, obsdiss, k = 3, ...)
Arguments
confs |
a numeric matrix or a dist object |
obsdiss |
a symmetric numeric matrix or a dist object. Must be supplied. |
k |
the number of nearest neighbours to be looked at |
... |
additional arguments passed to dist() |
Value
a numeric value; faithfulness
Examples
delts<-smacof::kinshipdelta
dis<-smacofSym(delts)$confdist
c_faithfulness(dis,obsdiss=delts,k=3)
c-functionality calculates the c-functionality based on the maximum edge value We define c-functionality as the aggregated functionality between any two columns of confs
Description
c-functionality calculates the c-functionality based on the maximum edge value We define c-functionality as the aggregated functionality between any two columns of confs
Usage
c_functionality(
confs,
aggr = NULL,
alpha = 1,
C = 15,
var.thr = 1e-05,
zeta = NULL
)
Arguments
confs |
a numeric matrix or data frame |
aggr |
the aggregation function for configurations of more than two dimensions. Defaults to mean |
alpha |
an optional number of cells allowed in the X-by-Y search-grid. Default value is 1 |
C |
an optional number determining the starting point of the X-by-Y search-grid. When trying to partition the x-axis into X columns, the algorithm will start with at most C X clumps. Default value is 15. |
var.thr |
minimum value allowed for the variance of the input variables, since mine can not be computed in case of variance close to 0. Default value is 1e-5. |
zeta |
integer in [0,1] (?). If NULL (default) it is set to 1-MIC. It can be set to zero for noiseless functions, but the default choice is the most appropriate parametrization for general cases (as stated in Reshef et al.). It provides robustness. |
Value
a numeric value; functionality (aggregated maximaum edge value MEV, see mine
)
Examples
x<-seq(-3,3,length.out=200)
y<-sqrt(3^2-x^2)
z<- sin(y-x)
confs<-cbind(x,y,z)
c_functionality(confs)
c-hierarchy captures how well a partition/ultrametric (obtained by hclust) explains the configuration distances. Uses variance explained for euclidean distances and deviance explained for everything else.
Description
c-hierarchy captures how well a partition/ultrametric (obtained by hclust) explains the configuration distances. Uses variance explained for euclidean distances and deviance explained for everything else.
Usage
c_hierarchy(confs, voidarg = NULL, p = 2, agglmethod = "complete")
Arguments
confs |
a numeric matrix |
voidarg |
a placeholder to allow to pass NULL as strucpar and not interfere with the other arguments |
p |
the parameter of the Minokwski distances (p=2 euclidean and p=1 is manhattan) |
agglmethod |
the method used for creating the clustering, see |
Value
a numeric value; hierarchy (see cl_validity
)
Examples
delts<-smacof::kinshipdelta
conf<-smacofSym(delts)$conf
c_hierarchy(conf,p=2,agglmethod="single")
c-inequality Calculates c-inequality (as in an economic measure of inequality) as Pearsons coefficient of variation of the fitted distance matrix. This can help with avoiding degenerate solutions. This is one of few c-structuredness indices not between 0 and 1, but 0 and infinity.
Description
c-inequality Calculates c-inequality (as in an economic measure of inequality) as Pearsons coefficient of variation of the fitted distance matrix. This can help with avoiding degenerate solutions. This is one of few c-structuredness indices not between 0 and 1, but 0 and infinity.
Usage
c_inequality(confs, ...)
Arguments
confs |
a numeric matrix or data frame |
... |
additional arguments (don't do anything) |
Value
a numeric value; inequality (Pearsons coefficient of variation of the fitted distance matrix)
Examples
x<-1:10
y<-2+3*x+rnorm(10)
z<- sin(y-x)
confs<-cbind(z,y,x)
c_inequality(confs)
c-linearity calculates c-linearity as the aggregated multiple correlation of all columns of the configuration.
Description
c-linearity calculates c-linearity as the aggregated multiple correlation of all columns of the configuration.
Usage
c_linearity(confs, aggr = NULL)
Arguments
confs |
a numeric matrix or data frame |
aggr |
the aggregation function for configurations of more than two dimensions. Defaults to max. |
Value
a numeric value; linearity (aggregated multiple correlation of all columns of the configuration)
Examples
x<-1:10
y<-2+3*x+rnorm(10)
z<- sin(y-x)
confs<-cbind(z,y,x)
c_linearity(confs)
c-manifoldness calculates c-manifoldness as the aggregated maximal correlation coefficient (i.e., Pearson correlation of the ACE transformed variables) of all pairwise combinations of two different columns in confs. If there is an NA (happens usually when the optimal transformation of any variable is a constant and therefore the covariance is 0 but also one of the sds in the denominator), it gets skipped.
Description
c-manifoldness calculates c-manifoldness as the aggregated maximal correlation coefficient (i.e., Pearson correlation of the ACE transformed variables) of all pairwise combinations of two different columns in confs. If there is an NA (happens usually when the optimal transformation of any variable is a constant and therefore the covariance is 0 but also one of the sds in the denominator), it gets skipped.
Usage
c_manifoldness(confs, aggr = NULL)
Arguments
confs |
a numeric matrix or data frame |
aggr |
the aggregation function for configurations of more than two dimensions. Defaults to max. |
Value
a numeric value; manifoldness (aggregated maximal correlation, correlation of ACE tranformed x and y, see ace
)
Examples
x<--100:100
y<-sqrt(100^2-x^2)
confs<-cbind(x,y)
c_manifoldness(confs)
wrapper for getting the mine coefficients
Description
wrapper for getting the mine coefficients
Usage
c_mine(confs, master = NULL, alpha = 0.6, C = 15, var.thr = 1e-05, zeta = NULL)
Arguments
confs |
a numeric matrix or data frame with two columns |
master |
the master column |
alpha |
an optional number of cells allowed in the X-by-Y search-grid. Default value is 0.6 |
C |
an optional number determining the starting point of the X-by-Y search-grid. When trying to partition the x-axis into X columns, the algorithm will start with at most C X clumps. Default value is 15. |
var.thr |
minimum value allowed for the variance of the input variables, since mine can not be computed in case of variance close to 0. Default value is 1e-5. |
zeta |
integer in [0,1] (?). If NULL (default) it is set to 1-MIC. It can be set to zero for noiseless functions, but the default choice is the most appropriate parametrization for general cases (as stated in Reshef et al. SOM; they call it epsilon in the paper). It provides robustness. |
c-nonmonotonicity calculates the c-nonmonotonicity based on the maximum asymmetric score We define c-nonmonotonicity as the aggregated nonmonotonicity between any two columns in confs this is one of few c-structuredness indices not between 0 and 1
Description
c-nonmonotonicity calculates the c-nonmonotonicity based on the maximum asymmetric score We define c-nonmonotonicity as the aggregated nonmonotonicity between any two columns in confs this is one of few c-structuredness indices not between 0 and 1
Usage
c_nonmonotonicity(
confs,
aggr = NULL,
alpha = 1,
C = 15,
var.thr = 1e-05,
zeta = NULL
)
Arguments
confs |
a numeric matrix or data frame |
aggr |
the aggregation function for configurations of more than two dimensions. Defaults to max. |
alpha |
an optional number of cells allowed in the X-by-Y search-grid. Default value is 1 |
C |
an optional number determining the starting point of the X-by-Y search-grid. When trying to partition the x-axis into X columns, the algorithm will start with at most C X clumps. Default value is 15. |
var.thr |
minimum value allowed for the variance of the input variables, since mine can not be computed in case of variance close to 0. Default value is 1e-5. |
zeta |
integer in [0,1] (?). If NULL (default) it is set to 1-MIC. It can be set to zero for noiseless functions, but the default choice is the most appropriate parametrization for general cases (as stated in Reshef et al. SOM). It provides robustness. |
Value
a numeric value; nonmonotonicity (aggregated maximal asymmetric score MAS, see mine
)
Examples
x<-seq(-3,3,length.out=200)
y<-sqrt(3^2-x^2)
z<- sin(y-x)
confs<-cbind(x,y,z)
c_nonmonotonicity(confs)
c-outlying
Description
Measures the c-outlying structure
Usage
c_outlying(conf, aggr = NULL)
Arguments
conf |
A numeric matrix. |
aggr |
the aggregation function for configurations of more than two dimensions. Defaults to max. |
Value
a numeric value; outlying (see scagnostics
)
Examples
delts<-smacof::kinshipdelta
conf3<-smacof::smacofSym(delts,ndim=3)$conf
c_outlying(conf3)
c-regularity calculates c-regularity as 1 - OPTICS cordillera for k=2. The higher the more regular.
Description
c-regularity calculates c-regularity as 1 - OPTICS cordillera for k=2. The higher the more regular.
Usage
c_regularity(
confs,
voidarg = NULL,
q = 1,
epsilon = 2 * max(dist(confs)),
distmeth = "euclidean",
dmax = NULL,
digits = 10,
scale = 0,
...
)
Arguments
confs |
a numeric matrix or a dist object |
voidarg |
a placeholder to allow to pass NULL as strucpar and not interfere with the other arguments |
q |
The norm used for the Cordillera. Defaults to 1 (and should always be 1 imo). |
epsilon |
The epsilon parameter for OPTICS (called epsilon_max in the paper). Defaults to 2 times the maximum distance between any two points. |
distmeth |
The distance to be computed if X is not a symmetric matrix or a dist object (otherwise ignored). Defaults to Euclidean distance. |
dmax |
The winsorization value for the highest allowed reachability. If used for comparisons this should be supplied. If no value is supplied, it is NULL (default), then dmax is taken from the data as minimum of epsilon or the largest reachability. |
digits |
The precision to round the raw Cordillera and the norm factor. Defaults to 10. |
scale |
Should X be scaled if it is an asymmetric matrix or data frame? Can take values TRUE or FALSE or a numeric value. If TRUE or 1, standardisation is to mean=0 and sd=1. If 2, no centering is applied and scaling of each column is done with the root mean square of each column. If 3, no centering is applied and scaling of all columns is done as X/max(standard deviation(allcolumns)). If 4, no centering is applied and scaling of all columns is done as X/max(rmsq(allcolumns)). If FALSE, 0 or any other numeric value, no standardisation is applied. Defaults to 0. |
... |
Additional arguments to be passed to |
Value
a numeric value; regularity
Examples
hpts<-expand.grid(seq(-5,5),seq(-5,5))
c_regularity(hpts)
hpts2<-cbind(jitter(hpts[,1]),jitter(hpts[,2]))
c_regularity(hpts2)
c-shepardness calculates the c-shepardness as the correlation between a loess smoother of the transformed distances and the transformed dissimilarities
Description
c-shepardness calculates the c-shepardness as the correlation between a loess smoother of the transformed distances and the transformed dissimilarities
Usage
c_shepardness(object, voidarg = NULL)
Arguments
object |
an object of class smacofP |
voidarg |
empty argument to allow passing NULL as strucpar |
Value
a numeric value
Examples
delts<-smacof::kinshipdelta
res<-smacofx::postmds(delts)
c_shepardness(res)
c-skinniness
Description
Measures the c-skinniness structure
Usage
c_skinniness(conf, aggr = NULL)
Arguments
conf |
A numeric matrix. |
aggr |
the aggregation function for configurations of more than two dimensions. Defaults to max. |
Value
a numeric value; skinniness (see scagnostics
)
Examples
delts<-smacof::kinshipdelta
conf<-smacof::smacofSym(delts)$conf
plot(conf,pch=19,asp=1)
c_skinniness(conf)
c-sparsity
Description
Measures the c-sparsity structure
Usage
c_sparsity(conf, aggr = NULL)
Arguments
conf |
A numeric matrix. |
aggr |
the aggregation function for configurations of more than two dimensions. Defaults to max. |
Value
a numeric value; sparsity (see scagnostics
)
Examples
delts<-smacof::kinshipdelta
conf<-smacof::smacofSym(delts)$conf
plot(conf,pch=19,asp=1)
c_sparsity(conf)
c-striatedness
Description
Measures the c-striatedness structure
Usage
c_striatedness(conf, aggr = NULL)
Arguments
conf |
A numeric matrix. |
aggr |
the aggregation function for configurations of more than two dimensions. Defaults to max. |
Value
a numeric value; striatedness (see scagnostics
)
Examples
delts<-smacof::kinshipdelta
conf<-smacof::smacofSym(delts)$conf
plot(conf,pch=19,asp=1)
c_striatedness(conf)
c-stringiness
Description
Measures the c-stringiness structure
Usage
c_stringiness(conf, aggr = NULL)
Arguments
conf |
A numeric matrix. |
aggr |
the aggregation function for configurations of more than two dimensions. Defaults to max. |
Value
a numeric value; stringiness (see scagnostics
)
Examples
delts<-smacof::kinshipdelta
conf<-smacof::smacofSym(delts)$conf
plot(conf,pch=19,asp=1)
c_stringiness(conf)
S3 coef method for stops objects
Description
S3 coef method for stops objects
Usage
## S3 method for class 'stops'
coef(object, ...)
Arguments
object |
object of class stops |
... |
addditional arguments |
Value
a vector of hyperparmeters theta
MDS Jackknife for stops objects
Description
These functions perform an MDS Jackknife and plot the corresponding solution.
Usage
## S3 method for class 'stops'
jackmds(object, eps = 1e-06, itmax = 5000, verbose = FALSE)
Arguments
object |
Object of class pcops. |
eps |
Convergence criterion |
itmax |
Maximum number of iterations |
verbose |
If 'TRUE', intermediate stress is printed out. |
Details
In order to examine the stability solution of an MDS, a Jackknife on the configurations can be performed (see de Leeuw & Meulman, 1986) and plotted. The plot shows the jackknife configurations which are connected to their centroid. In addition, the original configuration (transformed through Procrustes) is plotted. The Jackknife function itself returns also a stability measure (as ratio of between and total variance), a measure for cross validity, and the dispersion around the original smacof solution.
Note that this jackknife only resamples the configuration given the selected hyperparameters, so uncertainty with respect to the hyperparameter selection is not incorporated.
Value
An object of class 'smacofJK', see jackmds
. With values
smacof.conf: Original configuration
jackknife.confboot: An array of n-1 configuration matrices for each Jackknife MDS solution
comparison.conf: Centroid Jackknife configurations (comparison matrix)
cross: Cross validity
stab: Stability coefficient
disp: Dispersion
loss: Value of the loss function (just used internally)
ndim: Number of dimensions
call: Model call
niter: Number of iterations
nobj: Number of objects
Examples
diso<-kinshipdelta
fit <- stops(diso,loss="stress",lower=1,upper=5)
res.jk <- jackmds(fit)
plot(res.jk)
calculate k nearest neighbours from a distance matrix
Description
calculate k nearest neighbours from a distance matrix
Usage
knn_dist(dis, k)
Arguments
dis |
distance matrix |
k |
number of nearest neighbours (Note that with a tie, the function returns the alphanumerically first one!) |
(Adaptive) Version of Luus-Jaakola Optimization
Description
Adaptive means that the search space reduction factors in the number of iterations; makes convergence faster at about 100 iterations
Usage
ljoptim(
x,
fun,
...,
red = ifelse(adaptive, 0.99, 0.95),
lower,
upper,
acc = 1e-06,
accd = 1e-04,
itmax = 1000,
verbose = 0,
adaptive = TRUE
)
Arguments
x |
optional starting values |
fun |
function to minimize |
... |
additional arguments to be passed to the function to be optimized |
red |
value of the reduction of the search region |
lower |
The lower contraints of the search region |
upper |
The upper contraints of the search region |
acc |
if the numerical accuracy of two successive target function values is below this, stop the optimization; defaults to 1e-6 |
accd |
if the width of the search space is below this, stop the optimization; defaults to 1e-4 |
itmax |
maximum number of iterations |
verbose |
numeric value hat prints information on the fitting process; >2 is extremely verbose |
adaptive |
should the adaptive version be used? defaults to TRUE. |
Value
A list with the components (optim
)
par The position of the optimimum in the search space (parameters that minimize the function; argmin fun)
value The value of the objective function at the optimum (min fun)
counts The number of iterations performed at convergence with entries fnction for the number of iterations and gradient which is always NA at the moment
convergence 0 successful completion by the accd or acc criterion, 1 indicate iteration limit was reached, 99 is a problem
message is NULL (only for compatibility or future use)
Examples
fbana <- function(x) {
x1 <- x[1]
x2 <- x[2]
100 * (x2 - x1 * x1)^2 + (1 - x1)^2
}
res1<-ljoptim(c(-1.2,1),fbana,lower=-5,upper=5,accd=1e-16,acc=1e-16)
res1
set.seed(210485)
fwild <- function (x) 10*sin(0.3*x)*sin(1.3*x^2) + 0.00001*x^4 + 0.2*x+80
plot(fwild, -50, 50, n = 1000, main = "ljoptim() minimising 'wild function'")
res2<-ljoptim(50, fwild,lower=-50,upper=50,adaptive=FALSE,accd=1e-16,acc=1e-16)
points(res2$par,res2$value,col="red",pch=19)
res2
function for lookup that partially matched and ignores cases and punctuation
Description
function for lookup that partially matched and ignores cases and punctuation
Usage
match_partial_ignorecase_nopunct(lookup, entry, ...)
Arguments
lookup |
the lookup string |
entry |
the registry entry |
... |
additional arguments to pmatch |
S3 plot method for stops objects
Description
S3 plot method for stops objects
Usage
## S3 method for class 'stops'
plot(x, plot.type = "confplot", main, asp = 1, ...)
Arguments
x |
an object of class stops |
plot.type |
String indicating which type of plot to be produced: "confplot", "resplot", "Shepard", "stressplot", "bubbleplot" (see details) |
main |
the main title of the plot |
asp |
aspect ratio of x/y axis; defaults to 1; setting to 1 will lead to an accurate represenation of the fitted distances. |
... |
Further plot arguments passed: see 'plot.smacof' and 'plot' for detailed information. Details: See plot.smacofP |
Value
no return value, just plots
S3 print method for stops objects
Description
S3 print method for stops objects
Usage
## S3 method for class 'stops'
print(x, ...)
Arguments
x |
stops object |
... |
additional arguments |
Value
no return value, just prints
S3 print method for summary.stops
Description
S3 print method for summary.stops
Usage
## S3 method for class 'summary.stops'
print(x, ...)
Arguments
x |
object of class summary.stops |
... |
additional arguments |
Value
no return value, just prints
S3 residuals method for stops
Description
S3 residuals method for stops
Usage
## S3 method for class 'stops'
residuals(object, ...)
Arguments
object |
object of class stops |
... |
addditional arguments |
Value
a vector of residuals (observed minus fitted distances)
STOPS version of approximated power stress models.
Description
This uses an approximation to power stress that can make use of smacof as workhorse. Free parameters are kappa, lambda and nu.
Usage
stop_apstress(
dis,
theta = c(1, 1, 1),
type = "ratio",
ndim = 2,
weightmat = 1 - diag(nrow(dis)),
init = NULL,
itmaxi = 1000,
...,
stressweight = 1,
structures = c("cclusteredness", "clinearity", "cdependence", "cmanifoldness",
"cassociation", "cnonmonotonicity", "cfunctionality", "ccomplexity", "cfaithfulness",
"cregularity", "chierarchy", "cconvexity", "cstriatedness", "coutlying",
"cskinniness", "csparsity", "cstringiness", "cclumpiness", "cinequality"),
strucweight = rep(1/length(structures), length(structures)),
strucpars,
verbose = 0,
stoptype = c("additive", "multiplicative"),
registry = struc_reg
)
Arguments
dis |
numeric matrix or dist object of a matrix of proximities |
theta |
the theta vector of parameters to optimize over. Must be of length three, with the first the kappa argument, the second the lambda argument and the third the nu argument. One cannot supply upsilon and tau as of yet. Defaults to 1 1 1. |
type |
MDS type. |
ndim |
number of dimensions of the target space |
weightmat |
(optional) a binary matrix of nonnegative weights |
init |
(optional) initial configuration |
itmaxi |
number of iterations. default is 1000. |
... |
additional arguments to be passed to the fitting procedure |
stressweight |
weight to be used for the fit measure; defaults to 1 |
structures |
a character vector listing the structure indices to use. They always are called "cfoo" with foo being the structure. |
strucweight |
weight to be used for the structures; defaults to 1/number of structures |
strucpars |
a list of list of parameters for the structuredness indices; each list element corresponds to one index in the order of the appearance in structures vector. See examples. |
verbose |
numeric value hat prints information on the fitting process; >2 is extremely verbose |
stoptype |
which weighting to be used in the multi-objective optimization? Either 'additive' (default) or 'multiplicative'. |
registry |
registry object with c-structuredness indices. |
Value
A list with the components
stress: the stress-1 value (sqrt stress.m)
stress.m: default normalized stress
stoploss: the weighted loss value
struc: the structuredness indices
parameters: the parameters used for fitting (kappa, lambda, nu)
fit: the returned object of the fitting procedure
stopobj: the stopobj object
STOPS version of Box Cox Stress
Description
STOPS version of Box Cox Stress
Usage
stop_bcmds(
dis,
theta = c(1, 1, 0),
type = "ratio",
weightmat = NULL,
init = NULL,
ndim = 2,
itmaxi = 5000,
...,
stressweight = 1,
structures = c("cclusteredness", "clinearity", "cdependence", "cmanifoldness",
"cassociation", "cnonmonotonicity", "cfunctionality", "ccomplexity", "cfaithfulness",
"cregularity", "chierarchy", "cconvexity", "cstriatedness", "coutlying",
"cskinniness", "csparsity", "cstringiness", "cclumpiness", "cinequality"),
strucweight = rep(1/length(structures), length(structures)),
strucpars,
verbose = 0,
stoptype = c("additive", "multiplicative"),
registry = struc_reg
)
Arguments
dis |
numeric matrix or dist object of a matrix of proximities |
theta |
the theta vector of powers; the first is mu (for the fitted distances), the second lambda (for the proximities), the third nu (for the weights). If a scalar is given it is recycled. Defaults to 1 1 0. |
type |
MDS type. Is ignored here. |
weightmat |
(not used) |
init |
(optional) initial configuration |
ndim |
number of dimensions of the target space |
itmaxi |
number of iterations |
... |
additional arguments to be passed to the fitting procedure |
stressweight |
weight to be used for the fit measure; defaults to 1 |
structures |
which structures to look for |
strucweight |
weight to be used for the structures; defaults to 0.5 |
strucpars |
a list of parameters for the structuredness indices; each list element corresponds to one index in the order of the appeacrance in structures |
verbose |
numeric value hat prints information on the fitting process; >2 is extremely verbose |
stoptype |
which weighting to be used in the multi-objective optimization? Either 'additive' (default) or 'multiplicative'. |
registry |
registry object with c-structuredness indices. |
Value
A list with the components
stress: the stress-1
stress.m: default normalized stress
stoploss: the weighted loss value
struc: the structuredness indices
parameters: the parameters used for fitting (kappa, lambda)
fit: the returned object of the fitting procedure
stopobj: the stopobj object
STOPS version of CLCA.
Description
CLCA with free lambda0 and 20 epochs. Should we add alpha0?
Usage
stop_clca(
dis,
theta = 3 * max(sd(dis)),
type = "ratio",
weightmat = 1 - diag(nrow(dis)),
init = NULL,
ndim = 2,
itmaxi = 10000,
...,
stressweight = 1,
structures = c("cclusteredness", "clinearity", "cdependence", "cmanifoldness",
"cassociation", "cnonmonotonicity", "cfunctionality", "ccomplexity", "cfaithfulness",
"cregularity", "chierarchy", "cconvexity", "cstriatedness", "coutlying",
"cskinniness", "csparsity", "cstringiness", "cclumpiness", "cinequality"),
strucweight = rep(1/length(structures), length(structures)),
strucpars,
verbose = 0,
stoptype = c("additive", "multiplicative"),
registry = struc_reg
)
Arguments
dis |
numeric matrix or dist object of a matrix of proximities |
theta |
the theta vector of explicit parameters; lambda0 for the maximal neighbourhood. Defaults to 100. |
type |
MDS type. |
weightmat |
(optional) a matrix of nonnegative weights |
init |
(optional) initial configuration |
ndim |
number of dimensions of the target space |
itmaxi |
number of iterations |
... |
additional arguments to be passed to the fitting procedure |
stressweight |
weight to be used for the fit measure; defaults to 1 |
structures |
a character vector listing the structure indices to use. They always are called "cfoo" with foo being the structure. |
strucweight |
weight to be used for the structures; defaults to 1/number of structures |
strucpars |
a list of parameters for the structuredness indices; each list element corresponds to one index in the order of the appearance in structures |
verbose |
numeric value hat prints information on the fitting process; >2 is extremely verbose |
stoptype |
which weighting to be used in the multi-objective optimization? Either 'additive' (default) or 'multiplicative'. |
registry |
registry object with c-structuredness indices. |
Value
A list with the components
stress: the stress-1 value
stress.m: default normalized stress
stoploss: the weighted loss value
struc: the structuredness indices
parameters: the parameters used for fitting (tau)
fit: the returned object of the fitting procedure
stopobj: the stopobj object
STOPS version of CLDA with free epsilon.
Description
CLDA with free lambda0 and epsilon and 20 epochs. Should we add alpha0?
Usage
stop_cldae(
dis,
theta = rep(3 * max(sd(dis)), 2),
type = "ratio",
weightmat = 1 - diag(nrow(dis)),
init = NULL,
ndim = 2,
itmaxi = 10000,
...,
stressweight = 1,
structures = c("cclusteredness", "clinearity", "cdependence", "cmanifoldness",
"cassociation", "cnonmonotonicity", "cfunctionality", "ccomplexity", "cfaithfulness",
"cregularity", "chierarchy", "cconvexity", "cstriatedness", "coutlying",
"cskinniness", "csparsity", "cstringiness", "cclumpiness", "cinequality"),
strucweight = rep(1/length(structures), length(structures)),
strucpars,
verbose = 0,
stoptype = c("additive", "multiplicative"),
registry = struc_reg
)
Arguments
dis |
numeric matrix or dist object of a matrix of proximities |
theta |
the theta vector of explicit parameters; first is lambda0 for the maximal neighbourhood and second is k for the number of neighbours for the geodesic distance. |
type |
MDS type. |
weightmat |
(optional) a matrix of nonnegative weights |
init |
(optional) initial configuration |
ndim |
number of dimensions of the target space |
itmaxi |
number of iterations |
... |
additional arguments to be passed to the fitting procedure |
stressweight |
weight to be used for the fit measure; defaults to 1 |
structures |
a character vector listing the structure indices to use. They always are called "cfoo" with foo being the structure. |
strucweight |
weight to be used for the structures; defaults to 1/number of structures |
strucpars |
a list of parameters for the structuredness indices; each list element corresponds to one index in the order of the appearance in structures |
verbose |
numeric value hat prints information on the fitting process; >2 is extremely verbose |
stoptype |
which weighting to be used in the multi-objective optimization? Either 'additive' (default) or 'multiplicative'. |
registry |
registry object with c-structuredness indices. |
Value
A list with the components
stress: the stress-1 value
stress.m: default normalized stress
stoploss: the weighted loss value
struc: the structuredness indices
parameters: the parameters used for fitting (tau)
fit: the returned object of the fitting procedure
stopobj: the stopobj object
STOPS version of CLDA with free k.
Description
CLDA with free lambda0 and k and 20 epochs. Should we add alpha0?
Usage
stop_cldak(
dis,
theta = c(3 * max(sd(dis)), nrow(dis)/4),
type = "ratio",
weightmat = 1 - diag(nrow(dis)),
init = NULL,
ndim = 2,
itmaxi = 10000,
...,
stressweight = 1,
structures = c("cclusteredness", "clinearity", "cdependence", "cmanifoldness",
"cassociation", "cnonmonotonicity", "cfunctionality", "ccomplexity", "cfaithfulness",
"cregularity", "chierarchy", "cconvexity", "cstriatedness", "coutlying",
"cskinniness", "csparsity", "cstringiness", "cclumpiness", "cinequality"),
strucweight = rep(1/length(structures), length(structures)),
strucpars,
verbose = 0,
stoptype = c("additive", "multiplicative"),
registry = struc_reg
)
Arguments
dis |
numeric matrix or dist object of a matrix of proximities |
theta |
the theta vector of explicit parameters; first is lambda0 for the maximal neighbourhood and second is k for the number of neighbours for the geodesic distance. |
type |
MDS type. |
weightmat |
(optional) a matrix of nonnegative weights |
init |
(optional) initial configuration |
ndim |
number of dimensions of the target space |
itmaxi |
number of iterations |
... |
additional arguments to be passed to the fitting procedure |
stressweight |
weight to be used for the fit measure; defaults to 1 |
structures |
a character vector listing the structure indices to use. They always are called "cfoo" with foo being the structure. |
strucweight |
weight to be used for the structures; defaults to 1/number of structures |
strucpars |
a list of parameters for the structuredness indices; each list element corresponds to one index in the order of the appearance in structures |
verbose |
numeric value hat prints information on the fitting process; >2 is extremely verbose |
stoptype |
which weighting to be used in the multi-objective optimization? Either 'additive' (default) or 'multiplicative'. |
registry |
registry object with c-structuredness indices. |
Value
A list with the components
stress: the stress-1 value
stress.m: default normalized stress
stoploss: the weighted loss value
struc: the structuredness indices
parameters: the parameters used for fitting (tau)
fit: the returned object of the fitting procedure
stopobj: the stopobj object
STOPS version of strain
Description
The free parameter is lambda for power transformations of the observed proximities.
Usage
stop_cmdscale(
dis,
theta = 1,
type = "ratio",
weightmat = NULL,
ndim = 2,
init = NULL,
...,
stressweight = 1,
structures = c("cclusteredness", "clinearity", "cdependence", "cmanifoldness",
"cassociation", "cnonmonotonicity", "cfunctionality", "ccomplexity", "cfaithfulness",
"cregularity", "chierarchy", "cconvexity", "cstriatedness", "coutlying",
"cskinniness", "csparsity", "cstringiness", "cclumpiness", "cinequality"),
strucweight = rep(1/length(structures), length(structures)),
strucpars,
verbose = 0,
stoptype = c("additive", "multiplicative"),
itmaxi = 1000,
add = TRUE,
registry = struc_reg
)
Arguments
dis |
numeric matrix or dist object of a matrix of proximities |
theta |
the theta vector of powers; this must be a scalar of the lambda transformation for the observed proximities. |
type |
MDS type. Ignored here. |
weightmat |
(optional) a matrix of nonnegative weights. Not used. |
ndim |
number of dimensions of the target space |
init |
(optional) initial configuration |
... |
additional arguments to be passed to the fitting procedure |
stressweight |
weight to be used for the fit measure; defaults to 1 |
structures |
which structuredness indices to be included in the loss |
strucweight |
weight to be used for the structuredness indices; ; defaults to 1/#number of structures |
strucpars |
the parameters for the structuredness indices |
verbose |
numeric value hat prints information on the fitting process; >2 is extremely verbose |
stoptype |
How to construct the target function for the multi objective optimization? Either 'additive' (default) or 'multiplicative' |
itmaxi |
number of iterations. No effect here. |
add |
if TRUE dis is made to Euclidean distances |
registry |
registry object with c-structuredness indices. |
Value
A list with the components
stress: the badness-of-fit value (this isn't stress here but 1-(sum_ndim(max(eigenvalues,0))/sum_n(max(eigenvalues,0)), 1-GOF[2])
stress.m: explictly normalized stress (manually calculated)
stoploss: the weighted loss value
indices: the values of the structuredness indices
parameters: the parameters used for fitting (lambda)
fit: the returned object of the fitting procedure, which is cmdscalex object with some extra slots for the parameters and stresses
stopobj: the stopobj object
STOPS versions of elastic scaling models (via smacofSym)
Description
The free parameter is lambda for power transformations the observed proximities. The fitted distances power is internally fixed to 1 and the power for the weights=delta is -2. Allows for a weight matrix because of smacof.
Usage
stop_elastic(
dis,
theta = 1,
type = "ratio",
ndim = 2,
weightmat = 1 - diag(nrow(dis)),
init = NULL,
itmaxi = 1000,
...,
stressweight = 1,
structures = c("cclusteredness", "clinearity", "cdependence", "cmanifoldness",
"cassociation", "cnonmonotonicity", "cfunctionality", "ccomplexity", "cfaithfulness",
"cregularity", "chierarchy", "cconvexity", "cstriatedness", "coutlying",
"cskinniness", "csparsity", "cstringiness", "cclumpiness", "cinequality"),
strucweight = rep(1/length(structures), length(structures)),
strucpars,
verbose = 0,
stoptype = c("additive", "multiplicative"),
registry = struc_reg
)
Arguments
dis |
numeric matrix or dist object of a matrix of proximities |
theta |
the theta vector of powers; this must be a scalar of the lambda transformation for the observed proximities. Defaults to 1. |
type |
MDS type. Defaults ot 'ratio'. |
ndim |
number of dimensions of the target space |
weightmat |
(optional) a matrix of nonnegative weights (NOT the elscal weights) |
init |
(optional) initial configuration |
itmaxi |
number of iterations |
... |
additional arguments to be passed to the fitting procedure |
stressweight |
weight to be used for the fit measure; defaults to 1 |
structures |
which structuredness indices to be included in the loss |
strucweight |
weight to be used for the structuredness indices; ; defaults to 1/#number of structures |
strucpars |
the parameters for the structuredness indices |
verbose |
numeric value hat prints information on the fitting process; >2 is extremely verbose |
stoptype |
How to construct the target function for the multi objective optimization? Either 'additive' (default) or 'multiplicative' |
registry |
registry object with c-structuredness indices. |
Value
A list with the components
stress: the stress-1 (sqrt(stress.m))
stress.m: default normalized stress (used for STOPS)
stoploss: the weighted loss value
indices: the values of the structuredness indices
parameters: the parameters used for fitting (lambda)
fit: the returned object of the fitting procedure
stopobj: the stopobj objects
STOPS version of isomap to optimize over integer k.
Description
Free parameter is k.
Usage
stop_isomap1(
dis,
theta = 3,
type = "ratio",
weightmat = NULL,
ndim = 2,
init = NULL,
stressweight = 1,
structures = c("cclusteredness", "clinearity", "cdependence", "cmanifoldness",
"cassociation", "cnonmonotonicity", "cfunctionality", "ccomplexity", "cfaithfulness",
"cregularity", "chierarchy", "cconvexity", "cstriatedness", "coutlying",
"cskinniness", "csparsity", "cstringiness", "cclumpiness", "cinequality"),
strucweight = rep(1/length(structures), length(structures)),
strucpars,
verbose = 0,
stoptype = c("additive", "multiplicative"),
itmaxi = NULL,
registry = struc_reg
)
Arguments
dis |
numeric matrix or dist object of a matrix of proximities |
theta |
the number of shortest dissimilarities retained for a point (nearest neighbours), the isomap parameter. Must be a numeric scalar. Defaults to 3. |
type |
MDS type. Is "ratio". |
weightmat |
(optional) a matrix of nonnegative weights |
ndim |
number of dimensions of the target space |
init |
(optional) initial configuration |
stressweight |
weight to be used for the fit measure; defaults to 1 |
structures |
which structuredness indices to be included in the loss |
strucweight |
weight to be used for the structuredness indices; ; defaults to 1/#number of structures |
strucpars |
the parameters for the structuredness indices |
verbose |
numeric value hat prints information on the fitting process; >2 is extremely verbose |
stoptype |
How to construct the target function for the multi objective optimization? Either 'additive' (default) or 'multiplicative' |
itmaxi |
placeholder for compatibility in stops call; not used |
registry |
registry object with c-structuredness indices. |
Details
Currently this version is a bit less flexible than the vegan one, as the only allowed parameter for isomap is the theta (k in isomap, no epsilon) and the shortest path is always estimated with argument "shortest". Also note that fragmentedOK is always set to TRUE which means that for theta that is too small only the largest conected group will be analyzed. If that's not wanted just set the theta higher.
Value
A list with the components
stress: Not really stress but 1-GOF[2] where GOF is the second element returned from smacofx::cmdscale (the sum of the first ndim eigenvalues divided by the sum of all absolute eigenvalues).
stress.m: default normalized stress (sqrt explicitly normalized stress; really the stress this time)
stoploss: the weighted loss value
indices: the values of the structuredness indices
parameters: the parameters used for fitting
fit: the returned object of the fitting procedure
stopobj: the stopobj object
STOPS version of isomap over real epsilon.
Description
Free parameter is eps.
Usage
stop_isomap2(
dis,
theta = stats::quantile(dis, 0.1),
type = "ratio",
weightmat = NULL,
ndim = 2,
init = NULL,
stressweight = 1,
structures = c("cclusteredness", "clinearity", "cdependence", "cmanifoldness",
"cassociation", "cnonmonotonicity", "cfunctionality", "ccomplexity", "cfaithfulness",
"cregularity", "chierarchy", "cconvexity", "cstriatedness", "coutlying",
"cskinniness", "csparsity", "cstringiness", "cclumpiness", "cinequality"),
strucweight = rep(1/length(structures), length(structures)),
strucpars,
verbose = 0,
stoptype = c("additive", "multiplicative"),
itmaxi = NULL,
registry = struc_reg
)
Arguments
dis |
numeric matrix or dist object of a matrix of proximities |
theta |
the number of shortest dissimilarities retained for a point (neighbourhood region), the isomap parameter. Defaults to the 0.1 quantile of the empirical distribution of dis. |
type |
MDS type. Is "ratio". |
weightmat |
(optional) a matrix of nonnegative weights |
ndim |
number of dimensions of the target space |
init |
(optional) initial configuration |
stressweight |
weight to be used for the fit measure; defaults to 1 |
structures |
which structuredness indices to be included in the loss |
strucweight |
weight to be used for the structuredness indices; ; defaults to 1/#number of structures |
strucpars |
the parameters for the structuredness indices |
verbose |
numeric value hat prints information on the fitting process; >2 is extremely verbose |
stoptype |
How to construct the target function for the multi objective optimization? Either 'additive' (default) or 'multiplicative' |
itmaxi |
placeholder for compatibility in stops call; not used |
registry |
registry object with c-structuredness indices. |
Details
Currently this version is a bit less flexible than the vegan one, as the only allowed parameter for isomap is the theta (epsilon in isomap) and the shortest path is always estimated with argument "shortest". Also note that fragmentedOK is always set to TRUE which means that for theta that is too small only the largest conected group will be analyzed. If that's not wanted just set the theta higher.
Value
A list with the components
stress: Not really stress but 1-GOF[2] where GOF is the second element returned from cmdscale (the sum of the first ndim absolute eigenvalues divided by the sum of all absolute eigenvalues).
stress.m: default normalized stress (sqrt explicitly normalized stress; really the stress this time)
stoploss: the weighted loss value
indices: the values of the structuredness indices
parameters: the parameters used for fitting
fit: the returned object of the fitting procedure
stopobj: the stopobj object
STOPS version of lMDS
Description
STOPS version of lMDS
Usage
stop_lmds(
dis,
theta = c(2, 0.5),
type = "ratio",
weightmat = NULL,
init = NULL,
ndim = 2,
itmaxi = 5000,
...,
stressweight = 1,
structures = c("cclusteredness", "clinearity", "cdependence", "cmanifoldness",
"cassociation", "cnonmonotonicity", "cfunctionality", "ccomplexity", "cfaithfulness",
"cregularity", "chierarchy", "cconvexity", "cstriatedness", "coutlying",
"cskinniness", "csparsity", "cstringiness", "cclumpiness", "cinequality"),
strucweight = rep(1/length(structures), length(structures)),
strucpars,
verbose = 0,
stoptype = c("additive", "multiplicative"),
registry = struc_reg
)
Arguments
dis |
numeric matrix or dist object of a matrix of proximities |
theta |
the theta vector of powers; the first is k (for the neighbourhood), the second tau (for the penalty) . If a scalar is given it is recycled. Defaults to 2 and 0.5. |
type |
MDS type. Ignored. |
weightmat |
(not used) |
init |
(optional) initial configuration |
ndim |
number of dimensions of the target space |
itmaxi |
number of iterations |
... |
additional arguments to be passed to the fitting procedure |
stressweight |
weight to be used for the fit measure; defaults to 1 |
structures |
which structures to look for |
strucweight |
weight to be used for the structures; defaults to 0.5 |
strucpars |
a list of parameters for the structuredness indices; each list element corresponds to one index in the order of the appeacrance in structure |
verbose |
numeric value hat prints information on the fitting process; >2 is extremely verbose |
stoptype |
which weighting to be used in the multi-objective optimization? Either 'additive' (default) or 'multiplicative'. |
registry |
registry object with c-structuredness indices. |
Value
A list with the components
stress: the stress-1
stress.m: default normalized stress
stoploss: the weighted loss value
struc: the structuredness indices
parameters: the parameters used for fitting (kappa, lambda)
fit: the returned object of the fitting procedure
stopobj: the stopobj object
STOPS version of elastic scaling with powers for proximities and distances
Description
This is power stress with free kappa and lambda but rho is fixed to -2 and the weights are delta.
Usage
stop_powerelastic(
dis,
theta = c(1, 1),
type = "ratio",
weightmat = 1 - diag(nrow(dis)),
init = NULL,
ndim = 2,
itmaxi = 1e+05,
...,
stressweight = 1,
structures = c("cclusteredness", "clinearity", "cdependence", "cmanifoldness",
"cassociation", "cnonmonotonicity", "cfunctionality", "ccomplexity", "cfaithfulness",
"cregularity", "chierarchy", "cconvexity", "cstriatedness", "coutlying",
"cskinniness", "csparsity", "cstringiness", "cclumpiness", "cinequality"),
strucweight = rep(1/length(structures), length(structures)),
strucpars,
verbose = 0,
stoptype = c("additive", "multiplicative"),
registry = struc_reg
)
Arguments
dis |
numeric matrix or dist object of a matrix of proximities |
theta |
the theta vector of powers; a vector of length two where the first element is kappa (for the fitted distances), the second lambda (for the observed proximities). If a scalar for the free parameters is given it is recycled. Defaults to 1 1. |
type |
MDS type. Defaults to "ratio". |
weightmat |
(optional) a matrix of nonnegative weights |
init |
(optional) initial configuration |
ndim |
number of dimensions of the target space |
itmaxi |
number of iterations |
... |
additional arguments to be passed to the fitting procedure |
stressweight |
weight to be used for the fit measure; defaults to 1 |
structures |
which strcutures to look for |
strucweight |
weight to be used for the structures; defaults to 0.5 |
strucpars |
a list of parameters for the structuredness indices; each list element corresponds to one index in the order of the appeacrance in structures |
verbose |
numeric value hat prints information on the fitting process; >2 is extremely verbose |
stoptype |
which weighting to be used in the multi-objective optimization? Either 'additive' (default) or 'multiplicative'. |
registry |
registry object with c-structuredness indices. |
Value
A list with the components
stress: the stress-1 value
stress.m: default normalized stress
stoploss: the weighted loss value
struc: the structuredness indices
parameters: the parameters used for fitting (kappa, lambda)
fit: the returned object of the fitting procedure
stopobj: the stopobj object
STOPS version of powermds
Description
This is power stress with free kappa and lambda but rho is fixed to 1, so no weight transformation.
Usage
stop_powermds(
dis,
theta = c(1, 1),
type = "ratio",
weightmat = 1 - diag(nrow(dis)),
init = NULL,
ndim = 2,
itmaxi = 10000,
...,
stressweight = 1,
structures = c("cclusteredness", "clinearity", "cdependence", "cmanifoldness",
"cassociation", "cnonmonotonicity", "cfunctionality", "ccomplexity", "cfaithfulness",
"cregularity", "chierarchy", "cconvexity", "cstriatedness", "coutlying",
"cskinniness", "csparsity", "cstringiness", "cclumpiness", "cinequality"),
strucweight = rep(1/length(structures), length(structures)),
strucpars,
verbose = 0,
stoptype = c("additive", "multiplicative"),
registry = struc_reg
)
Arguments
dis |
numeric matrix or dist object of a matrix of proximities |
theta |
the theta vector of powers; a vector of length 2 where the first element is kappa (for the fitted distances), the second lambda (for the observed proximities). If a scalar is given it is recycled. Defaults to 1,1. |
type |
MDS type. Defaults to "ratio". |
weightmat |
(optional) a matrix of nonnegative weights |
init |
(optional) initial configuration |
ndim |
number of dimensions of the target space |
itmaxi |
number of iterations |
... |
additional arguments to be passed to the fitting procedure |
stressweight |
weight to be used for the fit measure; defaults to 1 |
structures |
which structures to look for |
strucweight |
weight to be used for the structures; defaults to 0.5 |
strucpars |
a list of parameters for the structuredness indices; each list element corresponds to one index in the order of the appeacrance in structures |
verbose |
numeric value hat prints information on the fitting process; >2 is extremely verbose |
stoptype |
which weighting to be used in the multi-objective optimization? Either 'additive' (default) or 'multiplicative'. |
registry |
registry object with c-structuredness indices. |
Value
A list with the components
stress: the stress-1 value
stress.m: default normalized stress
stoploss: the weighted loss value
struc: the structuredness indices
parameters: the parameters used for fitting (kappa, lambda)
fit: the returned object of the fitting procedure
stopobj: the stopobj object
STOPS version of sammon with powers
Description
This is power stress with free kappa and lambda but rho is fixed to -1 and the weights are delta.
Usage
stop_powersammon(
dis,
theta = c(1, 1),
type = "ratio",
weightmat = NULL,
init = NULL,
ndim = 2,
itmaxi = 10000,
...,
stressweight = 1,
structures = c("cclusteredness", "clinearity", "cdependence", "cmanifoldness",
"cassociation", "cnonmonotonicity", "cfunctionality", "ccomplexity", "cfaithfulness",
"cregularity", "chierarchy", "cconvexity", "cstriatedness", "coutlying",
"cskinniness", "csparsity", "cstringiness", "cclumpiness", "cinequality"),
strucweight = rep(1/length(structures), length(structures)),
strucpars,
verbose = 0,
stoptype = c("additive", "multiplicative"),
registry = struc_reg
)
Arguments
dis |
numeric matrix or dist object of a matrix of proximities |
theta |
the theta vector of powers; a vector of length two where the first element is kappa (for the fitted distances), the second lambda (for the observed proximities). If a scalar is given it is recycled for the free parameters. Defaults to 1 1. |
type |
MDS type. Defaults to "ratio". |
weightmat |
(optional) a matrix of nonnegative weights |
init |
(optional) initial configuration |
ndim |
number of dimensions of the target space |
itmaxi |
number of iterations |
... |
additional arguments to be passed to the fitting procedure |
stressweight |
weight to be used for the fit measure; defaults to 1 |
structures |
which structures to look for |
strucweight |
weight to be used for the structures; defaults to 0.5 |
strucpars |
a list of parameters for the structuredness indices; each list element corresponds to one index in the order of the appeacrance in structures |
verbose |
numeric value hat prints information on the fitting process; >2 is extremely verbose |
stoptype |
which weighting to be used in the multi-objective optimization? Either 'additive' (default) or 'multiplicative'. |
registry |
registry object with c-structuredness indices. |
Value
A list with the components
stress: the stress
stress.m: default normalized stress
stoploss: the weighted loss value
struc: the structuredness indices
parameters: the parameters used for fitting (kappa, lambda)
fit: the returned object of the fitting procedure
stopobj: the stopobj object
STOPS version of powerstress
Description
Power stress with free kappa and lambda and rho.
Usage
stop_powerstress(
dis,
theta = c(1, 1, 1),
type = "ratio",
weightmat = NULL,
init = NULL,
ndim = 2,
itmaxi = 10000,
...,
stressweight = 1,
structures = c("cclusteredness", "clinearity", "cdependence", "cmanifoldness",
"cassociation", "cnonmonotonicity", "cfunctionality", "ccomplexity", "cfaithfulness",
"cregularity", "chierarchy", "cconvexity", "cstriatedness", "coutlying",
"cskinniness", "csparsity", "cstringiness", "cclumpiness", "cinequality"),
strucweight = rep(1/length(structures), length(structures)),
strucpars,
verbose = 0,
stoptype = c("additive", "multiplicative"),
registry = struc_reg
)
Arguments
dis |
numeric matrix or dist object of a matrix of proximities |
theta |
the theta vector of powers; the first is kappa (for the fitted distances), the second lambda (for the observed proximities), the third nu (for the weights). If a scalar is given it is recycled. Defaults to 1 1 1. |
type |
MDS type. |
weightmat |
(optional) a matrix of nonnegative weights |
init |
(optional) initial configuration |
ndim |
number of dimensions of the target space |
itmaxi |
number of iterations |
... |
additional arguments to be passed to the fitting procedure |
stressweight |
weight to be used for the fit measure; defaults to 1 |
structures |
a character vector listing the structure indices to use. They always are called "cfoo" with foo being the structure. |
strucweight |
weight to be used for the structures; defaults to 1/number of structures |
strucpars |
a list of parameters for the structuredness indices; each list element corresponds to one index in the order of the appearance in structures |
verbose |
numeric value hat prints information on the fitting process; >2 is extremely verbose |
stoptype |
which weighting to be used in the multi-objective optimization? Either 'additive' (default) or 'multiplicative'. |
registry |
registry object with c-structuredness indices. |
Value
A list with the components
stress: the stress-1 value
stress.m: default normalized stress
stoploss: the weighted loss value
struc: the structuredness indices
parameters: the parameters used for fitting (kappa, lambda, nu)
fit: the returned object of the fitting procedure
stopobj: the stopobj object
STOPS version of restricted powerstress
Description
STOPS version of restricted powerstress
Usage
stop_rpowerstress(
dis,
theta = c(1, 1, 1),
type = "ratio",
weightmat = NULL,
init = NULL,
ndim = 2,
itmaxi = 10000,
...,
stressweight = 1,
structures = c("cclusteredness", "clinearity", "cdependence", "cmanifoldness",
"cassociation", "cnonmonotonicity", "cfunctionality", "ccomplexity", "cfaithfulness",
"cregularity", "chierarchy", "cconvexity", "cstriatedness", "coutlying",
"cskinniness", "csparsity", "cstringiness", "cclumpiness", "cinequality"),
strucweight = rep(1/length(structures), length(structures)),
strucpars,
verbose = 0,
stoptype = c("additive", "multiplicative"),
registry = struc_reg
)
Arguments
dis |
numeric matrix or dist object of a matrix of proximities |
theta |
the theta vector of powers; the first two arguments are for kappa and lambda and should be equal (for the fitted distances and observed proximities), the third nu (for the weights). Internally the kappa and lambda are equated. If a scalar is given it is recycled (so all elements of theta are equal); if a vector of length 2 is given, it gets expanded to c(theta[1],theta[1],theta[2]). Defaults to 1 1 1. |
type |
MDS type. Defaults to "ratio". |
weightmat |
(optional) a matrix of nonnegative weights |
init |
(optional) initial configuration |
ndim |
number of dimensions of the target space |
itmaxi |
number of iterations. default is 10000. |
... |
additional arguments to be passed to the fitting procedure powerStressMin |
stressweight |
weight to be used for the fit measure; defaults to 1 |
structures |
a character vector listing the structure indices to use. They always are called "cfoo" with foo being the structure. |
strucweight |
weight to be used for the structures; defaults to 1/number of structures |
strucpars |
a list of list of parameters for the structuredness indices; each list element corresponds to one index in the order of the appearance in structures vector. See examples. |
verbose |
numeric value hat prints information on the fitting process; >2 is extremely verbose |
stoptype |
which weighting to be used in the multi-objective optimization? Either 'additive' (default) or 'multiplicative'. |
registry |
registry object with c-structuredness indices. |
Value
A list with the components
stress: the stress-1 value
stress.m: default normalized stress
stoploss: the weighted loss value
struc: the structuredness indices
parameters: the parameters used for fitting (kappa=lambda, nu)
fit: the returned object of the fitting procedure
stopobj: the stopobj object
STOPS version of rstress
Description
Free parameter is kappa=2r for the fitted distances.
Usage
stop_rstress(
dis,
theta = 1,
type = "ratio",
weightmat = NULL,
init = NULL,
ndim = 2,
itmaxi = 10000,
...,
stressweight = 1,
structures = c("cclusteredness", "clinearity", "cdependence", "cmanifoldness",
"cassociation", "cnonmonotonicity", "cfunctionality", "ccomplexity", "cfaithfulness",
"cregularity", "chierarchy", "cconvexity", "cstriatedness", "coutlying",
"cskinniness", "csparsity", "cstringiness", "cclumpiness", "cinequality"),
strucweight = rep(1/length(structures), length(structures)),
strucpars,
verbose = 0,
stoptype = c("additive", "multiplicative"),
registry = struc_reg
)
Arguments
dis |
numeric matrix or dist object of a matrix of proximities |
theta |
the theta vector of powers; this must be a scalar of the kappa=2*r transformation for the fitted distances proximities. Defaults to 1. Note that what is returned is r, not kappa. |
type |
MDS type. Default is "ratio" |
weightmat |
(optional) a matrix of nonnegative weights |
init |
(optional) initial configuration |
ndim |
number of dimensions of the target space |
itmaxi |
number of iterations. |
... |
additional arguments to be passed to the fitting procedure |
stressweight |
weight to be used for the fit measure; defaults to 1 |
structures |
which structuredness indices to be included in the loss |
strucweight |
weight to be used for the structuredness indices; ; defaults to 1/#number of structures |
strucpars |
the parameters for the structuredness indices |
verbose |
numeric value hat prints information on the fitting process; >2 is extremely verbose |
stoptype |
How to construct the target function for the multi objective optimization? Either 'additive' (default) or 'multiplicative' |
registry |
registry object with c-structuredness indices. |
Value
A list with the components
stress: the stress-1 value
stress.m: default normalized stress
stoploss: the weighted loss value
indices: the values of the structuredness indices
parameters: the parameters used for fitting
fit: the returned object of the fitting procedure
stopobj: the stopobj object
STOPS version of Sammon mapping
Description
Uses smacofx::sammon. The free parameter is lambda for power transformations of the observed proximities.
Usage
stop_sammon(
dis,
theta = 1,
type = "ratio",
ndim = 2,
init = NULL,
weightmat = NULL,
itmaxi = 1000,
...,
stressweight = 1,
structures = c("cclusteredness", "clinearity", "cdependence", "cmanifoldness",
"cassociation", "cnonmonotonicity", "cfunctionality", "ccomplexity", "cfaithfulness",
"chierarchy", "cconvexity", "cstriatedness", "coutlying", "cskinniness", "csparsity",
"cstringiness", "cclumpiness", "cinequality"),
strucweight = rep(1/length(structures), length(structures)),
strucpars,
verbose = 0,
stoptype = c("additive", "multiplicative"),
registry = struc_reg
)
Arguments
dis |
numeric matrix or dist object of a matrix of proximities |
theta |
the theta vector of powers; this must be a scalar of the lambda transformation for the observed proximities. Defaults to 1. |
type |
MDS type. Ignored here. |
ndim |
number of dimensions of the target space |
init |
(optional) initial configuration |
weightmat |
a matrix of nonnegative weights. Has no effect here. |
itmaxi |
number of iterations |
... |
additional arguments to be passed to the fitting procedure |
stressweight |
weight to be used for the fit measure; defaults to 1 |
structures |
which structuredness indices to be included in the loss |
strucweight |
weight to be used for the structuredness indices; ; defaults to 1/#number of structures |
strucpars |
the parameters for the structuredness indices |
verbose |
numeric value hat prints information on the fitting process; >2 is extremely verbose |
stoptype |
How to construct the target function for the multi objective optimization? Either 'additive' (default) or 'multiplicative' |
registry |
registry object with c-structuredness indices. |
Value
A list with the components
stress: the stress/1 *sqrt stress(
stress.m: default normalized stress
stoploss: the weighted loss value
indices: the values of the structuredness indices
parameters: the parameters used for fitting
fit: the returned object of the fitting procedure smacofx::sammon
stopobj: the stopobj object
Another STOPS version of Sammon mapping models (via smacofSym)
Description
Uses Smacof, so it can deal with a weight matrix too. The free parameter is lambda for power transformations of the observed proximities. The fitted distances power is internally fixed to 1 and the power for the weights=delta is -1.
Usage
stop_sammon2(
dis,
theta = 1,
type = "ratio",
ndim = 2,
weightmat = NULL,
init = NULL,
itmaxi = 1000,
...,
stressweight = 1,
structures = c("cclusteredness", "clinearity", "cdependence", "cmanifoldness",
"cassociation", "cnonmonotonicity", "cfunctionality", "ccomplexity", "cfaithfulness",
"cregularity", "chierarchy", "cconvexity", "cstriatedness", "coutlying",
"cskinniness", "csparsity", "cstringiness", "cclumpiness", "cinequality"),
strucweight = rep(1/length(structures), length(structures)),
strucpars,
verbose = 0,
stoptype = c("additive", "multiplicative"),
registry = struc_reg
)
Arguments
dis |
numeric matrix or dist object of a matrix of proximities |
theta |
the theta vector of powers; this must be a scalar of the lambda transformation for the observed proximities. Defaults to 1. |
type |
MDS type |
ndim |
number of dimensions of the target space |
weightmat |
(optional) a matrix of nonnegative weights |
init |
(optional) initial configuration |
itmaxi |
number of iterations |
... |
additional arguments to be passed to the fitting procedure |
stressweight |
weight to be used for the fit measure; defaults to 1 |
structures |
which structuredness indices to be included in the loss |
strucweight |
weight to be used for the structuredness indices; ; defaults to 1/#number of structures |
strucpars |
the parameters for the structuredness indices |
verbose |
numeric value hat prints information on the fitting process; >2 is extremely verbose |
stoptype |
How to construct the target function for the multi objective optimization? Either 'additive' (default) or 'multiplicative'. |
registry |
registry object with c-structuredness indices. |
Value
A list with the components
stress: the stress-1 (sqrt(stress.m))
stress.m: default normalized stress (used for STOPS)
stoploss: the weighted loss value
indices: the values of the structuredness indices
parameters: the parameters used for fitting (lambda)
fit: the returned object of the fitting procedure
stopobj: the stopobj object
STOPS versions of smacofSphere models
Description
The free parameter is lambda for power transformations the observed proximities. The fitted distances power is internally fixed to 1 and the power for the weights is 1.
Usage
stop_smacofSphere(
dis,
theta = 1,
type = "ratio",
ndim = 2,
weightmat = NULL,
init = NULL,
itmaxi = 1000,
...,
stressweight = 1,
structures = c("cclusteredness", "clinearity", "cdependence", "cmanifoldness",
"cassociation", "cnonmonotonicity", "cfunctionality", "ccomplexity", "cfaithfulness",
"cregularity", "chierarchy", "cconvexity", "cstriatedness", "coutlying",
"cskinniness", "csparsity", "cstringiness", "cclumpiness", "cinequality"),
strucweight = rep(1/length(structures), length(structures)),
strucpars,
verbose = 0,
stoptype = c("additive", "multiplicative"),
registry = struc_reg
)
Arguments
dis |
numeric matrix or dist object of a matrix of proximities |
theta |
the theta vector of powers; this must be a scalar of the lambda transformation for the observed proximities. Defaults to 1. |
type |
MDS type. |
ndim |
number of dimensions of the target space |
weightmat |
(optional) a matrix of nonnegative weights |
init |
(optional) initial configuration |
itmaxi |
number of iterations |
... |
additional arguments to be passed to the fitting procedure |
stressweight |
weight to be used for the fit measure; defaults to 1 |
structures |
which structuredness indices to be included in the loss |
strucweight |
weight to be used for the structuredness indices; ; defaults to 1/#number of structures |
strucpars |
the parameters for the structuredness indices |
verbose |
numeric value hat prints information on the fitting process; >2 is extremely verbose |
stoptype |
How to construct the target function for the multi objective optimization? Either 'additive' (default) or 'multiplicative' |
registry |
registry object with c-structuredness indices. |
Value
A list with the components
stress: the stress-1 value
stress.m: default normalized stress
stoploss: the weighted loss value
indices: the values of the structuredness indices
parameters: the parameters used for fitting
fit: the returned object of the fitting procedure
stopobj: the stopobj object
STOPS version of smacofSym models
Description
The free parameter is lambda for power transformations the observed proximities. The fitted distances power is internally fixed to 1 and the power for the weights is 1.
Usage
stop_smacofSym(
dis,
theta = 1,
type = "ratio",
ndim = 2,
weightmat = 1 - diag(nrow(dis)),
init = NULL,
itmaxi = 1000,
...,
structures = c("cclusteredness", "clinearity", "cdependence", "cmanifoldness",
"cassociation", "cnonmonotonicity", "cfunctionality", "ccomplexity", "cfaithfulness",
"chierarchy", "cconvexity", "cstriatedness", "coutlying", "cskinniness", "csparsity",
"cstringiness", "cclumpiness", "cinequality"),
stressweight = 1,
strucweight = rep(1/length(structures), length(structures)),
strucpars,
verbose = 0,
stoptype = c("additive", "multiplicative"),
registry = struc_reg
)
Arguments
dis |
numeric matrix or dist object of a matrix of proximities |
theta |
the theta vector; must be a scalar for the lambda (proximity) transformation. Defaults to 1. |
type |
MDS type. Defaults ot 'ratio'. |
ndim |
number of dimensions of the target space |
weightmat |
(optional) a matrix of nonnegative weights |
init |
(optional) initial configuration |
itmaxi |
number of iterations |
... |
additional arguments to be passed to the fitting |
structures |
which structuredness indices to be included in the loss |
stressweight |
weight to be used for the fit measure; defaults to 1 |
strucweight |
weight to be used for the structuredness indices; ; defaults to 1/#number of structures |
strucpars |
the parameters for the structuredness indices |
verbose |
numeric value hat prints information on the fitting process; >2 is extremely verbose |
stoptype |
How to construct the target function for the multi objective optimization? Either 'additive' (default) or 'multiplicative' |
registry |
registry object with c-structuredness indices. |
Value
A list with the components
stress: the stress-1 (sqrt(stress.m))
stress.m: default normalized stress (used for STOPS)
stoploss: the weighted loss value
indices: the values of the structuredness indices
parameters: the parameters used for fitting (lambda)
fit: the returned object of the fitting procedure
stopobj: the stops object
STOPS version of sparsified multidimensional distance analysis for fixed eps and tau
Description
smdda with free parameters tau and epsilon.
Usage
stop_smddae(
dis,
theta = c(100, 100),
type = "ratio",
weightmat = 1 - diag(nrow(dis)),
init = NULL,
ndim = 2,
itmaxi = 10000,
...,
stressweight = 1,
structures = c("cclusteredness", "clinearity", "cdependence", "cmanifoldness",
"cassociation", "cnonmonotonicity", "cfunctionality", "ccomplexity", "cfaithfulness",
"cregularity", "chierarchy", "cconvexity", "cstriatedness", "coutlying",
"cskinniness", "csparsity", "cstringiness", "cclumpiness", "cinequality"),
strucweight = rep(1/length(structures), length(structures)),
strucpars,
verbose = 0,
stoptype = c("additive", "multiplicative"),
registry = struc_reg
)
Arguments
dis |
numeric matrix or dist object of a matrix of proximities |
theta |
the theta vector of explicit parameters; first is tau for the neighboourhood, second is epsilon for isomapdist. Defaults to 100, 100. |
type |
MDS type. |
weightmat |
(optional) a matrix of nonnegative weights |
init |
(optional) initial configuration |
ndim |
number of dimensions of the target space |
itmaxi |
number of iterations |
... |
additional arguments to be passed to the fitting procedure |
stressweight |
weight to be used for the fit measure; defaults to 1 |
structures |
a character vector listing the structure indices to use. They always are called "cfoo" with foo being the structure. |
strucweight |
weight to be used for the structures; defaults to 1/number of structures |
strucpars |
a list of parameters for the structuredness indices; each list element corresponds to one index in the order of the appearance in structures |
verbose |
numeric value hat prints information on the fitting process; >2 is extremely verbose |
stoptype |
which weighting to be used in the multi-objective optimization? Either 'additive' (default) or 'multiplicative'. |
registry |
registry object with c-structuredness indices. |
Value
A list with the components
stress: the stress-1 value
stress.m: default normalized stress
stoploss: the weighted loss value
struc: the structuredness indices
parameters: the parameters used for fitting (tau)
fit: the returned object of the fitting procedure
stopobj: the stopobj object
STOPS version of sparsified multidimensional distance analysis for fixed k and tau
Description
smdda with free parameters tau and k.
Usage
stop_smddak(
dis,
theta = c(100, 10),
type = "ratio",
weightmat = 1 - diag(nrow(dis)),
init = NULL,
ndim = 2,
itmaxi = 10000,
...,
stressweight = 1,
structures = c("cclusteredness", "clinearity", "cdependence", "cmanifoldness",
"cassociation", "cnonmonotonicity", "cfunctionality", "ccomplexity", "cfaithfulness",
"cregularity", "chierarchy", "cconvexity", "cstriatedness", "coutlying",
"cskinniness", "csparsity", "cstringiness", "cclumpiness", "cinequality"),
strucweight = rep(1/length(structures), length(structures)),
strucpars,
verbose = 0,
stoptype = c("additive", "multiplicative"),
registry = struc_reg
)
Arguments
dis |
numeric matrix or dist object of a matrix of proximities |
theta |
the theta vector of explicit parameters; first is tau for the neighbourhood, second is k. Defaults to 100, 10. |
type |
MDS type. |
weightmat |
(optional) a matrix of nonnegative weights |
init |
(optional) initial configuration |
ndim |
number of dimensions of the target space |
itmaxi |
number of iterations |
... |
additional arguments to be passed to the fitting procedure |
stressweight |
weight to be used for the fit measure; defaults to 1 |
structures |
a character vector listing the structure indices to use. They always are called "cfoo" with foo being the structure. |
strucweight |
weight to be used for the structures; defaults to 1/number of structures |
strucpars |
a list of parameters for the structuredness indices; each list element corresponds to one index in the order of the appearance in structures |
verbose |
numeric value hat prints information on the fitting process; >2 is extremely verbose |
stoptype |
which weighting to be used in the multi-objective optimization? Either 'additive' (default) or 'multiplicative'. |
registry |
registry object with c-structuredness indices. |
Value
A list with the components
stress: the stress-1 value
stress.m: default normalized stress
stoploss: the weighted loss value
struc: the structuredness indices
parameters: the parameters used for fitting (tau)
fit: the returned object of the fitting procedure
stopobj: the stopobj object
STOPS version of sparsified MDS.
Description
smds with free tau.
Usage
stop_smds(
dis,
theta = c(100),
type = "ratio",
weightmat = 1 - diag(nrow(dis)),
init = NULL,
ndim = 2,
itmaxi = 10000,
...,
stressweight = 1,
structures = c("cclusteredness", "clinearity", "cdependence", "cmanifoldness",
"cassociation", "cnonmonotonicity", "cfunctionality", "ccomplexity", "cfaithfulness",
"cregularity", "chierarchy", "cconvexity", "cstriatedness", "coutlying",
"cskinniness", "csparsity", "cstringiness", "cclumpiness", "cinequality"),
strucweight = rep(1/length(structures), length(structures)),
strucpars,
verbose = 0,
stoptype = c("additive", "multiplicative"),
registry = struc_reg
)
Arguments
dis |
numeric matrix or dist object of a matrix of proximities |
theta |
the theta vector of explicit parameters; tau for the neighbourhood. Defaults to 100. |
type |
MDS type. |
weightmat |
(optional) a matrix of nonnegative weights |
init |
(optional) initial configuration |
ndim |
number of dimensions of the target space |
itmaxi |
number of iterations |
... |
additional arguments to be passed to the fitting procedure |
stressweight |
weight to be used for the fit measure; defaults to 1 |
structures |
a character vector listing the structure indices to use. They always are called "cfoo" with foo being the structure. |
strucweight |
weight to be used for the structures; defaults to 1/number of structures |
strucpars |
a list of parameters for the structuredness indices; each list element corresponds to one index in the order of the appearance in structures |
verbose |
numeric value hat prints information on the fitting process; >2 is extremely verbose |
stoptype |
which weighting to be used in the multi-objective optimization? Either 'additive' (default) or 'multiplicative'. |
registry |
registry object with c-structuredness indices. |
Value
A list with the components
stress: the stress-1 value
stress.m: default normalized stress
stoploss: the weighted loss value
struc: the structuredness indices
parameters: the parameters used for fitting (tau)
fit: the returned object of the fitting procedure
stopobj: the stopobj object
STOPS version of sparsified post multidimensional distance analysis for fixed tau and epsilon.
Description
Sparsified POST MDDA with free kappa, lambda, rho, tau and epsilon. Phew.
Usage
stop_spmddae(
dis,
theta = c(1, 1, 1, 100, 100),
type = "ratio",
weightmat = 1 - diag(nrow(dis)),
init = NULL,
ndim = 2,
itmaxi = 10000,
...,
stressweight = 1,
structures = c("cclusteredness", "clinearity", "cdependence", "cmanifoldness",
"cassociation", "cnonmonotonicity", "cfunctionality", "ccomplexity", "cfaithfulness",
"cregularity", "chierarchy", "cconvexity", "cstriatedness", "coutlying",
"cskinniness", "csparsity", "cstringiness", "cclumpiness", "cinequality"),
strucweight = rep(1/length(structures), length(structures)),
strucpars,
verbose = 0,
stoptype = c("additive", "multiplicative"),
registry = struc_reg
)
Arguments
dis |
numeric matrix or dist object of a matrix of proximities |
theta |
the theta vector of explicit parameters; the first is kappa (for the fitted distances), the second lambda (for the observed proximities), the third nu (for the weights), the fourth tau (for the neighbourhood), the fifth the epsilon for the geodesic distances. If a scalar or vector shorter than 5 is given it is recycled. Defaults to 1 1 1 100 10. |
type |
MDS type. |
weightmat |
(optional) a matrix of nonnegative weights |
init |
(optional) initial configuration |
ndim |
number of dimensions of the target space |
itmaxi |
number of iterations |
... |
additional arguments to be passed to the fitting procedure |
stressweight |
weight to be used for the fit measure; defaults to 1 |
structures |
a character vector listing the structure indices to use. They always are called "cfoo" with foo being the structure. |
strucweight |
weight to be used for the structures; defaults to 1/number of structures |
strucpars |
a list of parameters for the structuredness indices; each list element corresponds to one index in the order of the appearance in structures |
verbose |
numeric value hat prints information on the fitting process; >2 is extremely verbose |
stoptype |
which weighting to be used in the multi-objective optimization? Either 'additive' (default) or 'multiplicative'. |
registry |
registry object with c-structuredness indices. |
Value
A list with the components
stress: the stress-1 value
stress.m: default normalized stress
stoploss: the weighted loss value
struc: the structuredness indices
parameters: the parameters used for fitting (kappa, lambda, nu, tau)
fit: the returned object of the fitting procedure
stopobj: the stopobj object
STOPS version of sparsified post multidimensional distance analysis for fixed tau and k.
Description
Sparsified Post MDDA with free kappa, lambda, rho, tau and k. Phew.
Usage
stop_spmddak(
dis,
theta = c(1, 1, 1, 100, 10),
type = "ratio",
weightmat = 1 - diag(nrow(dis)),
init = NULL,
ndim = 2,
itmaxi = 10000,
...,
stressweight = 1,
structures = c("cclusteredness", "clinearity", "cdependence", "cmanifoldness",
"cassociation", "cnonmonotonicity", "cfunctionality", "ccomplexity", "cfaithfulness",
"cregularity", "chierarchy", "cconvexity", "cstriatedness", "coutlying",
"cskinniness", "csparsity", "cstringiness", "cclumpiness", "cinequality"),
strucweight = rep(1/length(structures), length(structures)),
strucpars,
verbose = 0,
stoptype = c("additive", "multiplicative"),
registry = struc_reg
)
Arguments
dis |
numeric matrix or dist object of a matrix of proximities |
theta |
the theta vector of explicit parameters; the first is kappa (for the fitted distances), the second lambda (for the observed proximities), the third nu (for the weights), the fourth tau (for the neighbourhood), the fifth the k for the geodesic distances. If a scalar or vector shorter than 5 is given it is recycled. Defaults to 1 1 1 100 10. |
type |
MDS type. |
weightmat |
(optional) a matrix of nonnegative weights |
init |
(optional) initial configuration |
ndim |
number of dimensions of the target space |
itmaxi |
number of iterations |
... |
additional arguments to be passed to the fitting procedure |
stressweight |
weight to be used for the fit measure; defaults to 1 |
structures |
a character vector listing the structure indices to use. They always are called "cfoo" with foo being the structure. |
strucweight |
weight to be used for the structures; defaults to 1/number of structures |
strucpars |
a list of parameters for the structuredness indices; each list element corresponds to one index in the order of the appearance in structures |
verbose |
numeric value hat prints information on the fitting process; >2 is extremely verbose |
stoptype |
which weighting to be used in the multi-objective optimization? Either 'additive' (default) or 'multiplicative'. |
registry |
registry object with c-structuredness indices. |
Value
A list with the components
stress: the stress-1 value
stress.m: default normalized stress
stoploss: the weighted loss value
struc: the structuredness indices
parameters: the parameters used for fitting (kappa, lambda, nu, tau)
fit: the returned object of the fitting procedure
stopobj: the stopobj object
STOPS version of sparsified POST-MDS for fixed tau
Description
Sparsified power stress with free kappa, lambda, rho and tau.
Usage
stop_spmds(
dis,
theta = c(1, 1, 1, 100),
type = "ratio",
weightmat = 1 - diag(nrow(dis)),
init = NULL,
ndim = 2,
itmaxi = 10000,
...,
stressweight = 1,
structures = c("cclusteredness", "clinearity", "cdependence", "cmanifoldness",
"cassociation", "cnonmonotonicity", "cfunctionality", "ccomplexity", "cfaithfulness",
"cregularity", "chierarchy", "cconvexity", "cstriatedness", "coutlying",
"cskinniness", "csparsity", "cstringiness", "cclumpiness", "cinequality"),
strucweight = rep(1/length(structures), length(structures)),
strucpars,
verbose = 0,
stoptype = c("additive", "multiplicative"),
registry = struc_reg
)
Arguments
dis |
numeric matrix or dist object of a matrix of proximities |
theta |
the theta vector of explicit parameters; the first is kappa (for the fitted distances), the second lambda (for the observed proximities), the third nu (for the weights), the fourth tau (for the neighbourhood). If a scalar or vector shorter than 4 is given it is recycled. Defaults to 1 1 1 100. |
type |
MDS type. |
weightmat |
(optional) a matrix of nonnegative weights |
init |
(optional) initial configuration |
ndim |
number of dimensions of the target space |
itmaxi |
number of iterations |
... |
additional arguments to be passed to the fitting procedure |
stressweight |
weight to be used for the fit measure; defaults to 1 |
structures |
a character vector listing the structure indices to use. They always are called "cfoo" with foo being the structure. |
strucweight |
weight to be used for the structures; defaults to 1/number of structures |
strucpars |
a list of parameters for the structuredness indices; each list element corresponds to one index in the order of the appearance in structures |
verbose |
numeric value hat prints information on the fitting process; >2 is extremely verbose |
stoptype |
which weighting to be used in the multi-objective optimization? Either 'additive' (default) or 'multiplicative'. |
registry |
registry object with c-structuredness indices. |
Value
A list with the components
stress: the stress-1 value
stress.m: default normalized stress
stoploss: the weighted loss value
struc: the structuredness indices
parameters: the parameters used for fitting (kappa, lambda, nu, tau)
fit: the returned object of the fitting procedure
stopobj: the stopobj object
STOPS version of sstress
Description
Free parameter is lambda for the observed proximities. Fitted distances are transformed with power 2, weights have exponent of 1. Note that the lambda here works as a multiplicator of 2 (as sstress has f(delta^2)).
Usage
stop_sstress(
dis,
theta = 1,
type = type,
weightmat = 1 - diag(nrow(dis)),
init = NULL,
ndim = 2,
itmaxi = 1e+05,
...,
stressweight = 1,
structures = c("cclusteredness", "clinearity", "cdependence", "cmanifoldness",
"cassociation", "cnonmonotonicity", "cfunctionality", "ccomplexity", "cfaithfulness",
"cregularity", "chierarchy", "cconvexity", "cstriatedness", "coutlying",
"cskinniness", "csparsity", "cstringiness", "cclumpiness", "cinequality"),
strucweight = rep(1/length(structures), length(structures)),
strucpars,
verbose = 0,
stoptype = c("additive", "multiplicative"),
registry = struc_reg
)
Arguments
dis |
numeric matrix or dist object of a matrix of proximities |
theta |
the theta vector of powers; this must be a scalar of the lambda transformation for the observed proximities. Defaults to 1. Note that the lambda here works as a multiplicator of 2 (as sstress has f(delta^2)). |
type |
MDS type. |
weightmat |
(optional) a matrix of nonnegative weights |
init |
(optional) initial configuration |
ndim |
the number of dimensions of the target space |
itmaxi |
number of iterations |
... |
additional arguments to be passed to the fitting procedure |
stressweight |
weight to be used for the fit measure; defaults to 1 |
structures |
which structuredness indices to be included in the loss |
strucweight |
weight to be used for the structuredness indices; ; defaults to 1/#number of structures |
strucpars |
the parameters for the structuredness indices |
verbose |
numeric value hat prints information on the fitting process; >2 is extremely verbose |
stoptype |
How to construct the target function for the multi objective optimization? Either 'additive' (default) or 'multiplicative' |
registry |
registry object with c-structuredness indices. |
Value
A list with the components
stress: the stress-1 value
stress.m: default normalized stress
stoploss: the weighted loss value
indices: the values of the structuredness indices
parameters: the parameters used for fitting (lambda)
fit: the returned object of the fitting procedure
stopobj: the stopobj object
Calculate the weighted multiobjective loss function used in STOPS
Description
Calculate the weighted multiobjective loss function used in STOPS
Usage
stoploss(
obj,
stressweight = 1,
structures,
strucweight = rep(-1/length(structures), length(structures)),
strucpars,
stoptype = c("additive", "multiplicative"),
verbose = 0,
registry = struc_reg
)
Arguments
obj |
object returned inside a stop_* function. Uses the stress.m slot for getting the stress. |
stressweight |
weight to be used for the fit measure; defaults to 1 |
structures |
which c-structuredness indices to be included in the loss |
strucweight |
the weights of the structuredness indices; defaults to -1/#number of structures |
strucpars |
a list of parameters to be passed to the c-structuredness indices in the same order as the values in structures. If the index has no parameters or you want to use the defaults, supply NULL. (alternatively a named list that has the structure name as the element name). |
stoptype |
what type of weighted combination should be used? Can be 'additive' or 'multiplicative'. |
verbose |
verbose output |
registry |
an object of class registry. This can be used to add additional c-structuredness indices. Defaults ot the registry created via .onLoad in zzz.R |
Value
a list with calculated stoploss ($stoploss), structuredness indices ($strucinidices) and hyperparameters ($parameters and $theta)
High Level STOPS Function
Description
This allows to fit STOPS models as described in Rusch, Mair, Hornik (2023).
Usage
stops(
dis,
loss = "stress",
theta = 1,
type = "ratio",
structures,
ndim = 2,
weightmat = NULL,
init = NULL,
stressweight = 1,
strucweight,
strucpars,
optimmethod = c("SANN", "ALJ", "pso", "Kriging", "tgp", "direct", "stogo", "cobyla",
"crs2lm", "isres", "mlsl", "neldermead", "sbplx", "hjk", "cmaes"),
lower,
upper,
verbose = 0,
stoptype = c("additive", "multiplicative"),
initpoints = 10,
itmax = 50,
itmaxps = 10000,
model,
control,
registry = struc_reg,
...
)
Arguments
dis |
numeric matrix or dist object of a matrix of proximities |
loss |
which loss function to be used for fitting, defaults to stress. |
theta |
hyperparameter vector starting values for the transformation functions. If the length is smaller than the number of hyperparameters for the MDS version the vector gets recycled (see the corresponding stop_XXX function or the vignette for how theta must look like exactly for each loss). If larger than the number of hyperparameters for the MDS method, an error is thrown. If completely missing theta is set to 1 and recycled. |
type |
type of MDS optimal scaling (implicit transformation). One of "ratio", "interval", "mspline" or "ordinal". Default is "ratio". Not every type can be used with every loss, only ratio works with all. |
structures |
character vector of which c-structuredness indices should be considered; if missing no structure is considered. |
ndim |
number of dimensions of the target space |
weightmat |
(optional) a matrix of nonnegative weights; defaults to 1 for all off diagonals |
init |
(optional) initial configuration |
stressweight |
weight to be used for the fit measure; defaults to 1 |
strucweight |
vector of weights to be used for the c-structuredness indices (in the same order as in structures); defaults to -1/length(structures) for each index |
strucpars |
(possibly named with the structure). Metaparameters for the structuredness indices (gamma in the article). It's safest for it be a list of lists with the named arguments for the structuredness indices and the order of the lists must be like the order of structures. So something like this |
optimmethod |
What solver to use. Currently supported are Bayesian optimization with Gaussian Process priors and Kriging ("Kriging", for which the archived package 'DiceOptim' must be installed), Bayesian optimization with treed Gaussian processes with jump to linear models ("tgp", see |
lower |
The lower contraints of the search region. Needs to be a numeric vector of the same length as the parameter vector theta. |
upper |
The upper contraints of the search region. Needs to be a numeric vector of the same length as the parameter vector theta. |
verbose |
numeric value hat prints information on the fitting process; >2 is very verbose. |
stoptype |
which aggregation for the multi objective target function? Either 'additive' (default) or 'multiplicative' |
initpoints |
number of initial points to fit the surrogate model for Bayesian optimization; default is 10. |
itmax |
maximum number of iterations of the outer optimization (for theta) or number of steps of Bayesian optimization; default is 50. We recommend a higher number for ALJ (around 150). Note that due to the inner workings of some solvers, this may or may not correspond to the actual number of function evaluations performed (or PS models fitted). E.g., with tgp the actual number of function evaluation of the PS method is between itmax and 6*itmax as tgp samples 1-6 candidates from the posterior and uses the best candidate. For pso it is the number of particles s times itmax. For cmaes it is usually a bit higher than itmax. This currently may get overruled by a control argument if it is used (and then set to either ewhat is supplie dby control or to the default of the method). |
itmaxps |
maximum number of iterations of the inner optimization (to obtain the PS configuration) |
model |
a character specifying the surrogate model to use. For "Kriging" it specifies the covariance kernel for the GP prior; see |
control |
a control argument passed to the outer optimization procedure. Will override any other control arguents passed, especially verbose and itmax. For the effect of control, see the functions pomp::sannbox for SANN and pso::psoptim for pso, cmaes::cma_es for cmaes, dfoptim::hjkb for hjk and the nloptr docs for the algorithms direct, stogo, cobyla, crs2lm, isres, mlsl, neldermead, sbplx. |
registry |
an object of class registry containing the c-structuredness indices. Defaults to the what is created .onLoad. |
... |
additional arguments passed to the outer optimization procedures (not fully tested). |
Details
The combination of c-structurednes indices and stress uses the stress.m values, which are the explictly normalized stresses. Reported however is the stress-1 value which is sqrt(stress.m).
Value
A list with the components
stoploss: the stoploss value
optim: the object returned from the optimization procedure
stressweight: the stressweight
strucweight: the vector of structure weights
call: the call
optimmethod: The solver selected
loss: The PS badness-of-fit function
nobj: the number of objects in the configuration
type: The type of stoploss scalacrisation (additive or multiplicative)
fit: The fitted PS object (most importantly $fit$conf the fitted configuration)
stoptype: Type of stoploss combinatio
Examples
data(kinshipdelta,package="smacof")
strucpar<-list(NULL,NULL) #parameters for indices
res1<-stops(kinshipdelta,loss="stress",
structures=c("cclumpiness","cassociation"),strucpars=strucpar,
lower=0,upper=10,itmax=10)
res1
#use higher itmax in general, we use 5 just to shorten the tests
data(BankingCrisesDistances)
strucpar<-list(c(epsilon=10,minpts=2),NULL) #parameters for indices
res1<-stops(BankingCrisesDistances[,1:69],loss="stress",verbose=0,
structures=c("cclusteredness","clinearity"),strucpars=strucpar,
lower=0,upper=10,itmax=5)
res1
strucpar<-list(list(alpha=0.6,C=15,var.thr=1e-5,zeta=NULL),
list(alpha=0.6,C=15,var.thr=1e-5,zeta=NULL))
res1<-stops(BankingCrisesDistances[,1:69],loss="stress",verbose=0,
structures=c("cfunctionality","ccomplexity"),strucpars=strucpar,
lower=0,upper=10,itmax=5)
res1
S3 summary method for stops
Description
S3 summary method for stops
Usage
## S3 method for class 'stops'
summary(object, ...)
Arguments
object |
object of class stops |
... |
addditional arguments |
Value
object of class 'summary.stops'
Bayesian Optimization by a (treed) Bayesian Gaussian Process Prior (with jumps to linear models) surrogate model Essentially a wrapper for the functionality in tgp that has the same slots as optim with defaults for STOPS models.
Description
Bayesian Optimization by a (treed) Bayesian Gaussian Process Prior (with jumps to linear models) surrogate model Essentially a wrapper for the functionality in tgp that has the same slots as optim with defaults for STOPS models.
Usage
tgpoptim(
x,
fun,
...,
initpoints = 10,
lower,
upper,
acc = 1e-08,
itmax = 10,
verbose = 0,
model = "bgp"
)
Arguments
x |
optional starting values |
fun |
function to minimize |
... |
additional arguments to be passed to the function to be optimized |
initpoints |
the number of points to sample initially to fit the surrogate model |
lower |
The lower contraints of the search region |
upper |
The upper contraints of the search region |
acc |
if the numerical accuracy of two successive target function values is below this, stop the optimization; defaults to 1e-8 |
itmax |
maximum number of iterations |
verbose |
numeric value hat prints information on the fitting process; >2 is extremely verbose |
model |
which surrogate model class to use (currently uses defaults only, will extend this to tweak the model) |
Value
A list with the components (for compatibility with optim
)
par The position of the optimum in the search space (parameters that minimize the function; argmin fun).
value The value of the objective function at the optimum (min fun). Note we do not use the last value in the candidate list but the best candidate (which can but need not coincide).
svalue The value of the surrogate objective function at the optimal parameters
counts The number of iterations performed at convergence with entries fnction for the number of iterations and gradient which is always NA at the moment
convergence 0 successful completion by the accd or acc criterion, 1 indicate iteration limit was reached, 99 is a problem
message is NULL (only for compatibility or future use)
history the improvement history
tgpout the output of the tgp model
Examples
fbana <- function(x) {
x1 <- x[1]
x2 <- x[2]
100 * (x2 - x1 * x1)^2 + (1 - x1)^2
}
res1<-tgpoptim(c(-1.2,1),fbana,lower=c(-5,-5),upper=c(5,5),acc=1e-16,itmax=20)
res1
fwild <- function (x) 10*sin(0.3*x)*sin(1.3*x^2) + 0.00001*x^4 + 0.2*x+80
plot(fwild, -50, 50, n = 1000, main = "Bayesian GP Optimization minimizing 'wild function'")
set.seed(210485)
res2<-tgpoptim(50, fwild,lower=-50,upper=50,acc=1e-16,itmax=20,model="btgpllm")
points(res2$par,res2$value,col="red",pch=19)
res2