obs2probs: Observations -> discrete probabilities

View source: R/evaluation.R

obs2probsR Documentation

Observations –> discrete probabilities

Description

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

Usage

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)


laurenhsu1/corral documentation built on Feb. 19, 2023, 10:37 p.m.