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

Inconsistency when programmatically create dist_mixture #111

Open
statasaurus opened this issue May 21, 2024 · 0 comments
Open

Inconsistency when programmatically create dist_mixture #111

statasaurus opened this issue May 21, 2024 · 0 comments

Comments

@statasaurus
Copy link
Contributor

Basically when you try to make a mixture distribution with a vector of distributional objects it doesn't work. The results are very strange. It would be fine if it errored and just said you needed a list.


Brief description of the problem

# This works as I expect it to 
dist_ls <- list(dist_normal(mu = 0, sigma = 1), dist_student_t(df = 10),
                dist_student_t(df = 5))
dist_mixture(!!!dist_ls, 
             weights = c(0.5,0.2, 0.3)) 

# This makes makes a vector named vector where the length and the names match
# the number of parameters in the first distribution. But, each element of the
# vector is what I expect
dist_vec <- c(dist_normal(mu = 0, sigma = 1), dist_student_t(df = 10),
              dist_student_t(df = 5))
dist_mixture(!!!dist_vec, 
             weights = c(0.5,0.2, 0.3)) 
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