Sampling error: Unrecoverable error evaluating the log probability at the initial value

@hhau: Many thanks for your great help( I should have figured it out myself). The reason I looped over 1:ncol is because if I don’t, then each component of one vector of size big_integer x 1 would only be sampled only once (correct?), so we don’t really sample anything. But I guess i am wrong, because I do 100 iterations in sampling() function and 3 chains, so 300 times for each component in total?

I have another question though: since i never tried target += before, assuming I finish sampling, what does target()() extract for us in this case? My guess is the sampling log values of the (Poisson x Normal) above, so should I take the exp() afterwards? Of course, I would get the bunch of values of the parameter log_lambda, but I don’t think it gives me anything related to the value of the posterior though.