Hello Stan professors, I’m Stan rookie.
According to the title, I would like to ask you that can I put closed-form equation to “transformed parameters” block ?
I often see such demonstration.(This is regression model example)
parameters{
real a;
real b;
real<lower=0> sigma;
}
transformed parameters{
real y_base[N];
for(i in 1:N){
y_base[i] = a + b*x[i];
}
}
model{
for(i in 1:N){
y[i] ~ normal(y_base[i], sigma);
}
}
Abstractly
parameters{
real param1;
real param2;
}
transformed parameters{
real new_param1;
real new_param2;
new_param1 = some_func1(param1, param2);
new_param2 = some_func2(param1, param2);
}
I want to write like this↓
parameters{
real param1;
real param2;
}
transformed parameters{
real new_param1;
real new_param2;
some_func1(param1, param2, new_param1) = 0;
some_func1(param1, param2, new_param2) = 0; //so called closed-form, right?
}
Would you tell me whether this is allowed and/or something solution?
In addition, I would like you to forgive my poor English.
Thank you.