rbchan / unmarked

R package for hierarchical models in ecological research
https://rbchan.github.io/unmarked/
37 stars 25 forks source link

Use trapezoidal rule instead of Rdqags for approximating integrals #135

Closed kenkellner closed 4 years ago

kenkellner commented 5 years ago

Addresses #134 by replacing Rdqags with a built-in trapezoidal rule function. It should be extensible to other integrals we need to approximate in the future. This is currently only used for negative exponential (point) and hazard (point and line) for both distsamp and gdistsamp, the other detection functions already used solved integrals in both the C and R code.

Changing the integral approximation results in some slight differences in parameter estimates for some tests (on order of 1e-4), hence my adjustments to these tests.

No more compiler warnings, at least on my machine!