Hello, stan users,

I have a quick question:

Suppose I have a vector rho[J] which is a normally distributed variable for J groups.

Now I have another variable,Y that depends upon rho (I know I am highly simplifying the whole model).

Suppose I have two ways of drawing sample/samples from rho:

real Y;

for (j in 1:J) {

Y= (1-rho[j])*(1+rho[j]);

now this gives me one draw of Y from j rho’s.

I can have another way of sampling

vector[J] Y;

for (j in 1:J) {

Y[j]= (1-rho[j])*(1+rho[j]);

}

and this will give me j samples of Y.

I want to ask the modellers out there, is the one value of Y I got from the first sampling can be considered as the average of J Y samples I obtained from second procedure?

I know I have simplied it a lot and do not talk about the overall model.

I just want opinions.

Cheers

Antony