impose_floor function

Impose probability floor.

Impose probability floor.

Imposes a floor on the given array a, ensuring that its elements are greater than or equal to amin.

impose_floor(a, amin)

Arguments

  • a: Numeric vector. Must not contain NA values.
  • amin: Numeric. Minimum allowed value. Must be between 0 and 1.

Returns

A numeric vector with the same length as a, with the floor imposed on its elements.

Examples

a <- c(0.25, 0.25, 0.25, 0.25) imposed_a <- impose_floor(a = a, amin = 0.1)