# 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?)

## closed as off-topic by Michael Chernick, jbowman, mdewey, kjetil b halvorsen, Peter Flom - Reinstate Monica♦Jan 24 '18 at 13:28

This question appears to be off-topic. The users who voted to close gave this specific reason:

• "This question appears to be off-topic because EITHER it is not about statistics, machine learning, data analysis, data mining, or data visualization, OR it focuses on programming, debugging, or performing routine operations within a statistical computing platform. If the latter, you could try the support links we maintain." – Michael Chernick, jbowman, mdewey, kjetil b halvorsen, Peter Flom - Reinstate Monica
If this question can be reworded to fit the rules in the help center, please edit the question.