# Estimating uniform distribution with RJAGS - beginners question [closed]

I am trying to estimate the parameters of a uniform distribution, which, by a visual inspection, is between -5 and 25.

I am getting the following error:

"Error in jags.model(filepath, data = list(x = x, N = N), n.chains = 2) :

Error in node x[1]

Node inconsistent with parents"


I think the problem is with the .bug file:

model {
for (i in 1:N) {
x[i] ~ dunif(a, b)
}

a ~ dnorm(-5, .0001)
b ~ dnorm(15,.0001)

}


This code is suppose to estimate "a" and "b", where "x" is uniformly distributed between them.

Any idea why I am getting the error? (Am I even in the right direction?)