compute_normalize {clockSim} | R Documentation |
Trajectory similarity: variable normalization
Description
Performs per-state normalization by dividing state values by: range (max-min) or sd (standard deviation). none means no normalization is performed.
Usage
compute_normalize(res_mat, method = c("none", "range", "sd"), ref_stats = NULL)
Arguments
res_mat |
Trajectory matrix, first column must be time while others are states. |
method |
State normalization method, one of "none", "range", "sd". |
ref_stats |
Optional list containing pre-computed normalization statistics
(e.g., from a previous call to |
Value
Normalized trajectory matrix with attribute "ref_stats"
containing
normalization parameters.
Examples
mat <- cbind(time = 1:10, matrix(runif(30, 0, 10), ncol = 3))
# Range normalization with automatic stat computation
norm_mat1 <- compute_normalize(mat, "range")
# Reuse stats for another matrix
mat2 <- cbind(time = 1:10, matrix(runif(30, 5, 15), ncol = 3))
norm_mat2 <- compute_normalize(mat2, "range", attr(norm_mat1, "ref_stats"))
[Package clockSim version 0.1.2 Index]