Skip to main content

Module normexp

Module normexp 

Source
Expand description

normexp convolution model and background correction.

Pure-Rust port of limma’s background-normexp.R, background.R and the saddlepoint optimiser in src/normexp.c. Implements:

  • normexp_signal — exact expected signal under the normal+exponential convolution model (normexp.signal).
  • normexp_fit_saddlenormexp.fit(method = "saddle"), the limma default: minimise the saddlepoint approximation to -2 log L by Nelder-Mead ([nmmin], a faithful port of R’s nmmin).
  • background_correct_matrixbackgroundCorrect.matrix for the none/subtract/half/minimum/movingmin/edwards/normexp methods.

Structs§

NormexpFit
Fitted parameters from normexp_fit_saddle.

Enums§

BackgroundMethod
Background-correction method for background_correct_matrix.

Functions§

background_correct_matrix
backgroundCorrect.matrix(E, Eb, method, offset). eb is the optional background matrix; when absent, the methods that require it fall back to none (as limma does). offset is added after correction iff nonzero.
normexp_fit_saddle
normexp.fit(x, method = "saddle"). Returns (mu, log(sigma), log(alpha)) and the minimised saddlepoint -2 log L.
normexp_signal
normexp.signal(par, x): expected signal given foreground x under the normal(mu,sigma) + exponential(alpha) convolution model, where par = (mu, log(sigma), log(alpha)).