Test whether an object is a mixture distribution.

is_mixture(x)

Arguments

x

The object to test.

Value

TRUE if x inherits from "mixture", FALSE otherwise.

Examples

m <- mixture(list(normal(0, 1), normal(5, 2)), c(0.5, 0.5))
is_mixture(m)
#> [1] TRUE
is_mixture(normal(0, 1))
#> [1] FALSE