Initial value problem

Hello everyone, while running program I got this error.
Rejecting initial value:
Error evaluating the log probability at the initial value.
Exception: normal_lpdf: Scale parameter is -1.59449, but must be > 0!

Is there any way to solve it?!
Code is attached:

data {
int N;// number of observations
int n[N];//trials
int y[N];//successes
int M;
matrix[N,M] x;//predictor matrix
}
parameters {
vector[M] Beta;
real sigma;//between-observation variance
real gamma[N];//random effect

}
transformed parameters {
vector[N] mu;// probability
for (i in 1:N) {
mu[i] =inv_logit(dot_product(x[i],Beta)+gamma[i]);
}
}
model {
Beta~normal(0,1000);//priors are vague
sigma ~ inv_gamma(0.001,0.001);
gamma~normal(0,sigma);
y~binomial(n,mu);
}

Declare sigma as

parameters {
vector[M] Beta;
real<lower=0> sigma;//between-observation variance
real gamma[N];//random effect
}
1 Like

Thanks!