Skip to content

besselJ derivative inaccuracy #65

@kaskr

Description

@kaskr

Thought these were carefully tested in TMB, but just came across this:

library(RTMB)
f <- function(p) besselJ(6, p)
F <- MakeTape(f,1)
f(5)
## [1] 0.3620871
F(5) ## OK
## [1] 0.3620871
numDeriv::grad(f,5)
## [1] -0.08149916
F$jacobian(5) ## Wrong!
##           [,1]
##[1,] -0.6882948

Might be relevant to go back and have a look at https://www.admb-project.org/developers/workshops/seattle-2016/Kristensen_Anders_Report.pdf

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions