dpqr | R Documentation |
Four generic functions that take a distribution object (e.g. Bern
) and
return the density, cumulative probability, quantile, and random generator
functions, respectively.
d(x, ...)
p(x, ...)
qn(x, ...)
r(x, ...)
x |
an object of subclass |
... |
extra arguments. |
The d p q r functions return the density, cumulative probability, quantile, and random generator functions, respectively.
# -----------------------------------------------------
# Beta Distribution Example
# -----------------------------------------------------
library(estimators)
# Create the distribution
x <- Beta(3, 5)
# Density function
df <- d(x)
df(c(0.3, 0.8, 0.5))
# Probability function
pf <- p(x)
pf(c(0.3, 0.8, 0.5))
# Density function
qf <- qn(x)
qf(c(0.3, 0.8, 0.5))
# Random Generator function
rf <- r(x)
rf(5)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.