as_weight_operator: Create Weight Operator Function

View source: R/weight_operators.R

as_weight_operatorR Documentation

Create Weight Operator Function

Description

Returns a closure that applies a weight matrix W or its transformations (square root, inverse, or combinations thereof) to vectors/matrices.

Usage

as_weight_operator(W, transpose = FALSE, sqrt = FALSE, inverse = FALSE)

Arguments

W

A weight matrix (symmetric PSD) or NULL for identity

transpose

Logical, whether to transpose W before applying

sqrt

Logical, whether to use square root of W

inverse

Logical, whether to use inverse of W

Value

A function that applies the requested transformation


genpca documentation built on Sept. 17, 2026, 1:09 a.m.