Hi,

I’m trying to transform Jags-code into Stan, but am struggling with including a categorical parameter. I’ve seen there are other questions on this, but I was not able to extract the correct information to make it work for my case. Below is Jags-code that works (although in this simplified example prob doesn’t make much sense). How could I write this in Stan? In the attempts I’ve made I run into the error that K is an integer.

Thanks for any help, and let me know if anything is unclear.

Best,

Mads

```
model {
for (trial in 1:N) {
y[trial] ~ dnorm(K,0.01)
}
K ~ dcat(omega)
omega ~ ddirich(c(1.0,1.0,1.0,1.0))
}
```