Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Characteristic function for Univariate Mixtures #1838

Open
tlamadon opened this issue Feb 19, 2024 · 0 comments
Open

Characteristic function for Univariate Mixtures #1838

tlamadon opened this issue Feb 19, 2024 · 0 comments

Comments

@tlamadon
Copy link

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:

function mean(d::UnivariateMixture)

It matches the general cf signature as seen here:

"""
cf(d::UnivariateDistribution, t)
Evaluate the characteristic function of distribution `d`.
"""

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant