cpaint: L1 convex clustering with a lambda sequence.

Description Usage Arguments Details Value Examples

View source: R/cpaint.R

Description

L1 convex clustering with a lambda sequence.

Usage

1
cpaint(X, lam)

Arguments

X

a data matrix of n * p or a data vector with length n.

lam

a sequence of lambdas.

Details

A list with length p equal to the dimension of the data matrix. Each dimension includes a sequence of vectors. Each vector includes the estimated centroids with a certain tuning parameter lambda.

Value

A sequence of estimated centroids.

Examples

1
2
3
4
5
6
7
8
9
# generate a data matrix with n = 10 and p = 2.
X = matrix(rnorm(10*2), 10, 2)
# set the biggest lambda in the sequence.
lam_max = find_lambda(X)
# set the length of the sequence.
K = 10
# equally separate the sequence with K.
Lam = sapply(1:K, function(i) i/K*lam_max)
cpaint(X,Lam)

dpcc documentation built on June 1, 2021, 9:08 a.m.