Error using fitdist in R - dllogis function must be defined

Viewed 386

By running this code:

set.seed(12)
eta <- 10
nu <- 2
n <- 100
t <- eta*(((-1)*log(1-runif(n)))^(1/nu))# generates T_i
t
library("fitdistrplus")
fitll <- fitdist(t, "llogis")

In R, I received this error:

Error in fitdist(t, "llogis") : The  dllogis  function must be defined

I had installed the package "fitdistrplus" before. Any ideas on how to fix this error? With other distributions, for example, "gamma" this code works fine.

1 Answers

Try this. It looks like the package with the desired distribution needs to be invoked (flexsurv):

set.seed(12)
eta <- 10
nu <- 2
n <- 100
t <- eta*(((-1)*log(1-runif(n)))^(1/nu))# generates T_i
t
library("fitdistrplus")
library(flexsurv)
fitll <- fitdist(t, "llogis")
fitll

Output:

fitll
Fitting of the distribution ' llogis ' by maximum likelihood 
Parameters:
      estimate Std. Error
shape 3.141862  0.2609741
scale 7.659338  0.4246839
Related