R-alpha: optimization

Jim Lindsey (jlindsey@luc.ac.be)
Mon, 2 Sep 1996 11:45:55 +0200 (MET DST)

From: Jim Lindsey <jlindsey@luc.ac.be>
Message-Id: <9609020945.AA06445@alpha.luc.ac.be>
Subject: R-alpha: optimization
To: r-testers@stat.math.ethz.ch
Date: Mon, 2 Sep 1996 11:45:55 +0200 (MET DST)

The optimization routine can get into an infinite loop if NAs are generated
in the function to be optimized. For example, the mean of a Poisson
distribution fed negative values during search. This did not happen with 
the Fortran version. This occurs in the function lnsrch (maximize.c).
A quick hack is to add the line
after the called to fcn, the function to be optimized.

For some reason, optimization is definitely 15% slower than the original
Fortran passed through f2c. As well, it is much more sensitive to the
initial values provided (although the above hack seems to help a bit in the
relevant cases).

Following Douglas Bates' error in dqrsl.c, I have realized that solve()
will not invert a 1x1 matrix but now gives the error,
Error: nonpositive extents to matrix.
This can easily be handled by R coding for each case, but it would be nice
if it could be corrected in the function itself.
r-testers mailing list -- To (un)subscribe, send
subscribe	or	unsubscribe
(in the "body", not the subject !)  To: r-testers-request@stat.math.ethz.ch