Skip to contents

Stochastic genotype data is stored after min-max scaling: U_scaled = 2 * (U - u_min) / (u_max - u_min). This function exactly inverts that transform using the stored per-variant u_min and u_max values from a companion sidecar file (.afreq or .stochastic_meta.tsv).

Usage

invertMinmaxScaling(X, uMin, uMax)

Arguments

X

Numeric matrix (B x p) of min-max scaled values in [0, 2].

uMin

Numeric vector of per-variant minimum values before scaling.

uMax

Numeric vector of per-variant maximum values before scaling.

Value

Matrix of original U values with same dimensions.

Details

The recovered U satisfies U'U/B ~ Wishart(B, R)/B, the correct distributional property for LD-based fine-mapping with dynamic variance tracking.