0
$\begingroup$

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?

Thanks for your help

$\endgroup$
0
$\begingroup$

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.

$\endgroup$
3
  • $\begingroup$ Thank you E. Trauger- What is the basis of the mean and variance selected as prior knowledge in the this regression model $\endgroup$ – user3546966 Jul 6 '18 at 23:06
  • $\begingroup$ Thanks- I did not chose it, but I am still not clear how I can chose a tau value as prior knowledge. Any help? $\endgroup$ – user3546966 Jul 6 '18 at 23:30
  • $\begingroup$ 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? $\endgroup$ – whuber Jul 7 '18 at 2:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.