[R] Improved Nelder-Mead algorithm and Matlab's fminsearch. Was: Hi
Ravi Varadhan
rvaradhan at jhmi.edu
Fri Mar 5 16:21:38 CET 2010
The `fminsearch' in Matlab uses a version of the Nelder-Mead simplex search algorithm, which is a derivative-free search technique. The Nelder-Mead is also the default algorithm in optim(). Therefore, you can simply call optim() to get your job done. However, I would like to mentiion that the Nelder-Mead implementation in optim() is not the best, and I have had others (who use Matlab) tell me that `fminsearch' generally performs better than optim's Nelder-Mead. I have written an improved version of Nelder-Mead that performs better than optim's Nelder-Mead. Iwill soon release it as a package (I have been saying this for several months now!), but I can send it to you if you are interested.
Hope this helps,
Ravi.
____________________________________________________________________
Ravi Varadhan, Ph.D.
Assistant Professor,
Division of Geriatric Medicine and Gerontology
School of Medicine
Johns Hopkins University
Ph. (410) 502-2619
email: rvaradhan at jhmi.edu
----- Original Message -----
From: stephen sefick <ssefick at gmail.com>
Date: Thursday, March 4, 2010 4:02 pm
Subject: Re: [R] Hi
To: hussain abu-saaq <hussainib1 at hotmail.com>
Cc: r-help at r-project.org
> I would help, but I don't know matlab.
>
> Stephen
>
> On Thu, Mar 4, 2010 at 2:50 PM, hussain abu-saaq
> <hussainib1 at hotmail.com> wrote:
> >
> > How Can I write this this matlab code in R:
> >
> >
> > options=optimset('TolFun',1e-9,'TolX',1e-9,'MaxIter',1e8,'MaxFunEvals',1e8);
> > c=c/2;
> > [alpha, delta, epsilon, nofcup] = ustrs(set_date,mat_date);
> > y = fminsearch('pbond',.15,options,p,c,nofcup,delta/epsilon);
> > y = 200*y;
> >
> >
> >
> > Note
> > pbond is a function in Matlab I already wrote in R
> >
> >
> > ustrs is a function in Matlab I already convert into r
> >
> >
> > Thank you
> >
> > HI
> >
> >
> > [[alternative HTML version deleted]]
> >
> > ______________________________________________
> > R-help at r-project.org mailing list
> >
> > PLEASE do read the posting guide
> > and provide commented, minimal, self-contained, reproducible code.
> >
>
>
>
> --
> Stephen Sefick
>
> Let's not spend our time and resources thinking about things that are
> so little or so large that all they really do for us is puff us up and
> make us feel like gods. We are mammals, and have not exhausted the
> annoying little problems of being mammals.
>
> -K. Mullis
>
> ______________________________________________
> R-help at r-project.org mailing list
>
> PLEASE do read the posting guide
> and provide commented, minimal, self-contained, reproducible code.
More information about the R-help
mailing list