Skip to content
Prev 155067 / 398506 Next

Maximum likelihood estimation

toh
Yes I'm trying to optimize the parameters a, b, p and lambda where a > 0, b >
0 and 0 < p < 1. I attached the error message that I got when I run mle.
+
234,236,240,243,252,254,259,263,264,268,271,277,290,309,324,331,346,367,375,381,
+
401,411,414,417,425,430,431,433,435,437,444,446,446,448,451,453,460,463,463,464,
+
464,465,465,465,466,467,467,467,468,469,469,469,469,470,472,472,473,473,473,473,
+ 473,473,473,475,475,475,475)
+ l <- 0.5*(lambda + b*p + (1-p)*(lambda-b))
+ l^2 > lambda*b*p
+ delta <- sqrt(abs(l^2 - b*p*lambda))
+ mt <- a/p*(1-exp(-l*t)*cosh(delta*t)-(l-b*p)*exp(-t)*sinh(delta*t)/delta)
+ logl <- sum(diff(y)*log(diff(mt))-diff(mt)-lfactorial(diff(y)))
+ return(-logl)
+ }
+ lower = c(0.002, 0.002, 0.002, 0.002), upper = c(Inf, Inf, 0.999,
Inf),control=list(fnscale=-1))
Error in optim(start, f, method = method, hessian = TRUE, ...) : 
  non-finite finite-difference value [3]
Prof Brian Ripley wrote: