Skip to contents

Generate points from their \(n\)-dimensional projections on a cluster-supporting line, placing each point on a hyperplane orthogonal to that line and centered at the point's projection. The function specified in dist_fn is used to perform the actual placement.

Usage

clupoints_n_1_template(projs, lat_disp, clu_dir, dist_fn)

Arguments

projs

Point projections on the cluster-supporting line (\(p \times n\) matrix).

lat_disp

Dispersion of points from their projection.

clu_dir

Direction of the cluster-supporting line (unit vector).

dist_fn

Function to place points on a second line, orthogonal to the first.

Value

Generated points (\(p \times n\) matrix).

Details

This function is used internally by clupoints_n_1 and may be useful for constructing user-defined final point placement strategies for the point_dist_fn parameter of the main clugen function.

Note

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

Examples

set.seed(123)
ctr <- c(0, 0)
dir <- c(1, 0)
pdist <- c(-0.5, -0.2, 0.1, 0.3)
proj <- points_on_line(ctr, dir, pdist)
clupoints_n_1_template(proj, 0, dir, function(p, l) stats::runif(p))
#>      [,1]       [,2]
#> [1,] -0.5 -0.2875775
#> [2,] -0.2  0.7883051
#> [3,]  0.1 -0.4089769
#> [4,]  0.3 -0.8830174