Here is a plot of some data I’ve simulated:
It is a poisson distribution with rate parameter 7, and inflated counts at 7, 14, and 21 (similar to a zero inflated poisson, or a zero one inflated beta).
With brms
, I’d like to model:
a) rate parameter of the poisson, and
b) the mixture proportions of this data
My question is: how do I specify the family when the mixture locations are known and constant?
For reference, here is some code to simulate the data.
sim<-function(){
mixture.probs = c(0.6, 0.2, 0.15, 0.05)
outcomes = c(7,14,21)
mixture = sample(1:length(mixture.probs), size = 1, prob = mixture.probs)
if(mixture==1){
return(rpois(1,7))
}
else{
return(outcomes[mixture-1])
}
}
samples = unlist(purrr::rerun(100000,sim()) )
- Operating System: OSX
- brms Version: version 2.9.0