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 did they come from?

$\endgroup$

1 Answer 1

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}\left(0, \frac{1}{\mathcal{N}(0, \frac{1}{1.0E-6})}\right).$$

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$ Commented Jul 6, 2018 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$ Commented Jul 6, 2018 at 23:30
  • 1
    $\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
    Commented Jul 7, 2018 at 2:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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