It would be very helpful to have a function would return a list of distributional objects that make up a mixture distribution so that conjugacy can be used to calculate posteriors where possible. In Pharma we often use a mixture of normals to approximate other distributions for simulation work.
I have tried working around it like this:
x <- dist_mixture(dist_normal(), dist_normal(sigma = 10), weights = c(0.5, 0.5))
y <- parameters(x)$dist[[1]]
dist_mixture(!!!y, weights = parameters(x)$w[[1]])
But, the problem is the list isn't a list of distributional objects, so when you try to reconstitute it into a mixture distribution it doesn't work.
Sorry for so many issues. We are working on a bayesian dynamic borrowing package and your package is nearly perfect, we just need a few modifications
If I wrote this function would it be something you want to include in your package? If not I am happy to close the issue and I will work on this elsewhere
It would be very helpful to have a function would return a list of distributional objects that make up a mixture distribution so that conjugacy can be used to calculate posteriors where possible. In Pharma we often use a mixture of normals to approximate other distributions for simulation work.
I have tried working around it like this:
But, the problem is the list isn't a list of distributional objects, so when you try to reconstitute it into a mixture distribution it doesn't work.
Sorry for so many issues. We are working on a bayesian dynamic borrowing package and your package is nearly perfect, we just need a few modifications