Estimate a time series Signal to Noise Ratio (SNR) given total and noise variance components and (optionally) a background noise model.
Source:R/RcppExports.R
estimateSNR.RdGiven time series variance components (total variance, raw noise variance), compute the final noise, signal, and SNR. For noise estimation use one of:
A raw noise variance e.g the result of
estimateNoiseA background noise model based on linear predictors
A flooring rule: final noise = max(raw, background)
The background noise model is a general linear noise baseline:
baseline = sum_i beta[i] * feat[i].
Arguments
- totalVar
Total time series variance. Typically calculated with
estimateNoise- noiseRaw
noise variance estimate. Typically calculated with
estimateNoise- eps
Numeric. Lower bound applied to both noise and signal.
- betas, features
Coefficients (\(betas\)) and predictors (\(features\)) for the background noise model. Ignored when
noise_mode = "raw". Both vectors must have the same length when used. The predictors form a design vector: include a constant1if the model has an intercept. For example, for \(baseline = b0 + b1 * mean\), usebetas = c(b0, b1),features = c(1, mean).- noise_mode
Character scalar: one of
"raw","model","floor". -"raw"-> usenoise_raw-"model"-> usebaseline = sum(betas * features)-"floor"-> usemax(noise_raw, baseline)