similarity_sample: Sample elements based on similarity structure.

View source: R/utils.R

similarity_sampleR Documentation

Sample elements based on similarity structure.

Description

Choose similar object more often, depending on 'similarity_factor'.

Usage

similarity_sample(sim_mat, size, similarity_factor = 1)

Arguments

sim_mat

Similarity matrix with samples as row/col names.

size

How many samples to draw.

similarity_factor

Uniform sampling for 0. Weights mixture of uniform and similarity vector for each draw.

Value

Vector of samples.

Examples

similarity_sample(matrix(runif(100), nrow = 10, ncol = 10), 3)

cbg-ethz/pareg documentation built on July 20, 2023, 7:30 p.m.