I am wondering if there could be a generic cause of this sampling behaviour (that I have encountered in the past but I never wondered too much on) and/or could be indicative of some common pathology .
Warning message
Warning messages:
1: There were 3 chains where the estimated Bayesian Fraction of Missing Information was low. See
http://mc-stan.org/misc/warnings.html#bfmi-low
2: Examine the pairs() plot to diagnose sampling problems
My model
data {
int<lower=0> N;
int<lower=0> G;
int<lower=0> counts[N,G];
real my_prior[2];
int<lower=0, upper=1> omit_data;
}
parameters {
// Overall properties of the data
real lambda_mu;
real<lower=0> lambda_sigma;
real<lower=1> sigma;
// Gene-wise properties of the data
vector[G] lambda;
}
model {
// Overall properties of the data
lambda_mu ~ normal(0,1);
lambda_sigma ~ cauchy(0,2);
sigma ~ gamma(3,2);
// Gene-wise properties of the data
lambda ~ normal(lambda_mu, lambda_sigma);
// Sample from data
for(n in 1:N) counts[n,] ~ neg_binomial_2_log(lambda, sigma);
}
generated quantities{
int<lower=0> counts_gen[N,G];
vector[G] lambda_gen;
// Sample gene wise rates
for(g in 1:G) lambda_gen[g] = normal_rng(lambda_mu, lambda_sigma);
// Sample gene wise sample wise abundances
for(n in 1:N) for(g in 1:G) {
counts_gen[n,g] = neg_binomial_2_log_rng(lambda_gen[g], sigma);
}
}