Learn R Programming

rinform (version 1.0.2)

valid: Valid

Description

Generic function to determine if the distribution is a valid probability distribution, i.e. if the support is not empty and at least one observation has been made.

Usage

valid(d)

Arguments

d

Dist object representing the distribution.

Value

Logical representing the validity of the distribution.

Examples

Run this code
# NOT RUN {
d <- Dist(5)
valid(d) # FALSE, support is empty

d <- Dist(c(0, 1, 0))
valid(d) # TRUE, at least one observation is made
# }

Run the code above in your browser using DataLab