From: Adelchi Azzalini (email@example.com)
Date: Sun 22 Jun 2003 - 01:21:59 EST
There seems to exist peculiar cases where optim does not take care
of constraints on the parameters to be optimized over. The call to
optim is of the form
opt <- optim(cp, fn=sn.dev, gr=sn.dev.gh, method="L-BFGS-B",
lower=c(-Inf, 1e-10, -0.99527),
upper=c( Inf, Inf, 0.99527),
control=control, X=X, y=y, hessian=FALSE)
The code has worked fine many times, but I have come across cases
(for suitable data X and y) where the constraint on the last component
is ignored; that means that a call is made to sn.dev with
cp = -1.3546 0.4645 3.1741
so the third component exceeds 0.99527, and the program stops
because of a check in the function to be obtimised.
The call just before was to the gradient function
sn.dev.gh: gradient = 219013 -312643 441647332
which has rather large values.
To make the problem more interesting, it shows up on a Linux
(Debian) installation, but it works fine on MS-windows.
In both cases, R is 1.7.0.
Perhaps this sort of question should not be directed to the R-help
list, rather to the developer(s) of optim. Please instruct me on this
point. Also, I appreciate that the above is not a reproducible example;
this would be longish in text, and I though to ask first to whom
it is appropriate that I direct my question.
-- Adelchi Azzalini <firstname.lastname@example.org> Dipart.Scienze Statistiche, UniversitÃ di Padova, Italia http://azzalini.stat.unipd.it/
______________________________________________ Remail@example.com mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
This archive was generated by hypermail 2.1.3 : Tue 01 Jul 2003 - 09:12:02 EST