One of the reasons DUD is not available much any more is that methods
have evolved:
- nls (and nlxb() from nlmrt as well as nlsLM from minpack.LM -- which
are more robust but may be less efficient) can use automatic derivative
computation, which avoids the motive for which DUD was written
- DUD came about, as Bert noted, in a period when many methods were
being tried. I recall being at one of the first talks about DUD by Mary
Ralston. It seems to work well on the examples used to illustrate it,
but I have never seen a good comparative test of it. I think this is
because it was always embedded in proprietary code, so not properly
available for scrutiny. (If I'm wrong in this, I hope to be enlightened
as to source code. I did find a student paper, but it tests with SAS.)
- Marquardt methods, as in nlmrt and minpack.LM, generally have a better
track record. They can be used with numerical derivative approximations
(numDeriv, for example) with R functions rather than expressions (nlfb
from nlmrt, and one of the other minpack.LM routines), in which case one
gets a form of secant method.
- Ben's mention of bobyqa leads to a different derivative-free minimizer
that approximates the surface and minimizes that.
John Nash
Date: Tue, 2 Apr 2013 07:22:33 +0000
From: Ben Bolker <bbolker at gmail.com>
To: <r-help at stat.math.ethz.ch>
Subject: Re: [R] Is DUD available in nls()?
Message-ID: <loom.20130402T091830-660 at post.gmane.org>
Content-Type: text/plain; charset="us-ascii"
Bert Gunter <gunter.berton <at> gene.com> writes:
>
> I certainly second all Jeff's comments.
>
> **HOWEVER** :
> tandfonline.com/doi/pdf/10.1080/00401706.1978.10489610
>
> IIRC, DUD's provenance is old, being originally a BMDP feature.
>
If you want to do derivative-free nonlinear least-squares fitting
you could do something like:
library("bbmle")
dnorm2 <- function(x,mean,log=FALSE) {
ssq <- sum((x-mean)^2)
n <- length(x)
dnorm(x,mean,sd=ssq/n,log=log)
}
mle2(y~dnorm2(mean=a*x^b),data=...,method="Nelder-Mead")
This is not necessarily the most efficient/highly tuned possibility,
but it is one reasonably quick way to get going (you can substitute
other derivative-free optimizers, e.g.
library("optimx")
mle2(...,optimizer="optimx",method="bobyqa")
(I think).
This isn't the exact algorithm you asked for, but it might serve
your purpose.
Ben Bolker