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

Modify tidy_mixture_density() #510

Open
spsanderson opened this issue Sep 26, 2024 · 0 comments
Open

Modify tidy_mixture_density() #510

spsanderson opened this issue Sep 26, 2024 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@spsanderson
Copy link
Owner

spsanderson commented Sep 26, 2024

When distributions are passed to this function there should be an option on how to combine them: for example a parameter of .combination_type = c('add', 'multiply', 'stack', 'subtract'). So under the hood we should get something like the following:

> set.seed(123)
> plot(density(rnorm(50) + rbeta(50, .5 ,.5, 0)))

image

 set.seed(123)
> plot(density(rnorm(50) * rbeta(50, .5 ,.5, 0)))

image

> set.seed(123)
> plot(density(rnorm(50) - rbeta(50, .5 ,.5, 0)))

image

> set.seed(123)
> plot(density(rbind(rnorm(50), rbeta(50, .5 ,.5, 0))))

image

There should also be an option that is boolean of .cumulative_sum = FALSE where the default is FALSE, when set to TRUE the output of the .combinaiton_type

> set.seed(123)
> plot(density(cumsum(rbind(rnorm(50), rbeta(50, .5 ,.5, 0)))))

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Development

No branches or pull requests

1 participant