Dear All,
Hans Borchers and I have been trying to compute exact derivatives in R using
the idea of complex-step derivatives that Hans has proposed. This is a really,
really cool idea. It gives exact derivatives with only a minimal effort
(same as that involved in computing first-order
Full_Name: jan hattendorf
Version: 2.9.0
OS: XP
Submission from: (NULL) (213.3.108.185)
I get an incorrect result for
(41/10-1/10)%%1
[1] 1
The error did not occur with other numbers than 41 (1, 11, 21, 31, 51, ...)
test - rep(NA, 1000)
for(i in 1:1000){
test[i] - i/10-1/10
}
jan.hattend...@unibas.ch wrote:
Full_Name: jan hattendorf
Version: 2.9.0
OS: XP
Submission from: (NULL) (213.3.108.185)
I get an incorrect result for
(41/10-1/10)%%1
[1] 1
The error did not occur with other numbers than 41 (1, 11, 21, 31, 51, ...)
test - rep(NA, 1000)
for(i
Not a bug, just a FAQ (7.31).
http://CRAN.R-project.org/doc/FAQ/R-FAQ.html#Why-doesn_0027t-R-think-these-numbers-are-equal_003f
On Sat, 1 Aug 2009, jan.hattend...@unibas.ch wrote:
Full_Name: jan hattendorf
Version: 2.9.0
OS: XP
Submission from: (NULL) (213.3.108.185)
I get an incorrect
This is not a bug. It is a case of R FAQ 7.34:
http://cran.r-project.org/doc/FAQ/R-FAQ.html#Why-doesn_0027t-R-think-the
se-numbers-are-equal_003f
ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek / Research
Good morning Jan,
Could this be covered off by the following?
http://cran.r-project.org/doc/FAQ/R-FAQ.html#Why-doesn_0027t-R-think-these-numbers-are-equal_003f
Kind regards,
Sean
On Sat, Aug 1, 2009 at 9:05 PM, jan.hattend...@unibas.ch wrote:
Full_Name: jan hattendorf
Version: 2.9.0
OS: XP
Dear Ravi,
the inaccuracy seems to creep in when powers are calculated. Apparently,
some quite general function is called to calculate the squares, and one
can avoid the error by reformulating the example as follows:
rosen - function(x) {
n - length(x)
x1 - x[2:n]
x2 - x[1:(n-1)]
I get an incorrect result for
(41/10-1/10)%%1
[1] 1
Note that due to rounding errors, 41/10-1/10 is
formatC(41/10-1/10, digits=20) # [1] 3.9995559
Besides FAQ 7.31, related information may be found also at
http://wiki.r-project.org/rwiki/doku.php?id=misc:r_accuracy
Petr.
Hi
tmp - function(t=1) t+1
mtrace(tmp)
mtrace(tmp)
#Re-applying trace...
#Error in `[[-`(`*tmp*`, 1, value = list(t + 1)) :
# incompatible types (from list to expression) in [[ assignment
I think this used to work on my computer.
A month ago I upgraded R from r-base (2.9.0-4intrepid0) to
Thanks for pointing out the weak point in this computation. I tried out your
suggestions and they both deliver the correct and accurate result.
But as a general solution this approach is not feasible. We want to provide
complex-step derivatives as a new method for computing exact gradients, for
HWB == Hans W Borchers hwborch...@googlemail.com
on Mon, 3 Aug 2009 13:15:11 + (UTC) writes:
HWB Thanks for pointing out the weak point in this
HWB computation. I tried out your suggestions and they both
HWB deliver the correct and accurate result.
HWB But as a
11 matches
Mail list logo