[R] Is DUD available in nls()?

Ben Bolker bbolker at gmail.com
Tue Apr 2 09:22:33 CEST 2013


Bert Gunter <gunter.berton <at> gene.com> writes:

> 
> I certainly second all Jeff's comments.
> 
> **HOWEVER** :
> http://www.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



More information about the R-help mailing list