Mismatch in number dimensions error

The error is : Error in mod$fit_ptr() :
Exception: mismatch in number dimensions declared and found in context; processing stage=data initialization; variable name=N; dims declared=(); dims found=(1) (in ‘model465060f286c_model’ at line 4)

failed to create the sampler; sampling not done
stan_data = list(N=N,…, )
data {
int<lower=1> N;

I think maybe just N without converting to an array will work. Can you try that?

Yes!! Thank you,Also after I run the model on rstan, then how do I see if it converged?

Glad that works!

Regarding convergence, that’s a big topic! If you search online for “Stan convergence diagnostics” or something similar you’ll find a lot of materials and here’s a video from Stan youtube that discusses that briefly:

If you have specific questions about convergence feel free to open new topics here on the forum.