[R] fitting distributions with R

Huntsinger, Reid reid_huntsinger at merck.com
Tue Sep 6 16:00:08 CEST 2005

The MLE of beta is the reciprocal of the sample mean, so you don't need an
optimizer here. 

Reid Huntsinger

-----Original Message-----
From: r-help-bounces at stat.math.ethz.ch
[mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of Nadja Riedwyl
Sent: Tuesday, September 06, 2005 9:39 AM
To: r-help at stat.math.ethz.ch
Subject: [R] fitting distributions with R

Dear all
I've got the dataset
          14924;28640;17097;2136;5308;3477;91301;11488;3860;64114;14334
I know from other testing that it should be possible to fit the data with
exponentialdistribution. I tried to get parameterestimates for the 
exponentialdistribution with R, but as the values 
of the parameter are very close to 0 i get into troubles. Do you know, what
could do in order to get estimates?How do you choose the starting values? in

my opinion it should be around 1/mean(data).

#Parameterestimation  with mle() with the log-likelihood funktion of the  
est<-mle(minuslog=ll, start=list(beta=0.1))

#instead of a result, i get:

Error in optim(start, f, method = method, hessian = TRUE, ...) :
        non-finite finite-difference value [1]
In addition: There were 50 or more warnings (use warnings() to see the first

#with fitdistr() for the exponentialdistribution

#instead of a result, i get

Error in optim(start, mylogfn, x = x, hessian = TRUE, ...) :
        non-finite finite-difference value [1]
In addition: Warning messages:
1: bounds can only be used with method L-BFGS-B in: optim(start, mylogfn, x
x, hessian = TRUE, ...)
2: NaNs produced in: dexp(x, 1/rate, log)

i'll be very happy for any help i can get to solve this problem
thank you!

R-help at stat.math.ethz.ch mailing list
PLEASE do read the posting guide!

More information about the R-help mailing list