getProbForDiscrete {mmb}R Documentation

Get a probability of a discrete value.

Description

Similar to @seealso estimatePdf, this function returns the probability for a discrete value, given some observations.

Usage

getProbForDiscrete(data, value)

Arguments

data

vector of observations that have the same type as the given value.

value

a single observation of the same type as the data vector.

Value

the probability of value given data.

Note

If no observations are given, then this function will warn and return a probability of zero for the value given. While we could technically return positive infinity, 0 is more suitable in the context of Bayesian inferencing.

Author(s)

Sebastian Hönel sebastian.honel@lnu.se

Examples

mmb::getProbForDiscrete(data = c(), value = iris[1,]$Species)
mmb::getProbForDiscrete(data = iris$Species, value = iris[1,]$Species)

[Package mmb version 0.13.3 Index]