Hello!
Suppose I have an array of vectors, eg
data{
int T;
int n;
}
parameters{
row_vector[n] v[T];
}
and suppose I want to copy this into a matrix so I can use vectorised sampling statements. Which of these is more efficient?
Option 1:
model{
matrix[T,n] A;
for(i in 1:T){
for(j in 1:n){
A[i,j] = v[i,j];
}
}
to_vector(A) ~ normal(....);
}
Or option 2?
model{
matrix[T,n] A;
for(i in 1:T){
A[i] = v[i];
}
}
to_vector(A) ~ normal(....);
Thanks!