I’ve been trying to estimate the parameters of a reliability distribution called Kumaraswamy Inverse Weibull (KumIW), which can be found in the package ‘RelDists’. I tried to use the function optim, but it doesn’t matter the start that I give, the data generated by ‘rKumIW’ or the sample size, the mu parameter always converge to one, although the others parameters converge to the correct values. What can be done? Should I try to use another function from some different package?
library(RelDists)
library(gamlss)
ll <- function(par, x){
mu <- par[1]
sigma <- par[2]
nu <- par[3]
ll = n*log(sigma) + n*log(nu) + n*log(mu) - (mu+1)*sum(log(x)) - sigma*sum(x^-mu) + (nu-1)*sum(log(1-exp(-sigma*(x^-mu))))
return (ll)
}
n = 10000
set.seed(123)
y = rKumIW(n, mu = 2, sigma = 2.3, 3.5)
start = c(4, 2, 3)
fit1 <- optim(start, ll, x = y, method = "L-BFGS-B", hessian = FALSE, control = list(fnscale = -1),
lower = c(0, 0, 0), upper = c(Inf, Inf, Inf))
fit1
Output
César Augusto is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.