inmoose.limma.fitFDist

inmoose.limma.fitFDist(x, df1, covariate=None)

Moment estimation of the parameters of a scaled F-distribution given one of the degrees of freedom.

This function is called internally by eBayes() and squeezeVar() and is not usually called directly by a user.

This function implements an algorithm proposed by [Smyth2004] and [Phipson2016]. 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.

When covariate is supplied, a spline curve trend will be estimated for the x values and the estimation will be adjusted for this trend [Phipson2016].

Parameters:
  • x (array_like) – 1-D array of positive values representing a sample from a scaled F-distribution

  • df1 (array_like) – the first degrees of freedom of the F-distribution. Can be a single value or an array of the same length as x.

  • covariate – if not None, the estimated scale value will depend on this numeric covariate.

Returns:

a dictionary with the following components:

  • "scale", a scale factor for F-distribution. An array if covariate is not None, a scalar otherwise.

  • "df2", the second degrees of freedom of the fitted F-distribution.

Return type:

dict