orthogonalizeAndQSparsify: Sparsify and optionally orthogonalize a matrix

View source: R/multiscaleSVDxpts.R

orthogonalizeAndQSparsifyR Documentation

Sparsify and optionally orthogonalize a matrix

Description

This function implements a quantile-based sparsification operation.

Usage

orthogonalizeAndQSparsify(
  v,
  sparsenessQuantile = 0.5,
  positivity = "either",
  orthogonalize = TRUE,
  softThresholding = FALSE,
  unitNorm = FALSE,
  sparsenessAlg = NA
)

Arguments

v

Input matrix

sparsenessQuantile

Quantile to control sparseness - higher is sparser

positivity

Restrict to positive or negative solution (beta) weights. Choices are "positive", "negative", or "either".

orthogonalize

Run Gram-Schmidt if TRUE.

softThresholding

Use soft thresholding if TRUE.

unitNorm

Normalize each vector to unit norm if TRUE.

sparsenessAlg

If specified, use a matrix partition algorithm ("orthorank", "spmp", "sum_preserving_matrix_partition" or "basic").

Value

A sparsified and optionally orthogonalized matrix.

Examples

mat <- replicate(100, rnorm(20))
mat <- orthogonalizeAndQSparsify(mat)

ANTsX/ANTsR documentation built on March 29, 2025, 6:24 p.m.