Error : Exception thrown at line 23: []: accessing element out of range. index 1 out of range; expecting index to be between 1 and 0; index position = 1x
failed to create the sampler; sampling not donefor (i in 1:N_obs) x[i] = x_obs[i];
I don't really understand this error message. What's wrong with my code? Or is this a bug in Stan?
int N; real x[N]; vector[N] output_mean; // process mean real output_noise_scale; // assumed measurement error on individual observations N = N_obs + N_sim; for (i in 1:N_obs) x[i] = x_obs[i];
Also, in the model block you can create y with append_row(y_obs, y_sim).
Ben
So is the workaround to declare vector[N_obs+N_sim]? Since all variables have to be declared at the top of a block.
Thanks for the tip on append_row.So is the workaround to declare vector[N_obs+N_sim]? Since all variables have to be declared at the top of a block.