Hi everyone,
I’m new to stan syntax and I’m trying to infer the parameter for a simple multidimensional binomial. Here’s my model and an example of data for D = 3 and N = 8
model {
data {
int N;
int D;
int y[N,D];
}
parameters {
vector[D] p;
}
model {
for (d in 1:D)
y[,d] ~ bernoulli(p[d]);
}
y =
[[1 0 1]
[1 0 1]
[1 1 1]
[0 0 0]
[1 1 0]
[0 1 1]
[0 1 0]
[0 1 0]]
With D=2, everything works perfectly, but fails with D>2 (Initialization error, even with n_jobs set to 1).
My question is two fold:
- Is there a better way to define my model ?
- What do you think produces the error ?
Thanks in advance,
AD.