pick_neighbor: Pick Neighbor

View source: R/rTEM_multimer_simulation.R

pick_neighborR Documentation

Pick Neighbor

Description

Pick Neighbor

Usage

pick_neighbor(
  ranks,
  probs,
  distances = NA,
  sample_method = "rank",
  exponent = 1,
  group_size = 2
)

Arguments

ranks

ranks for each point. If based upon a weighted distance, then may not directly correspond to the 'distances'.

probs

vector of probabilities. For probs = c(p_1, p_2, p_3, p_4), the probability of the first NN being selected in p_1, the probability of the second is p_2, and so on

distances

distance to each point. Only used if sample_method = "exp" #' @param sample_method if equal to "rank", the probability of a point of rank x being chosen as a guest is probs[x]. If equal to "exp", the probability of a point of rank x being chosen as a guest is probs[x] * exp(-exponent * distances[ranks]))

exponent

a numeric. If sample_method = "exp", then this is the value of exponent in exp(-exponent * distances[ranks])

group_size

a numeric. How large will the groups be. Pick 'group_size -1' neighbors


rolandrolandroland/rTEM documentation built on March 29, 2025, 2:17 p.m.