[R] Estimating parameters of 3 parameters lognormal distribution

Rolf Turner r.turner at auckland.ac.nz
Fri Jan 17 22:46:41 CET 2014


Can you please tell us (me!) how you chose starting values?

Out of curiosity I tried the following:

set.seed(42)
x <- rlnorm(100,1,2) + 3
require(MASS)
strt <- list(mu=1,sigma=2,gamma=3)
fit  <- fitdistr(x,densfun=function(x,mu,sigma,gamma)
                                   {dlnorm(x-gamma,mu,sigma)
                           },
                start=strt,lower=c(0,0,-Inf),
                upper=c(Inf,Inf,min(x)))

and it ran just fine and gave sensible answers.  But when I took:

strt <- list(mu=0.9,sigma=1.9,gamma=2.9)

(not very different from the previous starting values)

I got an error:

> Error in stats::optim(x = c(45.178764955739, 3.87862565957867, 8.61957940802123,  :
>   L-BFGS-B needs finite values of 'fn'


On 18/01/14 01:00, Vito Ricci wrote:
> OK. It runs fine! Many thanks Frede.
> Regards.
> Vito
>
>
>
> Se non ora, quando?
> Se non qui, dove?
> Se non tu, chi?
>
>
>
> Il Venerdì 17 Gennaio 2014 12:38, Frede Aakmann Tøgersen <frtog at vestas.com> ha scritto:
>
>
>> In package MASS there is the fitdistr function using maximum likelihood estimation to infer on the parameters of distributions based on observed data.
>>
>>
>> One of the arguments of fitdistr () allows you to specify the probability density function.
>>
>>
>> You only know how the parametrization of your three parameters lognormal distribution is defined since you really haven't told us much.
>>
>>
>> Please have a look at fitdistr() and tell us if fit your needs.




More information about the R-help mailing list