dqstep
determines the smallest steps ds from s so that
abs(f(s+ds)-f(s)) equals a pre-specified sensitivity
dqstep(x, f, sens)
a list with components 'label' (of mode character), 'est' (the parameter vector with the initial guess), 'low' (vector with lower bounds), and 'upp' (vector with upper bounds)
the function that is to be minimized over the parameter vector
defined by the list x
target sensitivity (i.e. the value of f(s+ds)-f(s))
returns a vector with the desired step sizes
uses simple quadratic interpolation
# NOT RUN {
## Rosenbrock Banana function
fr <- function(x) {
x1 <- x[1]
x2 <- x[2]
100 * (x2 - x1 * x1)^2 + (1 - x1)^2
}
## define
x <- list(label=c("a","b"),est=c(1,1),low=c(0,0),upp=c(100,100))
dqstep(x,fr,sens=1)
# }
Run the code above in your browser using DataLab