Re: [R] Finding solution for non-linear equations

2013-10-16 Thread peter dalgaard
On Oct 15, 2013, at 17:18 , Berend Hasselman wrote: > > On 15-10-2013, at 15:24, Ron Michael wrote: > >> Hi, >> >> I need to solve following simultaneous equations for A, B, Y1, Y2: >> >> B * Phi(Y1 - A) + (1-B) * Phi(Y1 + A) = 0.05 >> B * Phi(Y2 - A) + (1-B) * Phi(Y2 + A) = 0.01 >> >> Y1 <

Re: [R] Finding solution for non-linear equations

2013-10-15 Thread Berend Hasselman
On 15-10-2013, at 15:24, Ron Michael wrote: > Hi, > > I need to solve following simultaneous equations for A, B, Y1, Y2: > > B * Phi(Y1 - A) + (1-B) * Phi(Y1 + A) = 0.05 > B * Phi(Y2 - A) + (1-B) * Phi(Y2 + A) = 0.01 > > Y1 <= -1.65 > Y2 >= -2.33 > > 0 <= B <=1 > > Phi is CDF for standard

Re: [R] Finding solution for non-linear equations

2013-10-15 Thread Bert Gunter
Homework? We don't do homework here. Otherwise, the answer is yes, R can be used to do this. Cheers, Bert On Tue, Oct 15, 2013 at 6:24 AM, Ron Michael wrote: > Hi, > > I need to solve following simultaneous equations for A, B, Y1, Y2: > > B * Phi(Y1 - A) + (1-B) * Phi(Y1 + A) = 0.05 > B * Phi(

[R] Finding solution for non-linear equations

2013-10-15 Thread Ron Michael
Hi, I need to solve following simultaneous equations for A, B, Y1, Y2: B * Phi(Y1 - A) + (1-B) * Phi(Y1 + A) = 0.05 B * Phi(Y2 - A) + (1-B) * Phi(Y2 + A) = 0.01 Y1 <= -1.65 Y2 >= -2.33 0 <= B <=1 Phi is CDF for standard normal If there is no unique solution, then I should be able to get some

Re: [R] Finding solution

2011-10-10 Thread Berend Hasselman
Bogaso wrote: > > Dear all, I have a system of simultaneous equations with 2 unknowns as > follows: > > x*y + (1-x) = 0.05 > > x*(y - .5)^2 + (1-x)*0.6 = 0.56^2 > > Ofcourse I can do it manually however wondering whether there is any > direct > way in R available to get the solution of this sy

Re: [R] Finding solution

2011-10-09 Thread Bert Gunter
R is not the right tool for all things. This looks like a job for a computer algebra system. That said, R **does** have at least one interface to such a system. See the Ryacas package (check my capitalization, which may be wrong). HelpeRs may provide you with others. -- Bert On Sun, Oct 9, 2011

Re: [R] Finding solution

2011-10-09 Thread peter dalgaard
On Oct 9, 2011, at 14:02 , Bogaso Christofer wrote: > Dear all, I have a system of simultaneous equations with 2 unknowns as > follows: > > > > x*y + (1-x) = 0.05 > > x*(y - .5)^2 + (1-x)*0.6 = 0.56^2 > > > > Ofcourse I can do it manually however wondering whether there is any direct > way

[R] Finding solution

2011-10-09 Thread Bogaso Christofer
Dear all, I have a system of simultaneous equations with 2 unknowns as follows: x*y + (1-x) = 0.05 x*(y - .5)^2 + (1-x)*0.6 = 0.56^2 Ofcourse I can do it manually however wondering whether there is any direct way in R available to get the solution of this system? Thanks and regards,

Re: [R] Finding solution set of system of linear equations.

2011-05-22 Thread dslowik
Thanks Robert. That all seems to work. I also found the MASS::Null() function that gives the null space for the matrix(transpose) given as argument. I am still trying to appreciate the math behind the Moore-Penrose inverse matrix. If you have any suggestions for understanding how to use R to solve

Re: [R] Finding solution set of system of linear equations.

2011-05-21 Thread Robert A LaBudde
solve() only works for nonsingular systems of equations. Use a generalized inverse for singular systems: > A<- matrix(c(1,2,1,1, 3,0,0,4, 1,-4,-2,-2, 0,0,0,0), ncol=4, byrow=TRUE) > A [,1] [,2] [,3] [,4] [1,]1211 [2,]3004 [3,]1 -4 -2 -2 [4,]0

[R] Finding solution set of system of linear equations.

2011-05-21 Thread dslowik
I have a simple system of linear equations to solve for X, aX=b: > a [,1] [,2] [,3] [,4] [1,]1211 [2,]3004 [3,]1 -4 -2 -2 [4,]0000 > b [,1] [1,]0 [2,]2 [3,]2 [4,]0 (This is ex Ch1, 2.2 of Artin, Algebra). So, 3 eqs