Hi!

I am trying to fit a linear model where every single x has it’s own mean and sd.

Looking through forums on measurement errors, this is what I’ve come up with.

Unfortunately, I don’t get any good results.

I keep getting the following error, no matter how much iterations I set.

There were 4 chains where the estimated Bayesian Fraction of Missing Information was low. See

http://mc-stan.org/misc/warnings.html#bfmi-low

Anyone has some thoughts on where the issue might be? Thanks in advance!

```
data {
int<lower=0> N; // number of obs
real x_mean[N]; // mean of x
real<lower=0> x_sd[N]; // sd x
real y[N];
}
parameters {
vector<lower=-5>[N] x; // unknown true value x
real<lower=-10> mu_x; // prior x
real<lower=0> sigma_x; // prior scale
real alpha; // intercept
real beta; // slope
real<lower=0> sigma; // outcome noise
}
transformed parameters {
vector[N] mu;
mu = alpha + beta * x;
}
model {
// priors
alpha ~ normal(5.4, 1);
beta ~ normal(0.99, 0.12);
sigma ~ cauchy(0, 5);
mu_x ~ normal(5, 2);
sigma_x ~ cauchy(0, 1);
for (n in 1:N){
x[n] ~ normal(mu_x, sigma_x); // prior
x_mean[n] ~ normal(x[n], x_sd[n]);
}
y ~ normal(mu, sigma);
}
```