Re: [R] Non-Linear Optimization - Query

2009-03-18 Thread Paul Smith
On Wed, Mar 18, 2009 at 7:43 PM, Berend Hasselman wrote: >>> system.time(ans.nl <- nleqslv(x=p0, fn=broydt))[1] >> >> user.self >>    8.17 > > On my Imac 2.16Ghz and R 2.8.1 and Mac OS X 10.5.6 > this took approximately 5 seconds. > > Interesting is this experiment. > I set the jacobian for a star

Re: [R] Non-Linear Optimization - Query

2009-03-18 Thread Berend Hasselman
On 18-03-2009, at 18:36, Ravi Varadhan wrote: system.time(ans.nl <- nleqslv(x=p0, fn=broydt))[1] user.self 8.17 On my Imac 2.16Ghz and R 2.8.1 and Mac OS X 10.5.6 this took approximately 5 seconds. Interesting is this experiment. I set the jacobian for a starting point with all x-values

Re: [R] Non-Linear Optimization - Query

2009-03-18 Thread Ravi Varadhan
-Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Paul Smith Sent: Wednesday, March 18, 2009 10:19 AM To: r-help@r-project.org Subject: Re: [R] Non-Linear Optimization - Query On Tue, Mar 17, 2009 at 7:55 PM, Berend Hasselman wrote: > You ca

Re: [R] Non-Linear Optimization - Query

2009-03-18 Thread Berend Hasselman
Paul Smith wrote: > > On Tue, Mar 17, 2009 at 7:55 PM, Berend Hasselman wrote: >> You can also try my package "nleqslv" for solving systems of non linear >> equations (using Broyden or Newton with a selection of global >> strategies). >> >> library(nleqslv) >> >> xinit <- rep(1,3)            

Re: [R] Non-Linear Optimization - Query

2009-03-18 Thread Paul Smith
On Tue, Mar 17, 2009 at 7:55 PM, Berend Hasselman wrote: > You can also try my package "nleqslv" for solving systems of non linear > equations (using Broyden or Newton with a selection of global strategies). > > library(nleqslv) > > xinit <- rep(1,3)               # or rep(0,3) for a singular star

Re: [R] Non-Linear Optimization - Query

2009-03-17 Thread Berend Hasselman
Ravi Varadhan wrote: > > > require(BB) > > f2 <- function(x) { > f <- rep(NA, length(x)) > f[1] <- 1 + 2 * x[1] * x[3] # x[3] is the Lagrangian multiplier > f[2] <- 1 + 2 * x[2] * x[3] > f[3] <- x[1]^2 + x[2]^2 - 1 # the equality constraint > f > } > > You can also try my packag

Re: [R] Non-Linear Optimization - Query

2009-03-17 Thread Paul Smith
On Tue, Mar 17, 2009 at 7:10 PM, Ravi Varadhan wrote: > Here is how you can implement the Lagrangian multiplier approach and solve > the first-order KKT conditions to obtain the solution for Paul Smith's > example: > >        require(BB) > > f2 <- function(x) { > f <- rep(NA, length(x)) > f[1] <-

Re: [R] Non-Linear Optimization - Query

2009-03-17 Thread Ravi Varadhan
-Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Paul Smith Sent: Tuesday, March 17, 2009 2:34 PM To: r-help@r-project.org Subject: Re: [R] Non-Linear Optimization - Query Hi Lars, Consider the following problem: max x + y s

Re: [R] Non-Linear Optimization - Query

2009-03-17 Thread Ravi Varadhan
uesday, March 17, 2009 2:34 PM To: r-help@r-project.org Subject: Re: [R] Non-Linear Optimization - Query Hi Lars, Consider the following problem: max x + y subject to x^2 + y^2 =1. The solution is obviously (x,y) = (sqrt(2) / 2, sqrt(2) / 2). Now, consider the unconstrained maximization problem o

Re: [R] Non-Linear Optimization - Query

2009-03-17 Thread Paul Smith
Hi Lars, Consider the following problem: max x + y subject to x^2 + y^2 =1. The solution is obviously (x,y) = (sqrt(2) / 2, sqrt(2) / 2). Now, consider the unconstrained maximization problem on the variables x, y and lambda: max x + y + lambda * (x^2 + y^2 - 1) (Notice that the objective fu

Re: [R] Non-Linear Optimization - Query

2009-03-17 Thread Ravi Varadhan
onday, March 16, 2009 9:57 pm Subject: Re: [R] Non-Linear Optimization - Query To: r-help@r-project.org > On Tue, Mar 17, 2009 at 12:09 AM, Lars Bishop wrote: > > I couple of weeks ago, I’ve asked for a package recommendation for > nonlinear > > optimization. In my problem I hav

Re: [R] Non-Linear Optimization - Query

2009-03-16 Thread Paul Smith
On Tue, Mar 17, 2009 at 12:09 AM, Lars Bishop wrote: > I couple of weeks ago, I’ve asked for a package recommendation for nonlinear > optimization. In my problem I have a fairly complicated non-linear objective > function subject to one non-linear equality constrain. > > I’ve been suggested to use

[R] Non-Linear Optimization - Query

2009-03-16 Thread Lars Bishop
Dear All, I couple of weeks ago, I’ve asked for a package recommendation for nonlinear optimization. In my problem I have a fairly complicated non-linear objective function subject to one non-linear equality constrain. I’ve been suggested to use the *Rdonlp2* package, but I did not get any re