# Fitting Log logistic and calculating its mean

I am trying to fit a log logistic curve to my set of data

library(MASS)
library(survival)
library(fitdistrplus)
library("actuar")

> fll<-fitdist(AdjClaim_Size,"llogis")
> summary(fll)
Fitting of the distribution ' llogis ' by maximum likelihood
Parameters :
estimate   Std. Error
shape    0.7904160   0.04786716
scale 1870.6747498 269.22215682


Do I use the below:?

Expected<-mllogis(order=1,shape=0.7904160,scale=1870.6747498)


But it gives me "inf"...What am I doing wrong?

I guess what I am trying to do is to estimate the parameters of a fitted curve, and based on the parameters, calculate E(X)

• 1. Not all log-logistic distributions have a mean; if you're using functions all with the same parameterization as Wikipedia, then shape<1 will do that; you need to make your parameterizations explicit (and check they're the same for all your functions) 2. You're using packages / functions you haven't specified so it's not possible to tell what this is actually doing (are you using the package actuar maybe?). Please include a minimal reproducible example. ... ctd Apr 17, 2019 at 1:35
• ctd ... - also see here 3. Note the help center in relation to programming. Your question should be framed as one about statistics, rather than "what's wrong with my code" (typically, if the question wouldn't change if you changed what language you used, it's more likely to be on-topic) Apr 17, 2019 at 2:50
• Thaks Glen_b, I have included the packages...
– by79
Apr 17, 2019 at 8:27

Yes, the parameterization in the *llogis functions in actuar (see the help on dllogis) is the same as on Wikipedia, but it uses different symbols for the shape and scale).
Not all log-logistic distributions have a mean; if the shape parameter (in that parameterization) is $$\leq 1$$ then the log-logistic does not have a finite mean.