Displaying 2 results from an estimated 2 matches for "ans_del".
Did you mean:
andel
2020 Jun 16
1
[External] numericDeriv alters result of eval in R 4.0.1
...ar as I could trace, looking at the function C function numeric_deriv,
this unwanted behavior comes from the inner most loop in, at the very end
of the function,
for(i = 0, start = 0; i < LENGTH(theta); i++) {
for(j = 0; j < LENGTH(VECTOR_ELT(pars, i)); j++, start += LENGTH(ans)) {
SEXP ans_del;
double origPar, xx, delta;
origPar = REAL(VECTOR_ELT(pars, i))[j];
xx = fabs(origPar);
delta = (xx == 0) ? eps : xx*eps;
REAL(VECTOR_ELT(pars, i))[j] += rDir[i] * delta;
PROTECT(ans_del = eval(expr, rho));
if(!isReal(ans_del)) ans_del = coerceVector(ans_del, REALSXP);...
2020 Jun 15
2
numericDeriv alters result of eval in R 4.0.1
Dear R developers,
I've run into a weird behavior of the numericDeriv function (from the stats
package) which I also posted on StackOverflow (question has same title as
this email, except for the version of R).
Running the code bellow we can see that the numericDeriv function gives an
error as the derivative of x^a wrt a is x^a * log(x) and log is not defined
for negative numbers. However,