eBayes
and squeezeVar
and is not usually called directly by a user.
fitFDist(x, df1, covariate=NULL)
fitFDistRobustly(x, df1, covariate=NULL, winsor.tail.p=c(0.05,0.1), trace=FALSE)
x
.NULL
, the estimated scale value will depend on this numeric covariate.x
to Winsorize.fitFDist
produces a list with the following components:
covariate
is non-NULL
, otherwise a scalar.fitFDistRobustly
returns the following components as well:
x
value.df1
and df2
.df2
, but outliers have reduced values depending on how extreme each case is. All values lie between df2.outlier
and df2
.fitFDist
implements an algorithm proposed by Smyth (2004).
It estimates scale
and df2
under the assumption that x
is distributed as scale
times an F-distributed random variable on df1
and df2
degrees of freedom.
The parameters are estimated using the method of moments, specifically from the mean and variance of the x
values on the log-scale.fitFDistRobustly
is similar to fitFDist
except that it computes the moments of the Winsorized values of x
, making it robust against left and right outliers.
Larger values for winsor.tail.p
produce more robustness but less efficiency.
The robust method is described by Phipson (2013) and Phipson et al (2016).
As well as estimating the F-distribution for the bulk of the cases, i.e., with outliers discounted, fitFDistRobustly
also returns an estimated F-distribution with reduced df2 that might be appropriate for each outlier case.
Phipson, B. (2013). Empirical Bayes modelling of expression profiles and their associations. PhD Thesis. University of Melbourne, Australia. http://repository.unimelb.edu.au/10187/17614
Phipson, B, Lee, S, Majewski, IJ, Alexander, WS, and Smyth, GK (2016). Robust hyperparameter estimation protects against hypervariable genes and improves power to detect differential expression. Annals of Applied Statistics 10. http://arxiv.org/abs/1602.08678
squeezeVar
, which in turn is called by ebayes
, eBayes
and treat
.This function calls trigammaInverse
.
x <- rf(100,df1=8,df2=16)
fitFDist(x,df1=8)
Run the code above in your browser using DataLab