francesc badia roca
2018-May-28 05:31 UTC
[R] to R Core T: mle function in 32bits not respecting the constrain
I have an issue using mle in versions of 32 bits. I am writing a package which I want to submit to the CRAN. When doing the check, there is an example that has an error running in the 32 bits version. The problem comes from the mle function, using it with a lower constrain. In 64 bits version it works fine but when I put it in the R 32 bits it fails. (same numbers, all equal!) The call is: *mle(minuslogl = p.est,start = beta,method "L-BFGS-B",lower=llim*reduction)* lower = -0.01570427 The optimizer (optim function in 32 bits) display: -0.015704 -loglik 48.690236 -0.015704 -loglik 48.690236 -0.017704 -loglik 1.#QNAN0 And it is not respecting the lower constrain. Could anyone explain me why this? Maybe I am misunderstunding of lower parameter meaning. Is this because the 'lower' is for the estimate but not for the hessian calculations internally? In such a case, why in 64 bits is different from 32 bits? And how I could solve it? Thank you. The code is in: https://github.com/fbr600/rERR -- Francesc Badia Roca. tel. (+34) 639 210 685 [[alternative HTML version deleted]]
Berry, Charles
2018-May-28 16:45 UTC
[R] to R Core T: mle function in 32bits not respecting the constrain
> On May 27, 2018, at 10:31 PM, francesc badia roca <fbr600 at gmail.com> wrote: > > I have an issue using mle in versions of 32 bits. > > I am writing a package which I want to submit to the CRAN. > When doing the check, there is an example that has an error running in the > 32 bits version. > > The problem comes from the mle function, using it with a lower constrain. > In 64 bits version it works fine but when I put it in the R 32 bits it > fails. (same numbers, all equal!) > > The call is: > *mle(minuslogl = p.est,start = beta,method > "L-BFGS-B",lower=llim*reduction)* > lower = -0.01570427 > > The optimizer (optim function in 32 bits) display: > -0.015704 -loglik 48.690236 > -0.015704 -loglik 48.690236 > -0.017704 -loglik 1.#QNAN0 > > And it is not respecting the lower constrain. > > Could anyone explain me why this?FAQ 7.31 is a likely suspect. You might need a `safe' lower bound. Perhaps, adding a small positive constant to it will fix it. HTH, Chuck
francesc badia roca
2018-May-29 05:08 UTC
[R] to R Core T: mle function in 32bits not respecting the constrain
The have set an epsilon > 0 to the point where the assimptota is, to compute the hessian at the lower it is required to evaluate at the left of the lower, and this is the point, because I want the estimate that usually is very close to the lower. I want to set a lower bound in which neither the estimate nor the hessian would be evaluated. Finally I set a suppressWarnings( reduction <- 0.999 while(is.na(numDeriv::hessian(p.est_num,llim2*reduction))) reduction <- reduction^2 ) 2018-05-28 18:45 GMT+02:00 Berry, Charles <ccberry at ucsd.edu>:> > > > On May 27, 2018, at 10:31 PM, francesc badia roca <fbr600 at gmail.com> > wrote: > > > > I have an issue using mle in versions of 32 bits. > > > > I am writing a package which I want to submit to the CRAN. > > When doing the check, there is an example that has an error running in > the > > 32 bits version. > > > > The problem comes from the mle function, using it with a lower constrain. > > In 64 bits version it works fine but when I put it in the R 32 bits it > > fails. (same numbers, all equal!) > > > > The call is: > > *mle(minuslogl = p.est,start = beta,method > > "L-BFGS-B",lower=llim*reduction)* > > lower = -0.01570427 > > > > The optimizer (optim function in 32 bits) display: > > -0.015704 -loglik 48.690236 > > -0.015704 -loglik 48.690236 > > -0.017704 -loglik 1.#QNAN0 > > > > And it is not respecting the lower constrain. > > > > Could anyone explain me why this? > > FAQ 7.31 is a likely suspect. > > You might need a `safe' lower bound. Perhaps, adding a small positive > constant to it will fix it. > > HTH, > > Chuck >-- Francesc Badia Roca. tel. (+34) 639 210 685 [[alternative HTML version deleted]]