Re: [R] Understanding and predict round-off errors sign on simple functions

2016-07-01 Thread Sirhc via R-help
2362] Sent: jeudi, 30 juin 2016 14:02 To: Marc Schwartz ; Bert Gunter Cc: R-help Subject: Re: [R] Understanding and predict round-off errors sign on simple functions Using "runmean" function from caTools package within your SMA function appears to solve the issue. Please see details bel

Re: [R] Understanding and predict round-off errors sign on simple functions

2016-06-30 Thread DIGHE, NILESH [AG/2362]
ject.org] On Behalf Of Marc Schwartz Sent: Wednesday, June 29, 2016 1:07 PM To: Bert Gunter Cc: R-help Subject: Re: [R] Understanding and predict round-off errors sign on simple functions Hi, Just to augment Bert's comments, I presume that you are aware of the relevant R FAQ: htt

Re: [R] Understanding and predict round-off errors sign on simple functions

2016-06-29 Thread MacQueen, Don
For all practical purposes, the differences are zero. If you want them to also look like zero, try round( m - mma , 3) or signif( m - mma , 3) (or some number of digits other than three; I picked 3 rather arbitrarily) For anticipating the sign of these minuscule differences, I doubt there

Re: [R] Understanding and predict round-off errors sign on simple functions

2016-06-29 Thread Marc Schwartz
Hi, Just to augment Bert's comments, I presume that you are aware of the relevant R FAQ: https://cran.r-project.org/doc/FAQ/R-FAQ.html#Why-doesn_0027t-R-think-these-numbers-are-equal_003f That you had an expectation of the difference being 0 suggested to me that you might not be, but my apo

Re: [R] Understanding and predict round-off errors sign on simple functions

2016-06-29 Thread Bert Gunter
I am certainly no expert, but I would assume that: 1. Roundoff errors depend on the exact numerical libraries and versions that are used, and so general language comparisons are impossible without that information; 2. Roundoff errors depend on the exact calculations being done and machine precisi