Aziz
2011-09-12
Hi,
is there any way to provide initial values for stochastic nodes given in the
data{} block (i.e. nodes for which we want to fix the sampling distribution)?
I need to do this because my model uses a dinterval() construct which requires
adequate initial values to work. The sampling distribution of some of the
parameters is known so I wish to provide these in the data block so that these
do not get updated by likelihood information from the data. My initial idea
was to avoid the data{} block and provide the sampling distribution in the
model{} block. I then locked these distribution with dsum() which mimics the
use of the cut() function in BUGS. However as known dsum() used in such
fashion (or cut()) do not actually provide the correct distribution so it is
not a solution. So Im looking at a way to provide initial values for nodes in
the data{} block. Is there any such possibility in JAGS?
Thanks
Aziz
2011-09-12
It seems that stochastic nodes in the data block are forward sampled only once
(and not once per iteration...) so it is not likely to work. The cut function
seems to work in WinBUGS for my problem but I'd like to use JAGS as it
provides some other features that WinBUGS doesn't have. For now I tried to
implement the cut function in JAGS this way (suppose the sampling distribution
of alpha is known with mean 10 and sd=sqrt(1/0.5)):
alpha ~ dnorm(10,0.5)
alpha.cut ~ dsum(alpha)
for(i in 1:N){
y_ ~ dnorm(alpha.cut*x_,tau)
}
tau <- pow(sigma,-2)
sigma ~ dunif(0,1000)
However in this fashion dsum doesn't have any effect (alpha gets modified by
the likelihood of y). How should I use dsum() so that alpha doesn't get
updated by y?__