rmcelreath / rethinking

Statistical Rethinking course and book package
2.1k stars 596 forks source link

Poisson response imputation compilation error #419

Open KonstantinosChristopoulos opened 5 months ago

KonstantinosChristopoulos commented 5 months ago

Hi everyone,

I am trying to impute a response variable that ~Poisson or ~Gamma-Poisson but I get this compilation error probably because Stan doesn't like constraints in the model compartment.

25: model{ 26: vector[3147] R_merge; 27: vector[3147] lambda; ^ 28: phi ~ exponential( 1 ); 29: D ~ normal( 0 , 3 );

Expected "[" expression "]" for vector size.

Is there any way to deal with this within the Ulam environment without having to hardcode everything into Stan? You cannot get the stancode() before the it compiles I believe, so ones has to write everything from scratch.

Thank you!