Ravi Varadhan wrote:
require(BB)
fn - function(x, s){
f - rep(NA, length(x))
f[1] - digamma(x[1]) - digamma(x[1]+x[2]) - s[1]
f[2] - digamma(x[2]) - digamma(x[1]+x[2]) - s[2]
f
}
nr - 10
smat - matrix(runif(2*nr, -3, -1), nr, 2)
soln - matrix(NA, nr, 2)
for (i in
-help@r-project.org
Sent: Thursday, March 11, 2010 8:02:43 PM GMT -06:00 US/Canada Central
Subject: Re: [R] help about solving two equations
You have to install it from CRAN before you can load it into your session.
Ravi Varadhan
Shaoqiong Zhao wrote:
I am not sure if this is correct and also this can only solve one row. How
to get the whole 1000 rows of p and q?
You can try something like this:
library(nleqslv)
library(BB)
fn - function(x, s){
f - rep(NA, length(x))
f[1] - digamma(x[1]) -
email: rvarad...@jhmi.edu
- Original Message -
From: Shaoqiong Zhao zh...@uwm.edu
Date: Thursday, March 11, 2010 9:00 pm
Subject: Re: [R] help about solving two equations
To: Ravi Varadhan rvarad...@jhmi.edu
Cc: r-help@r-project.org
Hello Professor Ravi,
I tried to load BB into R
: Ravi Varadhan rvarad...@jhmi.edu
To: Shaoqiong Zhao zh...@uwm.edu
Cc: r-help@r-project.org
Sent: Wednesday, March 10, 2010 9:03:25 PM GMT -06:00 US/Canada Central
Subject: Re: [R] help about solving two equations
Here is how you can solve:
fn - function(x, s){
f - rep(NA, length(x))
f[1
I have two matrix s1 and s2, each of them is 1000*1.
and I have two equations:
digamma(p)-digamma(p+q)=s1,
digamma(q)-digamma(p+q)=s2,
and I want to sovle these two equations to get the value of x and y, which are
also two 1000*1 matrices.
I write a program like this:
f - function(x) {
p- x[1];
and Gerontology
School of Medicine
Johns Hopkins University
Ph. (410) 502-2619
email: rvarad...@jhmi.edu
- Original Message -
From: Shaoqiong Zhao zh...@uwm.edu
Date: Wednesday, March 10, 2010 8:19 pm
Subject: [R] help about solving two equations
To: r-help@r-project.org
I have two matrix s1
Shaoqiong Zhao wrote:
I have two matrix s1 and s2, each of them is 1000*1.
and I have two equations:
digamma(p)-digamma(p+q)=s1,
digamma(q)-digamma(p+q)=s2,
and I want to sovle these two equations to get the value of x and y, which
are also two 1000*1 matrices.
Besides BB there is
dahuang wrote:
i wanna get x from the equations: Ax=x, given A is a matrix. How can i
apply it in R? thanks
?solve
--
View this message in context:
http://www.nabble.com/help-about-solving-the-equations-tp25738073p25738401.html
Sent from the R help mailing list archive at Nabble.com.
i wanna get x from the equations: Ax=x, given A is a matrix. How can i apply
it in R? thanks
--
View this message in context:
http://www.nabble.com/help-about-solving-the-equations-tp25738073p25738073.html
Sent from the R help mailing list archive at Nabble.com.
x is the eigenvector corresponding to eigenvalue 1. See ?eigen.
On Sun, Oct 4, 2009 at 9:31 AM, dahuang tsyell...@hotmail.com wrote:
i wanna get x from the equations: Ax=x, given A is a matrix. How can i apply
it in R? thanks
--
View this message in context:
Gabor Grothendieck wrote:
x is the eigenvector corresponding to eigenvalue 1. See ?eigen.
Correct.
I should have looked better.
Berend
--
View this message in context:
http://www.nabble.com/help-about-solving-the-equations-tp25738073p25740459.html
Sent from the R help mailing list
12 matches
Mail list logo