squeezeThetas | R Documentation |
Squeeze a set of sample variances towards a common value using empirical Bayes moderation similar to the limma
package.
This can be done for residual variances, random effects or shrunken fixed effects. The resulting variances are called posterior variances.
squeezeThetas(thetas, df_thetas, vars, df_vars, squeezeVar = TRUE, min_df = 1, robust_var = TRUE, printProgress = FALSE, shiny = FALSE, message = NULL, ...)
thetas |
A numeric matrix wherein each column contains variances for a different parameter. |
df_thetas |
A numeric matrix wherein each column contains degrees of freedom corresponding to the |
vars |
A numeric vector containing residual variances. |
df_vars |
A numeric vector containing residual degrees of freedom. |
squeezeVar |
A logical indicating whether the residual variances as given by the argument |
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 |
printProgress |
A logical indicating whether the R should print a message before performing each preprocessing step. Defaults to |
shiny |
A logical indicating whether this function is being used by a Shiny app. Setting this to |
message |
Only used when |
... |
Other arguments to be passed to the |
A named list with 4 slots. The first slot thetas_post
contains a matrix with in each column the squeezed variances corresponding to the thetas
input argument.
The second slot df_thetas_post
contains a matrix of similar structure to thetas_post
but containing the posterior degrees of freedom corresponding to the df_thetas
input argument. If squeezeVar=TRUE
, the third slot vars_post
contains a vector of posterior residual variances for each accession. If squeezeVar=FALSE
, it contains the residual variances given in the vars
input argument.
If squeezeVar=TRUE
, the fourth slot df_vars_post
contains a vector of posterior residual degrees of freedom. If squeezeVar=FALSE
, it contains the residual degrees of freedom given in the df_vars
input argument.
....
....
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.