squeezePars: Squeeze variances and other parameters

View source: R/squeezePars.R

squeezeParsR Documentation

Squeeze variances and other parameters

Description

Squeeze the standard deviations of the models towards a common value using empirical Bayes moderation similar to the limma package. Information is borrowed over all accessions in the protLM object in order to stabilize variances. These stabilized variances are called posterior variances. Options are provided to also perform the same squeezing over the random effects and for the penalty of the shrunken fixed effects.

Usage

squeezePars(protLM, par_squeeze = NULL, squeezeVar = TRUE, min_df = 1,
  robust_var = TRUE, printProgress = FALSE, shiny = FALSE,
  message_thetas = NULL, message_squeeze = NULL, message_update = NULL,
  ...)

Arguments

protLM

A protLM object of which residual standard deviations and/or model parameters need to be squeezed.

par_squeeze

Character vector indicating which model parameters need to be squeezed. When squeezing random effects, provide their names. Fixed effects are present in shrinkage groups, e.g. ridgeGroup.1. If you want them to be squeezed as well, provide the names of the shrinkage groups that need to be squeezed. The default NULL indicates that no parameters will be squeezed.

squeezeVar

A logical indicating whether the residual standard deviation of all models should be squeezed towards a common value. Defaults to TRUE. If set to FALSE, residual standard deviations will not be squeezed.

min_df

A numeric value indicating the minimal degrees of freedom that will be taken into account for calculating the prior degrees of freedom and prior variance.

robust_var

A logical indicating wheter the estimation of the prior degrees of freedom and the prior variance (needed for shrinkage) should be robustified against outlier variances. Defaults to TRUE.

printProgress

A logical indicating whether the R should print a message before performing each preprocessing step. Defaults to FALSE.

shiny

A logical indicating whether this function is being used by a Shiny app. Setting this to TRUE only works when using this function in a Shiny app and allows for dynamic progress bars. Defaults to FALSE.

message_thetas

Only used when printProgress=TRUE and shiny=TRUE. A single-element character vector: the message to be displayed to the user during the extraction of the variances, or NULL to hide the current message (if any).

message_squeeze

Only used when printProgress=TRUE and shiny=TRUE. A single-element character vector: the message to be displayed to the user during the squeezing of the variances, or NULL to hide the current message (if any).

message_update

Only used when printProgress=TRUE and shiny=TRUE. A single-element character vector: the message to be displayed to the user during the updating of the models, or NULL to hide the current message (if any).

...

Other arguments to be passed to the update_protLM function internally.

Value

An updated protLM object with squeezed variances and/or squeezed parameters (or the input protLM object if par_squeeze=NULL and squeezeVar=FALSE).

References

....

Examples

....

statOmics/MSqRob documentation built on Dec. 8, 2022, 6 a.m.