Returns a function that evaluates the mixture CDF at given points. The mixture CDF is \(F(x) = \sum_k w_k F_k(x)\).

# S3 method for class 'mixture'
cdf(x, ...)

Arguments

x

A mixture object.

...

Additional arguments (not used).

Value

A function function(q, ...) returning the CDF at q.

Examples

m <- mixture(list(normal(0, 1), normal(5, 1)), c(0.5, 0.5))
F <- cdf(m)
F(0)
#> [1] 0.2500001
F(5)
#> [1] 0.7499999