clupoints_n_1_template {clugenr} | R Documentation |
Create points from their projections on a cluster-supporting line
Description
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. |
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.
Value
Generated points (\(p \times n\) matrix).
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))