Internal soundgen function.
evaluatePars(
p,
pars,
myfun,
bounds = NULL,
fitnessPar,
fitnessFun = function(x) 1 - cor(x, key, use = "pairwise.complete.obs"),
myfolder,
key,
otherPars = list(plot = FALSE),
verbose = TRUE
)
Returns 1 - Pearson's correlation between fitness measure and the key (i.e. 0 is perfect fit, 1 is awful fit).
numeric vector of evaluated values of parameters
names of arguments to myfun
that should be
optimized
the function being optimized: either 'segment' or 'analyze' (in quotes)
a list setting the lower and upper boundaries for possible
values of optimized parameters. For ex., if we optimize smooth
and smoothOverlap
, reasonable bounds might be list(low = c(5,
0), high = c(500, 95))
the name of output variable that we are comparing with the key, e.g. 'nBursts' or 'pitch_median'
the function used to evaluate how well the output of
myfun
fits the key. Defaults to 1 - Pearson's correlation (i.e. 0 is
perfect fit, 1 is awful fit). For pitch, log scale is more meaningful, so a
good fitness criterion is "function(x) 1 - cor(log(x), log(key), use =
'pairwise.complete.obs')"
path to where the .wav files live
a vector containing the "correct" measurement that we are aiming to reproduce
a list of additional arguments to myfun
if TRUE, reports the values of parameters evaluated and fitness
Called by optimizePars
.