Hi,
I am a beginner to Stan and have an issue with fitting a simple beta binomial model.
Here is the warning message I get:-
“Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
Exception:validate transform params : beta is -nan, but must be greater than on equal to zero. If this warning occurs often then your model is ill conditioned or mis-specified.”
Here is the pySTAN code:
code="""data {
int<lower=2> J; // number of coins
int<lower=0> y[J]; // heads in respective coin trials
int<lower=0> n[J]; // total in respective coin trials
}
parameters {
real<lower = 0, upper = 1> mu;
real<lower = 0> kappa;
}
transformed parameters {
real<lower=0> alpha;
real<lower=0> beta;
alpha = kappa * mu;
beta = kappa - alpha;
}
model {
mu ~ uniform(0, 1);
kappa ~ exponential(0.05); // uniform(1,100);
y ~ beta_binomial(n, alpha, beta);
}
“”"
Thanks,
Meera