Re: [R] strange differences in vector operation versus manual calculation

2012-05-02 Thread Rui Barradas
Hello, > > I must be missing something very obvious, but I just cannot see it. > The hardest to find errors. Wrong manual calculation in t1, powers have precedence right to left and before additions. t1b <- 10^(params[1]-xx)^params[2] t3b <- 1 + t1b t4b <- t2/t3b t5b <- params[4] + t4b all.equal

Re: [R] strange differences in vector operation versus manual calculation

2012-05-02 Thread Petr Savicky
On Wed, May 02, 2012 at 11:42:27AM -0400, Rajarshi Guha wrote: > Hi, I'm running a calculation in two ways. The first way is to employ > vectors and evaluate a function in one go. The second way is to break > down the function into pieces and combine the pieces to the final > answer. > > Algebraic

Re: [R] strange differences in vector operation versus manual calculation

2012-05-02 Thread William Dunlap
help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On > Behalf > Of Rajarshi Guha > Sent: Wednesday, May 02, 2012 8:42 AM > To: R > Subject: [R] strange differences in vector operation versus manual calculation > > Hi, I'm running a calculation in two ways.

[R] strange differences in vector operation versus manual calculation

2012-05-02 Thread Rajarshi Guha
Hi, I'm running a calculation in two ways. The first way is to employ vectors and evaluate a function in one go. The second way is to break down the function into pieces and combine the pieces to the final answer. Algebraically, they should give me the same result. But the final vector differs sig