Implementing Logit-Normal priors on Dirichlet-Multinomial model

Something in RStan is swallowing the error. Upgrading to the latest RStan might help, I dunno.
In any case CmdStan gives

  Error evaluating the log probability at the initial value.
Exception: dirichlet_lpdf: probabilities is not a valid simplex.

It’s saying that the parameter p should be declared as a simplex and not vector<lower=0,upper=1>.

parameters {
  ...
  simplex[n] p[d];
}

Next up

Exception: multinomial_lpmf: Size of number of trials variable (10) and rows of probabilities parameter (30) must match in size

Some of the dimensions are transposed, you’re mixing up n and d. Note in particular that

simplex[n] p[d];

is an array of d vectors, each of which has n elements.

3 Likes