powered by
Returns a function that evaluates the mixture density at given points. The mixture density is \(f(x) = \sum_k w_k f_k(x)\).
# S3 method for mixture density(x, ...)
A function function(t, log = FALSE, ...) returning the density (or log-density) at t.
function(t, log = FALSE, ...)
t
A mixture object.
mixture
Additional arguments (not used).
m <- mixture(list(normal(0, 1), normal(5, 1)), c(0.5, 0.5)) f <- density(m) f(0) f(2.5)
Run the code above in your browser using DataLab