I know that WinBugs uses precision as a parameter in dnorm instead of variance
model {
#Likelihood
for(i in 1:N1){
y1[i] ~dnorm(mu,tau)
}
sigma <- sqrt(1/tau)
#Priors
mu ~ dnorm(0,0.000001)
tau~ dgamma(taumu, taus)
}
My question is: if instead I want to specify the prior for sigma because I know its mean and variance would it be right to use the following model ?
model {
#Likelihood
for(i in 1:N1){
y1[i] ~dnorm(mu,tau)
}
tau <- sqrt(1/sigma)
#Priors
mu ~ dnorm(0,0.000001)
sigma ~ dnorm(sigmamu, sigmas)
}
Thanks in advance