Learn R Programming

rv (version 0.949)

fuzzy: Fuzziness

Description

Tests whether an object is ``fuzzy", i.e. a logical random scalar that has probability strictly between zero and one (not strictly true nor strictly false).

Usage

is.fuzzy(x)
  ## S3 method for class 'rv':
is.fuzzy(x)

Arguments

x
an object, random or constant

References

Kerman, Jouni and Gelman, Andrew. Manipulating and Summarizing Posterior Simulations Using Random Variable Objects. Technical report, Columbia University, New York.

Examples

Run this code
x <- as.logical(rvbern(1,0.4)) # a logical random variable
  is.fuzzy(x) # TRUE, since x is logical and not constant
  is.fuzzy(x<2) # FALSE, since x is less than 2 with probability one
  is.fuzzy(rvnorm(1)) # FALSE, since it's not a probability
  is.fuzzy(TRUE) # FALSE, since TRUE is strictly TRUE
  is.fuzzy(1) # FALSE, since 1 is not a logical variable

Run the code above in your browser using DataLab