pdf: Evaluate the probability density of a probability distribution
Description
Generic function for computing probability density function (PDF)
contributions based on a distribution object and observed data.
Usage
pdf(d, x, drop = TRUE, ...)
log_pdf(d, x, ...)
pmf(d, x, ...)
Value
Probabilities corresponding to the vector x.
Arguments
d
An object. The package provides methods for distribution
objects such as those from Normal() or Binomial() etc.
x
A vector of elements whose probabilities you would like to
determine given the distribution d.
drop
logical. Should the result be simplified to a vector if possible?
...
Arguments passed to methods. Unevaluated arguments will generate a warning to
catch mispellings or other possible errors.
Details
The generic function pdf() computes the probability density,
both for continuous and discrete distributions. pmf() (for the
probability mass function) is an alias that just calls pdf() internally.
For computing log-density contributions (e.g., to a log-likelihood)
either pdf(..., log = TRUE) can be used or the generic function
log_pdf().