rbeta(100,0.1,0.1) is generating samples which contain 1, an impossible
value for a beta and hence the sample has an infinite log-likelihood.
It is clearly documented on the help page that the range is 0 x 1.
However, that is not so surprising as P(X 1-1e-16) is about 1% and hence
values will
My standard work-around for the kind of problem you identified is to
shrink the numbers just a little towards 0.5. For example:
library(MASS)
a - rbeta(100,0.1,0.1)
fitdistr(x=a, beta, start=list(shape1=0.1,shape2=0.1))
Error in optim(start, mylogfn, x = x, hessian = TRUE, ...) :
In this example shrinking by (1 - 2e-16) leads to a significant change in
the distribution: see my probability calculation. And you can't shrink by
much less. A beta(0.1, 0.1) is barely a continuous distribution.
On Fri, 4 Jul 2003, Spencer Graves wrote:
My standard work-around for the kind