I've come across an article (http://papers.ssrn.com/sol3/papers.cfm?abstract_id=704903), in which author wrote about maximum likelihood estimates of parameters in the so called modified Champernowne distribution (page 6). Since there are 3 parameters in the density(alpha, M, c), you can either try to calculate 3 estimates or notice that CDF(M) = 0.5. Then it will be possible to obtain, let's say, pseudo-ML estimates for alpha and c for M equal to empirical median.
I've tried to make a short exercise in R, using those 2 approaches. No success.
#Champernowne density
Champ_dens = function(x,alfa,M,c){
alfa*(x+c)^(alfa-1)*((M+c)^alfa-c^alfa) / ((x+c)^alfa+(M+c)^alfa-2*c^alfa)^2
}
#Generating variables from Weibull distribution
data <- rweibull(5000,3,2)
library(stats4)
#log-likelihood for calculating 3 estimates
Champ_LL <- function(alfa,M,c){
V = Champ_dens(data,alfa,M,c)
-sum(log(V))
}
#log-likelihood for calculating 2 estimates (the last one equal to empirical median)
Champ_LL2 <- function(alfa,c){
V = Champ_dens(data,alfa,median(data),c)
-sum(log(V))
}
est_par <- mle(Champ_LL,start=list(alfa=1,M=median(data),c=1),method = "L-BFGS-B",
lower=c(0.0001,0.0001,0),upper=c(Inf, Inf, Inf))
est_par
est_par2 <- mle(Champ_LL2,start=list(alfa=1,c=1),method = "L-BFGS-B",
lower=c(0.0001,0),upper=c(Inf, Inf))
est_par2
Every time I have the same error:
Error in optim(start, f, method = method, hessian = TRUE, ...) :
L-BFGS-B needs finite values of 'fn'
Since I know (e.g. from the article) then a > 0, M > 0, c $\geq$ 0, I suspect the problem lies in too nonrestrictive constraint for an upper bound of each parameter. The problem is, I know nothing about the suitable range of parameters. I wonder if there is a possibility to tackle this problem, e.g. choose some finite upper bound (justifying somehow why such a constraint). Or maybe in this particular example it is much better to some other optimization method (like simulated annealing)?
I'll be glad for any help.