Re: [R] Non-linear system of equations

2008-04-27 Thread Radka Pancheva
Hello, Thank you all for your answers. I'll try them all and I'm sure it will work. > >Try this: > >> library(Ryacas) >> x <- Sym("x") >> y <- Sym("y") >> Solve(List(x^2+y^2==6, x-y==3), List(x,y)) >expression(list(list(x == root(6 - y^2, 2), y == y))) > > >2008/4/25 Radka Pancheva <[

Re: [R] Non-linear system of equations

2008-04-25 Thread Gabor Grothendieck
Try this: > library(Ryacas) > x <- Sym("x") > y <- Sym("y") > Solve(List(x^2+y^2==6, x-y==3), List(x,y)) expression(list(list(x == root(6 - y^2, 2), y == y))) 2008/4/25 Radka Pancheva <[EMAIL PROTECTED]>: > Hello R users, > > I am trying to estimate the parameters of a bimodal normal distributio

Re: [R] Non-linear system of equations

2008-04-25 Thread Ravi Varadhan
Friday, April 25, 2008 8:13 AM To: R-help@r-project.org Subject: Re: [R] Non-linear system of equations Hello Paul, Thank you for your quick answer. I have tried to use your advice and to estimate the parameters of beta distribution with moments matching. This is my code: ex <- 0.3914877 ex2

Re: [R] Non-linear system of equations

2008-04-25 Thread Ravi Varadhan
iginal Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Radka Pancheva Sent: Friday, April 25, 2008 8:13 AM To: R-help@r-project.org Subject: Re: [R] Non-linear system of equations Hello Paul, Thank you for your quick answer. I have tried to use your advice and to estima

Re: [R] Non-linear system of equations

2008-04-25 Thread Paul Smith
Clearly, a family of solutions is (p,q) = (0,k), with k != 0. Paul On Fri, Apr 25, 2008 at 1:58 PM, Paul Smith <[EMAIL PROTECTED]> wrote: > Try to change the initial values of the parameters with, for instance, > > p0 <- rnorm(2) > > But you sure that your system has a solution, Evgeniq? > >

Re: [R] Non-linear system of equations

2008-04-25 Thread Paul Smith
Try to change the initial values of the parameters with, for instance, p0 <- rnorm(2) But you sure that your system has a solution, Evgeniq? Paul 2008/4/25 Radka Pancheva <[EMAIL PROTECTED]>: > Hello Paul, > > Thank you for your quick answer. I have tried to use your advice and to > estimate

Re: [R] Non-linear system of equations

2008-04-25 Thread Berend Hasselman
> x^2 - y^2 = 6 > x – y = 3 > > You can also try this # function f <- function(x) { y <- numeric(2) y[1] <- x[1]^2-x[2]^2-6 y[2] <- x[1]-x[2]-3 y } # function values transformed to scalar # minimising fnorm this way is not the best method of finding a solution for

Re: [R] Non-linear system of equations

2008-04-25 Thread Radka Pancheva
Hello Paul, Thank you for your quick answer. I have tried to use your advice and to estimate the parameters of beta distribution with moments matching. This is my code: ex <- 0.3914877 ex2 <- 0.2671597 my.mm <- function(x){ p <- x[1] q <- x[2] p <- .Machine$double.eps

Re: [R] Non-linear system of equations

2008-04-25 Thread Paul Smith
2008/4/25 Radka Pancheva <[EMAIL PROTECTED]>: > I am trying to estimate the parameters of a bimodal normal distribution > using moments matching, so I have to solve a non-linear system of equations. > How can I solve the following simple example? > > x^2 - y^2 = 6 > x – y = 3 > > I heard abou