Re: [R] Solving Systems of Non-linear equations

2005-12-05 Thread Gabor Grothendieck
Another follow up comment. I tried it in Maxima (also free) and noticed that it has the capability of performing the solution in just a single line using the Maxima solve command so you may prefer that. Note that the first line display2d:false turns off fancy 2d output and you can omit it if you

Re: [R] Solving Systems of Non-linear equations

2005-12-01 Thread NOEL Yvonnick
On 11/30/05, Scott Story [EMAIL PROTECTED] wrote: I am trying to write a function that will solve a simple system of nonlinear equations for the parameters that describe the beta distribution (a,b) given the mean and variance. mean = a/(a+b) variance = (a*b)/(((a+b)2) * (a+b+1)) Any help as

Re: [R] Solving Systems of Non-linear equations

2005-12-01 Thread Martin Maechler
YNoel == NOEL Yvonnick [EMAIL PROTECTED] on Thu, 01 Dec 2005 14:42:44 +0100 writes: YNoel On 11/30/05, Scott Story [EMAIL PROTECTED] wrote: I am trying to write a function that will solve a simple system of nonlinear equations for the parameters that describe the beta

[R] Solving Systems of Non-linear equations

2005-11-30 Thread Scott Story
I am trying to write a function that will solve a simple system of nonlinear equations for the parameters that describe the beta distribution (a,b) given the mean and variance. mean = a/(a+b) variance = (a*b)/(((a+b)^2) * (a+b+1)) Any help as to where to start would be welcome. -- Scott

Re: [R] Solving Systems of Non-linear equations

2005-11-30 Thread Peter Dalgaard
Scott Story [EMAIL PROTECTED] writes: I am trying to write a function that will solve a simple system of nonlinear equations for the parameters that describe the beta distribution (a,b) given the mean and variance. mean = a/(a+b) variance = (a*b)/(((a+b)^2) * (a+b+1)) Any help as to

Re: [R] Solving Systems of Non-linear equations

2005-11-30 Thread Duncan Murdoch
On 11/30/2005 10:14 AM, Scott Story wrote: I am trying to write a function that will solve a simple system of nonlinear equations for the parameters that describe the beta distribution (a,b) given the mean and variance. mean = a/(a+b) variance = (a*b)/(((a+b)^2) * (a+b+1)) Any help

Re: [R] Solving Systems of Non-linear equations

2005-11-30 Thread Gabor Grothendieck
Go to http://mathomatic.orgserve.de/math/ and install mathomatic (its free) or just connect to the online server and do this. The C output, i.e the result of the two code c commands, can be used verbatim in R. Note that mathomatic does not support logs but for simply problems like this its very

Re: [R] Solving Systems of Non-linear equations

2005-11-30 Thread Gabor Grothendieck
Sorry I seemed to have messed up the copying and pasting. Here it is again. --- Go to http://mathomatic.orgserve.de/math/ and install mathomatic (its free) or just connect to the online server and do this. The C output, i.e the result of the two code c commands, can be used verbatim in R. Note

Re: [R] Solving Systems of Non-linear equations

2005-11-30 Thread Gabor Grothendieck
Just one addition to this. I noticed that its not really true that the output can be used in R verbatim since the C output uses pow instead of ^; however, if one replaces the code c statement with the statement list export then it is valid R. That is the input to mathomatic should be: mean =

Re: [R] Solving systems of non-linear equations in R

2005-02-23 Thread T Petersen
Thank you, that was very helpful. My functions are in general monotonic, continous and differentiable(one exception sometimes encountered being y = min(a*x1,b*x2)) and do have a unique solution, if you specify the problem correctly. I have never worked with non-liner solving algoritms in my

Re: [R] Solving systems of non-linear equations in R

2005-02-23 Thread Spencer Graves
Write a driver function to compute the sum of squares of deviations from target. If the nonlinear equations are not pathological and a unique solution exists, optim will find it. If no solution exists, optim will find something close -- in terms of the sum of squared deviations. If the

[R] Solving systems of non-linear equations in R

2005-02-22 Thread T Petersen
I'm about to write my thesis in economics and will need to setup and solve a system of non-linear equations. At our university we usually use GAMS for this, and though GAMS is a fine program, it bugs me a that I won't be able to run my code after I finish my thesis without buying a license for

Re: [R] Solving systems of non-linear equations in R

2005-02-22 Thread yutaka hamaoka
I believe library(systemfit) has nlsytemfit function. Yh T Petersen wrote: I'm about to write my thesis in economics and will need to setup and solve a system of non-linear equations. At our university we usually use GAMS for this, and though GAMS is a fine program, it bugs me a that I won't be

Re: [R] Solving systems of non-linear equations in R

2005-02-22 Thread T Petersen
No, this doesn't seem right. What I look for is something that could solve nonlinear systems with n unknowns and n equations. So there will be zero degrees of freedom, and statistical methods can't be the right way forward. Specifically I can see that the litterature mentions's Scarf's

Re: [R] Solving systems of non-linear equations in R

2005-02-22 Thread Spencer Graves
A system of n equations in n unknowns has a unique solution if the n equations are linear and linearly independent. If the system is nonlinear, then one must characterize the nonlinearity before saying anything about whether a solution exists and if so how many solutions are there?