clucenters: Determine cluster centers using the uniform distribution

View source: R/module.R

clucentersR Documentation

Determine cluster centers using the uniform distribution

Description

\loadmathjax

Determine cluster centers using the uniform distribution, taking into account the number of clusters (num_clusters) and the average cluster separation (clu_sep).

More specifically, let \mjseqnc=num_clusters, \mjeqn\mathbfs=s=clu_sep, \mjeqn\mathbfo=o=clu_offset, \mjseqnn=length(clu_sep) (i.e., number of dimensions). Cluster centers are obtained according to the following equation:

\mjdeqn\mathbf

C=c\mathbfU\cdot\operatornamediag(\mathbfs) + \mathbf1\,\mathbfo^TC=cU.diag(s) + 1o'

where \mjeqn\mathbfCC is the \mjeqnc \times nc x n matrix of cluster centers, \mjeqn\mathbfUU is an \mjeqnc \times nc x n matrix of random values drawn from the uniform distribution between -0.5 and 0.5, and \mjeqn\mathbf11 is an \mjeqnc \times 1c x 1 vector with all entries equal to 1.

Usage

clucenters(num_clusters, clu_sep, clu_offset)

Arguments

num_clusters

Number of clusters.

clu_sep

Average cluster separation (\mjeqnn \times 1n x 1 vector).

clu_offset

Cluster offsets (\mjeqnn \times 1n x 1 vector).

Value

A \mjeqnc \times nc x n matrix containing the cluster centers.

Note

This function is stochastic. For reproducibility set a PRNG seed with set.seed.

Examples

set.seed(321)
clucenters(3, c(30, 10), c(-50,50))

clugenr documentation built on Aug. 8, 2025, 6:05 p.m.