[R] Determining model parameters

Ben Bolker bolker at ufl.edu
Mon Aug 4 02:39:06 CEST 2008


~  The beta distribution only applies to data that are bounded
between 0 and 1 (in some cases strictly bounded, i.e. 0<x<1 not
just 0<=x<=1).

~   As a start, try something like

d2 = (Diff-min(Diff)+0.001)/(max(Diff)-min(Diff)+0.002)
fitdistr(d2,densfun="beta",start=list(shape1=3,shape2=2))

~ [cc'ing back to R-help for posterity ...]

~ Ben Bolker

rkevinburton at charter.net wrote:
| OK. I see in the documentation that "start" is required for certain
distributions. Now I get:
|
| fitdistr(Diff, densfun="beta", list(shape1=3,shape2=2))
| Error in optim(x = c(0, 516, 968, 703, 960, 32, 956, 1417, -92, 471,
531,  :
|   initial value in 'vmmin' is not finite
|
| Any idea what vmmin is? And what the cause of the error is?
|
| Thanks again.
|
| Kevin
| ---- Ben Bolker <bolker at ufl.edu> wrote:
|>  <rkevinburton <at> charter.net> writes:
|>
|>> If I have some data that based on the historgram and other plots it
"looks"
|> like a beta distribution. Is there
|>> a function or functions within R to help me determine the model
parameters for
|> such a distirbution?
|>
|>
|> library(MASS)
|> ?fitdistr
|>



More information about the R-help mailing list