# How to identify prior for the precision parameter in Winbugs

I have the following model: model{ for (i in 1:n){ y[i] ~dnorm(mu[i], tau) mu[i] <- a + b*x[i] }

  a ~ dnorm(0, 1.0E-6)
b ~ dnorm(0, 1.0E-6)

tau ~ dnorm(0,1.0E-6)

sigma <- 1/sqrt(tau)


} In tau ~ dnorm(0,1.0E-6) ( prior for the precision parameter),what are the numbers inside the parentheses (0,1.0E-6). Where they come from?

WinBUGS uses “precision” as a parameter in specifying a Normal distribution, instead of variance.

Precision = $\frac{1}{\text{Variance}}$

dnorm(0, 0.0001) is the same as a Normal distribution with mean 0 and variance $\frac{1}{0.0001} = 100^2$, or $\sim \mathcal{N}(0,100^2)$

# Edit

In response to the question, I assume your model looks something like this...

model {
for (i in 1:n) {
y[i] ~ dnorm(mu[i], tau)
mu[i] <- a + b*x[i]
}

a ~ dnorm(0, 1.0E-6)
b ~ dnorm(0, 1.0E-6)

tau ~ dnorm(0,1.0E-6)

sigma <- 1/sqrt(tau)
}


So, you simulate a $\tau$ value as $\sim \mathcal{N}(0, \frac{1}{1.0E-6})$, then use that $\tau$ value to calculate $y[i]$, such that $y[i] \sim \mathcal{N}(0, \frac{1}{\mathcal{N}(0, \frac{1}{1.0E-6})})$

Using a mean-zero Gaussian is standard practice for most people simulating random positive-or-negative errors. I do not know why you chose $1.0 \times 10^{-6}$ as your precision parameter. It is your model, not mine.

• Thank you E. Trauger- What is the basis of the mean and variance selected as prior knowledge in the this regression model – user3546966 Jul 6 '18 at 23:06
• Thanks- I did not chose it, but I am still not clear how I can chose a tau value as prior knowledge. Any help? – user3546966 Jul 6 '18 at 23:30
• What is "$\mathcal{N}(0, \frac{1}{\mathcal{N}(0, \frac{1}{1.0E-6})})$" intended to mean when the denominator of the second parameter (which apparently is meant to be a variance) turns out negative, which it has a $50\%$ chance of doing? – whuber Jul 7 '18 at 2:00