Learn R Programming

rinform (version 1.0.2)

probability: Probability

Description

Generic function to compute the empirical probability of an event.

Usage

probability(d, event)

Arguments

d

Dist object representing the distribution.

event

Numeric representing the observed event.

Value

Numerical giving the empirical probability of event.

Examples

Run this code
# NOT RUN {
d <- Dist(c(0, 1, 2, 3, 4, 5))
for (i in 1:length(d))
  cat("event", i, "probability", probability(d, i), "\n")
# }

Run the code above in your browser using DataLab