Say, I want to fix the value of a variable inside a loop to a constant, although this could change when the constant is changed in the call to a function outside the loop; how do I specify such a scenario, if possible?
CODE:
real a;
real a_const;
real b;
a ~ std_normal();
b ~ std_normal();
a_const = a;
for (i in 1:10) {
c = b*a_const; // value of a_const should be constant, for b it can change
}
Can I do something as a work about to specify this?
I understand that inside the loop before the product is assigned to c; b and a must be sampled.
Please correct me if wrong.