pub fn array_weights_prwts_reml(
exprs: &Array2<f64>,
design: &Array2<f64>,
weights: &Array2<f64>,
var_design: Option<&Array2<f64>>,
prior_n: f64,
maxiter: usize,
tol: f64,
) -> Array1<f64>Expand description
Estimate array quality weights by REML with per-observation prior weights
(.arrayWeightsPrWtsREML).
The prior-weighted analogue of array_weights: because each gene carries
its own observation weights, the weighted design (and hence its QR) differs
per gene, so the Fisher information and score are accumulated gene-by-gene
rather than computed once and scaled by ngenes. limma reaches this routine
from arrayWeights(..., weights=W, method="reml") (the "auto" method sends
weighted data to gene-by-gene instead).
Every QR-sign-dependent term enters only through squares or crossprod
forms, so the result is independent of the QR column signs and matches R.
exprs—ngenes x narraysexpression matrix (noNA/infinite values).design—narrays x pdesign matrix (assumed full column rank).weights—ngenes x narrayspositive observation weights.var_design— optionalnarrays x ngamvariance designZ2whose columns sum to zero; defaults tocontr.sum(narrays).prior_n— prior support pulling weights toward 1 (limma default10).maxiter,tol— Fisher-scoring controls (arrayWeightsdefaults50,1e-5).
Returns a length-narrays vector of array weights.