Dear list
I think there might be an inconsistency in the function "do_optimhess"
in src/main/optim.c.
Consider changing the line
"eps = OS->ndeps[i]/(OS->parscale[i]);"
to
"eps = OS->ndeps[i];"
Then "ndeps" is the finite-difference step on "par/parscale" as it
should be according to the documentation.
Motivation:
## EXAMPLE
f <- function(x){sum(exp(.5*(a*x)^2))}
a <- c(1e-3,1e3)
## On "par/parscale"-domain we want g(y)=sum(exp(.5*y^2))
parscale <- 1/a
## Optimization works only when using a good parscale:
xstart <- 1/a
optim(xstart,f,hessian=FALSE,method="CG")$par