Returns a function that evaluates the beta PDF at given points.

# S3 method for class 'beta_dist'
density(x, ...)

Arguments

x

A beta_dist object.

...

Additional arguments (not used).

Value

A function function(t, log = FALSE, ...) returning the density (or log-density) at t.

Examples

x <- beta_dist(2, 5)
f <- density(x)
f(0.3)
#> [1] 2.1609
f(0.5)
#> [1] 0.9375