[R] Constrained non-linear optimisation
Ravi Varadhan
rvaradhan at jhmi.edu
Wed Aug 25 01:07:08 CEST 2010
David,
I am not sure I completely understand your problem. However, you can take a look at a couple of packages in R that can handle (smooth) nonlinear optimization with general (smooth) constraints:
library(alabama)
?constrOptim.nl
and
library(Rsolnp)
?solnp
Best,
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: Dennis Murphy <djmuser at gmail.com>
Date: Tuesday, August 24, 2010 4:44 pm
Subject: Re: [R] Constrained non-linear optimisation
To: David Beacham <d.beacham07 at imperial.ac.uk>
Cc: r-help at r-project.org
> Hi:
>
> A reasonable place to start would be the Optimization task view at CRAN:
>
>
>
> HTH,
> Dennis
>
> On Tue, Aug 24, 2010 at 10:47 AM, David Beacham
> <d.beacham07 at imperial.ac.uk>wrote:
>
> > I'm relatively new to R, but I'm attempting to do a non-linear maximum
> > likelihood estimation (mle) in R, with the added problem that I
> have a
> > non-linear constraint.
> >
> > The basic problem is linear in the parameters (a_i) and has only one
> > non-linear component, b, with the problem being linear when b = 0 and
> > non-linear otherwise. Furthermore, f(a_i) <= b <= g(a_i) for some
> (simple) f
> > and g.
> >
> > Using optim, I can get the optimisation to work when the
> non-linearity is
> > included but not constrained, but gives poor results (as I'd expect).
> > However, I'm not sure how best to go about the constraint
> condition. My
> > initial attempts revolve around the use of logarithmic barrier
> function, but
> > this only appears to work when using method="CG". When using
> "BFGS", the
> > value of b 'goes out of bounds' and the loglikelihood starts
> throwing NaN,
> > which is particularly bad if I want to box constrain the a_i using
> the
> > "L-BFGS-B" method.
> >
> > Are there any other methods/approaches/variations on the above
> available to
> > me in the form of other packages/R functions etc? Or any good
> > references/books to help me out?
> >
> > Any help would be greatly appreciated,
> > David.
> >
> > ______________________________________________
> > R-help at r-project.org mailing list
> >
> > PLEASE do read the posting guide
> >
> > and provide commented, minimal, self-contained, reproducible code.
> >
>
> [[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.
More information about the R-help
mailing list