Problem: Parameters in model1 do not appear in model2. Exploration happens on joint space of every parameters within the model network.
Suggestion: use transformed parameters block to conditioned parameters as below
From
data {
int N;
vector[N] y;
}
parameters {
real<lower=0> sigma;
}
...
To
data {
int N;
vector[N] y;
}
parameters {
real<lower=0> sigma;
real<lower=0> mu;
}
transformed parameters{
real<lower=0> mu;
mu = 0
}
model {
sigma ~ lognormal(0, 1);
y ~ normal(mu, sigma);
}