[R] Creatiing an R package for solving nonlinear system of equations was: RE: finding roots of multivariate equation

Ravi Varadhan rvaradhan at jhmi.edu
Thu Jun 21 17:14:22 CEST 2007


Hi,

I have written a simple function to solve a system of nonlinear equations. I
have called it nlsolve().  It actually minimizes the squared-norm of the set
of functions by calling optim().  It uses the BFGS algorithm within optim().
Apart from this restriction, the user can pass all the arguments available
in optim().  All the control parameters can be passed as in the call to
optim().  I have attached a text file containing the source for nlsolve()
and also a number of test problems illustrating the use of nlsolve().  Any
feedback and suggestions to improve it are welcome.

Hope this is useful.

Best,
Ravi.

----------------------------------------------------------------------------
-------

Ravi Varadhan, Ph.D.

Assistant Professor, The Center on Aging and Health

Division of Geriatric Medicine and Gerontology 

Johns Hopkins University

Ph: (410) 502-2619

Fax: (410) 614-9625

Email: rvaradhan at jhmi.edu

Webpage:  http://www.jhsph.edu/agingandhealth/People/Faculty/Varadhan.html



----------------------------------------------------------------------------
--------

-----Original Message-----
From: r-help-bounces at stat.math.ethz.ch
[mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of Ravi Varadhan
Sent: Wednesday, June 20, 2007 5:23 PM
To: r-help at stat.math.ethz.ch
Subject: [R] Creatiing an R package for solving nonlinear system of
equations was: RE: finding roots of multivariate equation

Hi All,

Replying to this and numerous other requests in the past has made me realize
that a nonlinear solver is very much needed for R users.  I have
successfully used a nonlinear solver based on the spectral gradient method,
in FORTRAN.  I can readily translate that to R and make it available as an R
function, but what I would really like to do is to make that into a package.
I can provide the R function and several test examples.  But I am not good
at creating a good/reliable package.  So, it would be ideal if one of the R
gurus is interested in collaborating with me on this project.  Any one
interested?

Ravi.
----------------------------------------------------------------------------
-------

Ravi Varadhan, Ph.D.

Assistant Professor, The Center on Aging and Health

Division of Geriatric Medicine and Gerontology 

Johns Hopkins University

Ph: (410) 502-2619

Fax: (410) 614-9625

Email: rvaradhan at jhmi.edu

Webpage:  http://www.jhsph.edu/agingandhealth/People/Faculty/Varadhan.html



----------------------------------------------------------------------------
--------

-----Original Message-----
From: r-help-bounces at stat.math.ethz.ch
[mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of Bill Shipley
Sent: Wednesday, June 20, 2007 1:37 PM
To: r-help at stat.math.ethz.ch
Subject: [R] finding roots of multivariate equation

Hello,
I want to find the roots of an equation in two variables.  I am aware of the
uniroot function, which can do this for a function with a single variable
(as I
understand it...) but cannot find a function that does this for an equation
with more than one variable.  I am looking for something implementing
similar
to a Newton-Raphson algorithm.
Thanks.

-- 
Bill Shipley
North American Editor for Annals of Botany
Subject Editor for Ecology
Département de biologie
Université de Sherbrooke
Sherbrooke (Québec) J1K 2R9
Canada

______________________________________________
R-help at stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

______________________________________________
R-help at stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


More information about the R-help mailing list