Vectorization: Can it be used in my case?


I am using a user defined log likelihood function in my Rstan code. The full code is:

. To make it faster, I wrote the code in a second format as:

. The second code does not work. The first one works fine.

Can anyone say what is wrong with this second case? I am naive in stan. Any help would be appreciated.

Umm, at least for me there is no code showing here. Not in the text and nothing attached. Just wanted to let you know.