I am trying to estimate parameters from a three-parameter Log-logistic distribution in R. I have a code as follows:nloglike <- function(p,y) { n <- length(y) alpha <- p[1];   beta <-p[2];gamma <-p[3];if (alpha > 0 && y > gamma && beta >= 1){logl <- sum(log((beta/alpha)*((y-gamma)/alpha)^(beta - 1))-log(1+((y- gamma)/alpha)^beta))^2}   else { logl <- 10000 } return((logl))}yy<-exp(data[,2])sol<-optim(p=c(1,1,0),nloglike,method =BFGS,y=yy,control=list(trace=0))$parprint(sol)The code does not throw any errors, but the output is far different from what's expected. I would like to know what to consider when choosing the initial / starting values from the optim command. i.e. p=c(1,1,0)
Maximum likelihood Estimation of three-parameter log-logistic distribution in R
r;distribution