Characteristic function for Univariate Mixtures
tlamadon opened this issue · comments
I would like to suggest adding this method to compute the characteristic function of Univariate Mixtures:
function cf(d::UnivariateMixture,t)
p = probs(d)
m = sum(pi * cf(component(d, i),t) for (i, pi) in enumerate(p) if !iszero(pi))
return m
end
This is a simple copy of the mean function but applied to the characteristic function. So I think it could be added next to it:
Distributions.jl/src/mixtures/mixturemodel.jl
Line 173 in c1705a3
It matches the general cf
signature as seen here:
Distributions.jl/src/univariates.jl
Lines 293 to 297 in c1705a3