What's with the funky fonts
On 11/30/13, 3:06 AM, KK Sasa wrote:
...
> And I found the definition of dinterval at the webpage
> <
http://jags.sourcearchive.com/documentation/3.1.0/classbugs_1_1DInterval.html>:
>
> |
>
> i ~ dinterval(t, cutpoints[])
> f(i|t) = 1 if t < cutpoints[i] and t >= cutpoints[i-1]
> = 0 otherwise
>
> |
>
> So, I think I can use custom probability function 'increment_log_prob' in Stan.
> p. 151 in Stan manual reads it can use increment_log_prob(log(0.0)) to calculate the log(probability=0).
> However, I gave it a try, but Stan failed to do this.
If you use increment_log_prob(log(0)), it's equivalent to hard-coding
a sample rejection. If you initialize at such a state, you'll never
be able to move.
> Any suggestion for this kind deterministic function?
No. You shouldn't try to implement dinterval() in Stan. It's
a hack in JAGS, whereas Stan can just implement the truncation
and censoring models directly.
I'd again urge you to check out the manual chapter on truncation
and censoring. What you're going to need is a constraint, because
Stan assumes that variables have support (non-zero probability or finite
log probability) on their (possibly constrained) ranges.
- Bob