I am testing a code I am using in R to compute estimates for the MLEs of the parameters for a given distribution. As an example, to check if the code works, I have chosen the paper A New Two-parameter Modified Half-logistic Distribution... by G. Mohammad. However, in trying to reproduce the parameter estimates for the MHL distribution (defined on page 1 of the attached paper) when using Data Set II (see page 14), I obtain estimates of $0.630$ and $0.228$ for $\alpha$ and $\beta$, respectively. This is markedly different to those obtained by the author ($0.975$ and $0.298$). What has gone wrong here? Is there a mistake somewhere in my code? It doesn't seem obvious to me.

The code I am using is as follows:

 x <- scan(textConnection("0.036   0.058   0.102   0.103   0.114   0.116   0.061   0.074   0.078   0.086   0.381   0.538  
0.570   0.574   0.590   0.618   0.645   0.961   1.228   10.94   11.02   13.88   1.600   0.148   0.183   0.192   0.254   0.262   0.379   2.006   2.054   2.804   3.058   3.076   3.147   3.625   3.704   3.931   4.073   4.393   4.534   4.893   6.274   6.816   7.896  
7.904   8.022   9.337   14.73   15.08"))
  dL <- function(x,alpha,beta) {
       r <- max(exp(-x)*(1-exp(-x))^(alpha-1)*(beta*exp(-(beta-1)*x)+alpha+(alpha-beta)*exp(-beta*x))/(1+exp(-beta*x))^2, 0.00000001)      
   vdL <- Vectorize(dL)
   LL <- function(x, alpha, beta){ -sum( log( vdL(x, alpha, beta))) }
 (m0 <- mle2(LL,start=list(alpha=1,beta=0.3),data=list(x=x)))

For convenience, the MHL pdf is given by

$$f(x) = e^{-x}(1-e^{-x})^{-1+\alpha}\frac{\beta e^{-(\beta-1)x}+\alpha+(\alpha-\beta)e^{-\beta x}}{(1+e^{-\beta x})^2}$$


1 Answer 1


I suspect the paper is wrong. Some of the computational results are clearly wrong: figure 10 is a duplicate of figure 8 and figure 3 shows the variance as zero to machine precision and the mean as almost independent of the parameters.

First check: do you have an optimisation failure? No, your loglikelihood really is higher at your value than the published value.

Second check: is the density right? I took the (much simpler) expression for the CDF from the paper, symbolically differentiated it using deriv(), and evaluated it. I match Figure 1 in the paper, and I match your loglikelihood. So the difference isn't explained by the paper getting its derivative wrong or you getting the implementation wrong.

Third check: the other dataset. Your code says the optimum is at (2.68,.113); the paper says it is at (3.367,.227). The loglikelihood at your optimum (according to your code and mine) is -72.16; the value at their optimum is -79.5. Neither one matches the y-axis of Figure 8, though your optimum is closer than theirs.

I wondered if they were actually using the MLE or one of the other estimators. However, they say at the end of section 3.4 that they are using the MLE, and the y-axis on Figure 8 is labelled as loglikelihood.

I'd suggest writing to the editor, but I suspect ... how do I put this politely ... this might not be a journal that has a strong focus on that sort of detail.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.