Hi everyone,
I'm trying to truncate deterministic node theta.t to ensure its values lie between 0 and 1.
I've tried to solve the issue by employing T(0,1) function at the end of line 6, which doesn't work, and I'm not sure how to use ~dinterval() to address this particular problem.
Here the code:
for(j in 1:n.intervals) {
trunc[j] ~ dinterval(theta.t[j], breaks)
}
This adds the information that theta.t[j] is observed to lie between breaks[1] (0) and breaks[2] (1).
Note that formally this is censoring ([i]a posteriori[/i] constraint) not truncation ([i]a priori[/i] constraint). Happily in your example neither alpha nor beta have unobserved parents, so censoring and truncation are equivalent. You should not do this in a model where you are trying to learn about hyper-parameters of alpha and beta.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi everyone,
I'm trying to truncate deterministic node theta.t to ensure its values lie between 0 and 1.
I've tried to solve the issue by employing T(0,1) function at the end of line 6, which doesn't work, and I'm not sure how to use ~dinterval() to address this particular problem.
Here the code:
Thanks in advance!
You can either add a data step (as below) or supply these values with the data
Then in the model you add
This adds the information that theta.t[j] is observed to lie between
breaks[1]
(0) andbreaks[2]
(1).Note that formally this is censoring ([i]a posteriori[/i] constraint) not truncation ([i]a priori[/i] constraint). Happily in your example neither
alpha
norbeta
have unobserved parents, so censoring and truncation are equivalent. You should not do this in a model where you are trying to learn about hyper-parameters ofalpha
andbeta
.