Hi all,
I’m trying to understand whether Jacobian adjustment is needed when a parameter is used as the upper and/or lower bound for other parameters.
For example,
parameters {
vector<lower=0, upper=10>[k] a1;
vector<lower=a1, upper=10>[k] a2;
vector<lower=a2, upper=10>[k] a3;
vector<lower=0, upper=10>[k] b1;
vector<lower=b1, upper=10>[k] b2;
vector<lower=b1 + b2, upper=10>[k] b3;
}
model {
a1 ~ normal(0, 2);
a2 ~ normal(0, 2);
a3 ~ normal(0, 2);
b1 ~ normal(0, 2);
b2 ~ normal(0, 2);
b3 ~ normal(0, 2);
}
I believe that when the upper and lower bounds are constants, as in a1 and b1, no additional Jacobian adjustment is needed.
My questions are:
-
Does Stan automatically handle the constraint transformation for
a2anda3, or do we need to add an explicit Jacobian adjustment in themodelblock? -
Does the answer change when the upper and lower bounds are parameters, for example
vector<lower=a1, upper=a3>[k] a2? -
Does it make a difference if we include multiple parameters with parameter-dependent upper and lower bounds, as shown in the code for
b3?
Any clarification would be greatly appreciated.
Thanks.