ba_svd.RdThis function attempts a standard SVD using base R's svd().
If that fails (typically due to ill-conditioning or non-convergence),
it automatically falls back to a randomized SVD via the rsvd package.
A numeric matrix.
Number of left singular vectors to compute.
Default: min(nrow(x), ncol(x)).
Number of right singular vectors to compute.
Default: min(nrow(x), ncol(x)).
Logical. If TRUE, scale x by its max absolute value
before SVD. Default: FALSE.
boolean replaces NA values with small noise values
A list with components u, d, and v, matching
the structure of base R's svd() output.
Optionally, the matrix can be scaled by its maximum absolute value to improve numerical stability before decomposition.