cops: cops: cluster optimized proximity scaling

Description Usage Arguments Details Value Examples

View source: R/cops.R

Description

About the package cops: Cluster optimized proximity scaling (COPS) refers to multidimensional scaling methods that aim at pronouncing the clustered appearance of the configuration. They achieve this by transforming proximities/distances with power functions and augment the fitting criterion with a clusteredness index, the OPTICS Cordillera (Rusch, Hornik & Mair 2018). There are two variants: One for finding the configuration directly for given parameters (COPS-C), and one for using the augmented fitting criterion to find optimal parameters for the power transformations (P-COPS). The package contains various functions, wrappers, methods and classes for fitting, plotting and displaying different MDS models in a COPS framework like Torgerson scaling, SMACOF, Sammon mapping, elastic scaling, symmetric SMACOF, spherical SMACOF, sstress, rstress, powermds, power elastic scaling, power sammon mapping, powerstress. All of these models can also solely be fit as MDS with power transformations. The package further contains functions for optimization (Adaptive LJ Algorithmus).

About the function cops: The high level function allows for minimizing copstress for a clustered MDS configuration. Allows to choose COPS-C (finding a configuration from copstress with cordillera penalty) and profile COPS (finding hyperparameters for MDS models with power transformations). It is a wrapper for copstressMin and pcops.

Usage

1
2
3
4
5
6
7
cops(
  dis,
  variant = c("1", "2", "Variant1", "Variant2", "v1", "v2", "COPS-C", "P-COPS",
    "configuration-c", "profile", "copstress-c", "p-copstress", "COPS-P", "copstress-p",
    "cops-c", "p-cops", "copsc", "pcops"),
  ...
)

Arguments

dis

a dissimilarity matrix or a dist object

variant

a character string specifying which variant of COPS to fit. Allowed is any of the following "1","2","Variant1","Variant2","v1","v2","COPS-C","P-COPS","configuration-c","profile","copstress-c","p-copstress". Defaults to "COPS-C".

...

arguments to be passed to copstressMin (for Variant 1) or pcops (for Variant 2).

Details

The cops package provides five categories of important functions:

Models & Algorithms:

Optimization functions:

Wrappers and convenience functions:

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, plot3dstatic.

References:

Authors: Thomas Rusch, Jan de Leeuw, Patrick Mair

Maintainer: Thomas Rusch

Value

For COPS-C Variant 1 see copstressMin, for P-COPS Variant 2 see pcops

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
data(BankingCrisesDistances)


# shorthand function for COPS-C (finding configuration with copstress)
res<-cops(BankingCrisesDistances[,1:69],variant="COPS-C",
          stressweight=0.98,cordweight=0.02,itmax=1000)
# Note: itmax is very small here for illustration; will give a non-convergence
# warning of the optimizer which disappears at itmax=275000  

res
summary(res)
plot(res)
plot(res,"reachplot")
plot(res,"transplot")
plot(res,"Shepard")
#shorthand function for P-COPS (hyperparameter search for powerstress)
res<-cops(BankingCrisesDistances[,1:69],variant="P-COPS")
res
summary(res)
plot(res)
plot(res,"reachplot")
plot(res,"transplot")
plot(res,"Shepard")

dis<-as.matrix(smacof::kinshipdelta)

#COPS-C with equal weight to stress and cordillera 
res1<-cops(dis,variant="COPS-C",stressweight=0.5,cordweight=0.5,
          minpts=2,itmax=1000) #use higher itmax in real
res1
summary(res1)
plot(res1)
plot(res1,"reachplot")



#s-stress type copstress (i.e. kappa=2, lambda=2)
res3<-cops(dis,variant="COPS-C",kappa=2,lambda=2,stressweight=0.5,cordweight=0.5) 
res3
summary(res3)
plot(res3)


# power-stress type profile copstress
# search for optimal kappa and lambda between
# kappa=0.5,lambda=0.5 and kappa=2,lambda=5
# nu is fixed on -1
ws<-1/dis
diag(ws)<-1 
res5<-cops(dis,variant="P-COPS",loss="powerstress",
          theta=c(1.4,3,-1), lower=c(1,0.5,-1),upper=c(3,5,-1),
          weightmat=ws, stressweight=0.9,cordweight=0.1) 
res5
summary(res5)
plot(res5)

cops documentation built on March 24, 2021, 1:06 a.m.