Re: [R] solving equation consisting of factorials

2010-10-30 Thread David Winsemius
On Oct 30, 2010, at 9:55 AM, Shant Ch wrote: Hi, I was trying to solve for m such that, choose(n-1,k-1)+choose(n-2,k-1)+...+choose(n-m+1,k-1) - ck=0 ck is calculated by the way given in the code. Now I solved for m using uniroot but the error messages appeared. n<-30 k=3 alpha<-0.05 n

[R] solving equation consisting of factorials

2010-10-30 Thread Shant Ch
Hi, I was trying to solve for m such that, choose(n-1,k-1)+choose(n-2,k-1)+...+choose(n-m+1,k-1) - ck=0 ck is calculated by the way given in the code. Now I solved for m using uniroot but the error messages appeared. n<-30 k=3 alpha<-0.05 nk<-choose(n,k); ck<-(nk/2)+k*nk*qnorm(1-alpha)/(1

Re: [R] Solving equation

2010-05-01 Thread Peter Ehlers
On 2010-05-01 7:13, Berend Hasselman wrote: David Winsemius wrote: On May 1, 2010, at 3:28 AM, Berend Hasselman wrote: Shant Ch wrote: I want to solve: x*(3^x)*log(4)-x*log(4/3)-(3^x)+1=0 for x. I used the following code, uniroot(function(x) x*(3^x)*log(4)-x*log(4/3)-(3^x)+1, lower =

Re: [R] Solving equation

2010-05-01 Thread Berend Hasselman
David Winsemius wrote: > > > On May 1, 2010, at 3:28 AM, Berend Hasselman wrote: > >> >> >> Shant Ch wrote: >>> >>> I want to solve: x*(3^x)*log(4)-x*log(4/3)-(3^x)+1=0 for x. I used >>> the >>> following code, >>> >>> uniroot(function(x) x*(3^x)*log(4)-x*log(4/3)-(3^x)+1, lower = -2, >>>

Re: [R] Solving equation

2010-05-01 Thread David Winsemius
On May 1, 2010, at 3:28 AM, Berend Hasselman wrote: Shant Ch wrote: I want to solve: x*(3^x)*log(4)-x*log(4/3)-(3^x)+1=0 for x. I used the following code, uniroot(function(x) x*(3^x)*log(4)-x*log(4/3)-(3^x)+1, lower = -2, upper = 2, tol = 0.001 ) While using this I am getting the fo

Re: [R] Solving equation

2010-05-01 Thread Berend Hasselman
Shant Ch wrote: > > I want to solve: x*(3^x)*log(4)-x*log(4/3)-(3^x)+1=0 for x. I used the > following code, > > uniroot(function(x) x*(3^x)*log(4)-x*log(4/3)-(3^x)+1, lower = -2, upper = > 2, tol = 0.001 ) > > While using this I am getting the following error. Can anyone please help > me out.

[R] Solving equation

2010-04-30 Thread Shant Ch
Hello, I want to solve: x*(3^x)*log(4)-x*log(4/3)-(3^x)+1=0 for x. I used the following code, uniroot(function(x) x*(3^x)*log(4)-x*log(4/3)-(3^x)+1, lower = -2, upper = 2, tol = 0.001 ) While using this I am getting the following error. Can anyone please help me out. Error in uniroot(function