Hi,
Would it be possible to see an example of the dirichlet_multinomial distribution? I’m trying to define an array z which is indicators of cluster membership, for N individuals and R clusters, with posterior probability of cluster membership given by the vector pi_r_hat.
So I thought I’d need to use
N <- 1000
R <- 2
pi_r_hat <- beta(1,1,dim=R)
z <- dirichlet_multinomial(size = 1, alpha = pi_r_hat, n_realisations = N, dimension = R)
where size = 1 since all the elements of z are indicators (1 or 0) and there are N individuals so thus N realisations, and each realisation has dimension R because the individual can only be a member of one cluster.
But I keep getting an error “number of realisations should be 1000, but arguments had 2, 1 rows”
The examples on the greta doc pages seem to be just for multivariate_normal, which is quite a different type of distribution.
Any help would be gratefully received, thanks.
Louise