[R] solving system of equations involving non-linearities
Ravi Varadhan
RVaradhan at jhmi.edu
Fri Aug 7 15:14:40 CEST 2009
If you suspect multiple roots, you can try `multiStart' in "BB", which runs
`BBsolve' from multiple starting values (which you have to specify).
If you want to convert it to an optimization problem, you can form the sum
of squared residuals of the equations and then use `BBoptim'. However, I
would not advise that approach when you have a "square" system (i.e. the
number of equations is the same as the number of unknowns). The optimization
approach is useful (and necessary) for over-determined systems.
Best,
Ravi.
-----Original Message-----
From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] On
Behalf Of Werner W.
Sent: Friday, August 07, 2009 2:43 AM
To: r-help at r-project.org
Subject: Re: [R] solving system of equations involving non-linearities
Many thanks, BBsolve works like a charm.
First I thought I should use the squares of the equations because BBsolve
would use some minimization objective function anyway but it actually only
works if I don't use the squared equations. I'll check the documentation if
I find something about the objective.
Thanks for the help,
Werner
Ravi Varadhan wrote:
>
> You have two options:
>
> 1. The `BBsolve' function in the "BB" package to solve this system of 3
> equations.
> 2. Try `nleqslv' function in the "nleqslv" package.
>
> These would work even if the residual is not zero.
>
> Hope this helps,
> Ravi.
>
--
View this message in context:
http://www.nabble.com/solving-system-of-equations-involving-non-linearities-
tp24845136p24859703.html
Sent from the R help mailing list archive at Nabble.com.
______________________________________________
R-help at r-project.org 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