Unconstrained and box-constrained optimization using PORT routines.
opt_nlminb_julia( par0, fitMeth = "doubleLog_Beck", y, t, w = NULL, ylu = NULL, lower = NULL, upper = NULL, ... )
par0 | Initial values for the parameters to be optimized over. |
---|---|
fitMeth | Curve fitting methods, one of |
y | Numeric vector, vegetation index time-series |
t | Numeric vector, |
w | (optional) Numeric vector, weights of |
ylu |
|
lower | vectors of lower and upper bounds, replicated to be as long as
|
upper | vectors of lower and upper bounds, replicated to be as long as
|
... | ignored parameters |
A list object of
par
: The optimal parameters
convergence
:
0: convergent;
1: Non-convergent
iterations
evaluations: list(function, gradient)
objective
if (FALSE) { t = seq(1.0, 366, 8) fun = doubleLog_Beck par = c(0.1 , 0.7, 50, 0.1, 250, 0.1) par0 = c(0.05, 0.6 , 45, 0.1, 200, 0.2) ypred = t*0 y = fun(par, t) julia_init() r_julia <- opt_nlminb_julia(par0, "doubleLog_Beck", y, t) r_R <- opt_nlminb(par0, f_goal, fun = fun, y = y, t = t, pred = ypred) list(julia = r_julia, R = r_R) %>% map(~c(.$par, .$objective, .$value)) %>% do.call(rbind, .)# %>% n <- length(t) w <- rep(0.2, n) # julia is 5 times faster { # microbenchmark::microbenchmark : 18.939826 ms in R info <- rbenchmark::benchmark( r1 <- opt_nlminb_julia(par0, "doubleLog_Beck", y, t, w), r2 <- opt_nlminb(par0, f_goal, fun = fun, y = y, t = t, pred = ypred), replications = 500 ) print(info) } }