This function optimizes parameters by calculating overlaps between observed
and permuted data for multiple values of a smoothing constant (ssq
) and a
single-label replicate (SLR) comparison.
Optimizing(niter, ssq, N, D, S, pD, pS, verbose)
Integer. Number of bootstrap samples or resampling iterations.
Numeric vector. Smoothing constants to be evaluated.
Integer vector. Number of top values to consider for overlap calculation.
Numeric matrix. Observed data values.
Numeric matrix. Standard errors or related values for observed data.
Numeric matrix. Permuted data values.
Numeric matrix. Standard errors or related values for permuted data.
Logical. If TRUE
, progress messages will be displayed.
A list containing the optimal parameters:
a1
: Optimal smoothing constant or 1 for SLR.
a2
: SLR flag (1 if smoothing constant is optimal,
0 if SLR is optimal).
k
: Optimal number of top values to consider for overlap.
R
: Optimal overlap value.
Z
: Optimal z-score.
ztable
: Matrix of z-scores for all evaluated parameters.
The function calculates overlaps for a range of smoothing constants and
identifies the optimal set of parameters by maximizing a z-score-based
metric, which compares the overlap of observed data to permuted data.
It computes overlap matrices for both observed (D
and S
) and permuted
(pD
and pS
) data and returns the optimal parameters based on the
highest z-score.