It looks like the use of poisson_log is incorrect, because the expression used (see below) is for the Poisson rate not the Poisson log rate.
Y[i, j] * exp(beta * Z[i]) * dL0[j] # this is Poisson rate, but used as log rate
In non-deprecated Stan code, the revised code would be:
target += poisson_lpmf(dN[i, j] | Y[i, j] * exp(beta * Z[i]) * dL0[j]);
Or perhaps a sampling statement is cleaner:
dN[i, j] ~ poisson(Y[i, j] * exp(beta * Z[i]) * dL0[j]);
It looks like the use of poisson_log is incorrect, because the expression used (see below) is for the Poisson rate not the Poisson log rate.
In non-deprecated Stan code, the revised code would be:
Or perhaps a sampling statement is cleaner: