Find the optimal half-window width combination to use for weighted regression.
input data object to use with weighted regression
starting list of window weights for initializing the search algorithm
A list of control parameters passed to optim
(see details in optim
help file). The value passed to factr
controls the convergence behavior of the "L-BFGS-B"
method. Values larger than the default will generally speed up the optimization with a potential loss of precision. parscale
describes the scaling values of the parameters.
vector of minimum half-window widths to evaluate
vector of maximum half-window widths to evaluate
Some stuff
This function uses optim
to minimize the error returned by wrtdscv
for a given window combination. The search algorithm uses the limited-memory modification of the BFGS quasi-Newton method to impose upper and lower limits on the optimization search. These limits can be changed using the lower
and upper
arguments.
if (FALSE) {
# setup parallel backend
library(doParallel)
ncores <- detectCores() - 1
registerDoParallel(cores = ncores)
# run search function - takes a while
res <- winsrch_optim(tidobjmean)
}