Hello, I have the following (test) data.
stan_data <- list(
N = 25,
Y = c(0.8333333,0.6000000,0.6000000,1.5000000,1.4166667,0.0500000,0.5500000,2.0000000,
1.5000000,2.1666667,2.9500000,0.7187500,1.3000000,0.4000000,0.8750000,1.3000000,
1.6000000,0.4438603,0.2083333,1.0937500,0.4642857,0.1500000,2.9000000,1.1666667,
1.2083333),
x = c(12.9000,5.6000,1.0000,0.9000,33.7500,11.5000,18.1500,15.3500,13.6500,18.0000,16.2500,
16.1000,21.7000,5.7000,10.2000,16.4000,17.1000,35.9483,6.9000,5.5000,8.3000,0.5500,
17.2000,6.8500,9.7500)
)
There are two published models for similar data with the non-linear form y = exp(b0 + b1 * sqrt(x) + b2 * x).
Say that model 1 shows a coefficients for b0 as Normal(-10,2) and model 2 as Normal (-12,1). My questions are:
- Is it correct to use both priors and give them the same probability? Should I take into account the sample size of those studies versus mine? (theoretical)
- How do you actually include a bimodal prior? (technical)
Here is the code for my new model including only one study as prior.
data {
int<lower=0> N;
real x[N];
real<lower=0> Y[N];
}
parameters {
real b0;
real b1;
real b2;
real<lower=0> beta;
}
transformed parameters {
real m[N];
for (i in 1:N)
m[i] = exp(b0 +b1*sqrt(x[i]) +b2*x[i]);
}
model {
// priors taken only from published model 1
b0 ~ normal(-10, 2);
b1 ~ normal(0.2, .5);
b2 ~ normal(-.05, .02);
// likelihood
Y ~ gamma(m, beta);
}
Here I found an example for plotting bimodal priors but I do not know how to integrate it with my model.
data { }
parameters {
real mu;
}
transformed parameters { }
model {
target += log_sum_exp(normal_lpdf(mu|-10,2),normal_lpdf(mu|-12,1));
}