Re: [R] Non-linear system of equations

From: Radka Pancheva <radica_at_abv.bg>
Date: Sun, 27 Apr 2008 10:10:22 +0300 (EEST)


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 <radica_at_abv.bg>:
>> Hello R users,
>>
>> 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 about nlsystemfit, but I don't know how to run it exactly. I have tried the following code, but it doesn't really work:
>>
>>
>> f1 <-y~ x[1]^2-x[2]^2-6
>> f2 <-z~ x[1]-x[2]-3
>> f <- list(f1=0,f2=0)
>> nlsystemfit("OLS",f,startvals=c(0,0))
>>
>> Thank You in advance for your help.
>>
>>
>> ______________________________________________
>> 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.
>>
>



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. Received on Sun 27 Apr 2008 - 07:13:28 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Sun 27 Apr 2008 - 10:30:34 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive