You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, there is only this signature: real multinomial_lpmf(array[] int y | vector theta) (the vector is actually a simplex but this is probably for efficiency?)
I wish there was a vectorized variant with the following signature (or compatible):
real multinomial_lpmf(array[ , ] int y | array[] simplex theta)
and probably
real multinomial_lpmf(array[ , ] int y | simplex theta) (assume all have same parameters)
it feels awkward to write for cycle for something most other distributions implement.
sample code where I use it to estimate mean product rating:
data {
int<lower=1> N; // num productsarray[N, 5] int<lower=0> ratings;
}
parameters {
vector<lower=0>[5] alpha;
array[N] simplex[5] d;
}
model {
d ~dirichlet(alpha); // for all d[i]for (i in1:N) { // unlike dirichlet, multinomial not vectorized
ratings[i] ~multinomial(d[i]);
}
}
The text was updated successfully, but these errors were encountered:
Currently, there is only this signature:
real multinomial_lpmf(array[] int y | vector theta)
(the vector is actually asimplex
but this is probably for efficiency?)I wish there was a vectorized variant with the following signature (or compatible):
real multinomial_lpmf(array[ , ] int y | array[] simplex theta)
and probably
real multinomial_lpmf(array[ , ] int y | simplex theta)
(assume all have same parameters)it feels awkward to write for cycle for something most other distributions implement.
sample code where I use it to estimate mean product rating:
The text was updated successfully, but these errors were encountered: