After some discussion on the dev list, Matt correctly
guessed there was a zero in the data being modeled as
beta distributed, which I repeat here, with the zero in the
first line of data highlighted.
O <-
structure(c(0.7, 0.2, 0.55, 0.2, 0.5, 0, 0.42, 0.4, 0.3, 0.8, 0.74, 0.6, 0.72,
^
0.19, 0.58, 0.18, 0.48, 0.01, 0.45, 0.48, 0.4, 0.85, 0.75, 0.68, 0.69, 0.26,
0.54, 0.19, 0.55, 0.05, 0.44, 0.49, 0.35, 0.78, 0.71, 0.69, 0.68, 0.24, 0.52,
0.21, 0.51, 0.04, 0.46, 0.5, 0.38, 0.81, 0.7, 0.7, 0.71, 0.35, 0.51, 0.22, 0.52,
0.03, 0.43, 0.51, 0.39, 0.82, 0.72, 0.71),
.Dim = c(4, 3, 5))
I don't know there's much we can do to fix this issue. An actual 0 is
outside the proper support for the beta distribution.
- Bob
On 2/25/13 5:38 PM, Matt Hoffman wrote:
> Ah. Might the problem be that there's a 0 in the data? That 0 means you compute
> –(a – 1) * ∞
> which is big trouble for any value of a that's not 1. On the
> unconstrained scale, there's actually no valid setting of a. But even
> on the constrained scale, the prior assigns zero probability to a=1,
> so you're guaranteed that the log-density of the data will be either
> infinity or negative infinity. What happens if you replace the 0 with
> 0.001?
>
> Matt
>
> On Mon, Feb 25, 2013 at 2:27 PM, Ben Goodrich <
goodri...@gmail.com> wrote:
>> On Monday, February 25, 2013 4:57:42 PM UTC-5, Matt Hoffman wrote:
>>>
>>> But that's not ideal. I'm not sure what we can do about this within
>>> our current architecture, which really wants to transform beta r.v.s
>>> to [0, 1] and gamma r.v.s to [0, inf].
>>
>>
>> All true, but in this particular case, the RV was data and not being
>> transformed. So, it seems that for alpha very small and beta very large and
>> x close to zero, the gradient of the log density blows up. Possibly the beta
>> distribution is inappropriate for these data but it would be nice if we
>> could come up with a solution to our numerical problems.
>>
>> Ben
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "stan development mailing list" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to
stan-dev+u...@googlegroups.com.