cvxclust_ama: Convex clustering via AMA

Description Usage Arguments Value Author(s) Examples

Description

cvxclust_ama performs convex clustering via AMA. This is an R wrapper function around C code. Dimensions of various arguments are as follows:

Note that the indices matrices 'M1', 'M2', and 'ix' take on values starting at 0 to match the indexing conventions of C.

Usage

1
2
cvxclust_ama(X, Lambda, ix, M1, M2, s1, s2, w, gamma, nu, type = 2,
  max_iter = 100, tol = 1e-04, accelerate = TRUE)

Arguments

X

The p-by-n data matrix whose columns are to be clustered.

Lambda

The p-by-k matrix of Lagrange multipliers.

ix

The k-by-2 matrix of index pairs.

M1

Index set used to track nonzero weights.

M2

Index set used to track nonzero weights.

s1

Index set used to track nonzero weights.

s2

Index set used to track nonzero weights.

w

A vector of k positive weights.

gamma

The regularization parameter controlling the amount of shrinkage.

nu

The initial step size parameter when backtracking is applied. Otherwise it is a fixed step size in which case there are no guarantees of convergence if it exceeds 2/ncol(X).

type

An integer indicating the norm used: 1 = 1-norm, 2 = 2-norm.

max_iter

The maximum number of iterations.

tol

The convergence tolerance.

accelerate

If TRUE (the default), acceleration is turned on.

Value

U A list of centroid matrices.

V A list of centroid difference matrices.

Lambda A list of Lagrange multiplier matrices.

nu The final step size used.

primal The primal objective evaluated at the final iterate.

dual The dual objective evaluated at the final iterate.

iter The number of iterations taken.

Author(s)

Eric C. Chi, Kenneth Lange

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
## Create random problem
seed <- 12345
p <- 10
n <- 20
rnd_problem <- create_clustering_problem(p,n,seed)
X <- rnd_problem$X
ix <- rnd_problem$ix
M1 <- rnd_problem$M1
M2 <- rnd_problem$M2
s1 <- rnd_problem$s1
s2 <- rnd_problem$s2
w  <- rnd_problem$w
nK <- nrow(ix)
Lambda <- matrix(rnorm(p*nK),p,nK)
gamma <- 0.1
nu <- 1.999/n
max_iter <- 1e6
tol <- 1e-15
sol_ama <- cvxclust_ama(X,Lambda,ix,M1,M2,s1,s2,w,gamma,nu,max_iter=max_iter,tol=tol)

Example output

Loading required package: Matrix
Loading required package: igraph

Attaching package: 'igraph'

The following objects are masked from 'package:stats':

    decompose, spectrum

The following object is masked from 'package:base':

    union

cvxclustr documentation built on May 2, 2019, 3:44 p.m.