Skip to content

solving simultaneous Equations in R

5 messages · Eliza Botto, Berend Hasselman

#
On 11-12-2013, at 12:16, eliza botto <eliza_botto at hotmail.com> wrote:

            
There are several packages that solve a system of equations.
ktsolve, nleqslv, BB, which you can find in CRAN Task views: "Numerical Mathematics? and ?Optimization?.

You will have to write your equations in standard R notation.
I can?t tell if your system is solvable.

Berend
#
On 11-12-2013, at 23:56, eliza botto <eliza_botto at hotmail.com> wrote:

            
I don?t quite understand what you you mean.
Your starting values obey the restrictions you specify (if that is what you meant).
The solution vector has all elements > 1. But it is a solution.

Do you mean that you want a solution satisfying the constraints you mention?
I cannot tell if that is possible.

Generally speaking a square system of equations is solved or not.

Sometimes you can vary the starting values to get a different solution that obeys the specified constraints.
If these constraints  are necessary you are not solving a system of equations but trying to find a  parameter set that satisfies certain criteria. Together with a criterion (sum of squares of function values for example) you could use an optimizing algorithm (optim, nlmin, constrOptim to name a few).

Berend