Problem: I observed a quantity, say Y, which can be seen as a sum
of the true value and an error due to the measurement instrument.
That is, y[i] = b[i] + e[i], i = 1,N. Errors e[i] follow a normal distribution
within a range of values (an interval [a,b]). I would like to estimate
b[i], assuming that these true values follow normal distribution (or a
Gamma distribution). Here is the tentative code I wrote. Since I am new,
I am not so sure of the correctness. Any help and suggestions are
welcomed. In the code, values are those observed means and standard
deviations for the errors and the observations y.
----------------------------------------------------------------------------
-------------------------------------------
model sphygmo;
const
N = 2000; # number of patients from FAMUS
var
y[N], # observed BP
b[N], # `true' value of BP
mu[N], # systematic error due to sphygmomanometer
nu, # parameter effect
sigma, # parameter effect
{
for (i in 1:N) {
y[i] ~ dnorm(mu[i] , tau);
mu[i] <- b[i] + e[i];
b[i] ~ dnorm(nu, sigma);
e[i] ~ dnorm(-0.5714, 2.6186);
}
# Priors:
nu ~ dgamma(129.6, 1);
sigma ~ dgamma(18.2, 1);
tau ~ dgamma(0.003, 1);
}
data y;
list(y = c(110, 120, 130, 140, 140, 80, 130, 150, 110, 120, 110, 105,
120, 120, 120, 140,.....),
N = 2000)
inits ;
list(nu=70, sigma=1, tau=1)
----------------------------------------------------------------------------
-----------------------------------------------
-------------------------------------------------------------------
This list is for discussion of modelling issues and the BUGS software.
For help with crashes and error messages, first mail [log in to unmask]
To mail the BUGS list, mail to [log in to unmask]
Before mailing, please check the archive at www.jiscmail.ac.uk/lists/bugs.html
Please do not mail attachments to the list.
To leave the BUGS list, send LEAVE BUGS to [log in to unmask]
If this fails, mail [log in to unmask], NOT the whole list
|