Bug 15352 - numericDeriv did not duplicate when necessary
numericDeriv did not duplicate when necessary
Status: CLOSED FIXED
Product: R
Classification: Unclassified
Component: Low-level
R 3.0.0
Other Other
: P5 normal
Assigned To: R-core
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-06-25 01:38 UTC by Duncan Murdoch
Modified: 2013-06-30 14:34 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Duncan Murdoch 2013-06-25 01:38:36 UTC
Found by Radford Neal:

numeric_deriv in stats/src/nls.c was not
duplicating when it should, as illustrated below:
      
         > x <- 5; y <- 2; f <- function (y) x
         > numericDeriv(f(y),"y")
          [1] 5
          attr(,"gradient")
               [,1]
          [1,]    0
          > x
          [1] 5
          attr(,"gradient")
               [,1]
          [1,]    0
Comment 1 Duncan Murdoch 2013-06-30 14:34:25 UTC
Fixed in R-devel r63113, soon in R-patched.