check_probability_vector {oeli} | R Documentation |
Check if an argument is a probability vector
Description
This function checks whether the input is a real vector with non-negative entries that add up to one.
Usage
check_probability_vector(x, len = NULL, tolerance = sqrt(.Machine$double.eps))
assert_probability_vector(
x,
len = NULL,
tolerance = sqrt(.Machine$double.eps),
.var.name = checkmate::vname(x),
add = NULL
)
test_probability_vector(x, len = NULL, tolerance = sqrt(.Machine$double.eps))
Arguments
x |
Object to check. |
len |
[ |
tolerance |
A non-negative |
.var.name |
[ |
add |
[ |
Value
Compare to check_numeric
.
[Package oeli version 0.5.2 Index]