obs2probs: Observations -> discrete probabilities

Description Usage Arguments Value

View source: R/evaluation.R

Description

usage: embedding <- matrix(sample(x = seq(0,10,.1),200, replace = TRUE)) disc_probs <- obs2probs(embedding)

Usage

1
obs2probs(obs, numbins = 100, startbin = min(obs), endbin = max(obs) + 1e-05)

Arguments

obs

vector of numeric, with the observations

numbins

int, the number of evenly sized bins to discretize the observations to

startbin

numeric, the starting value for the smallest bin. Defaults to taking the minimum of obs

endbin

numeric, the ending value for the largest bin. Defaults to taking the maximum of obs (plus a tiny decimal to ensure full range of obs is captured)

Value

dataframe, results has rows corresponding to each bin with columns for probability ('prob'), cumulative frequency ('cumfreq'), and frequency ('freq') of observations falling into that bin. The 'bins' column indicates the end of the bin (start is the preceding column)


corral documentation built on Nov. 8, 2020, 8:25 p.m.