[R] MLE with optim

From: Carsten Steinhoff <carsten.steinhoff_at_stud.uni-goettingen.de>
Date: Thu 30 Jun 2005 - 01:19:51 EST


Hello,  

I tried to fit a lognormal distribution by using optim. But sadly the output seems to be incorrect.
Who can tell me where the "bug" is?  

test     =     rlnorm(100,5,3)
logL    =     function(parm, x,...) -sum(log(dlnorm(x,parm,...)))
start    =     list(meanlog=5, sdlog=3)

optim(start,logL,x=test)$par  

Carsten.

        [[alternative HTML version deleted]]



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Thu Jun 30 01:23:28 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:33:07 EST