Hi, I'm a beginner of Stan, and I'm not that confident to vectorize all my distribution statements in Stan, for example, I know
when mu is a vector, delta is a scalar,
for(i in 1:N){
y[n]~dnorm(mu,delta)
}
is the same as
, is the sense that delta is broadcasted to a vector with the same size as mu, or y, i.e., N.
Can I do the same thing for all the distributions in Stan?
For example,
Vector[N] x;
x~uniform(a,b) # a, b are both scalar
matrix[K,K] sigma[N];
sigma ~ inv_wishart(m, S) # S is a single matrix with the same dim as each element of sigma array, broadcast??
Also, for increment_log_prob(), it can take a vector, suppose I have a vector of log_likelihood log_vec, which way is better:
increment_log_prob(sum(log_vec))
#or
increment_log_prob(log_vec)
Thanks for your patience and hope you don't mind if this question is too simple. I went over the menu 2 times but I'm still not feeling confident when writing programs.
Best!