dot-check_is_probability_distr_vector.Rd
To pass the check:
the object must be a numeric vector
its elements must sum to 1
it must not contain any strictly-negative value.
(optionally) it must not contain NAs.
.check_is_probability_distr_vector( distribution, tolerate_NAs = FALSE, tolerance_on_sum = 0.01, parameter_name = deparse(substitute(distribution)) )
distribution | Input for which we need to check that it is a proper probability distribution. |
---|---|
tolerate_NAs | Can the distribution contain NA values? |
tolerance_on_sum | Numeric tolerance in checking that vector elements sum to 1. |
parameter_name | A string containing the name the tested parameter had in the initial function in which it was passed. |
TRUE if all tests were passed. Throws an error otherwise.