2016-12-12

Duncan,

December 12 already!

This is about nls14/nlsr. I'll send you a separate message about a 
proposed UseR! session about which you may have ideas.

I've done some work on the nls14 package and a few other things. I 
think I can continue slowly to grind away at it, but a few 
interventions from you would probably speed my efforts. The 
particular points I would like advice or help on are at the end. 
First, what I've been doing. (Feel free to complain/cheer/etc.)
Anything I refer to is in the subversion repository at 
https://r-forge.r-project.org/projects/optimizer/ in the nlsr
directory. If you prefer, I can email a tarball, or we can move
to Github, or ....

1) Rename to nlsr to avoid a number.

2) Made comparisons of base, nlsr, Deriv, Ryacas and any other tool I can
find for derivatives. This is in nlsr-derivs.Rmd. This will be an ongoing
vignette as updates and such appear, and also as I dig deeper. This is 
intended as a memorandum as much to myself as anyone else, so essentially
documentation. I use ?? to mark things I want to check. Lots of these, 
so the points at the end of this msg are the important ones for now.

3) A quick look at fixed parameters and how to specify them to optimizers
or nonlinear least squares. This is in vignette FixedParameters.Rmd. I think
I've more or less sorted this out in my own mind, and current preference
is to allow lower and upper bounds to be equal for fixed parameters and
have programs recognize this and set the masking internally.

4) nlsr-devdoc.Rmd is a dog's dinner vignette of things I've tried or
want to try. As topics get resolved, I plan to extract them to other
vignettes like those in (2) and (3) above.

5) I've looked at some things outside the derivatives and such. For example,
tried some experiments on pure Gauss-Jordan on small-residual problems with
relative offset termination test turned off. I'd like to be able to allow
such control in nlsr through settings that are probably not going to be much
used. However, that's more on my end to allow check of different algorithm
ideas in different situations. 

Now the specific things that you may be able to help with.

1) Decision / strategy: The Deriv package has slightly more coverage in 
derivatives that we do. I think it may be a little simpler to call in that
there is only one function to get derivatives. Should we rejig nlsr to call
this rather than our functions, or borrow the ideas and try to simplify
them even more? There are pros and cons of both choices.

2) Appendix A of nlsr-devdoc vignette and inst/devfiles/nlsdata.R test 
different ways to provide exogenous data to nonlinear least squares 
solvers. I call the modes "quiet" to indicate data is in the calling
environment, "dots" to say it is in dotargs and "frame" if in dataframe.
My old nlmrt packages only does "frame", nls() does all, and nlsr (currently)
and minpack.lm::nlsLM do "frame" and "quiet" but not "dots". Is there an
easy way to make nlsr do the "dots" too?

3) I can't seem to get a handle on fnDeriv. Do we need it? 

4) How soon should we aim to put on CRAN to reserve the name?

For now, that's it, but if you have things you think I should look at, let me
know.

Best, JN
