This function squeezes a set of sample variances together by computing empirical Bayes posterior means in a way that is robust against the presence of very small non-integer degrees of freedom values.
Usage
squeezeVarRob(
var,
df,
covariate = NULL,
robust = FALSE,
winsor.tail.p = c(0.05, 0.1),
min_df = 1
)Arguments
- var
A numeric vector of independent sample variances.
- df
A numeric vector of degrees of freedom for the sample variances.
- covariate
If
non-NULL,var.priorwill depend on this numeric covariate. Otherwise,var.prioris constant.- robust
A logical indicating wheter the estimation of
df.priorandvar.priorshould be robustified against outlier sample variances. Defaults toFALSE.- winsor.tail.p
A numeric vector of length 1 or 2, giving left and right tail proportions of
xto Winsorize. Used only whenrobust=TRUE.- 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.